commit 96858860c820cbd29ee970edfb049fd1eba8d925 Author: lijh Date: Tue Mar 10 15:40:26 2026 +0800 first commit diff --git a/SignOff_itk/.vs/SignOff_itk/v16/.suo b/SignOff_itk/.vs/SignOff_itk/v16/.suo new file mode 100644 index 0000000..119957a Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/.suo differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/Browse.VC.db b/SignOff_itk/.vs/SignOff_itk/v16/Browse.VC.db new file mode 100644 index 0000000..5df78ae Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/Browse.VC.db differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/201f29b2f8158e43/CRUL_SERVER_CALL_HTTPSERVER.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/201f29b2f8158e43/CRUL_SERVER_CALL_HTTPSERVER.ipch new file mode 100644 index 0000000..7651318 Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/201f29b2f8158e43/CRUL_SERVER_CALL_HTTPSERVER.ipch differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/29820f799766819a/ADO.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/29820f799766819a/ADO.ipch new file mode 100644 index 0000000..79ee210 Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/29820f799766819a/ADO.ipch differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/3afc26805060a36d/ADDLB.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/3afc26805060a36d/ADDLB.ipch new file mode 100644 index 0000000..d29cfff Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/3afc26805060a36d/ADDLB.ipch differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/44fe916f4bb16f9/EPM_REGISTER_HANDLER.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/44fe916f4bb16f9/EPM_REGISTER_HANDLER.ipch new file mode 100644 index 0000000..5728f1e Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/44fe916f4bb16f9/EPM_REGISTER_HANDLER.ipch differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/595288528f3c3403/CONNOR_SIGNOFF_DATASET.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/595288528f3c3403/CONNOR_SIGNOFF_DATASET.ipch new file mode 100644 index 0000000..600c033 Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/595288528f3c3403/CONNOR_SIGNOFF_DATASET.ipch differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/5ffb9066b7fbd568/CONNOR_CHANGETASK_SETCOMMENTS.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/5ffb9066b7fbd568/CONNOR_CHANGETASK_SETCOMMENTS.ipch new file mode 100644 index 0000000..e8bddde Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/5ffb9066b7fbd568/CONNOR_CHANGETASK_SETCOMMENTS.ipch differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/9d6b9d982e4410d9/COMMON_ITK_UTIL.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/9d6b9d982e4410d9/COMMON_ITK_UTIL.ipch new file mode 100644 index 0000000..bd094b0 Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/9d6b9d982e4410d9/COMMON_ITK_UTIL.ipch differ diff --git a/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/b347c5c8ae124345/CONNOR_CHANGETASK_SETVALUE.ipch b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/b347c5c8ae124345/CONNOR_CHANGETASK_SETVALUE.ipch new file mode 100644 index 0000000..6c0a054 Binary files /dev/null and b/SignOff_itk/.vs/SignOff_itk/v16/ipch/AutoPCH/b347c5c8ae124345/CONNOR_CHANGETASK_SETVALUE.ipch differ diff --git a/SignOff_itk/SignOff_itk.sln b/SignOff_itk/SignOff_itk.sln new file mode 100644 index 0000000..ab127b6 --- /dev/null +++ b/SignOff_itk/SignOff_itk.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SignOff_itk", "SignOff_itk\SignOff_itk.vcxproj", "{8240A4EB-EBA7-448B-B846-2FEC53074C73}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Debug|x64.ActiveCfg = Debug|x64 + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Debug|x64.Build.0 = Debug|x64 + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Debug|x86.ActiveCfg = Release|x64 + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Debug|x86.Build.0 = Release|x64 + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Release|x64.ActiveCfg = Release|x64 + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Release|x64.Build.0 = Release|x64 + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Release|x86.ActiveCfg = Release|Win32 + {8240A4EB-EBA7-448B-B846-2FEC53074C73}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/SignOff_itk/SignOff_itk.suo b/SignOff_itk/SignOff_itk.suo new file mode 100644 index 0000000..a782802 Binary files /dev/null and b/SignOff_itk/SignOff_itk.suo differ diff --git a/SignOff_itk/SignOff_itk.v11.suo b/SignOff_itk/SignOff_itk.v11.suo new file mode 100644 index 0000000..511840e Binary files /dev/null and b/SignOff_itk/SignOff_itk.v11.suo differ diff --git a/SignOff_itk/SignOff_itk/CRUL_server_call_httpserver.cpp b/SignOff_itk/SignOff_itk/CRUL_server_call_httpserver.cpp new file mode 100644 index 0000000..d12f16f --- /dev/null +++ b/SignOff_itk/SignOff_itk/CRUL_server_call_httpserver.cpp @@ -0,0 +1,96 @@ +#include "CRUL_server_call_httpserver.h" +#include +#include +#include "common_itk_util.h" +//#define HTTP_HOST "localhost" +#define HTTP_POST 9293 + +void callHttpserver(string signinfoJsonString,char * HTTP_HOST) +{ + CURL *curl; + CURLcode res; + char httpUrl[1028] = "\0"; + curl = curl_easy_init(); + sprintf(httpUrl,"http://%s:%d/server/signoff",HTTP_HOST,HTTP_POST); + WriteLog("发送地址:%s\n", httpUrl); + if (curl) { + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_easy_setopt(curl, CURLOPT_URL, httpUrl); + //curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + //curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); + struct curl_slist *headers = NULL; + headers = curl_slist_append(headers, "Accept-Charset: GBK"); + headers = curl_slist_append(headers, "Content-Type: application/json;charset=GBK"); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + WriteLog("发送内容:%s\n", signinfoJsonString.c_str()); + //printf("data=>%s\n",signinfoJsonString.c_str()); + const char *data = signinfoJsonString.c_str(); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20); + res = curl_easy_perform(curl); + WriteLog("返回值:%d\n", res); + } + curl_easy_cleanup(curl); +} + +//void callHttpserverDwgtopdf(string signinfoJsonString, char* HTTP_HOST) +//{ +// CURL* curl; +// CURLcode res; +// char httpUrl[1028] = "\0"; +// curl = curl_easy_init(); +// sprintf(httpUrl, "http://%s:%d/server/dwgtopdf", HTTP_HOST, HTTP_POST); +// if (curl) { +// curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); +// curl_easy_setopt(curl, CURLOPT_URL, httpUrl); +// //curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); +// //curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); +// struct curl_slist* headers = NULL; +// headers = curl_slist_append(headers, "Accept-Charset: GBK"); +// headers = curl_slist_append(headers, "Content-Type: application/json;charset=GBK"); +// curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); +// WriteLog("发送内容:%s\n", signinfoJsonString.c_str()); +//// printf("data=>%s\n", signinfoJsonString.c_str()); +// const char* data = signinfoJsonString.c_str(); +// curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); +// curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); +// curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20); +// res = curl_easy_perform(curl); +// WriteLog("返回值:%d\n", res); +// +// } +// curl_easy_cleanup(curl); +//} +// +//void callHttpserverMail(string signinfoJsonString, char* HTTP_HOST) +//{ +// CURL* curl; +// CURLcode res; +// char httpUrl[4096] = "\0"; +// WriteLog("内容长度%d\n", signinfoJsonString.size()); +// curl = curl_easy_init(); +// sprintf(httpUrl, "http://%s:%d/server/sendmail", HTTP_HOST, HTTP_POST); +//// printf("call=>%s \n", httpUrl); +// WriteLog("发送的路径:%s\n", httpUrl); +// if (curl) { +// curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); +// curl_easy_setopt(curl, CURLOPT_URL, httpUrl); +// //curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); +// //curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); +// struct curl_slist* headers = NULL; +// headers = curl_slist_append(headers, "Accept-Charset: GBK"); +// headers = curl_slist_append(headers, "Content-Type: application/json;charset=GBK"); +// curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); +//// curl_easy_setopt(curl, CURLOPT_HTTPHEADER, "Expect:"); +// WriteLog("发送内容:%s\n", signinfoJsonString.c_str()); +// // printf("data=>%s\n", signinfoJsonString.c_str()); +// const char* data = signinfoJsonString.c_str(); +// curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); +// curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); +// curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20); +// res = curl_easy_perform(curl); +// WriteLog("返回值:%d\n", res); +// } +// curl_easy_cleanup(curl); +//} \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/CRUL_server_call_httpserver.h b/SignOff_itk/SignOff_itk/CRUL_server_call_httpserver.h new file mode 100644 index 0000000..1243b76 --- /dev/null +++ b/SignOff_itk/SignOff_itk/CRUL_server_call_httpserver.h @@ -0,0 +1,7 @@ +#include +#include +#include +using namespace std; +void callHttpserver(string signinfoJsonString,char * HTTP_HOST); +//void callHttpserverDwgtopdf(string signinfoJsonString, char* HTTP_HOST); +//void callHttpserverMail(string signinfoJsonString, char* HTTP_HOST); \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/Connor_ChangeTask_AssignUser.cpp b/SignOff_itk/SignOff_itk/Connor_ChangeTask_AssignUser.cpp new file mode 100644 index 0000000..68ee135 --- /dev/null +++ b/SignOff_itk/SignOff_itk/Connor_ChangeTask_AssignUser.cpp @@ -0,0 +1,197 @@ +#include "Supor_register.h" +#include "ado.h" +#include +using namespace std; +extern "C" int POM_AM__set_application_bypass(logical bypass); + + +int Connor_ChangeTask_AssignUser(EPM_action_message_t msg) { + int ifail = ITK_ok; + char* log_file = NULL; + + + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_AssignUser is strat ! *\n"); + printf("*************************************************************\n"); + + + int arg_cnt = 0, attachments = 0, * attach_type, occur_of_counts = 0, form_count; + + tag_t root_task = NULLTAG, * taskAttches = NULLTAG, root_job = NULLTAG; + arg_cnt = TC_number_of_arguments(msg.arguments); + + EPM_ask_root_task(msg.task, &root_task); + EPM_ask_job(root_task, &root_job); + EPM_ask_attachments(root_task, EPM_target_attachment, &occur_of_counts, &taskAttches); + POM_AM__set_application_bypass(true); + char* taskUid; + ITK__convert_tag_to_uid(root_job, &taskUid); + + + char* argflag = NULL, * argvalue = NULL, * arg = NULL; + char* uid; + char* endResult; + char* objecttype = NULL; + char* userField = NULL; + + printf("Ϊ%d\n", arg_cnt); + if (arg_cnt > 0) + { + + for (int i = 0; i < arg_cnt; i++) + { + //ȡһ0ʼ + arg = TC_next_argument(msg.arguments); + //ȡƺֵ + ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue); + if (stricmp(argflag, "objecttype") == 0) + { + if (argvalue != NULL) + { + objecttype = argvalue; + printf("ȡֵ%s\n", objecttype); + } + } + else if (stricmp(argflag, "user") == 0) + { + if (argvalue != NULL) + { + userField = argvalue; + printf("ȡֵ%s\n", userField); + } + } + + } + } + + if (objecttype == NULL || userField == NULL) { + EMH_store_error_s1(EMH_severity_error, + 919012, + "ò"); + + return 1; + } + char* task_type = NULL; + char* userName = NULL; + char* user_id = NULL; + tag_t aUserTag = NULLTAG, responsibleParty = NULLTAG, cur_perform_task = NULLTAG, * attachmentTags = NULLTAG; + + WSOM_ask_object_type2(msg.task, &task_type); + vector dbPrefs; + getPrefStrings("LD_dbinfo", dbPrefs); + if (dbPrefs.size() != 4) + { + EMH_store_error_s2(EMH_severity_error, 919012, "ݿѡô", "LD_dbinfo"); + } + if (open((char*)dbPrefs[0].c_str(), (char*)dbPrefs[1].c_str(), (char*)dbPrefs[2].c_str(), (char*)dbPrefs[3].c_str())) + { + printf("ݿʧܣû%s룺%sݿ⣺%sip%s", dbPrefs[0].c_str(), dbPrefs[1].c_str(), dbPrefs[2].c_str(), dbPrefs[3].c_str()); + EMH_store_error_s1(EMH_severity_error, + 919012, + "ݿʧ"); + + return 1; + } + printf("ݿӳɹ\n"); + + + + for (int count = 0; count < occur_of_counts; count++) { + char* id = NULL;//ûid + char* object_type = NULL;//ûid + + ITKCALL(AOM_ask_value_string(taskAttches[count], "object_type", &object_type)); + + printf("object_type=========%s\n", object_type); + + if (strstr(objecttype, object_type)) { + ITKCALL(AOM_ask_value_string(taskAttches[count], "item_id", &id)); + printf("id=========%s\n", id); + char selectById[1024] = ""; + vector result; + sprintf(selectById, "select %s from LY_CHANGETASSKFORM_DETAILS where ID='%s' and WFUID='%s'", userField, id, taskUid); + printf("selectById====%s\n", selectById); + if (selectData(selectById, result) != -1) { + if (result.size() > 0) { + string userId = result[0]; + + if (userId.length() > 0) { + printf("userId1===%s\n", userId.c_str()); + userId.resize(userId.length() - 1); + printf("userId2===%s\n", userId.c_str()); + + // + + // ŵλ + size_t startPos = userId.find('('); + if (startPos == std::string::npos) { + std::cerr << "No '(' found in the string." << std::endl; + } + else { + // ŵλ + size_t endPos = userId.find(')', startPos); + if (endPos == std::string::npos) { + std::cerr << "No ')' found in the string." << std::endl; + return 1; + } + else { + // ȡڵ + std::string id = userId.substr(startPos + 1, endPos - startPos - 1); + + // ȡIDֵ userId + userId = id; + + // + std::cout << "Extracted ID: " << userId << std::endl; + } + + + } + + + + printf("task_type========%s\n", task_type); + if (strcmp("EPMAcknowledgeTask", task_type) == 0) { + int mem_cnt = 0, signoff_cnt = 0, signmem_count = 0, * attach_type; + tag_t user_tag = NULLTAG, login_group = NULLTAG, * members = NULLTAG, * signoffs = NULLTAG, select_signoff_tag = NULLTAG, * attachmentTags = NULLTAG; + EPM_ask_sub_task(msg.task, "select-signoff-team", &select_signoff_tag); + //EPM_ask_sub_task(task_tags[i], "select-signoff-team", &cur_perform_task); + EPM_ask_all_attachments(select_signoff_tag, &signmem_count, &attachmentTags, &attach_type); + if (signmem_count == 0) { + ITKCALL(SA_find_user2(userId.c_str(), &user_tag)); + if (user_tag != NULLTAG) { + ITKCALL(SA_ask_user_login_group(user_tag, &login_group)); + ITKCALL(SA_find_groupmembers(user_tag, login_group, &mem_cnt, &members)); + ITKCALL(EPM_create_adhoc_signoff(select_signoff_tag, members[0], &signoff_cnt, &signoffs)); + ITKCALL(EPM_set_adhoc_signoff_selection_done(select_signoff_tag, true)); + } + else { + POM_AM__set_application_bypass(true); + ITKCALL(EPM_promote_task(msg.task, "")); + POM_AM__set_application_bypass(false); + } + + } + DOFREE(members); + DOFREE(signoffs); + } + + } + } + else { + printf("δҵ\n"); + } + } + + + } + + + } + POM_AM__set_application_bypass(false); + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_AssignUser is end ! *\n"); + printf("*************************************************************\n"); + return ifail; +} + diff --git a/SignOff_itk/SignOff_itk/Connor_ChangeTask_CheckValue.cpp b/SignOff_itk/SignOff_itk/Connor_ChangeTask_CheckValue.cpp new file mode 100644 index 0000000..1c3da7d --- /dev/null +++ b/SignOff_itk/SignOff_itk/Connor_ChangeTask_CheckValue.cpp @@ -0,0 +1,149 @@ +#include "Supor_register.h" +#include "ado.h" +using namespace std; +extern "C" int POM_AM__set_application_bypass(logical bypass); + + + +int Connor_ChangeTask_CheckValue(EPM_action_message_t msg) { + int ifail = ITK_ok; + char* log_file = NULL; + + + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_CheckValue is strat ! *\n"); + printf("*************************************************************\n"); + + + int arg_cnt = 0, attachments = 0, * attach_type, occur_of_counts = 0, form_count; + + tag_t root_task = NULLTAG, * taskAttches = NULLTAG,root_job = NULLTAG; + arg_cnt = TC_number_of_arguments(msg.arguments); + + EPM_ask_root_task(msg.task, &root_task); + EPM_ask_job(root_task,&root_job); + EPM_ask_attachments(root_task, EPM_target_attachment, &occur_of_counts, &taskAttches); + POM_AM__set_application_bypass(true); + char* taskUid; + ITK__convert_tag_to_uid(root_job, &taskUid); + + char* argflag = NULL, * argvalue = NULL, * arg = NULL; + char* uid; + char* endResult; + char* objecttype = NULL; + char* checkvaluename = NULL; + char* errormessage = NULL; + + printf("Ϊ%d\n", arg_cnt); + if (arg_cnt > 0) + { + + for (int i = 0; i < arg_cnt; i++) + { + //ȡһ0ʼ + arg = TC_next_argument(msg.arguments); + //ȡƺֵ + ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue); + if (stricmp(argflag, "objecttype") == 0) + { + if (argvalue != NULL) + { + objecttype = argvalue; + printf("ȡֵ%s\n", objecttype); + } + } + else if (stricmp(argflag, "checkvaluename") == 0) + { + if (argvalue != NULL) + { + checkvaluename = argvalue; + printf("ȡֵ%s\n", checkvaluename); + } + } + else if (stricmp(argflag, "errormessage") == 0) + { + if (argvalue != NULL) + { + errormessage = argvalue; + printf("ȡֵ%s\n", errormessage); + } + } + + } + } + + if (objecttype == NULL || checkvaluename == NULL || errormessage == NULL) { + EMH_store_error_s1(EMH_severity_error, + 919012, + "ò"); + + return 1; + } + char* task_type = NULL; + char* userName = NULL; + char* user_id = NULL; + tag_t aUserTag = NULLTAG, responsibleParty = NULLTAG, cur_perform_task = NULLTAG, * attachmentTags = NULLTAG; + + WSOM_ask_object_type2(msg.task, &task_type); + vector dbPrefs; + getPrefStrings("LD_dbinfo", dbPrefs); + if (dbPrefs.size() != 4) + { + EMH_store_error_s2(EMH_severity_error, 919012, "ݿѡô", "LD_dbinfo"); + } + if (open((char*)dbPrefs[0].c_str(), (char*)dbPrefs[1].c_str(), (char*)dbPrefs[2].c_str(), (char*)dbPrefs[3].c_str())) + { + printf("ݿʧܣû%s룺%sݿ⣺%sip%s", dbPrefs[0].c_str(), dbPrefs[1].c_str(), dbPrefs[2].c_str(), dbPrefs[3].c_str()); + EMH_store_error_s1(EMH_severity_error, + 919012, + "ݿʧ"); + + return 1; + } + printf("ݿӳɹ\n"); + + + + for (int count = 0; count < occur_of_counts; count++) { + char* id = NULL;//ûid + char* object_type = NULL;//ûid + + ITKCALL(AOM_ask_value_string(taskAttches[count], "object_type", &object_type)); + + printf("object_type=========%s\n", object_type); + + if (strstr(objecttype, object_type)) { + ITKCALL(AOM_ask_value_string(taskAttches[count], "item_id", &id)); + printf("id=========%s\n", id); + char selectById[1024] = ""; + vector result; + sprintf(selectById, "select %s from LY_CHANGETASSKFORM_DETAILS where ID='%s' and WFUID='%s'", checkvaluename, id, taskUid); + printf("selectById====%s\n", selectById); + if (selectDataNormal(selectById, result) != -1) { + if (result.size() <= 0) { + printf("δҵ\n"); + /*string field = result[0]; + printf("field====%s\n", field.c_str()); + if (field.length() <= 0) { + + }*/ + EMH_store_error_s1(EMH_severity_error, + 919012, + errormessage); + return 1; + } + + } + + + } + + + } + POM_AM__set_application_bypass(false); + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_CheckValue is end ! *\n"); + printf("*************************************************************\n"); + return ifail; +} + diff --git a/SignOff_itk/SignOff_itk/Connor_ChangeTask_SetComments.cpp b/SignOff_itk/SignOff_itk/Connor_ChangeTask_SetComments.cpp new file mode 100644 index 0000000..c0f6cbb --- /dev/null +++ b/SignOff_itk/SignOff_itk/Connor_ChangeTask_SetComments.cpp @@ -0,0 +1,180 @@ +#include "Supor_register.h" +#include "ado.h" +using namespace std; +extern "C" int POM_AM__set_application_bypass(logical bypass); + + + +int Connor_ChangeTask_SetComments(EPM_action_message_t msg) { + int ifail = ITK_ok; + char* log_file = NULL; + + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_SetComments is strat ! *\n"); + printf("*************************************************************\n"); + + + int arg_cnt = 0, attachments = 0, * attach_type, occur_of_counts = 0, form_count; + + tag_t root_task = NULLTAG, * taskAttches = NULLTAG, root_job = NULLTAG; + arg_cnt = TC_number_of_arguments(msg.arguments); + EPM_signoff_decision_t dec; + EPM_ask_root_task(msg.task, &root_task); + EPM_ask_job(root_task, &root_job); + EPM_ask_attachments(root_task, EPM_target_attachment, &occur_of_counts, &taskAttches); + POM_AM__set_application_bypass(true); + char* taskUid; + ITK__convert_tag_to_uid(root_job, &taskUid); + + char* argflag = NULL, * argvalue = NULL, * arg = NULL; + char* uid; + char* endResult; + char* objecttype = NULL; + char* setcomments = NULL; + char* comments = NULL; + + + + + + tag_t* sub_tasks = NULL; int sub_task_count = 0; + //ͨڵȡ + EPM_ask_root_task(msg.task, &root_task); + //õµеһڵ + EPM_ask_sub_tasks(root_task, &sub_task_count, &sub_tasks); + + for (int i = 0; i < sub_task_count; i++) + { + char* uid = NULL; + ITK__convert_tag_to_uid(sub_tasks[i], &uid); + printf("uid============%s\n", uid); + date_t decision_date; + int perform_count = 0; + tag_t* perform_attaches = NULLTAG; + tag_t memberTag = NULLTAG; + SIGNOFF_TYPE_t memberType; + EPM_ask_all_attachments(msg.task, &perform_count, &perform_attaches, &attach_type); + + + for (int i = 0; i < perform_count; i++) + { + EPM_ask_signoff_member(perform_attaches[i], &memberTag, &memberType); + // CR_ask_signoff_decision(perform_attaches[i], &signoff_decision, comments, &decision_date); + + // cout<<"ע1-------------"< 0) + { + + for (int i = 0; i < arg_cnt; i++) + { + //ȡһ0ʼ + arg = TC_next_argument(msg.arguments); + //ȡƺֵ + ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue); + if (stricmp(argflag, "objecttype") == 0) + { + if (argvalue != NULL) + { + objecttype = argvalue; + printf("ȡֵ%s\n", objecttype); + } + } + else if (stricmp(argflag, "setcomments") == 0) + { + if (argvalue != NULL) + { + setcomments = argvalue; + printf("ȡֵ%s\n", setcomments); + } + } + + } + } + + if (objecttype == NULL || setcomments == NULL) { + EMH_store_error_s1(EMH_severity_error, + 919012, + "ò"); + + return 1; + } + char* task_type = NULL; + char* userName = NULL; + char* user_id = NULL; + tag_t aUserTag = NULLTAG, responsibleParty = NULLTAG, cur_perform_task = NULLTAG, * attachmentTags = NULLTAG; + WSOM_ask_object_type2(msg.task, &task_type); + + + + vector dbPrefs; + getPrefStrings("LD_dbinfo", dbPrefs); + if (dbPrefs.size() != 4) + { + EMH_store_error_s2(EMH_severity_error, 919012, "ݿѡô", "LD_dbinfo"); + } + if (open((char*)dbPrefs[0].c_str(), (char*)dbPrefs[1].c_str(), (char*)dbPrefs[2].c_str(), (char*)dbPrefs[3].c_str())) + { + printf("ݿʧܣû%s룺%sݿ⣺%sip%s", dbPrefs[0].c_str(), dbPrefs[1].c_str(), dbPrefs[2].c_str(), dbPrefs[3].c_str()); + EMH_store_error_s1(EMH_severity_error, + 919012, + "ݿʧ"); + + return 1; + } + printf("ݿӳɹ\n"); + + + + for (int count = 0; count < occur_of_counts; count++) { + char* id = NULL;//ûid + char* object_type = NULL;//ûid + + ITKCALL(AOM_ask_value_string(taskAttches[count], "object_type", &object_type)); + + printf("object_type=========%s\n", object_type); + + if (strstr(objecttype, object_type)) { + ITKCALL(AOM_ask_value_string(taskAttches[count], "item_id", &id)); + printf("id=========%s\n", id); + //Ϊ ȲһݿǷͬid + char updateSql[1024] = ""; + vector result; + //sprintf(updateSql, "update LY_CHANGETASSKFORM_DETAILS set %s='%s' where ID='%s' and WFUID='%s'", setcomments,comments2, id, taskUid); + sprintf(updateSql, "update LY_CHANGETASSKFORM_DETAILS set %s='%s' where ID='%s' and WFUID='%s'", setcomments, comments, id, taskUid); + if (ExecuteSQLNoInputParam(updateSql) == -1) + { + printf("ʧ\n"); + } + else + { + //ExecuteSQLNoInputParam("commit"); + printf("ݳɹ\n"); + } + printf("updateSql====%s\n", updateSql); + + } + } + POM_AM__set_application_bypass(false); + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_SetComments is end ! *\n"); + printf("*************************************************************\n"); + return ifail; +} + diff --git a/SignOff_itk/SignOff_itk/Connor_ChangeTask_SetValue.cpp b/SignOff_itk/SignOff_itk/Connor_ChangeTask_SetValue.cpp new file mode 100644 index 0000000..1abf9b8 --- /dev/null +++ b/SignOff_itk/SignOff_itk/Connor_ChangeTask_SetValue.cpp @@ -0,0 +1,216 @@ +#include "Supor_register.h" +#include "ado.h" +using namespace std; +extern "C" int POM_AM__set_application_bypass(logical bypass); + + + +int Connor_ChangeTask_SetValue(EPM_action_message_t msg) { + int ifail = ITK_ok; + char* log_file = NULL; + + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_SetValue is strat ! *\n"); + printf("*************************************************************\n"); + + + int arg_cnt = 0, attachments = 0, * attach_type, occur_of_counts = 0, form_count; + + tag_t root_task = NULLTAG, * taskAttches = NULLTAG, root_job = NULLTAG; + arg_cnt = TC_number_of_arguments(msg.arguments); + + EPM_ask_root_task(msg.task, &root_task); + EPM_ask_job(root_task, &root_job); + EPM_ask_attachments(root_task, EPM_target_attachment, &occur_of_counts, &taskAttches); + POM_AM__set_application_bypass(true); + char* taskUid; + ITK__convert_tag_to_uid(root_job, &taskUid); + + char* argflag = NULL, * argvalue = NULL, * arg = NULL; + char* uid; + char* endResult; + char* objecttype = NULL; + char* setvaluename = NULL; + char* setvalue = NULL; + + printf("Ϊ%d\n", arg_cnt); + if (arg_cnt > 0) + { + + for (int i = 0; i < arg_cnt; i++) + { + //ȡһ0ʼ + arg = TC_next_argument(msg.arguments); + //ȡƺֵ + ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue); + if (stricmp(argflag, "objecttype") == 0) + { + if (argvalue != NULL) + { + objecttype = argvalue; + printf("ȡֵ%s\n", objecttype); + } + } + else if (stricmp(argflag, "setvaluename") == 0) + { + if (argvalue != NULL) + { + setvaluename = argvalue; + printf("ȡֵ%s\n", setvaluename); + } + } + else if (stricmp(argflag, "setvalue") == 0) + { + if (argvalue != NULL) + { + setvalue = argvalue; + printf("ȡֵ%s\n", setvalue); + } + } + } + } + + if (objecttype == NULL || setvaluename == NULL || setvalue == NULL) { + EMH_store_error_s1(EMH_severity_error, + 919012, + "ò"); + + return 1; + } + char* task_type = NULL; + char* userName = NULL; + char* user_id = NULL; + tag_t aUserTag = NULLTAG, responsibleParty = NULLTAG, cur_perform_task = NULLTAG, * attachmentTags = NULLTAG; + SIGNOFF_TYPE_t memberType; + tag_t memberTag = NULLTAG; + WSOM_ask_object_type2(msg.task, &task_type); + + EPM_signoff_decision_t dec; + + if (strcmp("EPMDoTask", task_type) == 0 || strcmp("EPMOrTask", task_type) == 0 || strcmp("EPMConditionTask", task_type) == 0) { + EPM_ask_responsible_party(msg.task, &responsibleParty); + POM_get_user(&userName, &aUserTag); + AOM_ask_value_string(aUserTag, "object_string", &user_id); + } + else + { + EPM_ask_sub_task(msg.task, "perform-signoffs", &cur_perform_task); + EPM_ask_all_attachments(cur_perform_task, &attachments, &attachmentTags, &attach_type); + printf(":%d\n", attachments); + if (attachments > 0) { + int start = 0; + for (int j = 0; j < attachments; j++) { + char* comment = NULL; + date_t decision_date_temp; + ITKCALL(EPM_ask_signoff_decision(attachmentTags[j], &dec, &comment, &decision_date_temp)); + ITKCALL(EPM_ask_signoff_member(attachmentTags[j], &memberTag, &memberType)); + if (memberType == SIGNOFF_GROUPMEMBER && dec == EPM_approve_decision) { + ITKCALL(SA_ask_groupmember_user(memberTag, &aUserTag)); + ITKCALL(AOM_ask_value_string(aUserTag, "object_string", &user_id)); + } + } + } + } + printf("user_id========%s\n", user_id); + time_t now; + struct tm* p; + time(&now);//ȡǰʱ + p = localtime(&now);//ػʱ䣬ϸΪʱ + int year = 1900 + p->tm_year; + int month = p->tm_mon; + int day = p->tm_mday; + int hour = p->tm_hour; + int min = p->tm_min; + int second = p->tm_sec; + date_t timesss; + char date_str_act[30] = "\0"; + sprintf(date_str_act, "%d-%d-%d", year, month + 1, day); + printf("ǰʱ:%s\n", date_str_act); + + + vector fieldNmae; + Split(setvaluename, ";", fieldNmae); + + vector fieldValue; + Split(setvalue, ";", fieldValue); + + string sets; + for (int i = 0; i < fieldNmae.size(); i++) { + + if (strcmp(fieldValue[i].c_str(),"sysdate") == 0) { + sets.append(fieldNmae[i]); + sets.append("="); + sets.append("'"); + sets.append(date_str_act); + sets.append("',"); + } + + if (strcmp(fieldValue[i].c_str(), "nodeuser") == 0) { + sets.append(fieldNmae[i]); + sets.append("="); + sets.append("'"); + sets.append(user_id); + sets.append("',"); + } + } + if (!sets.empty()) { // ȷַΪ + sets.erase(sets.size() - 1); // Ƴһַ + } + printf("sets=========%s\n", sets.c_str()); + vector dbPrefs; + getPrefStrings("LD_dbinfo", dbPrefs); + if (dbPrefs.size() != 4) + { + EMH_store_error_s2(EMH_severity_error, 919012, "ݿѡô", "LD_dbinfo"); + } + if (open((char*)dbPrefs[0].c_str(), (char*)dbPrefs[1].c_str(), (char*)dbPrefs[2].c_str(), (char*)dbPrefs[3].c_str())) + { + printf("ݿʧܣû%s룺%sݿ⣺%sip%s", dbPrefs[0].c_str(), dbPrefs[1].c_str(), dbPrefs[2].c_str(), dbPrefs[3].c_str()); + EMH_store_error_s1(EMH_severity_error, + 919012, + "ݿʧ"); + + return 1; + } + printf("ݿӳɹ\n"); + + + + for (int count = 0; count < occur_of_counts; count++) { + char* id = NULL;//ûid + char* object_type = NULL;//ûid + + ITKCALL(AOM_ask_value_string(taskAttches[count], "object_type", &object_type)); + + printf("object_type=========%s\n", object_type); + + if (strstr(objecttype, object_type)) { + ITKCALL(AOM_ask_value_string(taskAttches[count], "item_id", &id)); + printf("id=========%s\n", id); + //Ϊ ȲһݿǷͬid + char updateSql[1024] = ""; + vector result; + sprintf(updateSql, "update LY_CHANGETASSKFORM_DETAILS set %s where ID='%s' and WFUID='%s'",sets.c_str(), id, taskUid); + //sprintf(updateSql, "update LY_CHANGETASSKFORM_DETAILS set %s where ID='%s' and WFUID='%s'", sets.c_str(), id, "R9LAAiNz51TfkD"); + if (ExecuteSQLNoInputParam(updateSql) == -1) + { + printf("ʧ\n"); + } + else + { + //ExecuteSQLNoInputParam("commit"); + printf("ݳɹ\n"); + } + printf("updateSql====%s\n", updateSql); + + } + + + } + POM_AM__set_application_bypass(false); + printf("*************************************************************\n"); + printf("* Connor_ChangeTask_SetValue is end ! *\n"); + printf("*************************************************************\n"); + return ifail; +} + diff --git a/SignOff_itk/SignOff_itk/Connor_signoff_dataset.cpp b/SignOff_itk/SignOff_itk/Connor_signoff_dataset.cpp new file mode 100644 index 0000000..7604a6f --- /dev/null +++ b/SignOff_itk/SignOff_itk/Connor_signoff_dataset.cpp @@ -0,0 +1,579 @@ +#include "Supor_register.h" +#include "ado.h" +#include +extern "C" int POM_AM__set_application_bypass(logical bypass); +using namespace std; + +#define debug true +#define ITK_err 919012 +#define PREF_ML_DB "LD_dbinfo" + +/** +* +* 判断某个对象是否为ItemRevision +* +*/ +int checkIsItemRevision(tag_t objtag,logical & isItems){ + tag_t type = NULLTAG; + tag_t item_type = NULLTAG; + ITKCALL2(TCTYPE_ask_object_type(objtag,&type)); + ITKCALL2(TCTYPE_find_type("ItemRevision","",&item_type)); + if(item_type != NULLTAG){ + logical isok = FALSE; + ITKCALL2(TCTYPE_is_type_of(type,item_type,&isok)); + if(isok){ + isItems = TRUE; + }else{ + isItems = FALSE; + } + } + return 0; +} + +/** +* 用来拼接签名信息mapping为json +* paramMap 签名mapping +* jsonString 拼接后的json字符串 +*/ +int stringToJson(map paramMap,string &jsonString) +{ + std::map::iterator iter; + jsonString.assign("{"); + int tempIndex = 0; + int mapCount = paramMap.size(); + for (iter=paramMap.begin(); iter!=paramMap.end(); iter++) + { + jsonString.append("\""); + jsonString.append(iter->first); + jsonString.append("\":\""); + jsonString.append(iter->second); + jsonString.append("\""); + if(tempIndex != (mapCount-1)){ + jsonString.append(","); + } + tempIndex ++ ; + } + jsonString.append("}"); + + return 0; +} +/** +* 拼接电子签名字符串 +* paramMap 签名对象信息 +* paraName signinfos +* json 签名信息json +* jsonString 汇总签名信息 +*/ +int stringToJsonPlus(map paramMap, string paraName,string json ,string &jsonString) +{ + std::map::iterator iter; + jsonString.assign("{"); + for (iter=paramMap.begin(); iter!=paramMap.end(); iter++) + { + jsonString.append("\""); + jsonString.append(iter->first); + jsonString.append("\":\""); + jsonString.append(iter->second); + jsonString.append("\","); + } + jsonString.append("\""); + jsonString.append(paraName); + jsonString.append("\":"); + jsonString.append(json); + jsonString.append("}"); + + return 0; +} + +/** +* 拼接签名信息 +* paramMap 签名对象信息 +* signInfoMap 签名信息 +* signJson 签名汇总信息json +*/ +//void getSignoffInfoJson(map paramMap ,map signInfoMap,string &signJson) +//{ +// string signInfo ; +// stringToJson(signInfoMap,signInfo); +// stringToJsonPlus(paramMap,"signinfos",signInfo,signJson); +//} + +/** +* 获取签名信息到map +* revisionRevTag 版本对象 +* signInfoMap 签名信息map +*/ +void getSignoffInfoJson(tag_t revisionRevTag,map &signInfoMap,char * processid,char *sign_relation,char *sign_info_option){ + tag_t * signoffFormTags = NULL; + tag_t signFormTag = NULLTAG; + int signoffFormCount = 0; + char* tempValue = NULL; + + ITKCALL2(AOM_ask_value_tags(revisionRevTag, sign_relation,&signoffFormCount,&signoffFormTags)); + WriteLog("签名表单个数:%d\n",signoffFormCount); + if(signoffFormCount > 0){ + signFormTag = signoffFormTags[0]; + } + DOFREE(signoffFormTags); + if(signFormTag == NULLTAG){ + WriteLog("没有获取到签名表单\n"); + return; + } + vector signoffVec ; + getPrefStrings(sign_info_option,signoffVec); + WriteLog("首选项[%s]=[%d]\n", sign_info_option,signoffVec.size()); + for(int i = 0 ; i < signoffVec.size() ; i++){ + vector secondVec ; + Split(signoffVec[i],":",secondVec); + string signinfoValue ; + if(secondVec.size() !=2){ + secondVec.clear(); + continue; + } + if(strcmp(secondVec[0].c_str(),processid) != 0){ + secondVec.clear(); + continue; + } + signinfoValue.assign(secondVec[1]); + + secondVec.clear(); + Split( signinfoValue,";",secondVec); + + for(int j = 0;j thirdVec ; + Split( secondVec[j],"=",thirdVec); + if(thirdVec.size() == 2){ + PROP_value_type_t propertyValueType; + char * propertyType = NULL; + ITKCALL2(AOM_ask_value_type(signFormTag,thirdVec[0].c_str(),&propertyValueType,&propertyType)); + WriteLog("属性:%s\n", thirdVec[0].c_str()); + if(propertyValueType == 8){ + char valueTemp[128] = "\0"; + ITKCALL2(AOM_ask_value_string(signFormTag,thirdVec[0].c_str(),&tempValue)); + WriteLog("属性:%s, 内容:%s\n", thirdVec[0].c_str(), tempValue); + if (strcmp(ISNULL(tempValue), "") != 0) { + //char* tempValueGBK = tempValue; + // char* thirdVecGBK = thirdVec[1].c_str(); + //sprintf(valueTemp, "%s%s%s", picpath, tempValueGBK, picext); + signInfoMap.insert(pair(thirdVec[1], tempValue)); + DOFREE(tempValue); + // DOFREE(tempValueGBK); + // DOFREE(thirdVecGBK); + } + }else if(propertyValueType == 2){ + date_t date; + AOM_ask_value_date(signFormTag,thirdVec[0].c_str(),&date); + if(date.year > 1000){ + // char* thirdVecGBK = thirdVec[1].c_str()); + ITKCALL2(DATE_date_to_string(date,"%Y/%m/%d",&tempValue)); + signInfoMap.insert(pair(thirdVec[1],tempValue)); + DOFREE(tempValue); + // DOFREE(thirdVecGBK); + } + } + DOFREE(propertyType); + } + thirdVec.clear(); + } + secondVec.clear(); + break; + } +} + +/** +* Connor_signoff_dataset +* 签名到数据集handler +* -issignpdf=true 是否签字 非必填 +* -tcdepartmentid=sx 基地ID,用于对PDF签字位置的定位 必填 +* -relation=IMAN_specification,IMAN_reference 要转PDF或签字的数据集和版本的关系 必填 +* -datasettype=MSExcel,MSExcelX,MSWord,MSWordX,PDF 要转PDF或签字的数据集类型 必填 +* -sign_relation=S8SignOffR 审签表单和版本的关系 必填 +* -sign_info_option=Supor_signoff_dataset 签字配置的首选项名字 必填 +* -serverhost=172.24.14.164 签字服务所在的服务器IP 必填 +* -tcpdfrelation=IMAN_specification 转换出来的PDF挂载到对象下的关系 必填 +* -processid=D 签名首选项值的开头符号 必填 +* -dwgtype=S8AutoCAD Dwg的类型 非必填 +* -tcstatus PDF要添加的流程状态 非必填 +*/ +int Connor_signoff_dataset(EPM_action_message_t msg) +{ + int ifail = ITK_ok; + char *log_file=NULL; + CreateLogFile("Connor_signoff_dataset", &log_file); + WriteLog("*************************************************************\n"); + WriteLog("* Connor_signoff_dataset is strat ! *\n"); + WriteLog("*************************************************************\n"); + starTime(); + //===============业务==================== + + string signJson ; + string signInfo; + int arg_cnt = 0 , + i = 0, + j =0, + k = 0, + n = 0, + attachesCount = 0; + + char *arg = NULL, + *argflag =NULL, + *argvalue=NULL, + typeClass[TCTYPE_class_name_size_c+1]="\0"; + + char issignpdf[16]="true", + sign_relation[56]="\0", + sign_info_option[56]="\0", + tcdepartmentid[56]="\0", + tccomponentuid[56] ="\0", + tcdatasetuid[56]="\0", + tccomponentrelation[56]="\0" , + pdfuid[56] = "\0", + tcpdfrelation[56]="\0", + serverhost[56]="\0", + processid[56] = "\0", + dwgtype[56] = "\0", + userid[56]="\0", + objectType[56]="\0", + tcstatus[56]="\0", + taskpuid[56] = "\0", + istranslatepdf[56] = "\0"; + vector relationVec; + vector datasetTypeVec, dbPrefs; + + tag_t rootTask =NULLTAG, + *taskAttches =NULL, + attachTag=NULLTAG, + itemTag=NULLTAG, + relationTag = NULLTAG, + datasetTag = NULLTAG; + + int grmSecondCount =0 ; + tag_t *grmSecondTags = NULL; + char * tempValue = NULL; + + logical isneed = false; + EPM_decision_t decision = EPM_go; + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) + { + for (i=0;i inSignoffMap; + //遍历所有的关系 + //版本对象转换uid + ITK__convert_tag_to_uid(attachTag, &tempValue); + tc_strcpy(tccomponentuid, tempValue); + DOFREE(tempValue); + getSignoffInfoJson(attachTag, inSignoffMap, processid,sign_relation,sign_info_option); + stringToJson(inSignoffMap, signInfo); + WriteLog("relationVec.size()==================%d\n", relationVec.size()); + for(int j = 0;j inMap; + //数据集转换uid + ITK__convert_tag_to_uid(datasetTag,&tempValue); + tc_strcpy(tcdatasetuid, tempValue); + tag_t owningUser = NULLTAG; + ITKCALL2(AOM_ask_value_tag(datasetTag, "owning_user", &owningUser)); + ITKCALL2(AOM_ask_value_string(owningUser, "user_id", &tempValue)); + tc_strcpy(userid, tempValue); + DOFREE(tempValue); + WriteLog("添加的对象:%s,添加的数据集%s,添加的关系%s\n", tccomponentuid, tcdatasetuid, tccomponentrelation); + + WriteLog("类型是%s\n", objectType); + //如果数据集是PDF,先判断是否是转PDF系统生成的 + if (strcmp("PDF", objectType) == 0) { + char selectRecord[1024] = ""; + vector results2; + /*int outputValueCount = 0, outputColumn = 0; + char*** outputValue = NULL;*/ + sprintf(selectRecord, "select ITEMPUID from CONNOR_PDFMESSAGE where PDFPUID='%s'", tcdatasetuid); + if (selectData(selectRecord, results2) != -1) { + if (results2.size() > 0) { + WriteLog("是系统生成的,跳过:%s\n", tcdatasetuid); + continue; + } + } + } + char selectRecord[1024] = ""; + vector results; + vector values; + sprintf(selectRecord, "select ITEMPUID,PDFPUID from CONNOR_PDFMESSAGE where ITEMPUID='%s' and DATASETPUID='%s'", tccomponentuid, tcdatasetuid); + WriteLog("查找的数据:%s\n", selectRecord); + if (selectData(selectRecord, results) != -1) { + WriteLog("查找的结果数量:%d\n", results.size()); + if (results.size()>0) { + + Split(results[0], ",", values); + char updateRecord[1024] = ""; + + char** params = (char**)MEM_alloc(4 * sizeof(char*)); + params[0] = taskpuid; + params[1] = (char*)signInfo.c_str(); + params[2] = tcstatus; + params[3] = "正在发送到服务"; + + sprintf(updateRecord, "update CONNOR_PDFMESSAGE set ITEMPUID = '%s',SIGNINFO = '%s',TCSTATUS= '%s',STAGE= '%s',CREATEDATE=GETDATE() where ITEMPUID='%s' and DATASETPUID = '%s'", taskpuid, signInfo.c_str(), "正在发送到服务" , tcstatus,tccomponentuid, tcdatasetuid); + WriteLog("更新数据:%s\n", updateRecord); + if (ExecuteSQLNoInputParam(updateRecord) == -1) + { + WriteLog("更新数据失败:%s", tcdatasetuid); + } + else + { + ExecuteSQLNoInputParam("commit"); + WriteLog("更新数据成功"); + } + if (values.size() == 1) { + //if (strcmp("", values[1].c_str()) == 0) { + tc_strcpy(pdfuid, "nopdf"); + //} + } + + else + { + char selectRecord2[1024] = ""; + /*int outputValueCount2 = 0, outputColumn2 = 0; + char*** outputValue2 = NULL;*/ + sprintf(selectRecord2, "select PUID from PPOM_APPLICATION_OBJECT where PUID='%s'", values[1].c_str()); + WriteLog("查找的数据:%s\n", selectRecord2); + vector values22; + if (selectData(selectRecord2, values22) != -1) { + if (values22.size() > 0) { + tc_strcpy(pdfuid, values[1].c_str()); + } + else + { + WriteLog("数据库查询出的PDF:%s 已不存在\n", values[1].c_str()); + tc_strcpy(pdfuid, "nopdf"); + } + } + else + { + WriteLog("数据库查询PDF:%s 失败\n", values[1].c_str()); + tc_strcpy(pdfuid, "nopdf"); + } + } + } + else { + char insertRecord[1024] = ""; + + + char** params = (char**)MEM_alloc(10 * sizeof(char*)); + params[0] = tccomponentuid; + params[1] = tcdatasetuid; + params[2] = (char*)signInfo.c_str(); + params[3] = serverhost; + params[4] = "正在发送到服务"; + params[5] = userid; + params[6] = tcdepartmentid; + params[7] = taskpuid; + params[8] = tccomponentrelation; + params[9] = tcstatus; + sprintf(insertRecord, "insert into CONNOR_PDFMESSAGE(ITEMPUID,DATASETPUID,SIGNINFO,SERVERHOST,STAGE,OWNINGUSER,DEPARTMENTID,TASKPUID,TCRELATION,TCSTATUS,CREATEDATE) values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',GETDATE())", + params[0] , params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9]); + WriteLog("插入数据:%s\n", insertRecord); + if (ExecuteSQLNoInputParam(insertRecord) == -1) + { + WriteLog("保存数据失败2:%s", tcdatasetuid); + } + else + { + ExecuteSQLNoInputParam("commit"); + WriteLog("保存数据成功"); + } + tc_strcpy(pdfuid, "nopdf"); + } + } + else { + WriteLog("查询失败"); + tc_strcpy(pdfuid, "nopdf"); + } + if (strcmp("PDF", objectType) == 0) { + tc_strcpy(pdfuid, tcdatasetuid); + } + inMap.insert(pair("issignpdf", issignpdf)); + inMap.insert(pair("tccomponentuid", tccomponentuid)); + inMap.insert(pair("tcdatasetuid", tcdatasetuid)); + inMap.insert(pair("tccomponentrelation", tccomponentrelation)); + inMap.insert(pair("pdfuid", pdfuid)); + inMap.insert(pair("tcdepartmentid", tcdepartmentid)); + inMap.insert(pair("dwgtype", dwgtype)); + inMap.insert(pair("tcpdfrelation", tcpdfrelation)); + inMap.insert(pair("tcstatus", tcstatus)); + inMap.insert(pair("taskpuid", taskpuid)); + inMap.insert(pair("istranslatepdf", istranslatepdf)); + stringToJsonPlus(inMap, "signinfos", signInfo, signJson); + WriteLog("发送的签字数据:%s\n", signJson.c_str()); + callHttpserver(signJson, serverhost); + } + WriteLog(" release grmSecondTags \n"); + DOFREE(grmSecondTags); + WriteLog(" release grmSecondTags over \n"); + } + WriteLog(" go toend \n"); + //goto end; + } +//end: + + WriteLog(" bypass close() \n"); + POM_AM__set_application_bypass(false); + //DisConnServer(); + WriteLog(" sqlserver connection close() \n"); + close(); + WriteLog("*************************************************************\n"); + WriteLog("* Connor_signoff_dataset is end ! *\n"); + WriteLog("*************************************************************\n"); + //CloseLog(); + return ifail; +} diff --git a/SignOff_itk/SignOff_itk/Connor_signoff_form.cpp b/SignOff_itk/SignOff_itk/Connor_signoff_form.cpp new file mode 100644 index 0000000..5eb85a3 --- /dev/null +++ b/SignOff_itk/SignOff_itk/Connor_signoff_form.cpp @@ -0,0 +1,544 @@ +#include "Supor_register.h" +using namespace std; +extern "C" int POM_AM__set_application_bypass(logical bypass); + +/** +* +* Description: +* This handler will set signoff infomation to properties of rev +* +* Syntax: +* +* +* -SignUserName: ûID +* +* -SignDate: ʱ +* +* -SignDateFormate: %Y-%m-%d ʱʽ +* +* -SignComment: ע͵ DZ +* +* -SignRelation: ǩͰ汾Ĺϵ +* +* +*/ +int Connor_signoff_form(EPM_action_message_t msg) { + int ifail = ITK_ok; + char* log_file = NULL; + + CreateLogFile("Connor_signoff_form", &log_file); + WriteLog("*************************************************************\n"); + WriteLog("* Connor_signoff_form is strat ! *\n"); + WriteLog("*************************************************************\n"); + starTime(); + char* arg = NULL, + * argflag = NULL, + * argvalue = NULL, + * tempValue = NULL; + + char* task_type = NULL; + char* userName = NULL; + char* person_name = NULL, * type_class = NULL, * user_id = NULL; + int arg_cnt = 0, attachments = 0, * attach_type, occur_of_counts = 0, form_count; + date_t decision_date; + char SignUserName[56] = "\0", + SignDate[1024] = "\0", + SignDateFormate[56] = "\0", + SignComment[56] = "\0", + SignRelation[56] = "\0", + comments[4096] = "\0"; + char person_value[1024] = "\0"; + char person_value2[1024] = "\0"; + tag_t memberTag = NULLTAG; + SIGNOFF_TYPE_t memberType; + EPM_signoff_decision_t dec; + tag_t aUserTag = NULLTAG, responsibleParty = NULLTAG, cur_perform_task = NULLTAG, * attachmentTags = NULLTAG; + tag_t root_task = NULLTAG, * taskAttches = NULLTAG, master_form_rel_type = NULLTAG, * form_list = NULLTAG; + tag_t type_tag = NULLTAG, * user_tags = NULLTAG; + int user_cnt = 0; + char* timeinfo = NULL; + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL2(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (stricmp(argflag, "SignUserName") == 0) { + if (argvalue != NULL) + { + tc_strcpy(SignUserName, argvalue); + // WriteLog("-SignUserName=%s",Utf8ToGbk(SignUserName)); + WriteLog("-SignUserName=%s", SignUserName); + } + } + if (stricmp(argflag, "SignDate") == 0) { + if (argvalue != NULL) + { + tc_strcpy(SignDate, argvalue); + WriteLog("-SignDate=%s", SignDate); + } + } + if (stricmp(argflag, "SignComment") == 0) { + if (argvalue != NULL) + { + tc_strcpy(SignComment, argvalue); + WriteLog("-SignComment=%s", SignComment); + } + } + if (stricmp(argflag, "SignRelation") == 0) { + if (argvalue != NULL) + { + tc_strcpy(SignRelation, argvalue); + WriteLog("-SignRelation=%s", SignRelation); + } + } + if (stricmp(argflag, "SignDateFormate") == 0) { + if (argvalue != NULL) + { + tc_strcpy(SignDateFormate, argvalue); + WriteLog("-SignDateFormate=%s", SignDateFormate); + } + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + EPM_ask_root_task(msg.task, &root_task); + WSOM_ask_object_type2(msg.task, &task_type); + if (strcmp("EPMDoTask", task_type) == 0 || strcmp("EPMOrTask", task_type) == 0 || strcmp("EPMConditionTask", task_type) == 0) { + EPM_ask_responsible_party(msg.task, &responsibleParty); + POM_get_user(&userName, &aUserTag); + AOM_ask_value_string(aUserTag, "user_id", &user_id); + SA_ask_user_person_name2(aUserTag, &person_name); + tc_strcpy(person_value, person_name); + strcat(person_value, "#:#"); + strcat(person_value, user_id); + AOM_ask_value_date(msg.task, "last_mod_date", &decision_date); + DATE_date_to_string(decision_date, SignDateFormate, &timeinfo); + } + else + { + EPM_ask_sub_task(msg.task, "perform-signoffs", &cur_perform_task); + EPM_ask_all_attachments(cur_perform_task, &attachments, &attachmentTags, &attach_type); + WriteLog(":%d\n", attachments); + if (attachments > 0) { + int start = 0; + for (int j = 0; j < attachments; j++) { + char* comment = NULL; + date_t decision_date_temp; + ITKCALL2(EPM_ask_signoff_decision(attachmentTags[j], &dec, &comment, &decision_date_temp)); + ITKCALL2(EPM_ask_signoff_member(attachmentTags[j], &memberTag, &memberType)); + if (memberType == SIGNOFF_GROUPMEMBER && dec == EPM_approve_decision) { + ITKCALL2(SA_ask_groupmember_user(memberTag, &aUserTag)); + ITKCALL2(SA_ask_user_person_name2(aUserTag, &person_name)); + ITKCALL2(AOM_ask_value_string(aUserTag, "user_id", &user_id)); + if (start == 0) { + tc_strcpy(person_value, person_name); + strcat(person_value, "#:#"); + strcat(person_value, user_id); + strcpy(comments, comment); + decision_date = decision_date_temp; + start = 1; + } + else { + strcat(person_value, ","); + strcat(person_value, person_name); + strcat(person_value, "#:#"); + strcat(person_value, user_id); + + strcat(comments, ","); + strcat(comments, comment); + char* timeinfo2 = NULL, * timeinfo3 = NULL; + ITKCALL2(DATE_date_to_string(decision_date, SignDateFormate, &timeinfo2)); + ITKCALL2(DATE_date_to_string(decision_date_temp, SignDateFormate, &timeinfo3)); + int year1, month1, day1; + + int year2, month2, day2; + + sscanf(timeinfo2, "%d-%d-%d", &year1, &month1, &day1); + + sscanf(timeinfo3, "%d-%d-%d", &year2, &month2, &day2); + + int tm1 = year1 * 10000 + month1 * 100 + day1; + + int tm2 = year2 * 10000 + month2 * 100 + day2; + WriteLog("ʱ1:%d\n", tm1); + WriteLog("ʱ2:%d\n", tm2); + if (tm2 > tm1) { + decision_date = decision_date_temp; + } + } + } + } + } + } + EPM_ask_attachments(root_task, EPM_target_attachment, &occur_of_counts, &taskAttches); + GRM_find_relation_type(SignRelation, &master_form_rel_type); + POM_AM__set_application_bypass(true); + for (int count = 0; count < occur_of_counts; count++) { + char* object_string = NULL; + char* objectString = NULL; + int num = 0; + tag_t* release_tags = NULLTAG; + tag_t owning_user = NULLTAG; + //char* owner_name = NULL, * owner_id = NULL; + AOM_ask_value_string(taskAttches[count], "object_string", &object_string); + // objectString = Utf8ToGbk(object_string); + objectString = object_string; + TCTYPE_ask_object_type(taskAttches[count], &type_tag); + TCTYPE_ask_class_name2(type_tag, &type_class); + WriteLog("ж%sͣ%s\n", objectString, type_class); + if (((strstr(type_class, "Revision") != NULL) || (strstr(type_class, "revision") != NULL)) + && (strstr(type_class, "Master") == NULL) && (strstr(type_class, "master") == NULL) + && (strstr(type_class, "BOM") == NULL) && (strstr(type_class, "bom") == NULL) && (strstr(type_class, "Bom") == NULL)) + { + ITKCALL2(AOM_ask_value_tags(taskAttches[count], "release_status_list", &num, &release_tags)); + WriteLog("ж%s״̬%d\n", objectString, num); + if (num > 0) { + WriteLog("ж%s״̬0޸ı\n", objectString); + continue; + } + GRM_list_secondary_objects_only(taskAttches[count], master_form_rel_type, &form_count, &form_list); + WriteLog("ж%sǩ%d\n", objectString, form_count); + if (form_count > 0) { + WriteLog("ԣ%s, ݣ%s\n", ISNULL(SignUserName), person_value); + ITKCALL2(DATE_date_to_string(decision_date, SignDateFormate, &timeinfo)); + if (strcmp(ISNULL(timeinfo), "") != 0) { + WriteLog("ʱԣ%s, ݣ%s\n", ISNULL(SignDate), timeinfo); + AOM_lock(form_list[0]); + PROP_value_type_t propertyValueType; + char* propertyType = NULL; + ITKCALL2(AOM_ask_value_type(form_list[0], SignDate, &propertyValueType, &propertyType)); + if (propertyValueType == PROP_date) { + ITKCALL2(AOM_set_value_date(form_list[0], SignDate, decision_date)); + } + else + { + ITKCALL2(AOM_set_value_string(form_list[0], SignDate, timeinfo)); + } + WriteLog("Ա\n"); + ITKCALL2(AOM_set_value_string(form_list[0], SignUserName, person_value)); + if (strcmp("", SignComment) != 0 && strcmp("", comments) != 0) { + WriteLog("עԣ%s, ݣ%s\n", ISNULL(SignComment), comments); + ITKCALL2(AOM_set_value_string(form_list[0], SignComment, comments)); + } + WriteLog("\n"); + AOM_save(form_list[0]); + AOM_unlock(form_list[0]); + WriteLog("棬\n"); + } + else + { + WriteLog("ȡʱʧ\n"); + } + } + } + DOFREE(release_tags); + DOFREE(object_string); + /*DOFREE(objectString); + DOFREE(owner_name); + DOFREE(owner_id);*/ + } + printf("·\n"); + POM_AM__set_application_bypass(false); + //DOFREE(log_file); + DOFREE(task_type); + DOFREE(userName); + DOFREE(person_name); + DOFREE(type_class); + DOFREE(attachmentTags); + DOFREE(taskAttches); + DOFREE(form_list); + DOFREE(timeinfo); + WriteLog("*************************************************************\n"); + WriteLog("* Connor_signoff_form is end ! *\n"); + WriteLog("*************************************************************\n"); + CloseLog(); + return ifail; +} + + +//#include "Supor_register.h" +//using namespace std; +//extern "C" int POM_AM__set_application_bypass(logical bypass); +// +///** +//* +//* Description: +//* This handler will set signoff infomation to properties of rev +//* +//* Syntax: +//* +//* +//* -SignUserName: ûID +//* +//* -SignDate: ʱ +//* +//* -SignDateFormate: %Y-%m-%d ʱʽ +//* +//* -SignComment: ע͵ DZ +//* +//* -SignRelation: ǩͰ汾Ĺϵ +//* +//* +//*/ +//int Connor_signoff_form(EPM_action_message_t msg) { +// int ifail = ITK_ok; +// char* log_file = NULL; +// +// CreateLogFile("Connor_signoff_form", &log_file); +// WriteLog("*************************************************************\n"); +// WriteLog("* Connor_signoff_form is strat ! *\n"); +// WriteLog("*************************************************************\n"); +// starTime(); +// char* arg = NULL, +// * argflag = NULL, +// * argvalue = NULL, +// * tempValue = NULL; +// +// char* task_type = NULL; +// char* userName=NULL; +// char* person_name = NULL, * type_class = NULL,*user_id=NULL; +// int arg_cnt = 0, attachments=0,*attach_type, occur_of_counts=0,form_count; +// date_t decision_date; +// char SignUserName[56] = "\0", +// SignDate[1024] = "\0", +// SignDateFormate[56] = "\0", +// SignComment[56]="\0", +// SignRelation[56]="\0", +// comments[4096]="\0"; +// char person_value[1024] = "\0"; +// char person_value2[1024] = "\0"; +// tag_t memberTag = NULLTAG; +// SIGNOFF_TYPE_t memberType; +// EPM_signoff_decision_t dec; +// tag_t aUserTag = NULLTAG, responsibleParty=NULLTAG, cur_perform_task=NULLTAG, *attachmentTags=NULLTAG; +// tag_t root_task = NULLTAG, *taskAttches=NULLTAG, master_form_rel_type=NULLTAG; //,* form_list=NULLTAG +// tag_t type_tag = NULLTAG,*user_tags=NULLTAG; +// int user_cnt=0; +// char* timeinfo = NULL; +// arg_cnt = TC_number_of_arguments(msg.arguments); +// if (arg_cnt > 0) +// { +// for (int i = 0;i < arg_cnt;i++) +// { +// arg = TC_next_argument(msg.arguments); +// ITKCALL2(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); +// if (stricmp(argflag, "SignUserName") == 0) { +// if (argvalue != NULL) +// { +// tc_strcpy(SignUserName, argvalue); +// // WriteLog("-SignUserName=%s",Utf8ToGbk(SignUserName)); +// WriteLog("-SignUserName=%s",SignUserName); +// } +// } +// if (stricmp(argflag, "SignDate") == 0) { +// if (argvalue != NULL) +// { +// tc_strcpy(SignDate, argvalue); +// WriteLog("-SignDate=%s", SignDate); +// } +// } +// if (stricmp(argflag, "SignComment") == 0) { +// if (argvalue != NULL) +// { +// tc_strcpy(SignComment, argvalue); +// WriteLog("-SignComment=%s", SignComment); +// } +// } +// if (stricmp(argflag, "SignRelation") == 0) { +// if (argvalue != NULL) +// { +// tc_strcpy(SignRelation, argvalue); +// WriteLog("-SignRelation=%s", SignRelation); +// } +// } +// if (stricmp(argflag, "SignDateFormate") == 0) { +// if (argvalue != NULL) +// { +// tc_strcpy(SignDateFormate, argvalue); +// WriteLog("-SignDateFormate=%s", SignDateFormate); +// } +// } +// MEM_free(argflag); +// MEM_free(argvalue); +// } +// } +// EPM_ask_root_task(msg.task, &root_task); +// WSOM_ask_object_type2(msg.task, &task_type); +// if (strcmp("EPMDoTask", task_type) == 0 || strcmp("EPMOrTask", task_type) == 0|| strcmp("EPMConditionTask", task_type) == 0) { +// EPM_ask_responsible_party(msg.task, &responsibleParty); +// POM_get_user(&userName, &aUserTag); +// AOM_ask_value_string(aUserTag, "user_id", &user_id); +// SA_ask_user_person_name2(aUserTag, &person_name); +// tc_strcpy(person_value, person_name); +// strcat(person_value, "#:#"); +// strcat(person_value, user_id); +// AOM_ask_value_date(msg.task, "last_mod_date", &decision_date); +// DATE_date_to_string(decision_date, SignDateFormate, &timeinfo); +// } +// else +// { +// EPM_ask_sub_task(msg.task, "perform-signoffs", &cur_perform_task); +// EPM_ask_all_attachments(cur_perform_task, &attachments, &attachmentTags, &attach_type); +// WriteLog(":%d\n", attachments); +// if (attachments > 0) { +// int start = 0; +// for (int j = 0;j < attachments;j++) { +// char* comment = NULL; +// date_t decision_date_temp; +// ITKCALL2(EPM_ask_signoff_decision(attachmentTags[j], &dec, &comment, &decision_date_temp)); +// ITKCALL2(EPM_ask_signoff_member(attachmentTags[j], &memberTag, &memberType)); +// if (memberType == SIGNOFF_GROUPMEMBER && dec == EPM_approve_decision) { +// ITKCALL2(SA_ask_groupmember_user(memberTag, &aUserTag)); +// ITKCALL2(SA_ask_user_person_name2(aUserTag, &person_name)); +// ITKCALL2(AOM_ask_value_string(aUserTag, "user_id", &user_id)); +// if (start == 0) { +// tc_strcpy(person_value, person_name); +// strcat(person_value, "#:#"); +// strcat(person_value, user_id); +// strcpy(comments, comment); +// decision_date = decision_date_temp; +// start = 1; +// } +// else { +// strcat(person_value, ","); +// strcat(person_value, person_name); +// strcat(person_value, "#:#"); +// strcat(person_value, user_id); +// +// strcat(comments, ","); +// strcat(comments, comment); +// char* timeinfo2 = NULL, * timeinfo3 = NULL; +// ITKCALL2(DATE_date_to_string(decision_date, SignDateFormate, &timeinfo2)); +// ITKCALL2(DATE_date_to_string(decision_date_temp, SignDateFormate, &timeinfo3)); +// int year1, month1, day1; +// +// int year2, month2, day2; +// +// sscanf(timeinfo2, "%d-%d-%d", &year1, &month1, &day1); +// +// sscanf(timeinfo3, "%d-%d-%d", &year2, &month2, &day2); +// +// int tm1 = year1 * 10000 + month1 * 100 + day1; +// +// int tm2 = year2 * 10000 + month2 * 100 + day2; +// WriteLog("ʱ1:%d\n", tm1); +// WriteLog("ʱ2:%d\n", tm2); +// if (tm2 > tm1) { +// decision_date = decision_date_temp; +// } +// } +// } +// /* +// if (j == 0) { +// strcpy(comments, comment); +// decision_date = decision_date_temp; +// } +// else +// { +// strcat(comments, ","); +// strcat(comments, comment); +// char* timeinfo2 = NULL, * timeinfo3 = NULL; +// ITKCALL2(DATE_date_to_string(decision_date, SignDateFormate, &timeinfo2)); +// ITKCALL2(DATE_date_to_string(decision_date_temp, SignDateFormate, &timeinfo3)); +// int year1, month1, day1; +// +// int year2, month2, day2; +// +// sscanf(timeinfo2, "%d-%d-%d", &year1, &month1, &day1); +// +// sscanf(timeinfo3, "%d-%d-%d", &year2, &month2, &day2); +// +// int tm1 = year1 * 10000 + month1 * 100 + day1; +// +// int tm2 = year2 * 10000 + month2 * 100 + day2; +// WriteLog("ʱ1:%d\n", tm1); +// WriteLog("ʱ2:%d\n", tm2); +// if (tm2 > tm1) { +// decision_date = decision_date_temp; +// } +// }*/ +// } +// } +// } +// EPM_ask_attachments(root_task, EPM_target_attachment, &occur_of_counts, &taskAttches); +// GRM_find_relation_type(SignRelation, &master_form_rel_type); +// POM_AM__set_application_bypass(true); +// for (int count = 0; count < occur_of_counts; count++) { +// char* object_string = NULL; +// char* objectString = NULL; +// int num = 0; +// tag_t* release_tags = NULLTAG; +// tag_t owning_user = NULLTAG; +// char* owner_name = NULL, * owner_id = NULL; +// AOM_ask_value_string(taskAttches[count], "object_string", &object_string); +// // objectString = Utf8ToGbk(object_string); +// objectString = object_string; +// TCTYPE_ask_object_type(taskAttches[count], &type_tag); +// TCTYPE_ask_class_name2(type_tag, &type_class); +// WriteLog("ж%sͣ%s\n", objectString, type_class); +// if (((strstr(type_class, "Revision") != NULL) || (strstr(type_class, "revision") != NULL)) +// && (strstr(type_class, "Master") == NULL) && (strstr(type_class, "master") == NULL) +// && (strstr(type_class, "BOM") == NULL) && (strstr(type_class, "bom") == NULL) && (strstr(type_class, "Bom") == NULL)) +// { +// ITKCALL2(AOM_ask_value_tags(taskAttches[count], "release_status_list", &num, &release_tags)); +// WriteLog("ж%s״̬%d\n", objectString, num); +// if (num > 0) { +// WriteLog("ж%s״̬0޸ı\n", objectString); +// continue; +// } +// /*GRM_list_secondary_objects_only(taskAttches[count], master_form_rel_type, &form_count, &form_list); +// WriteLog("ж%sǩ%d\n", objectString, form_count); +// if (form_count > 0) {}*/ +// WriteLog("ԣ%s, ݣ%s\n", ISNULL(SignUserName), person_value); +// ITKCALL2(DATE_date_to_string(decision_date, SignDateFormate, &timeinfo)); +// if (strcmp(ISNULL(timeinfo), "") != 0) { +// WriteLog("ʱԣ%s, ݣ%s\n", ISNULL(SignDate), timeinfo); +// AOM_lock(taskAttches[count]); +// PROP_value_type_t propertyValueType; +// char* propertyType = NULL; +// ITKCALL2(AOM_ask_value_type(taskAttches[count], SignDate, &propertyValueType, &propertyType)); +// if (propertyValueType == 2) { +// ITKCALL2(AOM_set_value_date(taskAttches[count], SignDate, decision_date)); +// } +// else +// { +// ITKCALL2(AOM_set_value_string(taskAttches[count], SignDate, timeinfo)); +// } +// ITKCALL2(AOM_set_value_string(taskAttches[count], SignUserName, person_value)); +// if (strcmp("", SignComment) != 0 && strcmp("", comments) != 0) { +// WriteLog("עԣ%s, ݣ%s\n", ISNULL(SignComment), comments); +// ITKCALL2(AOM_set_value_string(taskAttches[count], SignComment, comments)); +// } +// AOM_save(taskAttches[count]); +// AOM_unlock(taskAttches[count]); +// } +// else +// { +// WriteLog("ȡʱʧ\n"); +// } +// +// } +// DOFREE(release_tags); +// DOFREE(object_string); +// DOFREE(objectString); +// DOFREE(owner_name); +// DOFREE(owner_id); +// } +// POM_AM__set_application_bypass(false); +// DOFREE(log_file); +// DOFREE(task_type); +// DOFREE(userName); +// DOFREE(person_name); +// DOFREE(type_class); +// DOFREE(attachmentTags); +// DOFREE(taskAttches); +// DOFREE(timeinfo); +// WriteLog("*************************************************************\n"); +// WriteLog("* Connor_signoff_form is end ! *\n"); +// WriteLog("*************************************************************\n"); +// CloseLog(); +// return ifail; +//} \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/ReadMe.txt b/SignOff_itk/SignOff_itk/ReadMe.txt new file mode 100644 index 0000000..0f2f6f5 --- /dev/null +++ b/SignOff_itk/SignOff_itk/ReadMe.txt @@ -0,0 +1,30 @@ +======================================================================== + 控制台应用程序:XNY_itk 项目概述 +======================================================================== + +应用程序向导已为您创建了此 XNY_itk 应用程序。 + +本文件概要介绍组成 XNY_itk 应用程序的每个文件的内容。 + + +XNY_itk.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +XNY_itk.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 + +XNY_itk.cpp + 这是主应用程序源文件。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h, StdAfx.cpp + 这些文件用于生成名为 XNY_itk.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/SignOff_itk/SignOff_itk/SignOff_itk.cpp b/SignOff_itk/SignOff_itk/SignOff_itk.cpp new file mode 100644 index 0000000..06c1707 --- /dev/null +++ b/SignOff_itk/SignOff_itk/SignOff_itk.cpp @@ -0,0 +1,11 @@ +// XNY_itk.cpp : ̨Ӧóڵ㡣 +// + +#include "stdafx.h" + + +int main() +{ + return 0; +} + diff --git a/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj b/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj new file mode 100644 index 0000000..3a449ff --- /dev/null +++ b/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {8240A4EB-EBA7-448B-B846-2FEC53074C73} + Win32Proj + SignOff_itk + 10.0 + SignOff_itk + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + MaxSpeed + WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions) + true + C:\app\admin\product\12.1.0\dbhome_1\OCI\include;D:\TC12.4\include_cpp;D:\TC12.4\include;%(AdditionalIncludeDirectories) + + + Console + true + C:\JKTC11\Siemens\Teamcenter\OTW11\OCI\lib\MSVC;%(AdditionalLibraryDirectories) + D:\TC12.4\lib\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions) + + + D:\WorkEnvironment\tc13ITK\include_cpp;D:\WorkEnvironment\tc13ITK\include;D:\WorkEnvironment\tc11ITK\curl-7.84.0\curl-7.84.0\builds\libcurl-vc15-x64-release-dll-ipv6-sspi-schannel\include;D:\dflittk\oci\include;D:\hf include\include;D:\hf include\include_cpp;D:\project\TC12.4\Excel_New\lib\native\include_cpp;D:\instantclient_19_12\sdk\include;D:\project\TC12.4\include;D:\project\TC12.4\include_cpp;%(AdditionalIncludeDirectories) + false + + + Console + true + true + true + %(AdditionalLibraryDirectories) + D:\curl-7.84.0\curl-7.84.0\builds\libcurl-vc15-x64-release-dll-ipv6-sspi-schannel\lib\*.lib;D:\hf include\lib\*.lib;D:\project\TC12.4\lib\*.lib;D:\instantclient_19_12\sdk\lib\msvc\*.lib;D:\project\TC12.4\Excel_New\lib\native\lib\*.lib;D:\WorkEnvironment\tc13ITK\lib\*.lib;*.lib;D:\WorkEnvironment\tc13ITK\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib + $(OutDir)SignOff_itk.dll + RequireAdministrator + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj.filters b/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj.filters new file mode 100644 index 0000000..8360551 --- /dev/null +++ b/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj.filters @@ -0,0 +1,108 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {2799e3e0-5454-43a6-a04a-5627cde49936} + + + {88c2de69-1cc0-4edb-a6ba-b56cb3ec6551} + + + + + + + + epm_handler + + + common + + + common + + + common + + + common + + + common + + + common + + + epm_handler + + + common + + + epm_handler + + + + + common + + + epm_handler + + + common + + + common + + + common + + + common + + + common + + + epm_handler + + + epm_handler + + + epm_handler + + + common + + + epm_handler + + + epm_handler + + + epm_handler + + + epm_handler + + + epm_handler + + + \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj.user b/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj.user new file mode 100644 index 0000000..abe8dd8 --- /dev/null +++ b/SignOff_itk/SignOff_itk/SignOff_itk.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/Supor_register.h b/SignOff_itk/SignOff_itk/Supor_register.h new file mode 100644 index 0000000..db1e131 --- /dev/null +++ b/SignOff_itk/SignOff_itk/Supor_register.h @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ocilib.h" +#include "common_itk_util.h" +#include "string_utils.h" +#include "error_handling.h" +#include "connor_util.h" +#include "CRUL_server_call_httpserver.h" + +#define ITKCALL2( argument ) \ +{ \ + int retcode = argument; \ + if ( retcode != ITK_ok ) { \ + char* s; \ + WriteLog( " "#argument "\n" ); \ + WriteLog( " returns [%d]\n", retcode ); \ + EMH_ask_error_text (retcode, &s); \ + WriteLog( " Teamcenter ERROR: [%s]\n", s); \ + WriteLog( " in file [" __FILE__ "], line [%d]\n\n", __LINE__ ); \ + if (s != 0) MEM_free (s); \ + } \ +} + + +int Connor_signoff_dataset(EPM_action_message_t msg); +int Connor_signoff_form(EPM_action_message_t msg); +int Connor_CreateItemPost(METHOD_message_t* msg, va_list args); +int Connor_ChangeTask_AssignUser(EPM_action_message_t msg); +int Connor_ChangeTask_SetComments(EPM_action_message_t msg); +int Connor_ChangeTask_SetValue(EPM_action_message_t msg); +int Connor_ChangeTask_CheckValue(EPM_action_message_t msg); \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/addLb.cpp b/SignOff_itk/SignOff_itk/addLb.cpp new file mode 100644 index 0000000..9e7f2a2 --- /dev/null +++ b/SignOff_itk/SignOff_itk/addLb.cpp @@ -0,0 +1,145 @@ +#include "Supor_register.h" +#include "ado.h" +#include + +int getPrefStrings(const char* preference, vector& pref_vec) +{ + int ifail = ITK_ok, i = 0, j = 0, k = 0, num = 0; + char** values; + ITKCALL2(ifail = PREF_ask_char_values(preference, &num, &values)); + for (i = 0; i < num; i++) + { + pref_vec.push_back(values[i]); + } + DOFREE(values); + return ifail; +} + + +int Connor_CreateItemPost(METHOD_message_t* msg, va_list va) +{ + + char* desc = NULL; + char* type = NULL; + //tag_t new_item_tag = NULLTAG; + printf("----------------------------------------------------\n"); + const char* temp = NULL; + //while ((temp = va_arg(va, const char*)) != NULL && strlen(temp) > 0) { + // printf("Number: %s\n", temp); + //} + + //printf("--------------------------------\n"); + const char* item_id = va_arg(va, const char*); + const char* item_name = va_arg(va, const char*); + const char* item_type = va_arg(va, const char*); + const char* rev_id = va_arg(va, const char*); + printf("item_id=========%s\n", item_id); + printf("item_name=========%s\n", item_name); + printf("item_type=========%s\n", item_type); + printf("rev_id=========%s\n", rev_id); + tag_t* new_item_tag = va_arg(va, tag_t*);//Ķ + //ȡѡ + int type_num = 0; + char** type_vals = NULL; + PREF_ask_char_values("Connor_ECRECNForm_Datbase_Config", &type_num, &type_vals); + string types; + for (int r = 0; r < type_num; r++) { + vector vec; + Split(type_vals[r], "|", vec); + types.append(vec[0]); + } + printf("types======%s\n", types.c_str()); + //ȡ汾 + tag_t new_rev = NULLTAG; + ITKCALL(ITEM_ask_latest_rev(*new_item_tag,&new_rev)); + if (new_item_tag && types.find(item_type) != std::string::npos && new_rev) + { + char* lov = NULL; + + ITKCALL(AOM_UIF_ask_value(new_rev, "ly6_template", &lov)); + + printf("%s=================lov",lov); + //ITKCALL(AOM_ask_value_string(*new_item_tag, "object_type", &type)); + //printf("object_type=========%s\n", type); + //if (strcmp(type,"LY6_BasicMat") == 0) { + //ݿ + vector dbPrefs; + getPrefStrings("LD_dbinfo", dbPrefs); + if (dbPrefs.size() != 4) + { + EMH_store_error_s2(EMH_severity_error, 919012, "ݿѡô", "LD_dbinfo"); + } + if (open((char*)dbPrefs[0].c_str(), (char*)dbPrefs[1].c_str(), (char*)dbPrefs[2].c_str(), (char*)dbPrefs[3].c_str())) + { + printf("ݿʧܣû%s룺%sݿ⣺%sip%s", dbPrefs[0].c_str(), dbPrefs[1].c_str(), dbPrefs[2].c_str(), dbPrefs[3].c_str()); + EMH_store_error_s1(EMH_severity_error, + 919012, + "ݿʧ"); + + return 1; + } + printf("ݿӳɹ\n"); + + + //Ϊ ȲһݿǷͬid + char selectById[1024] = ""; + vector result; + sprintf(selectById, "select ID from LY_CHANGETASSKFORM_DETAILS where ID='%s'", item_id); + if (selectData(selectById, result) != -1) { + if (result.size() > 0) { + printf("%sѾ\n", item_id); + return 0; + } + else { + printf("%sδ\n", item_id); + } + } + printf("selectById====%s\n", selectById); + + char selectRecord[1024] = ""; + vector fields; + vector results; + + sprintf(selectRecord, "select * from LY_CHANGETASSKFORM_TEMPLATE where OBJECTTYPE='%s' and FIELDWHEN='%s' ORDER BY XH ASC", item_type,lov); + //printf("ҵݣ%s\n", selectRecord); + if (selectData2(selectRecord, results,fields) != -1) { + printf("ҵĽ%d\n", results.size()); + + // ȡ vector ĴС + size_t row = fields.size(); + // ʹôͳ for ѭ vector + for (size_t i = 0; i < row; ++i) { + + string sql = "insert into LY_CHANGETASSKFORM_DETAILS("; + string field = fields[i]; + string result = results[i]; + // ʹ resize ȥһ, + /* if (!field.empty() && !result.empty()) { + field.resize(field.length() - 1); + result.resize(result.length() - 1); + }*/ + //printf("field============%s\n", field.c_str()); + //printf("result======================%s\n",result.c_str()); + sql.append(field); + sql.append("ID) values("); + sql.append(result); + //id + sql.append("'"); + sql.append(item_id); + sql.append("')"); + printf("sql============%s\n", sql.c_str()); + if (ExecuteSQLNoInputParam((char*)sql.c_str()) == -1) + { + printf("ʧ2%s", sql.c_str()); + } + else + { + ExecuteSQLNoInputParam("commit"); + printf("ݳɹ"); + } + } + } + + } + return 0; +} \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/ado.cxx b/SignOff_itk/SignOff_itk/ado.cxx new file mode 100644 index 0000000..d8a3727 --- /dev/null +++ b/SignOff_itk/SignOff_itk/ado.cxx @@ -0,0 +1,521 @@ +#include "ado.h" + +_ConnectionPtr m_pConnection; +_RecordsetPtr m_pRecordset; +HRESULT hr; + +using namespace std; + +void PrintVariantType(VARTYPE vt,string name) { + switch (vt) { + case VT_EMPTY: std::cout<< name<<"=======" << "VT_EMPTY"; break; + case VT_NULL: std::cout << name << "=======" << "VT_NULL"; break; + case VT_I2: std::cout << name << "=======" << "VT_I2 (Short)"; break; + case VT_I4: std::cout << name << "=======" << "VT_I4 (Long)"; break; + case VT_R4: std::cout << name << "=======" << "VT_R4 (Float)"; break; + case VT_R8: std::cout << name << "=======" << "VT_R8 (Double)"; break; + case VT_BOOL: std::cout << name << "=======" << "VT_BOOL"; break; + case VT_DATE: std::cout << name << "=======" << "VT_DATE"; break; + case VT_BSTR: std::cout << name << "=======" << "VT_BSTR (String)"; break; + case VT_DISPATCH: std::cout << name << "=======" << "VT_DISPATCH"; break; + case VT_ERROR: std::cout << name << "=======" << "VT_ERROR"; break; + case VT_VARIANT: std::cout << name << "=======" << "VT_VARIANT"; break; + case VT_UNKNOWN: std::cout << name << "=======" << "VT_UNKNOWN"; break; + case VT_DECIMAL: std::cout << name << "=======" << "VT_DECIMAL"; break; + case VT_I1: std::cout << name << "=======" << "VT_I1 (Char)"; break; + case VT_UI1: std::cout << name << "=======" << "VT_UI1 (Byte)"; break; + case VT_UI2: std::cout << name << "=======" << "VT_UI2 (Unsigned Short)"; break; + case VT_UI4: std::cout << name << "=======" << "VT_UI4 (Unsigned Long)"; break; + case VT_I8: std::cout << name << "=======" << "VT_I8 (Long Long)"; break; + case VT_UI8: std::cout << name << "=======" << "VT_UI8 (Unsigned Long Long)"; break; + case VT_INT: std::cout << name << "=======" << "VT_INT (Int)"; break; + case VT_UINT: std::cout << name << "=======" << "VT_UINT (Unsigned Int)"; break; + case VT_VOID: std::cout << name << "=======" << "VT_VOID"; break; + case VT_HRESULT: std::cout << name << "=======" << "VT_HRESULT"; break; + case VT_PTR: std::cout << name << "=======" << "VT_PTR"; break; + case VT_SAFEARRAY: std::cout << name << "=======" << "VT_SAFEARRAY"; break; + case VT_CARRAY: std::cout << name << "=======" << "VT_CARRAY"; break; + case VT_USERDEFINED: std::cout << name << "=======" << "VT_USERDEFINED"; break; + case VT_LPSTR: std::cout << name << "=======" << "VT_LPSTR (String)"; break; + case VT_LPWSTR: std::cout << name << "=======" << "VT_LPWSTR (Wide String)"; break; + case VT_RECORD: std::cout << name << "=======" << "VT_RECORD"; break; + case VT_INT_PTR: std::cout << name << "=======" << "VT_INT_PTR"; break; + case VT_UINT_PTR: std::cout << name << "=======" << "VT_UINT_PTR"; break; + case VT_FILETIME: std::cout << name << "=======" << "VT_FILETIME"; break; + case VT_BLOB: std::cout << name << "=======" << "VT_BLOB"; break; + case VT_STREAM: std::cout << name << "=======" << "VT_STREAM"; break; + case VT_STORAGE: std::cout << name << "=======" << "VT_STORAGE"; break; + case VT_STREAMED_OBJECT: std::cout << name << "=======" << "VT_STREAMED_OBJECT"; break; + case VT_STORED_OBJECT: std::cout << name << "=======" << "VT_STORED_OBJECT"; break; + case VT_BLOB_OBJECT: std::cout << name << "=======" << "VT_BLOB_OBJECT"; break; + case VT_CF: std::cout << name << "=======" << "VT_CF"; break; + case VT_CLSID: std::cout << name << "=======" << "VT_CLSID"; break; + case VT_VERSIONED_STREAM: std::cout << name << "=======" << "VT_VERSIONED_STREAM"; break; + case VT_BSTR_BLOB: std::cout << name << "=======" << "VT_BSTR_BLOB"; break; + default: std::cout << name << "=======" << "Unknown type (" << vt << ")"; break; + } +} + + + + +int selectData2(const string& sql, vector& results, vector& fields) +{ + int ret = -1; + string ss; + string aa; + try + { + //ÿεöʵȽ + if (!FAILED(m_pRecordset.CreateInstance(__uuidof(Recordset)))) + { + ret = 0; + m_pRecordset->Open((_bstr_t)sql.c_str(), _variant_t((IDispatch*)m_pConnection, true), + adOpenKeyset, adLockOptimistic, adCmdText); + long line = 0; + while (NULL != m_pRecordset && !m_pRecordset->adoEOF && adStateClosed != m_pRecordset->State) + { + long count = m_pRecordset->Fields->Count; + ++line; + ss = ""; + aa = ""; + printf("count%d\n", count); + for (long i = 0; i < count; ++i) + { + + //ƻȡ + // + //_variant_t Column("lastUpdDt"); + //_variant_t RusultGet = m_pRecordset->Fields->GetItem(Column)->Value; + BSTR bstrColName = NULL; + m_pRecordset->Fields->Item[i]->get_Name(&bstrColName); + + + /*const char* name; + name = (const char*)bstrColName; + printf(" name=========================== %s \n ", name);*/ + + + // BSTRתΪstd::wstring + std::wstring wname(bstrColName); + // std::wstringתΪstd::string + std::string name(wname.begin(), wname.end()); + //printf(" name=========================== %s \n ", name.c_str()); + + + if (name.length() > 0) { + + + aa.append(name); + aa.append(","); + } + //ţ0ʼ + if (bstrColName != NULL) { + + _variant_t taskStyle = m_pRecordset->GetCollect(bstrColName); + + /*if (taskStyle.bstrVal) { + + }*/ + //PrintVariantType(taskStyle.vt,name); + if (taskStyle.vt != VT_NULL && taskStyle.vt != VT_EMPTY) + { + const char* str; + + + + if (taskStyle.vt == VT_DATE) + { + SYSTEMTIME systime; + VariantTimeToSystemTime(taskStyle.date, &systime); + char buffer[20]; + sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d", + systime.wYear, systime.wMonth, systime.wDay, + systime.wHour, systime.wMinute, systime.wSecond); + + str = buffer; + + + } + else { + _bstr_t value = (_bstr_t)taskStyle; + str = (const char*)value; + } + + + + if (str != NULL) { + //printf(" ѯĽ %s \n", str); + if (strcmp(str, "00:00:00.0000000") == 0) { + + ss.append("NULL"); + ss.append(","); + } + else { + ss.append("'"); + ss.append(str); + ss.append("'"); + ss.append(","); + } + + } + else { + + ss.append("NULL"); + ss.append(","); + + + } + } + else { + ss.append("NULL"); + ss.append(","); + + } + } + + + + } + // printf(" ѯĽ %s \n ", ss.c_str()); + // printf(" ѯֶ %s \n ", aa.c_str()); + results.push_back(ss); + fields.push_back(aa); + m_pRecordset->MoveNext(); + } + m_pRecordset->Close(); + m_pRecordset = NULL; + + } + else + { + + } + + } + catch (_com_error e) + { + std::cout << "ѯ¼ʧ " << e.ErrorMessage() << std::endl; + if (strcmp(ss.c_str(), "") != 0) { + results.push_back(ss); + } + + } + return ret; +} + + + +int selectDataNormal(const string& sql, vector& results) +{ + int ret = -1; + string ss; + + try + { + //ÿεöʵȽ + if (!FAILED(m_pRecordset.CreateInstance(__uuidof(Recordset)))) + { + ret = 0; + m_pRecordset->Open((_bstr_t)sql.c_str(), _variant_t((IDispatch*)m_pConnection, true), + adOpenKeyset, adLockOptimistic, adCmdText); + long line = 0; + while (NULL != m_pRecordset && !m_pRecordset->adoEOF && adStateClosed != m_pRecordset->State) + { + long count = m_pRecordset->Fields->Count; + ++line; + ss = ""; + printf("count%d\n", count); + for (long i = 0; i < count; ++i) + { + + //ƻȡ + // + //_variant_t Column("lastUpdDt"); + //_variant_t RusultGet = m_pRecordset->Fields->GetItem(Column)->Value; + BSTR bstrColName = NULL; + m_pRecordset->Fields->Item[i]->get_Name(&bstrColName); + + + /*const char* name; + name = (const char*)bstrColName; + printf(" name=========================== %s \n ", name);*/ + + + // BSTRתΪstd::wstring + std::wstring wname(bstrColName); + // std::wstringתΪstd::string + std::string name(wname.begin(), wname.end()); + printf(" name=========================== %s \n ", name.c_str()); + + //ţ0ʼ + if (bstrColName != NULL) { + _variant_t taskStyle = m_pRecordset->GetCollect(bstrColName); + + /*if (taskStyle.bstrVal) { + + }*/ + + const char* str; + + + + + + _bstr_t value = (_bstr_t)taskStyle; + str = (const char*)value; + + if (str != NULL) { + //printf(" ѯĽ %s \n", str); + + ss.append(str); + } + } + + + + } + //printf(" ѯĽ %s \n ", ss.c_str()); + results.push_back(ss); + m_pRecordset->MoveNext(); + } + m_pRecordset->Close(); + m_pRecordset = NULL; + + } + else + { + + } + + } + catch (_com_error e) + { + std::cout << "ѯ¼ʧ " << e.ErrorMessage() << std::endl; + if (strcmp(ss.c_str(), "") != 0) { + results.push_back(ss); + } + + } + return ret; +} + + +int selectData(const string& sql, vector& results) +{ + int ret = -1; + string ss; + + try + { + //ÿεöʵȽ + if (!FAILED(m_pRecordset.CreateInstance(__uuidof(Recordset)))) + { + ret = 0; + m_pRecordset->Open((_bstr_t)sql.c_str(), _variant_t((IDispatch*)m_pConnection, true), + adOpenKeyset, adLockOptimistic, adCmdText); + long line = 0; + while (NULL != m_pRecordset && !m_pRecordset->adoEOF && adStateClosed != m_pRecordset->State) + { + long count = m_pRecordset->Fields->Count; + ++line; + ss = ""; + printf("count%d\n", count); + for (long i = 0; i < count; ++i) + { + + //ƻȡ + // + //_variant_t Column("lastUpdDt"); + //_variant_t RusultGet = m_pRecordset->Fields->GetItem(Column)->Value; + BSTR bstrColName = NULL; + m_pRecordset->Fields->Item[i]->get_Name(&bstrColName); + + + /*const char* name; + name = (const char*)bstrColName; + printf(" name=========================== %s \n ", name);*/ + + + // BSTRתΪstd::wstring + std::wstring wname(bstrColName); + // std::wstringתΪstd::string + std::string name(wname.begin(), wname.end()); + printf(" name=========================== %s \n ", name.c_str()); + + //ţ0ʼ + if (bstrColName != NULL) { + _variant_t taskStyle = m_pRecordset->GetCollect(bstrColName); + + /*if (taskStyle.bstrVal) { + + }*/ + + const char* str; + + + + + + _bstr_t value = (_bstr_t)taskStyle; + str = (const char*)value; + + if (str != NULL) { + //printf(" ѯĽ %s \n", str); + + ss.append(str); + ss.append(","); + } + } + + + + } + //printf(" ѯĽ %s \n ", ss.c_str()); + results.push_back(ss); + m_pRecordset->MoveNext(); + } + m_pRecordset->Close(); + m_pRecordset = NULL; + + } + else + { + + } + + } + catch (_com_error e) + { + std::cout << "ѯ¼ʧ " << e.ErrorMessage() << std::endl; + if (strcmp(ss.c_str(), "")!=0) { + results.push_back(ss); + } + + } + return ret; +} + +bool open(char* username, char* password, char* dbname, char* ip) +{ + try + { + ::CoInitialize(NULL); //ʼCOM + m_pConnection.CreateInstance(__uuidof(Connection)); //Ӷ + char connStr[200] = ""; + sprintf(connStr, "Provider=SQLOLEDB;Data Source=%s;Initial Catalog=%s;", ip, dbname); + printf(" connStr %s name %s password %s :\n", connStr , username , password); + hr = m_pConnection->Open(connStr, username, password, -1); + if (hr != S_OK) + return true; + } + catch (_com_error e) + { + return true; + } + return false; +} + +// IJѯ +int QuerySQL(char* SQL, int inputValueCount, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + + Fields* fields = NULL; + long ColCount = 0; + + *outputColumn = 0; + *outputValueCount = 0; + m_pRecordset.CreateInstance(__uuidof(Recordset)); + + m_pRecordset->Open(SQL, m_pConnection.GetInterfacePtr(), adOpenStatic, adLockOptimistic, adCmdText); + hr = m_pRecordset->get_Fields(&fields); //õ¼ֶμ + if (SUCCEEDED(hr)) + { + fields->get_Count(&ColCount); + } + if (ColCount == 0) { + return 0; + } + else + { + *outputValueCount = 1; + } + + int index = 0; + // ʼڴ沢Ҵ洢 + *outputValue = (char***)calloc( 1, sizeof(char**)); + if (!m_pRecordset->adoEOF) + { + printf("ҵĽ%d\n", index); + (*outputValue)[index] = (char**)calloc( 1, sizeof(char*)); + for (long i = 0; i < ColCount; i++) + { + BSTR bstrColName = NULL; + fields->Item[i]->get_Name(&bstrColName); + (*outputValue)[index][i] = (char*)calloc(1000, sizeof(char)); + _variant_t taskStyle = NULL; + taskStyle = m_pRecordset->GetCollect(bstrColName); + const char* str; + _bstr_t bst_t = (_bstr_t)taskStyle; + str = (const char*)bst_t; + strcpy((*outputValue)[index][i], str); + } + m_pRecordset->MoveNext();///Ƶһ¼ + + printf("ҵĽ%d\n", index); + + index++; + } + return 0; +} + +// ִвѯ +int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + return QuerySQL(SQL, 0, outputColumn, outputValueCount, outputValue); +} + +// ִɾ +int ExecuteSQLNoInputParam(char* SQL) +{ + return ExecuteSQL(SQL, 0, NULL); +} + +int ExecuteSQL(char* SQL, int valueCount, char** value) +{ + try + { + m_pConnection->Execute(_bstr_t(SQL), 0, adCmdText); + } + catch (_com_error e) + { + //printf("ʧ\n"); + printf(e.Description()); + return -1; + } + + return 0; +} + +void close(void) +{ + try + { + if (m_pRecordset != NULL) { + //m_pRecordset->MoveFirst(); + + m_pRecordset->Close(); + m_pConnection->Close(); + } + printf("ͷŻ"); + + ::CoUninitialize(); //ͷŻ + } + catch (_com_error e) + { + printf("ͷŻ error"); + + return; + } + +} \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/ado.h b/SignOff_itk/SignOff_itk/ado.h new file mode 100644 index 0000000..1e040a3 --- /dev/null +++ b/SignOff_itk/SignOff_itk/ado.h @@ -0,0 +1,40 @@ +#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF", "adoEOF") +#include "Supor_register.h" + +bool open(char* username, char* password, char* dbname, char* ip); +_RecordsetPtr& execute(_bstr_t SQL); +/** +* IJѯSQL. +* @param SQL - SQL +* @param inputValueCount - +* @param inputValue - ֵ +* @param outputColumn - е +* @param outputValueCount - е +* @param outputValue - +* @return - OCI_OK or error code +* +* ORACLE ݿװ +*/ +int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue); + +int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue); +// ִ +int ExecuteSQL(char* SQL, int valueCount, char** value); +/** +* ִSQL. +* @param SQL - SQL +* @return - OCI_OK or error code +* +* ORACLE ݿװ +*/ +int selectData2(const string& sql, vector& results, vector& fields); +int selectData(const string& sql,vector& results); +int selectDataNormal(const string& sql, vector& results); +int ExecuteSQLNoInputParam(char* SQL); +int getPrefStrings(const char* preference, vector& pref_vec); +/** +* Ͽݿ. +* +* ORACLE ݿװ +*/ +void close(); \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/common_itk_util.cxx b/SignOff_itk/SignOff_itk/common_itk_util.cxx new file mode 100644 index 0000000..b94c326 --- /dev/null +++ b/SignOff_itk/SignOff_itk/common_itk_util.cxx @@ -0,0 +1,477 @@ +/** +* @file common_itk_util.cpp +* @brief itk warpper utility function +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 18-July-2008 James +*/ + +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) + + + +#include "error_handling.h" +#include "ado.h" +#include "common_itk_util.h" +#include "ocilib.h" +#include +#include +#ifdef WIN32 +#include +#include +#else +#include +#endif + +#define ARGS_LENGTH 200 +#define ARGS_NAME_DEBUG "-debug" +#define DEBUG "-debug=" +#define MAX_PRINTLINE_LENGTH 2000 +#define MAX_PATH_LENGTH 2000 +#define MAX_ARGUMENT_LENGTH 400 +#define MAX_PARAMNAME_LENGTH 50 +#define MAX_FILE_EXT_LENGTH 10 +#define TRUE_FLAG 1 +#define FALSE_FLAG 0 +#define DETAILLOG 1 + + + +void ECHO(char *format, ...) +{ + //if( !YFJC_OPT_DEBUG ) + // return; + + char msg[4096]; + va_list args; + + va_start( args, format ); + vsprintf( msg, format, args ); + va_end( args ); + + printf( msg ); + TC_write_syslog( msg ); +} + +FILE* logFile = NULL; + +/*=============================================================================* + * FUNCTION: current_time + * PURPOSE : get the current datetime + * INPUT: + * date_t* date_tag // current date time tag + * + * RETURN: + * void + *============================================================================*/ +void current_time( date_t * date_tag ) +{ + time_t ltime; + struct tm *today ; + + // Set time zone from TZ environment variable. If TZ is not set, + // the operating system is queried to obtain the default value + // for the variable. + // + //_tzset(); + + // Get UNIX-style time and display as number and string. + time( <ime ); + + today = localtime( <ime ); + date_tag->year = today->tm_year + 1900 ; + date_tag->month = today->tm_mon ; + date_tag->day = today->tm_mday ; + date_tag->hour = today->tm_hour ; + date_tag->minute = today->tm_min ; + date_tag->second = today->tm_sec ; +} +/*=============================================================================* + * FUNCTION: CreateLogFile + * PURPOSE : create log file + * INPUT: + * char* FunctionName // the funtion which need to create log file + * FILE** logFile // out: the log file pointer + * + * RETURN: + * void + *============================================================================*/ +void CreateLogFile(char* FunctionName, char **fullname) +{ + int i=0, ifail = ITK_ok; + //date_t status_now; + //char* date_string = NULL; + char date_string[MAX_PATH_LENGTH]; + char logFileDir[MAX_PATH_LENGTH]; + char logFileName[MAX_PATH_LENGTH]; + + char* session_uid = NULL; + tag_t session_tag = NULLTAG; + time_t now; + struct tm *p; + + time(&now); + + logFile = NULL; + //current_time(&status_now); + p=localtime(&now); + + memset(date_string, 0, sizeof(date_string)); + //sprintf(date_string,"%4d%02d%02d%02d%02d%02d",1900+p->tm_year,p->tm_mon+1 ,p->tm_mday ,p->tm_hour,p->tm_min ,p->tm_sec ); + sprintf(date_string,"%4d%02d%02d",1900+p->tm_year,p->tm_mon+1 ,p->tm_mday); + //if( DATE_date_to_string( status_now, "%Y%m%d%H%M%S", &date_string) != ITK_ok ) + //ifail = ITK_date_to_string (status_now, &date_string ); + //if (ifail) + //{ + // printf("!*ERROR*!: Failed to get current date time\n"); + // goto CLEANUP; + //} + + memset(logFileDir, 0, sizeof(logFileDir)); + memset(logFileName, 0, sizeof(logFileName)); + //get log dir + sprintf(logFileDir, "%s", getenv("TEMP")); + printf("\n log file dir: %s\n", logFileDir); + //try to change dir to TC_USER_LOG_DIR + if(chdir(logFileDir)!=ITK_ok) + { + //not set TC_USER_LOG_DIR + //log in to default TC_LOG + memset(logFileDir, 0, sizeof(logFileDir)); + sprintf(logFileDir, "%s", getenv("TC_LOG")); + printf("\n TC_USER_LOG_DIR invalide, log file dir: %s\n", logFileDir); + if(chdir(logFileDir)!=ITK_ok) + { + //still can not change to log dir + printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n"); + goto CLEANUP; + } + } + + //get session_uid to make sure the log file name unique + POM_ask_session(&session_tag); + ITK__convert_tag_to_uid(session_tag, &session_uid); + + + //get logFileName + //sprintf(logFileName, "%s_%s_%s.log", FunctionName, session_uid, date_string); + sprintf(logFileName, "%s_%s.log", FunctionName, date_string); + printf("log file name: %s\n", logFileName); + + *fullname = (char *)MEM_alloc(sizeof(char)*512); + sprintf(*fullname,"%s\\%s",logFileDir,logFileName); + + //for(i = 0; _access((char *)logFileName, 4) == 0; i++) + /*{ + memset(logFileName, 0, sizeof(logFileName)); + sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i); + } + printf("final log file name: %s\n", logFileName);*/ + + //create log file + logFile = fopen(logFileName, "a"); + +CLEANUP: + //DOFREE(date_string); + DOFREE(session_uid); +} + + +/*=============================================================================* + * FUNCTION: WriteLog + * PURPOSE : write log, if debug log File not null, write log message to log File + * INPUT: + * const char* format // debug message string + * + * RETURN: + * void + *============================================================================*/ +void WriteLog(const char* format, ...) +{ + va_list arg; + char tmp[MAX_PRINTLINE_LENGTH]; + + if(logFile) + { + //get the message + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + + //----------print to command window for trace--------// + printf("%s\n", tmp); + + //print message to log file + fprintf(logFile, "%s\n", tmp); + fflush(logFile); + } + else + { + printf("*!Error!*: Log File Not Exist\n"); + } +} + +void CloseLog(void) +{ + if(logFile) + { + fclose(logFile); + logFile = NULL; + } +} + +//void getTypeinfo(char *type) +//{ +// int ulen = 0,i=0,tempcount=0,asd=0; +// +// char temp[128]=""; +// ulen = strlen(type); +// asd = ulen-1; +// for(i=0;i < ulen;i++) +// { +// if(type[i] == ';') +// { +// temp[tempcount] = '\0'; +// strcpy(excludetypes[typecount].type,temp); +// strcpy(temp,""); +// tempcount = 0; +// typecount = typecount + 1; +// } +// else +// { +// +// temp[tempcount] = type[i]; +// tempcount = tempcount + 1; +// if(i==asd) +// { +// temp[tempcount] = '\0'; +// strcpy(excludetypes[typecount].type,temp); +// typecount = typecount + 1; +// } +// +// } +// +// } +//} + +int SuporConnectionDB(){ + char username[100]="\0",//数据库用户名 + password[100]="\0",//数据库密码 + url[100] = "\0", + sid[100]="\0"; //数据库链接 + FILE* dbconfig = NULL; + char* tc_root_dir = getenv("tc_root"); + char filePath[1024] = ""; + tc_strcpy(filePath, tc_root_dir); + tc_strcat(filePath,"\\bin\\dbConfig.properties"); + dbconfig = fopen(filePath, "r"); + if(dbconfig==NULL){ + WriteLog("%s该路径的配置文件读取失败,请检查权限或是否存在\n", filePath); + }else + { + int line_num=0; + int data_count=0; + char **data_values=NULL; + char lineBuffer[1024]=""; + while( fgets(lineBuffer, sizeof(lineBuffer), dbconfig) != NULL ){ + line_num++; + EPM__parse_string(lineBuffer, "=", &data_count, &data_values); + if(line_num==1){ + strcpy(username,data_values[1]); + WriteLog("用户名:%s\n",username); + } + if(line_num==2){ + strcpy(password,data_values[1]); + WriteLog("密码:%s\n",password); + } + if(line_num==3){ + strcpy(sid,data_values[1]); + WriteLog("sid:%s\n",sid); + } + if (line_num == 4) { + strcpy(url, data_values[1]); + WriteLog("url:%s\n", url); + } + } + DOFREE(data_values); + fclose(dbconfig); + // WriteLog("数据库连接配置内容:用户名:%s,密码:%s,链接:%s\n",username,password,sid); + if (open(username, password, sid, url)) + { + WriteLog("连接数据库失败\n"); + return -1; + }else + { + return 0; + } + } + return -1; +} + +char* GbkToUtf8(const char* src_str) +{ + int len = MultiByteToWideChar(CP_ACP, 0, src_str, -1, NULL, 0); + wchar_t* wstr = (wchar_t*)MEM_alloc((len + 1) * sizeof(wchar_t)); + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_ACP, 0, src_str, -1, wstr, len); + len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); + char *str = (char*)MEM_alloc((len + 1) * sizeof(char)); + + memset(str, 0, len + 1); + WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); + return str; +} + +char* Utf8ToGbk(const char* src_str) +{ + int len = MultiByteToWideChar(CP_UTF8, 0, src_str, -1, NULL, 0); + wchar_t* wszGBK = (wchar_t*)MEM_alloc((len + 1) * sizeof(wchar_t)); + memset(wszGBK, 0, len * 2 + 2); + MultiByteToWideChar(CP_UTF8, 0, src_str, -1, wszGBK, len); + len = WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, NULL, 0, NULL, NULL); + char *szGBK = (char*)MEM_alloc((len + 1) * sizeof(char)); + + memset(szGBK, 0, len + 1); + WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, szGBK, len, NULL, NULL); + return szGBK; +} + +void starTime() { + time_t now; + struct tm* p; + time(&now); + p = localtime(&now); + WriteLog("start time %4d%02d%02d%02d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); +} + +/** +* +* 判断某个对象是否为ItemRevision +* +*/ +logical checkIsItemRevision(tag_t objtag) { + tag_t type = NULLTAG; + tag_t item_type = NULLTAG; + logical isItems = false; + ITKCALL(TCTYPE_ask_object_type(objtag, &type)); + ITKCALL(TCTYPE_find_type("ItemRevision", "", &item_type)); + if (item_type != NULLTAG) { + logical isok = FALSE; + ITKCALL(TCTYPE_is_type_of(type, item_type, &isok)); + if (isok) { + isItems = TRUE; + } + else { + isItems = FALSE; + } + } + return isItems; +} + +/******************************************************************* +* +*将签名信息写入到中间文件 +* +*@param file_content 签名信息的内容 +*@param item_id 对象id +*@param file_name 文件名称 +* +*******************************************************************/ +int Supor_create_signinfo_file(char* file_content,char *item_id, char** file_name) +{ + time_t now; + struct tm* p; + FILE* filePtr = NULL; + char temp_dir[MAX_PATH_LENGTH]; + char local_path[MAX_PATH] = ""; + char date_string[MAX_PATH_LENGTH]; + memset(temp_dir, 0, sizeof(temp_dir)); + memset(local_path, 0, sizeof(local_path)); + sprintf(temp_dir, "%s", getenv("TEMP")); + printf("\n file dir: %s\n", temp_dir); + time(&now); + p = localtime(&now); + if (chdir(temp_dir) != ITK_ok) + { + memset(temp_dir, 0, sizeof(temp_dir)); + sprintf(temp_dir, "%s", getenv("TC_LOG")); + printf("\n TC_USER_LOG_DIR invalide, log file dir: %s\n", temp_dir); + if (chdir(temp_dir) != ITK_ok) + { + printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n"); + + } + } + memset(date_string, 0, sizeof(date_string)); + if (item_id != NULL) { + sprintf(date_string, "%s_%4d%02d%02d%02d%02d%02d.dat", item_id, 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + } + else + { + sprintf(date_string, "%4d%02d%02d%02d%02d%02d.dat", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + } + printf("file name: %s\n", date_string); + filePtr = fopen(date_string, "w"); + printf("create the temp dat file success!\n"); + *file_name = (char*)MEM_alloc(sizeof(char) * 512); + sprintf(local_path, "%s\\%s", temp_dir, date_string); + strcpy((*file_name), local_path); + fprintf(filePtr, "%s", file_content); + //fwrite(file_content, sizeof(char), strlen(file_content), filePtr); + fclose(filePtr); + + return ITK_ok; +} +/******************************************************************* +* +*创建中间文件 +* +*@param file_content 签名信息的内容 +*@param item_id 对象id +*@param file_name 文件名称 +* +*******************************************************************/ +int Supor_create_txt_file(char* FunctionName, char** file_name) +{ + time_t now; + struct tm* p; + FILE* filePtr = NULL; + char temp_dir[MAX_PATH_LENGTH]; + char local_path[MAX_PATH] = ""; + char date_string[MAX_PATH_LENGTH]; + memset(temp_dir, 0, sizeof(temp_dir)); + memset(local_path, 0, sizeof(local_path)); + sprintf(temp_dir, "%s", getenv("TEMP")); + printf("\n file dir: %s\n", temp_dir); + time(&now); + p = localtime(&now); + if (chdir(temp_dir) != ITK_ok) + { + memset(temp_dir, 0, sizeof(temp_dir)); + sprintf(temp_dir, "%s", getenv("TC_LOG")); + printf("\n TC_USER_LOG_DIR invalide, log file dir: %s\n", temp_dir); + if (chdir(temp_dir) != ITK_ok) + { + printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n"); + + } + } + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%s_%4d%02d%02d%02d%02d%02d.txt", FunctionName, 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + printf("file name: %s\n", date_string); + filePtr = fopen(date_string, "w"); + printf("create the temp dat file success!\n"); + *file_name = (char*)MEM_alloc(sizeof(char) * 512); + sprintf(local_path, "%s\\%s", temp_dir, date_string); + strcpy((*file_name), local_path); + //fwrite(file_content, sizeof(char), strlen(file_content), filePtr); + fclose(filePtr); + + return ITK_ok; +} + + diff --git a/SignOff_itk/SignOff_itk/common_itk_util.h b/SignOff_itk/SignOff_itk/common_itk_util.h new file mode 100644 index 0000000..4b45be8 --- /dev/null +++ b/SignOff_itk/SignOff_itk/common_itk_util.h @@ -0,0 +1,76 @@ +/** +* @file common_itk_util.h +* @brief itk warpper utility function +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +*/ + +#ifndef COMMON_ITK_UTIL +#define COMMON_ITK_UTIL + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +//#include +//#include +//#include +#include +#include +//#include +#include +#include + +//#include +//#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} +void ECHO(char *format, ...); +void CreateLogFile(char* FunctionName, char **fullname); +void WriteLog(const char* format, ...); +void CloseLog(void); +void current_time( date_t * date_tag ); +int SuporConnectionDB(); +char* GbkToUtf8(const char* src_str); +char* Utf8ToGbk(const char* src_str); +void starTime(); +logical checkIsItemRevision(tag_t objtag); +int Supor_create_signinfo_file(char* file_content,char *item_id, char** file_name); +int Supor_create_txt_file(char* FunctionName, char** file_name); +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/connor_assign_user.cpp b/SignOff_itk/SignOff_itk/connor_assign_user.cpp new file mode 100644 index 0000000..be24d38 --- /dev/null +++ b/SignOff_itk/SignOff_itk/connor_assign_user.cpp @@ -0,0 +1,86 @@ +#include "Supor_register.h" +using namespace std; +extern "C" int POM_AM__set_application_bypass(logical bypass); + +/** +* +* Description: +* This handler will set signoff infomation to properties of rev +* +* Syntax: +* +* +* -SignUserName: ûID +* +* -SignDate: ʱ +* +* -SignDateFormate: %Y-%m-%d ʱʽ +* +* -SignComment: ע͵ DZ +* +* -SignRelation: ǩͰ汾Ĺϵ +* +* +*/ +int connor_assign_user(EPM_action_message_t msg) { + int ifail = ITK_ok; + char* log_file = NULL; + + CreateLogFile("connor_assign_user", &log_file); + WriteLog("*************************************************************\n"); + WriteLog("* connor_assign_user is strat ! *\n"); + WriteLog("*************************************************************\n"); + + + int arg_cnt = 0, attachments = 0, * attach_type, occur_of_counts = 0, form_count; + + SIGNOFF_TYPE_t memberType; + EPM_signoff_decision_t dec; + tag_t aUserTag = NULLTAG, responsibleParty = NULLTAG, cur_perform_task = NULLTAG, * attachmentTags = NULLTAG; + tag_t root_task = NULLTAG, * taskAttches = NULLTAG, master_form_rel_type = NULLTAG, * form_list = NULLTAG; + tag_t type_tag = NULLTAG, * user_tags = NULLTAG; + int user_cnt = 0; + char* timeinfo = NULL; + EPM_ask_root_task(msg.task, &root_task); + EPM_ask_attachments(root_task, EPM_target_attachment, &occur_of_counts, &taskAttches); + POM_AM__set_application_bypass(true); + for (int count = 0; count < occur_of_counts; count++) { + char* id = NULL;//ûid + ITKCALL(AOM_ask_value_string(taskAttches[count], "ly6_assignUser", &id)); + printf("id=========%s\n", id); + if (id != NULL) { + tag_t tmp_select_signoff_task = NULLTAG; + ITKCALL(EPM_ask_sub_task(root_task, EPM_select_signoff_team_task, &tmp_select_signoff_task)); + + tag_t user; + ITKCALL(SA_find_user2(id, &user)); + if (user) { + printf("11111111111111111111\n"); + } + if (user && tmp_select_signoff_task) { + printf("=========\n"); + int signoff_cnt = 0; + tag_t* signoffs = NULL; + ITKCALL(EPM_create_adhoc_signoff(tmp_select_signoff_task, user, &signoff_cnt, &signoffs)); + ITKCALL(EPM_set_adhoc_signoff_selection_done(tmp_select_signoff_task, true)); + + if (signoffs) + { + MEM_free(signoffs); + signoffs = NULL; + } + } + + } + + + + } + POM_AM__set_application_bypass(false); + WriteLog("*************************************************************\n"); + WriteLog("* connor_assign_user is end ! *\n"); + WriteLog("*************************************************************\n"); + CloseLog(); + return ifail; +} + diff --git a/SignOff_itk/SignOff_itk/connor_util.cpp b/SignOff_itk/SignOff_itk/connor_util.cpp new file mode 100644 index 0000000..48bd0d3 --- /dev/null +++ b/SignOff_itk/SignOff_itk/connor_util.cpp @@ -0,0 +1,384 @@ +#include "connor_util.h" +#include +#include +#include +#include +#include +#include + +extern "C" int POM_AM__set_application_bypass(logical bypass); +/** +*判断某个对象是否是类或者子类 +*objtag 要判断的对象 +*type_name 类型的名称 +*/ +int checkIsTypeOrSubtype(tag_t objtag, char* type_name) { + printf("判断是否是%s及其子类\n", type_name); + tag_t type = NULLTAG; + ITKCALL(TCTYPE_ask_object_type(objtag, &type)); + tag_t item_type = NULLTAG; + ITKCALL(TCTYPE_find_type(type_name, "", &item_type)); + int is_type = 0; + if (item_type != NULLTAG) { + printf("找到%s类\n", type_name); + //printf(" find Folder type ok !!!! \n"); + logical isok = FALSE; + ITKCALL(TCTYPE_is_type_of(type, item_type, &isok)); + if (isok) { + printf("是%s类及其子类\n\n", type_name); + is_type = 1; + } + else { + printf("不是%s类及其子类\n\n", type_name); + is_type = 0; + } + } + else { + printf("没有找到%s类\n\n", type_name); + } + return is_type; +} + +int Supor_open_bypass(void* returnValue) +{ + POM_AM__set_application_bypass(true); + return 0; +} + +int Supor_close_bypass(void* returnValue) +{ + POM_AM__set_application_bypass(false); + return 0; +} + +int ITK_server_bypass(void* returnValue) +{ + int status = ITK_ok; + char* setBypass = false; + logical byPassStatus = false; + + ITKCALL(status = USERARG_get_string_argument(&setBypass)); + + if (strcmp(setBypass, "true") == 0) { + byPassStatus = true; + } + POM_AM__set_application_bypass(setBypass); + return 0; +} + +int Supor_add_release_status(void* return_data) { + int ifail = ITK_ok; + char* client_string = NULL, * client_string2 = NULL; + ITKCALL(ifail = USERARG_get_string_argument(&client_string)); + ITKCALL(ifail = USERARG_get_string_argument(&client_string2)); + printf(("添加发布状态 %s 到UID = %s \n", client_string2, client_string)); + tag_t dataset_tag = NULLTAG; + tag_t release_stat = NULLTAG; + char* flag = NULL; + ITKCALL(ifail = POM_string_to_tag(client_string, &dataset_tag)); + if (dataset_tag == NULLTAG) { + flag = "false"; + } + else { + ITKCALL(ifail = RELSTAT_create_release_status(client_string2, &release_stat)); + if (ifail == ITK_ok) { + ITKCALL(ifail = RELSTAT_add_release_status(release_stat, 1, &dataset_tag, true)); + if (ifail == ITK_ok) { + printf(("添加发布状态成功\n")); + flag = "true"; + } + else { + flag = "false"; + } + } + else { + flag = "false"; + } + } + MEM_free(client_string); + MEM_free(client_string2); + + char server_string[10]; + strcpy(server_string, flag); + + *((char**)return_data) = + (char*)MEM_alloc((strlen(server_string) + 1) * sizeof(char)); + + strcpy(*((char**)return_data), server_string); + return ITK_ok; +} + + +//递归bom 判断子是否发布 +boolean getchibomline_isrelease(tag_t top_line_tag, char* err) { + + int m = 0, status_count = 0, + rev_form_cnt = 0, + c_line_count = 0, + tuzhi_col = 0; + tag_t bom_window_tag = NULLTAG, + * c_line_tags = NULL, + * rev_form_tags = NULL, + * tuzhi_tags = NULL; + printf("nnnn\n"); + ITKCALL(BOM_line_ask_all_child_lines(top_line_tag, &c_line_count, &c_line_tags)); + printf("c_line_count=%d\n" + c_line_count); + if (c_line_count == 0) { + printf("下面没有BOM结构\n"); + + } + else { + + for (int m = 0; m < c_line_count; m++) + { + tag_t rev_tag = NULLTAG; + char* name = "\0"; + ITKCALL(AOM_ask_value_tag(c_line_tags[m], "bl_line_object", &rev_tag));//获取BOMLINE关联的版本 + ITKCALL(AOM_ask_value_string(rev_tag, "object_string", &name)); + int wl_release_count = 0; + tag_t* wl_release_tags = NULL; + ITKCALL(AOM_ask_value_tags(rev_tag, "release_status_list", &wl_release_count, &wl_release_tags)); + if (wl_release_count > 0) + { + printf("版本已发布\n"); + } + else { + printf("版本未发布\n"); + strcat(err, "["); + strcat(err, name); + strcat(err, "]"); + } + + getchibomline_isrelease(c_line_tags[m], err); + + } + + } + + return true; +} + + + +//判断子件是否发布 +int BOM_CHI_ISRELEASE(EPM_rule_message_t msg) { + + printf("===================================\n"); + printf("根据BOM子件是否发布,限制流程发起 开始\n"); + printf("===================================\n"); + + int ifail = EPM_go, att_cnt = 0; + tag_t task_tag = NULL_TAG, + root_task_tag = NULLTAG, + * attachments;; + task_tag = msg.task; + char errs[2500] = "\0"; + char err[2000] = "\0"; + + if (task_tag == NULLTAG) + { + return EPM_nogo; + } + + EPM_ask_root_task(task_tag, &root_task_tag); + EPM_ask_attachments(root_task_tag, EPM_target_attachment, &att_cnt, &attachments); + + + if (att_cnt <= 0) { + printf("目标为空 退出\n"); + return EPM_go; + } + else { + POM_AM__set_application_bypass(true); + for (int i = 0; i < att_cnt; i++) + { + tag_t tagt = NULLTAG; + char* name = NULL; + int form_c = 0; + tagt = attachments[i];// + if (checkIsTypeOrSubtype(tagt, "PSBOMViewRevision") != 1) + { + printf("类型不是PSBOMViewRevision\n"); + continue; + } + printf("类型是PSBOMViewRevision,继续\n"); + ITKCALL(AOM_ask_value_string(tagt, "object_string", &name)); + int m = 0, c_line_count = 0; + tag_t bom_window_tag = NULLTAG, + top_line_tag = NULLTAG, + * c_line_tags; + ITKCALL(BOM_create_window(&bom_window_tag));//创建window视图 + ITKCALL(BOM_set_window_top_line_bvr(bom_window_tag, tagt, &top_line_tag));//获取顶层bomline + ITKCALL(BOM_line_ask_all_child_lines(top_line_tag, &c_line_count, &c_line_tags)); + if (c_line_count == 0) { + printf("没有BOM结构\n"); + + } + else { + getchibomline_isrelease(top_line_tag, err); + if (strcmp(err, "") != 0) + { + sprintf(errs, "存在BOM对象%s子件%s未发布!!", name, err); + EMH_store_error_s1(EMH_severity_information, 278701, errs);//错误弹窗 + ifail = EPM_nogo; + } + + } + ITKCALL(BOM_close_window(bom_window_tag)); + if (name != NULL) { + MEM_free(name); + name = NULL; + } + } + POM_AM__set_application_bypass(false); + } + + printf("ifail:%d\n", ifail); + + printf("===================================\n"); + printf("根据BOM子件是否发布,限制流程发起 结束\n"); + printf("===================================\n"); + + return ifail; +} + +int checkIsTypeOrSubtype(tag_t objtag, const char* type_name) { + //printf("判断是否是%s及其子类\n",type_name); + tag_t type = NULLTAG; + ITKCALL(TCTYPE_ask_object_type(objtag, &type));//获得类型 + tag_t item_type = NULLTAG; + ITKCALL(TCTYPE_find_type(type_name, "", &item_type));//获得所有类型为type_name的对象 + int is_type = 0; + if (item_type != NULLTAG) { + //printf("找到%s类\n",type_name); + //printf(" find Folder type ok !!!! \n"); + logical isok = FALSE; + ITKCALL(TCTYPE_is_type_of(type, item_type, &isok));//判断type是否为item_type的子类或者相同 + if (isok) { + is_type = 1; + } + else { + is_type = 0; + } + } + else { + + } + return is_type; +} + +wchar_t* c2w(const char* str) +{ + /* + int length = strlen(str) + 1; + wchar_t* t = (wchar_t*)malloc(sizeof(wchar_t) * length); + memset(t, 0, length * sizeof(wchar_t)); + MultiByteToWideChar(CP_ACP, 0, str, strlen(str), t, length); + return t; + */ + int iSize; + wchar_t* pwszUnicode; + + //返回接受字符串所需缓冲区的大小,已经包含字符结尾符'\0' + iSize = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); //iSize =wcslen(pwsUnicode)+1=6 + pwszUnicode = (wchar_t*)malloc(iSize * sizeof(wchar_t)); //不需要 pwszUnicode = (wchar_t *)malloc((iSize+1)*sizeof(wchar_t)) + MultiByteToWideChar(CP_ACP, 0, str, -1, pwszUnicode, iSize); + + return pwszUnicode; +} + + +string WStringToString(const wstring& ws) + +{ + string curLocale = setlocale(LC_ALL, NULL); // curLocale = "C"; + setlocale(LC_ALL, "chs"); + const wchar_t* _Source = ws.c_str(); + size_t _Dsize = 2 * ws.size() + 1; + char* _Dest = new char[_Dsize]; + memset(_Dest, 0, _Dsize); + wcstombs(_Dest, _Source, _Dsize); + string result = _Dest; + delete[]_Dest; + setlocale(LC_ALL, curLocale.c_str()); + return result; + +} + +void split(std::string s, const char* delim, std::vector* ret) +{ + size_t last = 0; + size_t index = s.find(delim, last); + int size = strlen(delim); + while (index != std::string::npos) { + ret->push_back(s.substr(last, index - last)); + last = index + size; + index = s.find(delim, last); + } + if (index - last > 0) { + ret->push_back(s.substr(last, index - last)); + } +} + +string trim(string& str) + +{ + + str.erase(0, str.find_first_not_of(" \t")); // 去掉头部空格 + str.erase(str.find_last_not_of(" \t") + 1); // 去掉尾部空格 + + return str; + +} + +string trim(const char* wtr) + +{ + string str = wtr; + str.erase(0, str.find_first_not_of(" \t")); // 去掉头部空格 + str.erase(str.find_last_not_of(" \t") + 1); // 去掉尾部空格 + + return str; + +} + +void updateRev(tag_t form, map map_prop, map> map_props) +{ + WriteLog("-------updateRev start---------开旁路\n"); + POM_AM__set_application_bypass(true); + AOM_lock(form); + for (auto it = map_prop.begin(); it != map_prop.end(); it++) + { + string str = GbkToUtf8(it->second.c_str()); + WriteLog("更新单值属性[%s]=[%s]\n", it->first, it->second.c_str()); + ITKCALL(AOM_set_value_string(form, it->first.data(), str.c_str())); + } + for (auto it = map_props.begin(); it != map_props.end(); it++) + { + vector values = it->second; + int size = values.size(); + if (size > 0) + { + WriteLog("更新多值属性[%s]\n", it->first); + char** props; + props = (char**)MEM_alloc((size + 1) * sizeof(char*)); + for (auto i = 0; i < size; i++) + { + string str = GbkToUtf8(values[i].c_str()); + WriteLog("---[%s]\n", values[i].c_str()); + props[i] = (char*)MEM_alloc((str.size() + 1) * sizeof(char)); + tc_strcpy(props[i], str.data()); + } + ITKCALL(AOM_set_value_strings(form, it->first.data(), size, props)); + DOFREE(props); + } + else + { + WriteLog("多值属性[%s]无值\n", it->first); + } + } + AOM_save(form); + AOM_unlock(form); + POM_AM__set_application_bypass(false); + WriteLog("-------updateRev end---------关闭旁路\n"); +} diff --git a/SignOff_itk/SignOff_itk/connor_util.h b/SignOff_itk/SignOff_itk/connor_util.h new file mode 100644 index 0000000..752bba1 --- /dev/null +++ b/SignOff_itk/SignOff_itk/connor_util.h @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include "common_itk_util.h" +#define CUST_PROP_ERROR_NO 38600 +using namespace std; +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + +#define ISNULL(s) (s == NULL? "" : (s ? s : "")) +int checkIsTypeOrSubtype(tag_t objtag,char * type_name); +int Supor_open_bypass(void *returnValue); +int Supor_close_bypass(void *returnValue); +int Supor_add_release_status(void * returnValue); +int BOM_CHI_ISRELEASE(EPM_rule_message_t msg); +int ITK_server_bypass(void *returnValue); +int checkIsTypeOrSubtype(tag_t objtag, const char* type_name); +string WStringToString(const wstring& ws); +wchar_t* c2w(const char* str); +void split(std::string s, const char* delim, std::vector* ret); +string trim(string& str); +string trim(const char* wtr); + +void updateRev(tag_t form, map map_prop, map> map_props); + \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/epm_register_handler.cpp b/SignOff_itk/SignOff_itk/epm_register_handler.cpp new file mode 100644 index 0000000..12aafed --- /dev/null +++ b/SignOff_itk/SignOff_itk/epm_register_handler.cpp @@ -0,0 +1,274 @@ +/*=================================================================================================== + Copyright(c) 2011 Siemens PLM Software Corp. All rights reserved. + Unpublished - All rights reserved +==================================================================================================== +File description: + + Filename : epm_register_handler.c + + This file registers functions which are called when Teamcenter is being initialized + +==================================================================================================== +Date Name Description of Change +2011-8-21 Ray creation + +$HISTORY$ +==================================================================================================*/ + +#pragma warning (disable: 4819) + +/** +* @headerfile tcua 头文件 +*/ +#include +#include +#include +#include + +/** +* @headerfile standard c & cpp header files +*/ +#include +#include +#include +#include +#include +#include +#include + +/** +* @headerfile user's header files +*/ +#include "epm_register_handler.h" +#include "connor_util.h" +#include "Supor_register.h" +#define LIMITDAY 2016 + +int checkvalue(char* str) +{ + + int i; + for (i=0;i + +#ifdef __cplusplus +extern "C" { +#endif + +extern DLLAPI int USERSERVICE_custom_register_handlers(int *, va_list); +extern DLLAPI int USERSERVICE_custom_register_methods(int *decision, va_list args); + + +#ifdef __cplusplus +} +#endif + +#endif + + +/** +* @} +*/ \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/error_handling.h b/SignOff_itk/SignOff_itk/error_handling.h new file mode 100644 index 0000000..f163600 --- /dev/null +++ b/SignOff_itk/SignOff_itk/error_handling.h @@ -0,0 +1,162 @@ +/*! +* @addtogroup common +* \file error_handling.h +* \brief 错误处理函数 +* \date 2008/6/10 +* \author Ray Li +*/ + +#ifndef SIMPLE_ERR_H_INCLUDED +#define SIMPLE_ERR_H_INCLUDED + + +//#include +//#include +#include +#include +//#include +//#include +#include + +#include +#include + +#define BUFSIZE 512 + + +// +#define HANDLER_ARGUMENT_ERROR EMH_USER_error_base + 1 +//#define WORKFLOW_NODE_IS_NOT_VALID EMH_USER_error_base + 2 + +#define ERROR_STATUS_ERROR EMH_USER_error_base + 2 +//#define HANDLER_PLACED_INVALID EMH_USER_error_base + 3 +// +////user errors define +////在站点文件中缺少 %1$ 配置,或该配置中无数据项 +//#define ERROR_PREFERENCE_NOT_FOUND (EMH_USER_error_base + 100) + + +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + + + +//#define ECHO(X) printf X; +#define SYS_LOG(X) IMAN_write_syslog X; +#define LOG_ECHO(X) printf X; IMAN_write_syslog X; + + + +/*! +* \def CALL(x) +* 打印错误信息 +*/ +#define CALL(x) { \ + int stat; \ + char *err_string; \ + if( (stat = (x)) != ITK_ok) \ + { \ + EMH_ask_error_text (stat, &err_string); \ + LOG_ECHO( ("ERROR: %d ERROR MSG: %s.\n",stat, err_string) ) \ + LOG_ECHO( ("Function: %s FILE: %s LINE: %d\n", #x, __FILE__, __LINE__ ) ) \ + MEM_free (err_string); \ + return (stat); \ + } \ +} + +/*! +* \def DO(x) +* 打印错误信息 +*/ +#define DO(x) { \ + int stat; \ + char *err_string; \ + if( (stat = (x)) != POM_ok) \ + { \ + EMH_ask_error_text (stat, &err_string); \ + printf ("ERROR: %d ERROR MSG: %s.\n", stat, err_string); \ + printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \ + MEM_free (err_string); \ + } \ +} + +/*! +* \def CALLRNULL(x) +* 打印错误信息 +*/ +#define CALLRNULL(x) { \ + int stat; \ + char *err_string; \ + if( (stat = (x)) != ITK_ok) \ + { \ + EMH_ask_error_text (stat, &err_string); \ + printf ("ERROR: %d ERROR MSG: %s.\n", stat, err_string); \ + printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \ + MEM_free (err_string); \ + return ((char *)NULL); \ + } \ +} + +/*! +* \def CALL2(x) +* 打印错误信息 +*/ +#define CALL2(x) { \ + int stat, n_ifails, *serverities, *ifails, err_count; \ + char *err_string, **texts; \ + if( (stat = (x)) != ITK_ok) \ + { \ + printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \ + EMH_ask_errors( &n_ifails, (const int**)(&serverities), (const int**)(&ifails), (const char***)(&texts) );\ + for( err_count=0; err_count +#include +#include +#include "error_handling.h" +#include "epm_register_handler.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + /** + * @fn extern "C" DLLAPI int liborigin_register_callbacks + * @return usually return ITK_ok + * @brief liborigin customization entry + * 此函数必须有规范的写法,必须以dll的名称加上"_"开头 + */ + + DLLAPI int SignOff_itk_register_callbacks() + { + int ifail = ITK_ok; + TC_write_syslog("*******************************************************************************\n"); + TC_write_syslog("* SUPOR_connor_itk register_callbacks is starting *\n"); + TC_write_syslog("*******************************************************************************\n"); + + + ITKCALL( ifail = CUSTOM_register_exit( "SignOff_itk", "USERSERVICE_register_methods", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_methods) ); + fprintf( stdout, "\n SUPOR_connor_itk registering USERSERVICE_custom_register_methods completed!\n" ); + + + ITKCALL( ifail = CUSTOM_register_exit("SignOff_itk","USER_gs_shell_init_module", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_handlers) ); + fprintf( stdout, "\n SUPOR_connor_itk registering USERSERVICE_custom_register_handlers completed!\n" ); + + + return ifail; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/ocilib.cxx b/SignOff_itk/SignOff_itk/ocilib.cxx new file mode 100644 index 0000000..22065bf --- /dev/null +++ b/SignOff_itk/SignOff_itk/ocilib.cxx @@ -0,0 +1,472 @@ +///*===================================================================================================================== +// Copyright(c) 2012 ORIGIN. +// Unpublished - All rights reserved +//======================================================================================================================= +//File description: +// +// Filename: ocilib.cxx +// Module : OCI +// +// This file describes OCI library Package. +// +//======================================================================================================================= +//Date Name Description of Change +//1-Feb-2015 Ray li Initialize creation +//$HISTORY$ +//=====================================================================================================================*/ +//#include "common_itk_util.h" +//#include "ocilib.h" +//#include +// +//#define NUM 100 +//#define USERNAME "MES" +//#define PASSWORD "infodba" +//#define DBNAME "TCPORD" +// +// +//// 定义句柄结构 +//typedef struct{ +// OCIEnv *p_env; //OCI environment handle 环境句柄 +// OCIError *p_err; //OCI error handle 错误句柄 +// OCISvcCtx *p_svc; //OCI service context handel 服务上下文句柄 +// OCIServer *p_ser; //OCI server handle 服务器句柄 +// OCISession *p_usr; //OCI user session handle 用户会话句柄 +// OCIStmt *p_sql; //OCI statement handle 语句句柄 +// OCIDefine *p_dfn; //OCI define handle 定义句柄 +// OCIBind *p_bnd; //OCI bind handle 绑定句柄 +//}OCIHandleInfo; +// +// +//// 定义错误句柄结构 +//typedef struct{ +// OCIEnv *p_env; +// OCIError *p_err; +// OCISvcCtx *p_svc; +// OCIStmt *p_sql; +// OCIDefine *p_dfn; +// OCIBind *p_bnd; +//}OCIDATA; +// +// +//// 定义执行语句时候的输入参数 +//typedef struct{ +// char value[NUM][NUM]; +// char type[NUM][NUM]; +//}SqlField; +// +// +//// 定义查询语句时候的输入,输出参数 +//typedef struct{ +// int naIntValue[NUM]; +// int nIntNum; +// char caCharValue[500][500]; +// int nCharNum; +//}SqlSelField; +// +//OCIHandleInfo *ociHandle = NULL; +//OCIHandleInfo ociHand; +// +//int InitHandle(); +//int _ExeSQL(char *SQL,char ** inputValue,int inputValueCount); +//int _QuerySQL(char *SQL, SqlSelField *pOutField, SqlSelField *pSelField); +//int GetDataFromQuery(int *pRc, SqlSelField *pOutField); +//void QuitFreeHandle(); +// +// +// +// +///**************************************************************************************************************************************** +//函数名称: +//函数功能: +//入口参数: +//出口参数: +//备 注: +//*****************************************************************************************************************************************/ +// +// +//// 初始化Handler +//int InitHandle() +//{ +// int swResult; +// +// ociHandle = &ociHand; +// +// +// /*create OCI environment*/ +// if(swResult = OCIEnvCreate(&ociHandle->p_env,OCI_DEFAULT,NULL,NULL,NULL,NULL,0,NULL)) //环境句柄 +// { +// printf("environment create error!\n\n"); +// WriteLog("environment create error!\n\n"); +// return -1; +// } +// else +// { +// printf("environment create success!\n\n"); +// WriteLog("environment create success!\n\n"); +// //return 0; +// } +// +// /*init handle*/ +// if(swResult = OCIHandleAlloc(ociHandle->p_env,(dvoid **)&ociHandle->p_ser,OCI_HTYPE_SERVER,0,NULL)) //服务器句柄 +// { +// printf("init server handle error!\n\n"); +// WriteLog("init server handle error!\n\n"); +// return -1; +// } +// +// +// if(swResult = OCIHandleAlloc(ociHandle->p_env,(dvoid **)&ociHandle->p_err,OCI_HTYPE_ERROR,0,NULL)) //错误句柄 +// { +// printf("init error handle error!\n\n"); +// WriteLog("init error handle error!\n\n"); +// return -1; +// } +// +// +// if(swResult = OCIHandleAlloc(ociHandle->p_env,(dvoid **)&ociHandle->p_usr,OCI_HTYPE_SESSION,0,NULL)) //事务句柄 +// { +// printf("init session handle error!\n\n"); +// WriteLog("init session handle error!\n\n"); +// return -1; +// } +// +// +// if(swResult = OCIHandleAlloc(ociHandle->p_env,(dvoid **)&ociHandle->p_svc,OCI_HTYPE_SVCCTX,0,NULL)) //上下文句柄 +// { +// printf("init service context handle error!\n\n"); +// WriteLog("init service context handle error!\n\n"); +// return -1; +// } +// +// +// if(swResult = OCIHandleAlloc(ociHandle->p_env,(dvoid **)&ociHandle->p_sql,OCI_HTYPE_STMT,0,NULL)) //SQL语句句柄 +// { +// printf("init statement handle error!\n\n"); +// WriteLog("init statement handle error!\n\n"); +// return -1; +// } +// +// printf("init handle success!\n\n"); +// WriteLog("init handle success!\n\n"); +// return 0; +//} +// +// +// +//// 连接数据库服务器 +//int ConnServer(char *username,char *password,char *dbname) +//{ +// int swResult; +// char errbuf[100]={0}; +// int errcode; +// +// if(InitHandle() == -1)//初始化句柄 +// return -1; +// +// if(swResult = OCILogon(ociHandle->p_env,ociHandle->p_err,&ociHandle->p_svc,(text *)username,strlen(username),(text *)password,strlen(password),(text *)dbname,strlen(dbname))) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("Error - %.*s/n", 512, errbuf); +// WriteLog("Error - %.*s/n", 512, errbuf); +// return -1; +// } +// else { +// printf("数据库连接成功!\n\n"); +// WriteLog("数据库连接成功!\n\n"); +// } +// +// return 0; +//} +// +// +// +//// SQL语句的陈述(执行SQL语句) +//int _ExeSQL(char *SQL,char ** inputValue,int inputValueCount) +//{ +// int swResult,i; +// int errcode; +// +// //设置绑定变量 +// OCIBind *p_bndp[100]; +// +// //准备SQL语句 +// if(swResult = OCIStmtPrepare(ociHandle->p_sql,ociHandle->p_err,(text *)SQL,strlen(SQL),OCI_NTV_SYNTAX,OCI_DEFAULT)) +// { +// printf("prepare SQL statements error!\n\n"); +// WriteLog("prepare SQL statements error!\n\n"); +// } +// else +// { +// printf("prepare SQL statements success!\n\n"); +// WriteLog("prepare SQL statements success!\n\n"); +// } +// +// +// // 绑定输入变量 +// for(i=0;ip_sql,&p_bndp[i],ociHandle->p_err,i+1,(dvoid *)inputValue[i],(sb4)strlen(inputValue[i])+1,SQLT_STR, (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("Bind Error - %.*s/n", 512, errbuf); +// WriteLog("Bind Error - %.*s/n", 512, errbuf); +// return -1; +// } +// } +// +// //执行SQL statements +// if(swResult = OCIStmtExecute(ociHandle->p_svc,ociHandle->p_sql,ociHandle->p_err,1,0,NULL,NULL,OCI_DEFAULT)) +// { +// char errbuf[100]={0}; +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("execute SQL statement Error - %.*s\n", 512, errbuf); +// WriteLog("execute SQL statement Error - %.*s\n", 512, errbuf); +// return -1; +// } +// else +// { +// printf("execute SQL statement success!\n\n"); +// WriteLog("execute SQL statement success!\n\n"); +// } +// return 0; +//} +// +// +// +// +//// 查询SQL +//int _QuerySQL(char *SQL, SqlSelField *pOutField, SqlSelField *pSelField ) +//{ +// sword status; +// int rc= 0,ret=0; +// char errbuf[100]={0}; +// int maxNum = 2048; +// char chTag[8]; +// int iIndex = 0; +// int outputColumn = 0; +// int errcode=0; +// char nullValue = '\0'; // +// sb2 sb2aInd[30] = {'\0'}; +// +// // 准备SQL语句 +// status = OCIStmtPrepare(ociHandle->p_sql, ociHandle->p_err, (text *)SQL,(ub4)strlen(SQL), (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT); +// +// if (status != OCI_SUCCESS) +// { +// printf("SQL Preparing failed/n"); +// WriteLog("SQL Preparing failed/n"); +// return -1; +// } +// +// +// // 绑定int类型的, 定义SQL语句时 :1,:2, 定义输入变量 +// for (iIndex=0; iIndexnIntNum; iIndex++) +// { +// memset(chTag, 0, 8); +// sprintf(chTag, ":%d", iIndex+1); +// if(rc = OCIBindByName(ociHandle->p_sql, (OCIBind **)&ociHandle->p_dfn, ociHandle->p_err, (text *)chTag,(sb4)strlen((char *)chTag),(dvoid *) &pSelField->naIntValue[iIndex], sizeof(int), SQLT_INT,(dvoid *) 0,(ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// WriteLog("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// return -1; +// } +// } +// +// // 绑定char *类型的, 定义SQL语句时 :3,:4, 定义输入变量 +// for (iIndex=0; iIndexnCharNum; iIndex++) +// { +// int n=0; +// memset(chTag, 0, 8); +// n = pSelField->nIntNum + iIndex +1; +// sprintf(chTag, ":%d", n); +// if(rc = OCIBindByName(ociHandle->p_sql, (OCIBind **)&ociHandle->p_dfn, ociHandle->p_err, (text *)chTag,(sb4)strlen((char *)chTag),(dvoid *) &pSelField->caCharValue[iIndex], NUM, SQLT_STR,(dvoid *) 0,(ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// WriteLog("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// return -1; +// } +// } +// +// +// // 执行SQL语句 +// if (rc = OCIStmtExecute(ociHandle->p_svc, ociHandle->p_sql, ociHandle->p_err, (ub4) 0, (ub4) 0,(CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_STMT_SCROLLABLE_READONLY)) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("execute SQL Error - %.*s\n", 512, errbuf); +// WriteLog("execute SQL Error - %.*s\n", 512, errbuf); +// return -1; +// } +// else +// { +// printf("execute SQL success!\n\n"); +// WriteLog("execute SQL success!\n\n"); +// } +// +// +// if (ret = OCIAttrGet (ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid *) &outputColumn, (ub4 *) 0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err)) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("Get OCIAttr Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// WriteLog("Get OCIAttr Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// return -1; +// } +// +// +// // 绑定int类型的, 定义SQL语句时 :1,:2, 定义输出变量 +// for (iIndex=0; iIndexnIntNum; iIndex++) +// { +// if(rc = OCIDefineByPos(ociHandle->p_sql, &ociHandle->p_dfn, ociHandle->p_err, iIndex+1, (dvoid *)&pOutField->naIntValue[iIndex], sizeof(int), SQLT_INT, (dvoid *) 0, (ub2 *)0,(ub2 *)0, OCI_DEFAULT)) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// WriteLog("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// return -1; +// } +// } +// +// +// // 绑定char *类型的, 定义SQL语句时 :1,:2, 定义输出变量 +// for (iIndex=0; iIndexp_sql, &ociHandle->p_dfn, ociHandle->p_err, n, (dvoid *)&pOutField->caCharValue[iIndex], 1000*sizeof(char), SQLT_STR, (dvoid *) 0, (ub2 *)0,(ub2 *)0, OCI_DEFAULT)) +// { +// OCIErrorGet((dvoid *)ociHandle->p_err, (ub4) 1, (text *) NULL, &errcode, (ub1 *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); +// printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// WriteLog("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); +// return -1; +// } +// } +// +// return 0; +// +//} +// +// +// +//// 释放Handler +//void QuitFreeHandle() +//{ +// // 退出服务器 +// OCILogoff(ociHandle->p_svc,ociHandle->p_err); +// printf("Quit success!\n"); +// WriteLog("Quit success!\n"); +// +// // 释放句柄 +// OCIHandleFree(ociHandle->p_ser,OCI_HTYPE_SERVER); //释放服务器句柄 +// OCIHandleFree(ociHandle->p_err,OCI_HTYPE_ERROR); //释放错误句柄 +// OCIHandleFree(ociHandle->p_usr,OCI_HTYPE_SESSION); //释放事务句柄 +// OCIHandleFree(ociHandle->p_svc,OCI_HTYPE_SVCCTX); //释放上下文句柄 +// OCIHandleFree(ociHandle->p_sql,OCI_HTYPE_STMT); //释放SQL语句句柄 +//} +// +// +//// 执行类操作 +//int ExecuteSQL(char *SQL,int valueCount,char **value) +//{ +// int i=0; +// +// if(i=_ExeSQL(SQL,value,valueCount)) +// { +// printf("继续操作1\n"); +// WriteLog("继续操作1\n"); +// QuitFreeHandle(); +// return -1; +// } +// printf("继续操作2\n"); +// WriteLog("继续操作2\n"); +// return 0; +//} +// +// +//// 有输入参数的查询 +//int QuerySQL(char *SQL, int inputValueCount, char ** inputValue, int * outputColumn, int * outputValueCount, char **** outputValue) +//{ +// int i = 0, j=0 ,ret =0; +// +// int times = 0, temp=0; +// +// SqlSelField infield; +// SqlSelField outField; +// +// // 初始化参数结构 +// infield.nCharNum = inputValueCount; +// infield.nIntNum = 0; +// outField.nCharNum = 0; +// outField.nIntNum = 0; +// +// * outputColumn = 0; +// * outputValueCount = 0; +// +// for(i=0;ip_sql, (ub4)OCI_HTYPE_STMT, (dvoid *) outputColumn, (ub4 *) 0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err); +// +// // 提取最后一行,便于去行数 +// ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err,1, OCI_FETCH_LAST,0, OCI_DEFAULT); +// // 获取结果行数 +// ret= OCIAttrGet (ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid *) outputValueCount, (ub4 *) 0, (ub4)OCI_ATTR_ROW_COUNT, ociHandle->p_err); +// +// if(*outputValueCount == 0) +// return 0; +// +// +// // 开始分配内存并且存储 +// ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err,1, OCI_FETCH_FIRST,0, OCI_DEFAULT); +// *outputValue = (char ***) calloc ((*outputValueCount)+1,sizeof(char**)); +// do +// { +// (*outputValue)[i] = (char **) calloc ((*outputColumn)+1,sizeof(char *)); +// for(j=0;j<(*outputColumn);j++) +// { +// (*outputValue)[i][j] = (char *) calloc (1000,sizeof(char)); +// strcpy((*outputValue)[i][j],outField.caCharValue[j]); +// //printf("outValue[%d][%d] = %s , 地址=%d, 所指向地址= %d\n ",i,j,(*outputValue)[i][j],&(*outputValue)[i][j],(*outputValue)[i][j]); +// } +// i++; +// } +// while((ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err,1, OCI_FETCH_NEXT, 1, OCI_DEFAULT)!= OCI_NO_DATA)); +// +// return 0; +//} +// +// +//// 无输入参数的查询 +//int QuerySQLNoInputParam(char *SQL, int * outputColumn, int * outputValueCount, char **** outputValue) +//{ +// return QuerySQL(SQL,0,NULL,outputColumn,outputValueCount,outputValue); +//} +// +//// 无参数操作 +//int ExecuteSQLNoInputParam(char *SQL) +//{ +// printf("开始操作\n"); +// WriteLog("开始操作\n"); +// return ExecuteSQL(SQL,0,NULL); +//} +// +//// 断开连接 +//void DisConnServer() +//{ +// if(ociHandle != NULL) +// QuitFreeHandle(); +//} +// diff --git a/SignOff_itk/SignOff_itk/ocilib.h b/SignOff_itk/SignOff_itk/ocilib.h new file mode 100644 index 0000000..6f93749 --- /dev/null +++ b/SignOff_itk/SignOff_itk/ocilib.h @@ -0,0 +1,98 @@ +///*===================================================================================================================== +// Copyright(c) 2012 ORIGIN. +// Unpublished - All rights reserved +//======================================================================================================================= +//File description: +// +// Filename: ocilib.h +// Module : OCI +// +// This Header file of OCI library Package. +// +//======================================================================================================================= +//Date Name Description of Change +//1-Feb-2015 Ray Initialize creation +//$HISTORY$ +//=====================================================================================================================*/ +//#include +//#include +//#include +//#include +//#include +////#include +// +//#define OCI_FAIL 1 +//#define OCI_OK 0 +// +//#ifdef __cplusplus +//extern "C" +//{ +//#endif +// /** +// * 连接数据库. +// * @param username - 用户名 +// * @param password - 密码 +// * @param dbname - 数据库SID +// * @return - OCI_OK or error code +// * +// * ORACLE 数据库的连接与封装函数 +// */ +// extern int ConnServer(char *username,char *password,char *dbname); +// +// +// /** +// * 不带输入参数的执行SQL语句. +// * @param SQL - SQL语句 +// * @return - OCI_OK or error code +// * +// * ORACLE 数据库的连接与封装函数 +// */ +// extern int ExecuteSQLNoInputParam(char *SQL); +// +// /** +// * 带输入参数的执行SQL语句. +// * @param SQL - SQL语句 +// * @param inputValueCount - 输入参数数量 +// * @param inputValue - 输入参数值 +// * @return - OCI_OK or error code +// * +// * ORACLE 数据库的连接与封装函数 +// */ +// extern int ExecuteSQL(char *SQL,int inputValueCount,char **inputValue); +// +// /** +// * 不带输入参数的查询SQL语句. +// * @param SQL - SQL语句 +// * @param outputColumn - 输出表的列的数量 +// * @param outputValueCount - 输出表的行的数量 +// * @param outputValue - 输出表内容 +// * @return - OCI_OK or error code +// * +// * ORACLE 数据库的连接与封装函数 +// */ +// extern int QuerySQLNoInputParam(char *SQL, int * outputColumn, int * outputValueCount, char **** outputValue); +// +// /** +// * 带输入参数的查询SQL语句. +// * @param SQL - SQL语句 +// * @param inputValueCount - 输入参数数量 +// * @param inputValue - 输入参数值 +// * @param outputColumn - 输出表的列的数量 +// * @param outputValueCount - 输出表的行的数量 +// * @param outputValue - 输出表内容 +// * @return - OCI_OK or error code +// * +// * ORACLE 数据库的连接与封装函数 +// */ +// extern int QuerySQL(char *SQL, int inputValueCount, char ** inputValue, int * outputColumn, int * outputValueCount, char **** outputValue); +// +// /** +// * 断开数据库连接. +// * +// * ORACLE 数据库的连接与封装函数 +// */ +// extern void DisConnServer(); +// +//#ifdef __cplusplus +//} +//#endif diff --git a/SignOff_itk/SignOff_itk/stdafx.cpp b/SignOff_itk/SignOff_itk/stdafx.cpp new file mode 100644 index 0000000..c24bdb0 --- /dev/null +++ b/SignOff_itk/SignOff_itk/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// XNY_itk.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H κĸͷļ +//ڴļ diff --git a/SignOff_itk/SignOff_itk/stdafx.h b/SignOff_itk/SignOff_itk/stdafx.h new file mode 100644 index 0000000..baa4bbc --- /dev/null +++ b/SignOff_itk/SignOff_itk/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/SignOff_itk/SignOff_itk/string_helper.cpp b/SignOff_itk/SignOff_itk/string_helper.cpp new file mode 100644 index 0000000..d5e0841 --- /dev/null +++ b/SignOff_itk/SignOff_itk/string_helper.cpp @@ -0,0 +1,146 @@ +/** +* @file string_helper.cpp +* @brief string utility functions' implemention +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +* 14-Jau-2009 James modify Split functions, add trim blank characters +*/ +#pragma warning(disable:4996) +// +//#include +//#include +//#include +#include "string_helper.h" + +string TrimString( string strArg ) +{ + size_t index1 = 0; + index1 = strArg.find_first_not_of( ' '); + if( index1 != string::npos ) + strArg.erase( strArg.begin(), strArg.begin()+index1 ); + index1 = strArg.find_last_not_of( ' '); + if( index1 != string::npos ) + strArg.erase( strArg.begin() + index1 + 1 ); + return strArg; +} + +void Split( string strArg, char spliter, vector &ans ) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if ( strArg.find_first_not_of(' ') == string::npos ) + strArg = ""; + while( strArg.size()>0 ) + { + index0 = strArg.find_first_of( spliter ); + if( index0 != string::npos ) + { + one_arg = strArg.substr( 0,index0 ); + strArg = strArg.substr( index0 + 1 ); + ans.push_back( one_arg ); + } + else + { + ans.push_back( strArg ); + break; + } + } +} + +void Split( string strArg, string spliter, vector &ans ) +{ + + ans.clear(); + + size_t index0; + string one_arg; + + if ( strArg.find_first_not_of(" ") == string::npos ) + strArg = ""; + + + while( strArg.size()>0 ) + { + + index0 = strArg.find(spliter); + + if( index0 != string::npos ) + { + + one_arg = strArg.substr( 0, index0 ); + strArg = strArg.substr( index0 + spliter.size() ); + + ans.push_back( one_arg ); + } + else + { + + ans.push_back( strArg ); + break; + } + } +} + + +void RemoveLiner( string &in, string &out ) +{ + char buf[BUFSIZ] = ""; + for( int i=0; i<(int)in.size(); i++ ) + { + if( in[i] == '\n') + continue; + else + sprintf( buf,"%s%c", buf, in[i] ); + } + out.assign(buf); +} + +////Converting a WChar string to a Ansi string +//std::string WChar2Ansi(LPCWSTR pwszSrc) +//{ +// int nLen = WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, NULL, 0, NULL, NULL); +// +// if (nLen<= 0) return std::string(""); +// +// char* pszDst = new char[nLen]; +// if (NULL == pszDst) return std::string(""); +// +// WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, pszDst, nLen, NULL, NULL); +// pszDst[nLen -1] = 0; +// +// std::string strTemp(pszDst); +// delete [] pszDst; +// +// return strTemp; +//} +// +//string ws2s(wstring& inputws){ return WChar2Ansi(inputws.c_str()); } +// +////Converting a Ansi string to WChar string +//std::wstring Ansi2WChar(LPCSTR pszSrc, int nLen) +//{ +// int nSize = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszSrc, nLen, 0, 0); +// if(nSize <= 0) return NULL; +// +// WCHAR *pwszDst = new WCHAR[nSize+1]; +// if( NULL == pwszDst) return NULL; +// +// MultiByteToWideChar(CP_ACP, 0,(LPCSTR)pszSrc, nLen, pwszDst, nSize); +// pwszDst[nSize] = 0; +// +// if( pwszDst[0] == 0xFEFF) // skip Oxfeff +// for(int i = 0; i < nSize; i ++) +// pwszDst[i] = pwszDst[i+1]; +// +// wstring wcharString(pwszDst); +// delete pwszDst; +// +// return wcharString; +//} +// +//std::wstring s2ws(const string& s){ return Ansi2WChar(s.c_str(),s.size());} + diff --git a/SignOff_itk/SignOff_itk/string_helper.h b/SignOff_itk/SignOff_itk/string_helper.h new file mode 100644 index 0000000..c9277d7 --- /dev/null +++ b/SignOff_itk/SignOff_itk/string_helper.h @@ -0,0 +1,25 @@ +/** +* @file string_helper.h +* @brief string utilities to help dealing with string +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +*/ + +#ifndef STRING_HELPER +#define STRING_HELPER + +#include +#include +using namespace std; + +string TrimString( string strArg ); +void Split( string strArg, char spliter, vector &ans ); +void Split( string strArg, string spliter, vector &ans ); +void RemoveLiner( string &in, string &out ); +//string ws2s(wstring& inputws); +//wstring s2ws(const string& s); + +#endif \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/string_utils.cxx b/SignOff_itk/SignOff_itk/string_utils.cxx new file mode 100644 index 0000000..5f32d2b --- /dev/null +++ b/SignOff_itk/SignOff_itk/string_utils.cxx @@ -0,0 +1,253 @@ +/*================================================================================================================== + Copyright(c) 2012 ORIGIN. + Unpublished - All rights reserved +==================================================================================================================== +File description: + Filename: string_utils.c + Module : Common module. + + This file includes some operations of the string. + +==================================================================================================================== +Date Name Description of Change +3-Feb-2015 Ray li Initialize creation +$HISTORY$ +===================================================================================================================*/ +#ifndef _cplusplus +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE +#endif +#endif + +#include +#include +//#include +#include +#include +#include + +#include "string_utils.h" + +void Split( string strArg, string spliter, vector &ans ) +{ + ans.clear(); + size_t index0; + string one_arg; + if ( strArg.find_first_not_of(' ') == string::npos ) + strArg = ""; + while( strArg.size()>0 ) + { + index0 = strArg.find(spliter); + if( index0 != string::npos ) + { + one_arg = strArg.substr( 0, index0 ); + strArg = strArg.substr( index0 + spliter.size() ); + ans.push_back( one_arg ); + } + else + { + ans.push_back( strArg ); + break; + } + } +} +char* GSTR_clone( char **dst, const char *src ) +{ + char *retVal = NULL; + int srcLen = 0; + + *dst = NULL; + if (src == NULL) + return NULL; + + srcLen = (int)tc_strlen( src ) + 1; + *dst = (char*)MEM_alloc( srcLen * sizeof(char) ); + retVal = tc_strncpy( *dst, src, srcLen ); + (*dst)[srcLen - 1] = '\0'; + + return retVal; +} + +char* GSTR_copy( char *dst, const char *src, int dstSize ) +{ + char *retVal = tc_strncpy( dst, src, dstSize ); + dst[dstSize - 1] = '\0'; + return retVal; +} + +char* GSTR_int_to_string( char **dst, int value ) +{ + char strVal[128 + 1]; + + *dst = NULL; + memset( strVal, 0, sizeof(strVal)/sizeof(char) ); + sprintf( strVal, "%d", value ); + + return GSTR_clone( dst, strVal ); +} + +void GSTR_format_int_to_string( char *dst, int digitNum, int value ) +{ + char sNum[WSO_desc_size_c + 1]; + sprintf( sNum, "%%0%dd", digitNum ); + sprintf( dst, sNum, value ); +} + +void GSTR_format_string( const char *dst, int m, const char *fill_char, char **out ) +{ + char sNum[WSO_name_size_c + 1] = {0}; + char sNew[WSO_name_size_c + 1] = {0}; + sprintf( sNum, "%%%d.%ds", m, m ); + sprintf( sNew, sNum, dst ); + STRNG_replace_str( sNew, " ", fill_char, out ); +} + + +char* GSTR_string_append( const char *s1, const char *s2 ) +{ + char *s = NULL; + if (s1 == NULL || s2 == NULL) + { + GSTR_clone(&s, s1 == NULL ? (s2 == NULL ? "" : s2) : s1 ); + } + else + { + int size = (int)tc_strlen(s1) + (int)tc_strlen(s2) + 1; + s = (char *)MEM_alloc( size ); + tc_strcpy( s, s1 ); + tc_strcat( s, s2 ); + s[size - 1] = '\0'; + } + return s; +} + +logical GSTR_is_float(const char *str) +{ + logical isfloat = true; + char *pStr = (char *)str; + logical hasPositive = false; + logical hasMinus = false; + logical hasDot = false; + + if (str == NULL) + return false; + + while (*pStr != '\0' && isfloat == true) + { + if ( (*pStr >= '0' && *pStr <= '9')) + { + //continue; + } + else if ( *pStr == '+' ) + { + isfloat = (hasPositive ? false : (hasPositive = true)); + } + else if ( *pStr == '-' ) + { + isfloat = (hasMinus ? false : (hasMinus = true)); + } + else if ( *pStr == '.' ) + { + isfloat = (hasDot ? false : (hasDot = true)); + } + else + isfloat = false; + + pStr ++; + } + return isfloat; +} + +logical GSTR_is_number(const char *str) +{ + logical is_number = true; + char *pStr = (char *)str; + if (str == NULL) + return false; + + while (*pStr != '\0') + { + if ( !( (*pStr >= '0' && *pStr <= '9') || *pStr == '-' ) ) + { + is_number = false; + break; + } + pStr ++; + } + return is_number; +} + +logical GSTR_is_ascii(char ch) +{ + return ((unsigned int)ch) < 128; +} + +int GSTR_trim_l( char *str, char s ) +{ + int count = 0; + char *pointer = str, *poffset = NULL; + if (str == NULL || str[0] == '\0') + return 0; + + while ( *pointer != '\0' ) + { + if ( *pointer != s ) + { + break; + } + count++; + pointer++; + } + if (count == 0) + return 0; + + poffset = str + count; + pointer = str; + while ( *poffset != '\0' ) + { + *pointer = *poffset; + pointer ++; + poffset ++; + } + *pointer = '\0'; + + return count; +} + +int GSTR_trim_r( char *str, char s ) +{ + int count = 0; + char *pointer = NULL; + if (str == NULL || str[0] == '\0') + return 0; + + pointer = str + ((int) strlen(str) - 1); + + while ( pointer != str ) + { + if ( *pointer != s ) + { + break; + } + + *pointer = '\0'; + + count++; + pointer--; + } + + return count; +} + +void GSTR_trim_float( char *floatValue ) +{ + if ( !IS_EMPTY(floatValue) && tc_strstr(floatValue, ".") != NULL ) + { + int len = 0; + GSTR_trim_r(floatValue, '0'); + len = (int)tc_strlen(floatValue); + if (floatValue[ len - 1 ] == '.') + floatValue[ len - 1 ] = '\0'; + } +} + diff --git a/SignOff_itk/SignOff_itk/string_utils.h b/SignOff_itk/SignOff_itk/string_utils.h new file mode 100644 index 0000000..31c08c8 --- /dev/null +++ b/SignOff_itk/SignOff_itk/string_utils.h @@ -0,0 +1,125 @@ +/*===================================================================================================================== + Copyright(c) 2005 ORIGIN PLM Software Corp. All rights reserved. + Unpublished - All rights reserved +======================================================================================================================= +File description: + Filename: string_utils.h + Module : Common module. + + This file includes some operations of the string. + +======================================================================================================================= +Date Name Description of Change +14-Jul-2009 Ray Li Initialize creation +$HISTORY$ +=====================================================================================================================*/ +#ifndef STRING_UTILS_H +#define STRING_UTILS_H +#include +#include +#include +using namespace std; +#ifdef __cplusplus + extern "C" + { +#endif + +// @{{ String assister +#define IS_NULL(S) ((S)==NULL) +#define IS_EMPTY(S) (((S)==NULL) || !(*(S))) +// @}} + void Split( string strArg, string spliter, vector &ans ); + /** + * Clones the string. + * @param dst - the output string. + * @param src - the string to be cloned. + * @return - the destinatin string pointer. + */ + extern char* GSTR_clone( char **dst, const char *src ); + + /** + * Copy safely the string with null end. + * @param dst - the output string. + * @param src - the string to be cloned. + * @param dstSize - the size of output string. + * @return - the destinatin string pointer. + */ + extern char *GSTR_copy( char *dst, const char *src, int dstSize ); + + /** + * Converts int to string. + * @param dst - the output string. + * @param value - the int to be cloned. + * @return - the destinatin string pointer. + */ + extern char* GSTR_int_to_string( char **dst, int value ); + + /** + * Formats the int/string value as string. + * @param dst - the destination string. + * @param digitNum - the digit number of the value. + * @param value - the value to be converted. + * @return - N/A. + */ + extern void GSTR_format_int_to_string( char *dst, int digitNum, int value ); + extern void GSTR_format_string( const char *dst, int m, const char *fill_char, char **out ); + + /** + * Appends the strings( never null returned ) + * @param s1 - string 1 + * @param s2 - string 2 + * @return - new string + */ + extern char* GSTR_string_append( const char *s1, const char *s2 ); + + /** + * Whether the string is float type + * @param str - The string + * + * NOTE: it's only check whether each word is in "+-.0123456789", not care the float with "E" or the float rule, + * like "00-1.+01", it will return true. + * @return - return true if it is one. + */ + extern logical GSTR_is_float(const char *str); + + /** + * Whether all char of the string are number + * @param str - The string + * + * NOTE: it's only check whether each word is in "0123456789" + * @return - return true if it is one. + */ + extern logical GSTR_is_number(const char *str); + + /** + * Is ascii char + * @param ch - ascii char + * @return - return true if it is. + */ + extern logical GSTR_is_ascii(char ch); + + /** + * Trims the string's prefix. + * @param str - The string + * @param s - The char + * + * @return - count. + */ + extern int GSTR_trim_l( char *str, char s ); + extern int GSTR_trim_r( char *str, char s ); + + /** + * Remove the zero. + * For Example: + * floatValue="50.00" -> = "50" + * floatValue="50.0100" -> = "50.01" + * @return - count. + */ + extern void GSTR_trim_float( char *floatValue ); + +#ifdef __cplusplus + } +#endif + + +#endif //STRING_UTILS_H diff --git a/SignOff_itk/SignOff_itk/targetver.h b/SignOff_itk/SignOff_itk/targetver.h new file mode 100644 index 0000000..416cebf --- /dev/null +++ b/SignOff_itk/SignOff_itk/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// _WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/SignOff_itk/SignOff_itk/tc_log.cxx b/SignOff_itk/SignOff_itk/tc_log.cxx new file mode 100644 index 0000000..8c4d149 --- /dev/null +++ b/SignOff_itk/SignOff_itk/tc_log.cxx @@ -0,0 +1,103 @@ +/** +* @file common_itk_util.cpp +* @brief itk warpper utility function +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 18-July-2008 Ray +*/ +#include +#include +#include + +#include +#include +#include +#include +// +#ifdef WIN32 +#include +#include +#else +#include +#endif +// +#include "tc_log.h" + +#define ARGS_LENGTH 200 +#define MAX_PRINTLINE_LENGTH 2000 +#define MAX_PATH_LENGTH 2000 +#define MAX_ARGUMENT_LENGTH 400 +#define MAX_PARAMNAME_LENGTH 50 +#define MAX_FILE_EXT_LENGTH 10 +#define TRUE_FLAG 1 +#define FALSE_FLAG 0 +#define DETAILLOG 1 + +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + + +FILE* logFile = NULL; + +void CreateLogFile(char* logFileName) +{ + int i=0; + + logFile = NULL; + + + //get logFileName + sprintf(logFileName, "%s", logFileName); + printf("log file name: %s\n", logFileName); + + + //create log file + if((logFile = fopen(logFileName, "w"))==NULL) + { + printf("log file create failed\n"); + } + +} + +void WriteLog(const char* format, ...) +{ + va_list arg; + char tmp[MAX_PRINTLINE_LENGTH]; + + if(logFile) + { + //get the message + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + + //----------print to command window for trace--------// + printf("%s\n", tmp); + + //print message to log file + fprintf(logFile, "%s\n", tmp); + fflush(logFile); + } + else + { + printf("*!Error!*: Log File Not Exist\n"); + } +} + +void CloseLog(void) +{ + if(logFile) + { + fclose(logFile); + logFile = NULL; + } +} diff --git a/SignOff_itk/SignOff_itk/tc_log.h b/SignOff_itk/SignOff_itk/tc_log.h new file mode 100644 index 0000000..8dc0a0a --- /dev/null +++ b/SignOff_itk/SignOff_itk/tc_log.h @@ -0,0 +1,30 @@ +/** +* @file common_itk_util.h +* @brief itk warpper utility function +* @author Ray +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 Ray +*/ + +#ifndef TC_LOG_H +#define TC_LOG_H + +#ifdef __cplusplus +extern "C" { +#endif + +void CreateLogFile(char* logFileName); +void WriteLog(const char* format, ...); +void CloseLog(void); +//int FindDatasetReferenceExt( tag_t datasettype, const char *datasettype_ref, char ext[10] ); +//int CompareDate( date_t date1, date_t date2 ); +//int GetRandomTempFile( char tempFile[256] ); +//logical IsItemRevisionType( char object_type[WSO_name_size_c + 1] ); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.Build.CppClean.log b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.Build.CppClean.log new file mode 100644 index 0000000..3d0b271 --- /dev/null +++ b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.Build.CppClean.log @@ -0,0 +1,32 @@ +d:\source\力源\signoff_itk\signoff_itk\x64\release\vc142.pdb +d:\source\力源\signoff_itk\signoff_itk\x64\release\connor_signoff_form.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\connor_signoff_dataset.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\string_utils.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\string_helper.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\ocilib.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\lib_custom_main.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\epm_register_handler.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\crul_server_call_httpserver.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\connor_util.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\connor_changetask_setvalue.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\connor_changetask_setcomments.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\connor_changetask_checkvalue.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\connor_changetask_assignuser.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\common_itk_util.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\ado.obj +d:\source\力源\signoff_itk\signoff_itk\x64\release\addlb.obj +d:\source\力源\signoff_itk\x64\release\signoff_itk.dll +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.ipdb +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.iobj +d:\source\力源\signoff_itk\x64\release\signoff_itk.pdb +d:\source\力源\signoff_itk\x64\release\signoff_itk.lib +d:\source\力源\signoff_itk\x64\release\signoff_itk.exp +d:\source\力源\signoff_itk\signoff_itk\x64\release\msado15.tli +d:\source\力源\signoff_itk\signoff_itk\x64\release\msado15.tlh +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.tlog\cl.command.1.tlog +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.tlog\cl.read.1.tlog +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.tlog\cl.write.1.tlog +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.tlog\link.command.1.tlog +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.tlog\link.read.1.tlog +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.tlog\link.write.1.tlog +d:\source\力源\signoff_itk\signoff_itk\x64\release\signoff_itk.tlog\signoff_itk.write.1u.tlog diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.dll.recipe b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.dll.recipe new file mode 100644 index 0000000..bd34adc --- /dev/null +++ b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\source\力源\SignOff_itk\x64\Release\SignOff_itk.dll + + + + + + \ No newline at end of file diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.log b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.log new file mode 100644 index 0000000..d53042f --- /dev/null +++ b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.log @@ -0,0 +1,217 @@ + addLb.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\addLb.cpp(106,12): warning C4477: “printf”: 格式字符串“%d”需要类型“int”的参数,但可变参数 1 拥有了类型“unsigned __int64” +D:\source\力源\SignOff_itk\SignOff_itk\addLb.cpp(106,12): message : 请考虑在格式字符串中使用“%zd” +D:\source\力源\SignOff_itk\SignOff_itk\addLb.cpp(59,3): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. +D:\source\力源\SignOff_itk\SignOff_itk\addLb.cpp(87,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\addLb.cpp(103,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + ado.cxx +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\ado.cxx(132,9): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\ado.cxx(406,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\ado.cxx(461,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(2541,23): warning C4244: “参数”: 从“wchar_t”转换到“const _Elem”,可能丢失数据 + with + [ + _Elem=char + ] +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(2552): message : 查看对正在编译的函数 模板 实例化“void std::basic_string,std::allocator>::_Construct(_Iter,const _Iter,std::input_iterator_tag)”的引用 + with + [ + _Iter=wchar_t * + ] +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(2552): message : 查看对正在编译的函数 模板 实例化“void std::basic_string,std::allocator>::_Construct(_Iter,const _Iter,std::input_iterator_tag)”的引用 + with + [ + _Iter=wchar_t * + ] +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(2532): message : 查看对正在编译的函数 模板 实例化“void std::basic_string,std::allocator>::_Construct(const _Iter,const _Iter,std::forward_iterator_tag)”的引用 + with + [ + _Iter=wchar_t * + ] +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(2532): message : 查看对正在编译的函数 模板 实例化“void std::basic_string,std::allocator>::_Construct(const _Iter,const _Iter,std::forward_iterator_tag)”的引用 + with + [ + _Iter=wchar_t * + ] +D:\source\力源\SignOff_itk\SignOff_itk\ado.cxx(102): message : 查看对正在编译的函数 模板 实例化“std::basic_string,std::allocator>::basic_string>>,0>(_Iter,_Iter,const _Alloc &)”的引用 + with + [ + _Elem=wchar_t, + _Iter=std::_String_iterator>>, + _Alloc=std::allocator + ] +D:\source\力源\SignOff_itk\SignOff_itk\ado.cxx(102): message : 查看对正在编译的函数 模板 实例化“std::basic_string,std::allocator>::basic_string>>,0>(_Iter,_Iter,const _Alloc &)”的引用 + with + [ + _Elem=wchar_t, + _Iter=std::_String_iterator>>, + _Alloc=std::allocator + ] + common_itk_util.cxx +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(52,5): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(84,10): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(120,4): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(124,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(136,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(139,5): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(144,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(146,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(161,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(165,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(175,12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(202,3): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(284,5): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(288,5): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(292,5): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(296,5): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(303,6): error C2664: “int open(const char *,int,...)”: 无法将参数 2 从“char [100]”转换为“int” +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(303,22): message : 没有使该转换得以执行的上下文 +D:\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_io.h(518,30): message : 参见“open”的声明 +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(267,22): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(271,13): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(347,6): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(422,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(394,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(397,6): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(398,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(401,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(403,7): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(411,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(415,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(418,12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(421,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(470,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(448,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(451,6): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(452,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(455,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(457,7): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(464,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(466,12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\common_itk_util.cxx(469,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Connor_ChangeTask_AssignUser.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_AssignUser.cpp(47,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_AssignUser.cpp(55,13): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_AssignUser.cpp(112,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_AssignUser.cpp(18,73): warning C4101: “form_count”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_AssignUser.cpp(18,39): warning C4101: “attach_type”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_AssignUser.cpp(32,8): warning C4101: “uid”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_AssignUser.cpp(33,8): warning C4101: “endResult”: 未引用的局部变量 + Connor_ChangeTask_CheckValue.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(47,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(55,13): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(63,13): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(120,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(18,73): warning C4101: “form_count”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(18,39): warning C4101: “attach_type”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(31,8): warning C4101: “uid”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_CheckValue.cpp(32,8): warning C4101: “endResult”: 未引用的局部变量 + Connor_ChangeTask_SetComments.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetComments.cpp(91,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetComments.cpp(99,13): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetComments.cpp(160,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetComments.cpp(17,73): warning C4101: “form_count”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetComments.cpp(30,8): warning C4101: “uid”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetComments.cpp(31,8): warning C4101: “endResult”: 未引用的局部变量 + Connor_ChangeTask_SetValue.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(46,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(54,13): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(62,13): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(118,6): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(127,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(193,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(125,9): warning C4101: “timesss”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(17,73): warning C4101: “form_count”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(30,8): warning C4101: “uid”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_ChangeTask_SetValue.cpp(31,8): warning C4101: “endResult”: 未引用的局部变量 + connor_util.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(102,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(105,62): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(107,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(147,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(148,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(149,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(221,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(300,2): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(312,26): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(359,27): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(369,64): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\力源\SignOff_itk\SignOff_itk\connor_util.cpp(380,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. + CRUL_server_call_httpserver.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\CRUL_server_call_httpserver.cpp(14,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + epm_register_handler.cpp +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(65,12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(61,29): warning C4101: “str”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(98,9): warning C4101: “now”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(97,56): warning C4101: “temp2”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(97,21): warning C4101: “expire_date”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(97,7): warning C4101: “date_buf”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(99,17): warning C4101: “p”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(97,34): warning C4101: “env”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(97,44): warning C4101: “temp1”: 未引用的局部变量 +D:\source\力源\SignOff_itk\SignOff_itk\epm_register_handler.cpp(189,14): warning C4101: “mth_tag”: 未引用的局部变量 + lib_custom_main.cpp + ocilib.cxx + string_helper.cpp + string_utils.cxx +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + Connor_signoff_dataset.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(43,32): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(263,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(270,7): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(277,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(284,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(291,7): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(298,7): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(305,7): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(312,7): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(319,7): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(326,7): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(333,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(340,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(440,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(451,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(466,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(488,8): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_dataset.cpp(523,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Connor_signoff_form.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(115,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(116,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(138,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(139,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(140,7): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(145,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(146,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(147,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(148,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(150,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(151,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(67,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(75,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(82,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(89,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(96,8): warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _stricmp. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(159,7): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(161,7): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\力源\SignOff_itk\SignOff_itk\Connor_signoff_form.cpp(227,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.command.1.tlog b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.command.1.tlog new file mode 100644 index 0000000..1e75b28 Binary files /dev/null and b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.command.1.tlog differ diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.read.1.tlog b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.read.1.tlog new file mode 100644 index 0000000..8f0a801 Binary files /dev/null and b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.read.1.tlog differ diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.write.1.tlog b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.write.1.tlog new file mode 100644 index 0000000..54bf03f Binary files /dev/null and b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/CL.write.1.tlog differ diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/SignOff_itk.lastbuildstate b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/SignOff_itk.lastbuildstate new file mode 100644 index 0000000..ae4c873 --- /dev/null +++ b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/SignOff_itk.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Release|x64|D:\source\力源\SignOff_itk\| diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/unsuccessfulbuild b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.vcxproj.FileListAbsolute.txt b/SignOff_itk/SignOff_itk/x64/Release/SignOff_itk.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/SignOff_itk/SignOff_itk/x64/Release/msado15.tlh b/SignOff_itk/SignOff_itk/x64/Release/msado15.tlh new file mode 100644 index 0000000..a2199a5 --- /dev/null +++ b/SignOff_itk/SignOff_itk/x64/Release/msado15.tlh @@ -0,0 +1,5027 @@ +// Created by Microsoft (R) C/C++ Compiler Version 14.29.30159.0 (dad71ecd). +// +// D:\source\力源\SignOff_itk\SignOff_itk\x64\Release\msado15.tlh +// +// C++ source equivalent of type library c:\program files\common files\system\ado\msado15.dll +// compiler-generated file created 01/20/26 at 11:27:32 - DO NOT EDIT! + +#pragma once +#pragma pack(push, 8) + +#include + +// +// Forward references and typedefs +// + +struct __declspec(uuid("b691e011-1797-432e-907a-4d8c69339129")) +/* LIBID */ __ADODB; +enum CursorTypeEnum; +enum CursorOptionEnum; +enum LockTypeEnum; +enum ExecuteOptionEnum; +enum ConnectOptionEnum; +enum ObjectStateEnum; +enum CursorLocationEnum; +enum DataTypeEnum; +enum FieldAttributeEnum; +enum EditModeEnum; +enum RecordStatusEnum; +enum GetRowsOptionEnum; +enum PositionEnum; +enum BookmarkEnum; +enum MarshalOptionsEnum; +enum AffectEnum; +enum ResyncEnum; +enum CompareEnum; +enum FilterGroupEnum; +enum SearchDirectionEnum; +enum PersistFormatEnum; +enum StringFormatEnum; +enum ConnectPromptEnum; +enum ConnectModeEnum; +enum RecordCreateOptionsEnum; +enum RecordOpenOptionsEnum; +enum IsolationLevelEnum; +enum XactAttributeEnum; +enum PropertyAttributesEnum; +enum ErrorValueEnum; +enum ParameterAttributesEnum; +enum ParameterDirectionEnum; +enum CommandTypeEnum; +enum EventStatusEnum; +enum EventReasonEnum; +enum SchemaEnum; +enum FieldStatusEnum; +enum SeekEnum; +enum ADCPROP_UPDATECRITERIA_ENUM; +enum ADCPROP_ASYNCTHREADPRIORITY_ENUM; +enum ADCPROP_AUTORECALC_ENUM; +enum ADCPROP_UPDATERESYNC_ENUM; +enum MoveRecordOptionsEnum; +enum CopyRecordOptionsEnum; +enum StreamTypeEnum; +enum LineSeparatorEnum; +enum StreamOpenOptionsEnum; +enum StreamWriteEnum; +enum SaveOptionsEnum; +enum FieldEnum; +enum StreamReadEnum; +enum RecordTypeEnum; +struct __declspec(uuid("00000512-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Collection; +struct __declspec(uuid("00000513-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _DynaCollection; +struct __declspec(uuid("00000534-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _ADO; +struct __declspec(uuid("00000504-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Properties; +struct __declspec(uuid("00000503-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Property; +struct __declspec(uuid("00000500-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Error; +struct __declspec(uuid("00000501-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Errors; +struct __declspec(uuid("00001508-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command15; +struct __declspec(uuid("00001550-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Connection; +struct __declspec(uuid("00001515-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Connection15; +struct __declspec(uuid("00001556-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Recordset; +struct __declspec(uuid("00001555-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset21; +struct __declspec(uuid("0000154f-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset20; +struct __declspec(uuid("0000150e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset15; +struct __declspec(uuid("00001564-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields; +struct __declspec(uuid("0000154d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields20; +struct __declspec(uuid("00001506-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields15; +struct __declspec(uuid("00001569-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field; +struct __declspec(uuid("0000154c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field20; +struct __declspec(uuid("0000150c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Parameter; +struct __declspec(uuid("0000150d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Parameters; +struct __declspec(uuid("0000154e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command25; +struct __declspec(uuid("986761e8-7269-4890-aa65-ad7c03697a6d")) +/* dual interface */ _Command; +struct __declspec(uuid("00001402-0000-0010-8000-00aa006d2ea4")) +/* interface */ ConnectionEventsVt; +struct __declspec(uuid("00001403-0000-0010-8000-00aa006d2ea4")) +/* interface */ RecordsetEventsVt; +struct __declspec(uuid("00001400-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ ConnectionEvents; +struct __declspec(uuid("00001266-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ RecordsetEvents; +struct __declspec(uuid("00000516-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOConnectionConstruction15; +struct __declspec(uuid("00000551-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOConnectionConstruction; +struct /* coclass */ Connection; +struct __declspec(uuid("00001562-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Record; +struct /* coclass */ Record; +struct __declspec(uuid("00001565-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Stream; +struct /* coclass */ Stream; +struct __declspec(uuid("00000567-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADORecordConstruction; +struct __declspec(uuid("00000568-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOStreamConstruction; +struct __declspec(uuid("00000517-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOCommandConstruction; +struct /* coclass */ Command; +struct /* coclass */ Recordset; +struct __declspec(uuid("00000283-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADORecordsetConstruction; +struct __declspec(uuid("00001505-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field15; +struct /* coclass */ Parameter; +struct __declspec(uuid("00000402-0000-0010-8000-00aa006d2ea4")) +/* interface */ ConnectionEventsVt_Deprecated; +struct __declspec(uuid("00000550-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Connection_Deprecated; +struct __declspec(uuid("00000515-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Connection15_Deprecated; +struct __declspec(uuid("00000556-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Recordset_Deprecated; +struct __declspec(uuid("00000555-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset21_Deprecated; +struct __declspec(uuid("0000054f-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset20_Deprecated; +struct __declspec(uuid("0000050e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset15_Deprecated; +struct __declspec(uuid("00000564-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields_Deprecated; +struct __declspec(uuid("0000054d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields20_Deprecated; +struct __declspec(uuid("00000506-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields15_Deprecated; +struct __declspec(uuid("00000569-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field_Deprecated; +struct __declspec(uuid("0000054c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field20_Deprecated; +struct __declspec(uuid("b08400bd-f9d1-4d02-b856-71d5dba123e9")) +/* dual interface */ _Command_Deprecated; +struct __declspec(uuid("0000054e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command25_Deprecated; +struct __declspec(uuid("00000508-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command15_Deprecated; +struct __declspec(uuid("0000050c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Parameter_Deprecated; +struct __declspec(uuid("0000050d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Parameters_Deprecated; +struct __declspec(uuid("00000403-0000-0010-8000-00aa006d2ea4")) +/* interface */ RecordsetEventsVt_Deprecated; +struct __declspec(uuid("00000400-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ ConnectionEvents_Deprecated; +struct __declspec(uuid("00000266-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ RecordsetEvents_Deprecated; +struct __declspec(uuid("00000562-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Record_Deprecated; +struct __declspec(uuid("00000565-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Stream_Deprecated; +struct __declspec(uuid("00000505-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field15_Deprecated; +typedef __int64 PositionEnum_Param; +typedef enum SearchDirectionEnum SearchDirection; +typedef __int64 ADO_LONGPTR; + +// +// Smart pointer typedef declarations +// + +_COM_SMARTPTR_TYPEDEF(_Collection, __uuidof(_Collection)); +_COM_SMARTPTR_TYPEDEF(_DynaCollection, __uuidof(_DynaCollection)); +_COM_SMARTPTR_TYPEDEF(Property, __uuidof(Property)); +_COM_SMARTPTR_TYPEDEF(Properties, __uuidof(Properties)); +_COM_SMARTPTR_TYPEDEF(_ADO, __uuidof(_ADO)); +_COM_SMARTPTR_TYPEDEF(Error, __uuidof(Error)); +_COM_SMARTPTR_TYPEDEF(Errors, __uuidof(Errors)); +_COM_SMARTPTR_TYPEDEF(Field20, __uuidof(Field20)); +_COM_SMARTPTR_TYPEDEF(Field, __uuidof(Field)); +_COM_SMARTPTR_TYPEDEF(Fields15, __uuidof(Fields15)); +_COM_SMARTPTR_TYPEDEF(Fields20, __uuidof(Fields20)); +_COM_SMARTPTR_TYPEDEF(Fields, __uuidof(Fields)); +_COM_SMARTPTR_TYPEDEF(_Parameter, __uuidof(_Parameter)); +_COM_SMARTPTR_TYPEDEF(Parameters, __uuidof(Parameters)); +_COM_SMARTPTR_TYPEDEF(ConnectionEvents, __uuidof(ConnectionEvents)); +_COM_SMARTPTR_TYPEDEF(RecordsetEvents, __uuidof(RecordsetEvents)); +_COM_SMARTPTR_TYPEDEF(ADOConnectionConstruction15, __uuidof(ADOConnectionConstruction15)); +_COM_SMARTPTR_TYPEDEF(ADOConnectionConstruction, __uuidof(ADOConnectionConstruction)); +_COM_SMARTPTR_TYPEDEF(_Stream, __uuidof(_Stream)); +_COM_SMARTPTR_TYPEDEF(ADORecordConstruction, __uuidof(ADORecordConstruction)); +_COM_SMARTPTR_TYPEDEF(ADOStreamConstruction, __uuidof(ADOStreamConstruction)); +_COM_SMARTPTR_TYPEDEF(ADOCommandConstruction, __uuidof(ADOCommandConstruction)); +_COM_SMARTPTR_TYPEDEF(ADORecordsetConstruction, __uuidof(ADORecordsetConstruction)); +_COM_SMARTPTR_TYPEDEF(Field15, __uuidof(Field15)); +_COM_SMARTPTR_TYPEDEF(Field20_Deprecated, __uuidof(Field20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Field_Deprecated, __uuidof(Field_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields15_Deprecated, __uuidof(Fields15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields20_Deprecated, __uuidof(Fields20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields_Deprecated, __uuidof(Fields_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Parameter_Deprecated, __uuidof(_Parameter_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Parameters_Deprecated, __uuidof(Parameters_Deprecated)); +_COM_SMARTPTR_TYPEDEF(ConnectionEvents_Deprecated, __uuidof(ConnectionEvents_Deprecated)); +_COM_SMARTPTR_TYPEDEF(RecordsetEvents_Deprecated, __uuidof(RecordsetEvents_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Stream_Deprecated, __uuidof(_Stream_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Field15_Deprecated, __uuidof(Field15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command15, __uuidof(Command15)); +_COM_SMARTPTR_TYPEDEF(Command25, __uuidof(Command25)); +_COM_SMARTPTR_TYPEDEF(_Command, __uuidof(_Command)); +_COM_SMARTPTR_TYPEDEF(Connection15, __uuidof(Connection15)); +_COM_SMARTPTR_TYPEDEF(_Connection, __uuidof(_Connection)); +_COM_SMARTPTR_TYPEDEF(Recordset15, __uuidof(Recordset15)); +_COM_SMARTPTR_TYPEDEF(Recordset20, __uuidof(Recordset20)); +_COM_SMARTPTR_TYPEDEF(Recordset21, __uuidof(Recordset21)); +_COM_SMARTPTR_TYPEDEF(_Recordset, __uuidof(_Recordset)); +_COM_SMARTPTR_TYPEDEF(ConnectionEventsVt, __uuidof(ConnectionEventsVt)); +_COM_SMARTPTR_TYPEDEF(RecordsetEventsVt, __uuidof(RecordsetEventsVt)); +_COM_SMARTPTR_TYPEDEF(_Record, __uuidof(_Record)); +_COM_SMARTPTR_TYPEDEF(ConnectionEventsVt_Deprecated, __uuidof(ConnectionEventsVt_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Connection15_Deprecated, __uuidof(Connection15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Connection_Deprecated, __uuidof(_Connection_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset15_Deprecated, __uuidof(Recordset15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset20_Deprecated, __uuidof(Recordset20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset21_Deprecated, __uuidof(Recordset21_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Recordset_Deprecated, __uuidof(_Recordset_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command15_Deprecated, __uuidof(Command15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command25_Deprecated, __uuidof(Command25_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Command_Deprecated, __uuidof(_Command_Deprecated)); +_COM_SMARTPTR_TYPEDEF(RecordsetEventsVt_Deprecated, __uuidof(RecordsetEventsVt_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Record_Deprecated, __uuidof(_Record_Deprecated)); + +// +// Type library items +// + +enum __declspec(uuid("0000051b-0000-0010-8000-00aa006d2ea4")) +CursorTypeEnum +{ + adOpenUnspecified = -1, + adOpenForwardOnly = 0, + adOpenKeyset = 1, + adOpenDynamic = 2, + adOpenStatic = 3 +}; + +enum __declspec(uuid("0000051c-0000-0010-8000-00aa006d2ea4")) +CursorOptionEnum +{ + adHoldRecords = 256, + adMovePrevious = 512, + adAddNew = 16778240, + adDelete = 16779264, + adUpdate = 16809984, + adBookmark = 8192, + adApproxPosition = 16384, + adUpdateBatch = 65536, + adResync = 131072, + adNotify = 262144, + adFind = 524288, + adSeek = 4194304, + adIndex = 8388608 +}; + +enum __declspec(uuid("0000051d-0000-0010-8000-00aa006d2ea4")) +LockTypeEnum +{ + adLockUnspecified = -1, + adLockReadOnly = 1, + adLockPessimistic = 2, + adLockOptimistic = 3, + adLockBatchOptimistic = 4 +}; + +enum __declspec(uuid("0000051e-0000-0010-8000-00aa006d2ea4")) +ExecuteOptionEnum +{ + adOptionUnspecified = -1, + adAsyncExecute = 16, + adAsyncFetch = 32, + adAsyncFetchNonBlocking = 64, + adExecuteNoRecords = 128, + adExecuteStream = 1024, + adExecuteRecord = 2048 +}; + +enum __declspec(uuid("00000541-0000-0010-8000-00aa006d2ea4")) +ConnectOptionEnum +{ + adConnectUnspecified = -1, + adAsyncConnect = 16 +}; + +enum __declspec(uuid("00000532-0000-0010-8000-00aa006d2ea4")) +ObjectStateEnum +{ + adStateClosed = 0, + adStateOpen = 1, + adStateConnecting = 2, + adStateExecuting = 4, + adStateFetching = 8 +}; + +enum __declspec(uuid("0000052f-0000-0010-8000-00aa006d2ea4")) +CursorLocationEnum +{ + adUseNone = 1, + adUseServer = 2, + adUseClient = 3, + adUseClientBatch = 3 +}; + +enum __declspec(uuid("0000051f-0000-0010-8000-00aa006d2ea4")) +DataTypeEnum +{ + adEmpty = 0, + adTinyInt = 16, + adSmallInt = 2, + adInteger = 3, + adBigInt = 20, + adUnsignedTinyInt = 17, + adUnsignedSmallInt = 18, + adUnsignedInt = 19, + adUnsignedBigInt = 21, + adSingle = 4, + adDouble = 5, + adCurrency = 6, + adDecimal = 14, + adNumeric = 131, + adBoolean = 11, + adError = 10, + adUserDefined = 132, + adVariant = 12, + adIDispatch = 9, + adIUnknown = 13, + adGUID = 72, + adDate = 7, + adDBDate = 133, + adDBTime = 134, + adDBTimeStamp = 135, + adBSTR = 8, + adChar = 129, + adVarChar = 200, + adLongVarChar = 201, + adWChar = 130, + adVarWChar = 202, + adLongVarWChar = 203, + adBinary = 128, + adVarBinary = 204, + adLongVarBinary = 205, + adChapter = 136, + adFileTime = 64, + adPropVariant = 138, + adVarNumeric = 139, + adArray = 8192 +}; + +enum __declspec(uuid("00000525-0000-0010-8000-00aa006d2ea4")) +FieldAttributeEnum +{ + adFldUnspecified = -1, + adFldMayDefer = 2, + adFldUpdatable = 4, + adFldUnknownUpdatable = 8, + adFldFixed = 16, + adFldIsNullable = 32, + adFldMayBeNull = 64, + adFldLong = 128, + adFldRowID = 256, + adFldRowVersion = 512, + adFldCacheDeferred = 4096, + adFldIsChapter = 8192, + adFldNegativeScale = 16384, + adFldKeyColumn = 32768, + adFldIsRowURL = 65536, + adFldIsDefaultStream = 131072, + adFldIsCollection = 262144 +}; + +enum __declspec(uuid("00000526-0000-0010-8000-00aa006d2ea4")) +EditModeEnum +{ + adEditNone = 0, + adEditInProgress = 1, + adEditAdd = 2, + adEditDelete = 4 +}; + +enum __declspec(uuid("00000527-0000-0010-8000-00aa006d2ea4")) +RecordStatusEnum +{ + adRecOK = 0, + adRecNew = 1, + adRecModified = 2, + adRecDeleted = 4, + adRecUnmodified = 8, + adRecInvalid = 16, + adRecMultipleChanges = 64, + adRecPendingChanges = 128, + adRecCanceled = 256, + adRecCantRelease = 1024, + adRecConcurrencyViolation = 2048, + adRecIntegrityViolation = 4096, + adRecMaxChangesExceeded = 8192, + adRecObjectOpen = 16384, + adRecOutOfMemory = 32768, + adRecPermissionDenied = 65536, + adRecSchemaViolation = 131072, + adRecDBDeleted = 262144 +}; + +enum __declspec(uuid("00000542-0000-0010-8000-00aa006d2ea4")) +GetRowsOptionEnum +{ + adGetRowsRest = -1 +}; + +enum __declspec(uuid("00000528-0000-0010-8000-00aa006d2ea4")) +PositionEnum +{ + adPosUnknown = -1, + adPosBOF = -2, + adPosEOF = -3 +}; + +enum BookmarkEnum +{ + adBookmarkCurrent = 0, + adBookmarkFirst = 1, + adBookmarkLast = 2 +}; + +enum __declspec(uuid("00000540-0000-0010-8000-00aa006d2ea4")) +MarshalOptionsEnum +{ + adMarshalAll = 0, + adMarshalModifiedOnly = 1 +}; + +enum __declspec(uuid("00000543-0000-0010-8000-00aa006d2ea4")) +AffectEnum +{ + adAffectCurrent = 1, + adAffectGroup = 2, + adAffectAll = 3, + adAffectAllChapters = 4 +}; + +enum __declspec(uuid("00000544-0000-0010-8000-00aa006d2ea4")) +ResyncEnum +{ + adResyncUnderlyingValues = 1, + adResyncAllValues = 2 +}; + +enum __declspec(uuid("00000545-0000-0010-8000-00aa006d2ea4")) +CompareEnum +{ + adCompareLessThan = 0, + adCompareEqual = 1, + adCompareGreaterThan = 2, + adCompareNotEqual = 3, + adCompareNotComparable = 4 +}; + +enum __declspec(uuid("00000546-0000-0010-8000-00aa006d2ea4")) +FilterGroupEnum +{ + adFilterNone = 0, + adFilterPendingRecords = 1, + adFilterAffectedRecords = 2, + adFilterFetchedRecords = 3, + adFilterPredicate = 4, + adFilterConflictingRecords = 5 +}; + +enum __declspec(uuid("00000547-0000-0010-8000-00aa006d2ea4")) +SearchDirectionEnum +{ + adSearchForward = 1, + adSearchBackward = -1 +}; + +enum __declspec(uuid("00000548-0000-0010-8000-00aa006d2ea4")) +PersistFormatEnum +{ + adPersistADTG = 0, + adPersistXML = 1 +}; + +enum __declspec(uuid("00000549-0000-0010-8000-00aa006d2ea4")) +StringFormatEnum +{ + adClipString = 2 +}; + +enum __declspec(uuid("00000520-0000-0010-8000-00aa006d2ea4")) +ConnectPromptEnum +{ + adPromptAlways = 1, + adPromptComplete = 2, + adPromptCompleteRequired = 3, + adPromptNever = 4 +}; + +enum __declspec(uuid("00000521-0000-0010-8000-00aa006d2ea4")) +ConnectModeEnum +{ + adModeUnknown = 0, + adModeRead = 1, + adModeWrite = 2, + adModeReadWrite = 3, + adModeShareDenyRead = 4, + adModeShareDenyWrite = 8, + adModeShareExclusive = 12, + adModeShareDenyNone = 16, + adModeRecursive = 4194304 +}; + +enum __declspec(uuid("00000570-0000-0010-8000-00aa006d2ea4")) +RecordCreateOptionsEnum +{ + adCreateCollection = 8192, + adCreateStructDoc = 0x80000000, + adCreateNonCollection = 0, + adOpenIfExists = 33554432, + adCreateOverwrite = 67108864, + adFailIfNotExists = -1 +}; + +enum __declspec(uuid("00000571-0000-0010-8000-00aa006d2ea4")) +RecordOpenOptionsEnum +{ + adOpenRecordUnspecified = -1, + adOpenSource = 8388608, + adOpenOutput = 8388608, + adOpenAsync = 4096, + adDelayFetchStream = 16384, + adDelayFetchFields = 32768, + adOpenExecuteCommand = 65536 +}; + +enum __declspec(uuid("00000523-0000-0010-8000-00aa006d2ea4")) +IsolationLevelEnum +{ + adXactUnspecified = -1, + adXactChaos = 16, + adXactReadUncommitted = 256, + adXactBrowse = 256, + adXactCursorStability = 4096, + adXactReadCommitted = 4096, + adXactRepeatableRead = 65536, + adXactSerializable = 1048576, + adXactIsolated = 1048576 +}; + +enum __declspec(uuid("00000524-0000-0010-8000-00aa006d2ea4")) +XactAttributeEnum +{ + adXactCommitRetaining = 131072, + adXactAbortRetaining = 262144, + adXactAsyncPhaseOne = 524288, + adXactSyncPhaseOne = 1048576 +}; + +enum __declspec(uuid("00000529-0000-0010-8000-00aa006d2ea4")) +PropertyAttributesEnum +{ + adPropNotSupported = 0, + adPropRequired = 1, + adPropOptional = 2, + adPropRead = 512, + adPropWrite = 1024 +}; + +enum __declspec(uuid("0000052a-0000-0010-8000-00aa006d2ea4")) +ErrorValueEnum +{ + adErrProviderFailed = 3000, + adErrInvalidArgument = 3001, + adErrOpeningFile = 3002, + adErrReadFile = 3003, + adErrWriteFile = 3004, + adErrNoCurrentRecord = 3021, + adErrIllegalOperation = 3219, + adErrCantChangeProvider = 3220, + adErrInTransaction = 3246, + adErrFeatureNotAvailable = 3251, + adErrItemNotFound = 3265, + adErrObjectInCollection = 3367, + adErrObjectNotSet = 3420, + adErrDataConversion = 3421, + adErrObjectClosed = 3704, + adErrObjectOpen = 3705, + adErrProviderNotFound = 3706, + adErrBoundToCommand = 3707, + adErrInvalidParamInfo = 3708, + adErrInvalidConnection = 3709, + adErrNotReentrant = 3710, + adErrStillExecuting = 3711, + adErrOperationCancelled = 3712, + adErrStillConnecting = 3713, + adErrInvalidTransaction = 3714, + adErrNotExecuting = 3715, + adErrUnsafeOperation = 3716, + adwrnSecurityDialog = 3717, + adwrnSecurityDialogHeader = 3718, + adErrIntegrityViolation = 3719, + adErrPermissionDenied = 3720, + adErrDataOverflow = 3721, + adErrSchemaViolation = 3722, + adErrSignMismatch = 3723, + adErrCantConvertvalue = 3724, + adErrCantCreate = 3725, + adErrColumnNotOnThisRow = 3726, + adErrURLDoesNotExist = 3727, + adErrTreePermissionDenied = 3728, + adErrInvalidURL = 3729, + adErrResourceLocked = 3730, + adErrResourceExists = 3731, + adErrCannotComplete = 3732, + adErrVolumeNotFound = 3733, + adErrOutOfSpace = 3734, + adErrResourceOutOfScope = 3735, + adErrUnavailable = 3736, + adErrURLNamedRowDoesNotExist = 3737, + adErrDelResOutOfScope = 3738, + adErrPropInvalidColumn = 3739, + adErrPropInvalidOption = 3740, + adErrPropInvalidValue = 3741, + adErrPropConflicting = 3742, + adErrPropNotAllSettable = 3743, + adErrPropNotSet = 3744, + adErrPropNotSettable = 3745, + adErrPropNotSupported = 3746, + adErrCatalogNotSet = 3747, + adErrCantChangeConnection = 3748, + adErrFieldsUpdateFailed = 3749, + adErrDenyNotSupported = 3750, + adErrDenyTypeNotSupported = 3751, + adErrProviderNotSpecified = 3753, + adErrConnectionStringTooLong = 3754 +}; + +enum __declspec(uuid("0000052b-0000-0010-8000-00aa006d2ea4")) +ParameterAttributesEnum +{ + adParamSigned = 16, + adParamNullable = 64, + adParamLong = 128 +}; + +enum __declspec(uuid("0000052c-0000-0010-8000-00aa006d2ea4")) +ParameterDirectionEnum +{ + adParamUnknown = 0, + adParamInput = 1, + adParamOutput = 2, + adParamInputOutput = 3, + adParamReturnValue = 4 +}; + +enum __declspec(uuid("0000052e-0000-0010-8000-00aa006d2ea4")) +CommandTypeEnum +{ + adCmdUnspecified = -1, + adCmdUnknown = 8, + adCmdText = 1, + adCmdTable = 2, + adCmdStoredProc = 4, + adCmdFile = 256, + adCmdTableDirect = 512 +}; + +enum __declspec(uuid("00000530-0000-0010-8000-00aa006d2ea4")) +EventStatusEnum +{ + adStatusOK = 1, + adStatusErrorsOccurred = 2, + adStatusCantDeny = 3, + adStatusCancel = 4, + adStatusUnwantedEvent = 5 +}; + +enum __declspec(uuid("00000531-0000-0010-8000-00aa006d2ea4")) +EventReasonEnum +{ + adRsnAddNew = 1, + adRsnDelete = 2, + adRsnUpdate = 3, + adRsnUndoUpdate = 4, + adRsnUndoAddNew = 5, + adRsnUndoDelete = 6, + adRsnRequery = 7, + adRsnResynch = 8, + adRsnClose = 9, + adRsnMove = 10, + adRsnFirstChange = 11, + adRsnMoveFirst = 12, + adRsnMoveNext = 13, + adRsnMovePrevious = 14, + adRsnMoveLast = 15 +}; + +enum __declspec(uuid("00000533-0000-0010-8000-00aa006d2ea4")) +SchemaEnum +{ + adSchemaProviderSpecific = -1, + adSchemaAsserts = 0, + adSchemaCatalogs = 1, + adSchemaCharacterSets = 2, + adSchemaCollations = 3, + adSchemaColumns = 4, + adSchemaCheckConstraints = 5, + adSchemaConstraintColumnUsage = 6, + adSchemaConstraintTableUsage = 7, + adSchemaKeyColumnUsage = 8, + adSchemaReferentialContraints = 9, + adSchemaReferentialConstraints = 9, + adSchemaTableConstraints = 10, + adSchemaColumnsDomainUsage = 11, + adSchemaIndexes = 12, + adSchemaColumnPrivileges = 13, + adSchemaTablePrivileges = 14, + adSchemaUsagePrivileges = 15, + adSchemaProcedures = 16, + adSchemaSchemata = 17, + adSchemaSQLLanguages = 18, + adSchemaStatistics = 19, + adSchemaTables = 20, + adSchemaTranslations = 21, + adSchemaProviderTypes = 22, + adSchemaViews = 23, + adSchemaViewColumnUsage = 24, + adSchemaViewTableUsage = 25, + adSchemaProcedureParameters = 26, + adSchemaForeignKeys = 27, + adSchemaPrimaryKeys = 28, + adSchemaProcedureColumns = 29, + adSchemaDBInfoKeywords = 30, + adSchemaDBInfoLiterals = 31, + adSchemaCubes = 32, + adSchemaDimensions = 33, + adSchemaHierarchies = 34, + adSchemaLevels = 35, + adSchemaMeasures = 36, + adSchemaProperties = 37, + adSchemaMembers = 38, + adSchemaTrustees = 39, + adSchemaFunctions = 40, + adSchemaActions = 41, + adSchemaCommands = 42, + adSchemaSets = 43 +}; + +enum __declspec(uuid("0000057e-0000-0010-8000-00aa006d2ea4")) +FieldStatusEnum +{ + adFieldOK = 0, + adFieldCantConvertValue = 2, + adFieldIsNull = 3, + adFieldTruncated = 4, + adFieldSignMismatch = 5, + adFieldDataOverflow = 6, + adFieldCantCreate = 7, + adFieldUnavailable = 8, + adFieldPermissionDenied = 9, + adFieldIntegrityViolation = 10, + adFieldSchemaViolation = 11, + adFieldBadStatus = 12, + adFieldDefault = 13, + adFieldIgnore = 15, + adFieldDoesNotExist = 16, + adFieldInvalidURL = 17, + adFieldResourceLocked = 18, + adFieldResourceExists = 19, + adFieldCannotComplete = 20, + adFieldVolumeNotFound = 21, + adFieldOutOfSpace = 22, + adFieldCannotDeleteSource = 23, + adFieldReadOnly = 24, + adFieldResourceOutOfScope = 25, + adFieldAlreadyExists = 26, + adFieldPendingInsert = 65536, + adFieldPendingDelete = 131072, + adFieldPendingChange = 262144, + adFieldPendingUnknown = 524288, + adFieldPendingUnknownDelete = 1048576 +}; + +enum __declspec(uuid("00000552-0000-0010-8000-00aa006d2ea4")) +SeekEnum +{ + adSeekFirstEQ = 1, + adSeekLastEQ = 2, + adSeekAfterEQ = 4, + adSeekAfter = 8, + adSeekBeforeEQ = 16, + adSeekBefore = 32 +}; + +enum __declspec(uuid("0000054a-0000-0010-8000-00aa006d2ea4")) +ADCPROP_UPDATECRITERIA_ENUM +{ + adCriteriaKey = 0, + adCriteriaAllCols = 1, + adCriteriaUpdCols = 2, + adCriteriaTimeStamp = 3 +}; + +enum __declspec(uuid("0000054b-0000-0010-8000-00aa006d2ea4")) +ADCPROP_ASYNCTHREADPRIORITY_ENUM +{ + adPriorityLowest = 1, + adPriorityBelowNormal = 2, + adPriorityNormal = 3, + adPriorityAboveNormal = 4, + adPriorityHighest = 5 +}; + +enum __declspec(uuid("00000554-0000-0010-8000-00aa006d2ea4")) +ADCPROP_AUTORECALC_ENUM +{ + adRecalcUpFront = 0, + adRecalcAlways = 1 +}; + +enum __declspec(uuid("00000553-0000-0010-8000-00aa006d2ea4")) +ADCPROP_UPDATERESYNC_ENUM +{ + adResyncNone = 0, + adResyncAutoIncrement = 1, + adResyncConflicts = 2, + adResyncUpdates = 4, + adResyncInserts = 8, + adResyncAll = 15 +}; + +enum __declspec(uuid("00000573-0000-0010-8000-00aa006d2ea4")) +MoveRecordOptionsEnum +{ + adMoveUnspecified = -1, + adMoveOverWrite = 1, + adMoveDontUpdateLinks = 2, + adMoveAllowEmulation = 4 +}; + +enum __declspec(uuid("00000574-0000-0010-8000-00aa006d2ea4")) +CopyRecordOptionsEnum +{ + adCopyUnspecified = -1, + adCopyOverWrite = 1, + adCopyAllowEmulation = 4, + adCopyNonRecursive = 2 +}; + +enum __declspec(uuid("00000576-0000-0010-8000-00aa006d2ea4")) +StreamTypeEnum +{ + adTypeBinary = 1, + adTypeText = 2 +}; + +enum __declspec(uuid("00000577-0000-0010-8000-00aa006d2ea4")) +LineSeparatorEnum +{ + adLF = 10, + adCR = 13, + adCRLF = -1 +}; + +enum __declspec(uuid("0000057a-0000-0010-8000-00aa006d2ea4")) +StreamOpenOptionsEnum +{ + adOpenStreamUnspecified = -1, + adOpenStreamAsync = 1, + adOpenStreamFromRecord = 4 +}; + +enum __declspec(uuid("0000057b-0000-0010-8000-00aa006d2ea4")) +StreamWriteEnum +{ + adWriteChar = 0, + adWriteLine = 1, + stWriteChar = 0, + stWriteLine = 1 +}; + +enum __declspec(uuid("0000057c-0000-0010-8000-00aa006d2ea4")) +SaveOptionsEnum +{ + adSaveCreateNotExist = 1, + adSaveCreateOverWrite = 2 +}; + +enum FieldEnum +{ + adDefaultStream = -1, + adRecordURL = -2 +}; + +enum StreamReadEnum +{ + adReadAll = -1, + adReadLine = -2 +}; + +enum __declspec(uuid("0000057d-0000-0010-8000-00aa006d2ea4")) +RecordTypeEnum +{ + adSimpleRecord = 0, + adCollectionRecord = 1, + adStructDoc = 2 +}; + +struct __declspec(uuid("00000512-0000-0010-8000-00aa006d2ea4")) +_Collection : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetCount)) + long Count; + + // + // Wrapper methods for error-handling + // + + long GetCount ( ); + IUnknownPtr _NewEnum ( ); + HRESULT Refresh ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Count ( + /*[out,retval]*/ long * c ) = 0; + virtual HRESULT __stdcall raw__NewEnum ( + /*[out,retval]*/ IUnknown * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Refresh ( ) = 0; +}; + +struct __declspec(uuid("00000513-0000-0010-8000-00aa006d2ea4")) +_DynaCollection : _Collection +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + IDispatch * Object ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ IDispatch * Object ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00000503-0000-0010-8000-00aa006d2ea4")) +Property : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pval ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + long GetAttributes ( ); + void PutAttributes ( + long plAttributes ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pval ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttributes ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttributes ) = 0; +}; + +struct __declspec(uuid("00000504-0000-0010-8000-00aa006d2ea4")) +Properties : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + PropertyPtr Item[]; + + // + // Wrapper methods for error-handling + // + + PropertyPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Property * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000534-0000-0010-8000-00aa006d2ea4")) +_ADO : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetProperties)) + PropertiesPtr Properties; + + // + // Wrapper methods for error-handling + // + + PropertiesPtr GetProperties ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Properties ( + /*[out,retval]*/ struct Properties * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000500-0000-0010-8000-00aa006d2ea4")) +Error : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetDescription)) + _bstr_t Description; + __declspec(property(get=GetNumber)) + long Number; + __declspec(property(get=GetSource)) + _bstr_t Source; + __declspec(property(get=GetHelpFile)) + _bstr_t HelpFile; + __declspec(property(get=GetHelpContext)) + long HelpContext; + __declspec(property(get=GetSQLState)) + _bstr_t SQLState; + __declspec(property(get=GetNativeError)) + long NativeError; + + // + // Wrapper methods for error-handling + // + + long GetNumber ( ); + _bstr_t GetSource ( ); + _bstr_t GetDescription ( ); + _bstr_t GetHelpFile ( ); + long GetHelpContext ( ); + _bstr_t GetSQLState ( ); + long GetNativeError ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Number ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Description ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_HelpFile ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_HelpContext ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_SQLState ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_NativeError ( + /*[out,retval]*/ long * pl ) = 0; +}; + +struct __declspec(uuid("00000501-0000-0010-8000-00aa006d2ea4")) +Errors : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + ErrorPtr Item[]; + + // + // Wrapper methods for error-handling + // + + ErrorPtr GetItem ( + const _variant_t & Index ); + HRESULT Clear ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Error * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Clear ( ) = 0; +}; + +struct __declspec(uuid("0000154c-0000-0010-8000-00aa006d2ea4")) +Field20 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize,put=PutDefinedSize)) + long DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + long ActualSize; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetDataFormat,put=PutRefDataFormat)) + IUnknownPtr DataFormat; + + // + // Wrapper methods for error-handling + // + + long GetActualSize ( ); + long GetAttributes ( ); + long GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + IUnknownPtr GetDataFormat ( ); + void PutRefDataFormat ( + IUnknown * ppiDF ); + void PutPrecision ( + unsigned char pbPrecision ); + void PutNumericScale ( + unsigned char pbNumericScale ); + void PutType ( + enum DataTypeEnum pDataType ); + void PutDefinedSize ( + long pl ); + void PutAttributes ( + long pl ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_DataFormat ( + /*[out,retval]*/ IUnknown * * ppiDF ) = 0; + virtual HRESULT __stdcall putref_DataFormat ( + /*[in]*/ IUnknown * ppiDF ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbNumericScale ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum pDataType ) = 0; + virtual HRESULT __stdcall put_DefinedSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long pl ) = 0; +}; + +struct __declspec(uuid("00001569-0000-0010-8000-00aa006d2ea4")) +Field : Field20 +{ + // + // Property data + // + + __declspec(property(get=GetStatus)) + long Status; + + // + // Wrapper methods for error-handling + // + + long GetStatus ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pFStatus ) = 0; +}; + +struct __declspec(uuid("00001506-0000-0010-8000-00aa006d2ea4")) +Fields15 : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + FieldPtr Item[]; + + // + // Wrapper methods for error-handling + // + + FieldPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Field * * ppvObject ) = 0; +}; + +struct __declspec(uuid("0000154d-0000-0010-8000-00aa006d2ea4")) +Fields20 : Fields15 +{ + // + // Wrapper methods for error-handling + // + + HRESULT _Append ( + _bstr_t Name, + enum DataTypeEnum Type, + long DefinedSize, + enum FieldAttributeEnum Attrib ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw__Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ long DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00001564-0000-0010-8000-00aa006d2ea4")) +Fields : Fields20 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + _bstr_t Name, + enum DataTypeEnum Type, + long DefinedSize, + enum FieldAttributeEnum Attrib, + const _variant_t & FieldValue = vtMissing ); + HRESULT Update ( ); + HRESULT Resync ( + enum ResyncEnum ResyncValues ); + HRESULT CancelUpdate ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ long DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib, + /*[in]*/ VARIANT FieldValue = vtMissing ) = 0; + virtual HRESULT __stdcall raw_Update ( ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; +}; + +struct __declspec(uuid("0000150c-0000-0010-8000-00aa006d2ea4")) +_Parameter : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDirection,put=PutDirection)) + enum ParameterDirectionEnum Direction; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetSize,put=PutSize)) + long Size; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstr ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + enum DataTypeEnum GetType ( ); + void PutType ( + enum DataTypeEnum psDataType ); + void PutDirection ( + enum ParameterDirectionEnum plParmDirection ); + enum ParameterDirectionEnum GetDirection ( ); + void PutPrecision ( + unsigned char pbPrecision ); + unsigned char GetPrecision ( ); + void PutNumericScale ( + unsigned char pbScale ); + unsigned char GetNumericScale ( ); + void PutSize ( + long pl ); + long GetSize ( ); + HRESULT AppendChunk ( + const _variant_t & Val ); + long GetAttributes ( ); + void PutAttributes ( + long plParmAttribs ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * psDataType ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum psDataType ) = 0; + virtual HRESULT __stdcall put_Direction ( + /*[in]*/ enum ParameterDirectionEnum plParmDirection ) = 0; + virtual HRESULT __stdcall get_Direction ( + /*[out,retval]*/ enum ParameterDirectionEnum * plParmDirection ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbScale ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbScale ) = 0; + virtual HRESULT __stdcall put_Size ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Val ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plParmAttribs ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plParmAttribs ) = 0; +}; + +struct __declspec(uuid("0000150d-0000-0010-8000-00aa006d2ea4")) +Parameters : _DynaCollection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + _ParameterPtr Item[]; + + // + // Wrapper methods for error-handling + // + + _ParameterPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct _Parameter * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00001400-0000-0010-8000-00aa006d2ea4")) +ConnectionEvents : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); +}; + +struct __declspec(uuid("00001266-0000-0010-8000-00aa006d2ea4")) +RecordsetEvents : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); +}; + +struct __declspec(uuid("00000516-0000-0010-8000-00aa006d2ea4")) +ADOConnectionConstruction15 : IUnknown +{ + // + // Property data + // + + __declspec(property(get=GetDSO)) + IUnknownPtr DSO; + __declspec(property(get=GetSession)) + IUnknownPtr Session; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetDSO ( ); + IUnknownPtr GetSession ( ); + HRESULT WrapDSOandSession ( + IUnknown * pDSO, + IUnknown * pSession ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_DSO ( + /*[out,retval]*/ IUnknown * * ppDSO ) = 0; + virtual HRESULT __stdcall get_Session ( + /*[out,retval]*/ IUnknown * * ppSession ) = 0; + virtual HRESULT __stdcall raw_WrapDSOandSession ( + /*[in]*/ IUnknown * pDSO, + /*[in]*/ IUnknown * pSession ) = 0; +}; + +struct __declspec(uuid("00000551-0000-0010-8000-00aa006d2ea4")) +ADOConnectionConstruction : ADOConnectionConstruction15 +{}; + +struct __declspec(uuid("00000514-0000-0010-8000-00aa006d2ea4")) +Connection; + // [ default ] interface _Connection + // [ default, source ] dispinterface ConnectionEvents + +struct __declspec(uuid("00000560-0000-0010-8000-00aa006d2ea4")) +Record; + // [ default ] interface _Record + +struct __declspec(uuid("00001565-0000-0010-8000-00aa006d2ea4")) +_Stream : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetSize)) + long Size; + __declspec(property(get=GetEOS)) + VARIANT_BOOL EOS; + __declspec(property(get=GetPosition,put=PutPosition)) + long Position; + __declspec(property(get=GetType,put=PutType)) + enum StreamTypeEnum Type; + __declspec(property(get=GetLineSeparator,put=PutLineSeparator)) + enum LineSeparatorEnum LineSeparator; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetCharset,put=PutCharset)) + _bstr_t Charset; + + // + // Wrapper methods for error-handling + // + + long GetSize ( ); + VARIANT_BOOL GetEOS ( ); + long GetPosition ( ); + void PutPosition ( + long pPos ); + enum StreamTypeEnum GetType ( ); + void PutType ( + enum StreamTypeEnum ptype ); + enum LineSeparatorEnum GetLineSeparator ( ); + void PutLineSeparator ( + enum LineSeparatorEnum pLS ); + enum ObjectStateEnum GetState ( ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetCharset ( ); + void PutCharset ( + _bstr_t pbstrCharset ); + _variant_t Read ( + long NumBytes ); + HRESULT Open ( + const _variant_t & Source, + enum ConnectModeEnum Mode, + enum StreamOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + HRESULT SkipLine ( ); + HRESULT Write ( + const _variant_t & Buffer ); + HRESULT SetEOS ( ); + HRESULT CopyTo ( + struct _Stream * DestStream, + long CharNumber ); + HRESULT Flush ( ); + HRESULT SaveToFile ( + _bstr_t FileName, + enum SaveOptionsEnum Options ); + HRESULT LoadFromFile ( + _bstr_t FileName ); + _bstr_t ReadText ( + long NumChars ); + HRESULT WriteText ( + _bstr_t Data, + enum StreamWriteEnum Options ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ long * pSize ) = 0; + virtual HRESULT __stdcall get_EOS ( + /*[out,retval]*/ VARIANT_BOOL * pEOS ) = 0; + virtual HRESULT __stdcall get_Position ( + /*[out,retval]*/ long * pPos ) = 0; + virtual HRESULT __stdcall put_Position ( + /*[in]*/ long pPos ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum StreamTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum StreamTypeEnum ptype ) = 0; + virtual HRESULT __stdcall get_LineSeparator ( + /*[out,retval]*/ enum LineSeparatorEnum * pLS ) = 0; + virtual HRESULT __stdcall put_LineSeparator ( + /*[in]*/ enum LineSeparatorEnum pLS ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_Charset ( + /*[out,retval]*/ BSTR * pbstrCharset ) = 0; + virtual HRESULT __stdcall put_Charset ( + /*[in]*/ BSTR pbstrCharset ) = 0; + virtual HRESULT __stdcall raw_Read ( + /*[in]*/ long NumBytes, + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum StreamOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_SkipLine ( ) = 0; + virtual HRESULT __stdcall raw_Write ( + /*[in]*/ VARIANT Buffer ) = 0; + virtual HRESULT __stdcall raw_SetEOS ( ) = 0; + virtual HRESULT __stdcall raw_CopyTo ( + /*[in]*/ struct _Stream * DestStream, + /*[in]*/ long CharNumber ) = 0; + virtual HRESULT __stdcall raw_Flush ( ) = 0; + virtual HRESULT __stdcall raw_SaveToFile ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum SaveOptionsEnum Options ) = 0; + virtual HRESULT __stdcall raw_LoadFromFile ( + /*[in]*/ BSTR FileName ) = 0; + virtual HRESULT __stdcall raw_ReadText ( + /*[in]*/ long NumChars, + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_WriteText ( + /*[in]*/ BSTR Data, + /*[in]*/ enum StreamWriteEnum Options ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000566-0000-0010-8000-00aa006d2ea4")) +Stream; + // [ default ] interface _Stream + +struct __declspec(uuid("00000567-0000-0010-8000-00aa006d2ea4")) +ADORecordConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetRow,put=PutRow)) + IUnknownPtr Row; + __declspec(property(put=PutParentRow)) + IUnknownPtr ParentRow; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetRow ( ); + void PutRow ( + IUnknown * ppRow ); + void PutParentRow ( + IUnknown * _arg1 ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Row ( + /*[out,retval]*/ IUnknown * * ppRow ) = 0; + virtual HRESULT __stdcall put_Row ( + /*[in]*/ IUnknown * ppRow ) = 0; + virtual HRESULT __stdcall put_ParentRow ( + /*[in]*/ IUnknown * _arg1 ) = 0; +}; + +struct __declspec(uuid("00000568-0000-0010-8000-00aa006d2ea4")) +ADOStreamConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetStream,put=PutStream)) + IUnknownPtr Stream; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetStream ( ); + void PutStream ( + IUnknown * ppStm ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Stream ( + /*[out,retval]*/ IUnknown * * ppStm ) = 0; + virtual HRESULT __stdcall put_Stream ( + /*[in]*/ IUnknown * ppStm ) = 0; +}; + +struct __declspec(uuid("00000517-0000-0010-8000-00aa006d2ea4")) +ADOCommandConstruction : IUnknown +{ + // + // Property data + // + + __declspec(property(get=GetOLEDBCommand,put=PutOLEDBCommand)) + IUnknownPtr OLEDBCommand; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetOLEDBCommand ( ); + void PutOLEDBCommand ( + IUnknown * ppOLEDBCommand ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_OLEDBCommand ( + /*[out,retval]*/ IUnknown * * ppOLEDBCommand ) = 0; + virtual HRESULT __stdcall put_OLEDBCommand ( + /*[in]*/ IUnknown * ppOLEDBCommand ) = 0; +}; + +struct __declspec(uuid("00000507-0000-0010-8000-00aa006d2ea4")) +Command; + // [ default ] interface _Command + +struct __declspec(uuid("00000535-0000-0010-8000-00aa006d2ea4")) +Recordset; + // [ default ] interface _Recordset + // [ default, source ] dispinterface RecordsetEvents + +struct __declspec(uuid("00000283-0000-0010-8000-00aa006d2ea4")) +ADORecordsetConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetRowset,put=PutRowset)) + IUnknownPtr Rowset; + __declspec(property(get=GetChapter,put=PutChapter)) + ADO_LONGPTR Chapter; + __declspec(property(get=GetRowPosition,put=PutRowPosition)) + IUnknownPtr RowPosition; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetRowset ( ); + void PutRowset ( + IUnknown * ppRowset ); + ADO_LONGPTR GetChapter ( ); + void PutChapter ( + ADO_LONGPTR plChapter ); + IUnknownPtr GetRowPosition ( ); + void PutRowPosition ( + IUnknown * ppRowPos ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Rowset ( + /*[out,retval]*/ IUnknown * * ppRowset ) = 0; + virtual HRESULT __stdcall put_Rowset ( + /*[in]*/ IUnknown * ppRowset ) = 0; + virtual HRESULT __stdcall get_Chapter ( + /*[out,retval]*/ ADO_LONGPTR * plChapter ) = 0; + virtual HRESULT __stdcall put_Chapter ( + /*[in]*/ ADO_LONGPTR plChapter ) = 0; + virtual HRESULT __stdcall get_RowPosition ( + /*[out,retval]*/ IUnknown * * ppRowPos ) = 0; + virtual HRESULT __stdcall put_RowPosition ( + /*[in]*/ IUnknown * ppRowPos ) = 0; +}; + +struct __declspec(uuid("00001505-0000-0010-8000-00aa006d2ea4")) +Field15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize)) + long DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + long ActualSize; + __declspec(property(get=GetPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + long GetActualSize ( ); + long GetAttributes ( ); + long GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; +}; + +struct __declspec(uuid("0000050b-0000-0010-8000-00aa006d2ea4")) +Parameter; + // [ default ] interface _Parameter + +struct __declspec(uuid("0000054c-0000-0010-8000-00aa006d2ea4")) +Field20_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize,put=PutDefinedSize)) + ADO_LONGPTR DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + ADO_LONGPTR ActualSize; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetDataFormat,put=PutRefDataFormat)) + IUnknownPtr DataFormat; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetActualSize ( ); + long GetAttributes ( ); + ADO_LONGPTR GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + IUnknownPtr GetDataFormat ( ); + void PutRefDataFormat ( + IUnknown * ppiDF ); + void PutPrecision ( + unsigned char pbPrecision ); + void PutNumericScale ( + unsigned char pbNumericScale ); + void PutType ( + enum DataTypeEnum pDataType ); + void PutDefinedSize ( + ADO_LONGPTR pl ); + void PutAttributes ( + long pl ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_DataFormat ( + /*[out,retval]*/ IUnknown * * ppiDF ) = 0; + virtual HRESULT __stdcall putref_DataFormat ( + /*[in]*/ IUnknown * ppiDF ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbNumericScale ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum pDataType ) = 0; + virtual HRESULT __stdcall put_DefinedSize ( + /*[in]*/ ADO_LONGPTR pl ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long pl ) = 0; +}; + +struct __declspec(uuid("00000569-0000-0010-8000-00aa006d2ea4")) +Field_Deprecated : Field20_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetStatus)) + long Status; + + // + // Wrapper methods for error-handling + // + + long GetStatus ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pFStatus ) = 0; +}; + +struct __declspec(uuid("00000506-0000-0010-8000-00aa006d2ea4")) +Fields15_Deprecated : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + Field_DeprecatedPtr Item[]; + + // + // Wrapper methods for error-handling + // + + Field_DeprecatedPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Field_Deprecated * * ppvObject ) = 0; +}; + +struct __declspec(uuid("0000054d-0000-0010-8000-00aa006d2ea4")) +Fields20_Deprecated : Fields15_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT _Append ( + _bstr_t Name, + enum DataTypeEnum Type, + ADO_LONGPTR DefinedSize, + enum FieldAttributeEnum Attrib ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw__Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ ADO_LONGPTR DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00000564-0000-0010-8000-00aa006d2ea4")) +Fields_Deprecated : Fields20_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + _bstr_t Name, + enum DataTypeEnum Type, + ADO_LONGPTR DefinedSize, + enum FieldAttributeEnum Attrib, + const _variant_t & FieldValue = vtMissing ); + HRESULT Update ( ); + HRESULT Resync ( + enum ResyncEnum ResyncValues ); + HRESULT CancelUpdate ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ ADO_LONGPTR DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib, + /*[in]*/ VARIANT FieldValue = vtMissing ) = 0; + virtual HRESULT __stdcall raw_Update ( ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; +}; + +struct __declspec(uuid("0000050c-0000-0010-8000-00aa006d2ea4")) +_Parameter_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDirection,put=PutDirection)) + enum ParameterDirectionEnum Direction; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetSize,put=PutSize)) + ADO_LONGPTR Size; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstr ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + enum DataTypeEnum GetType ( ); + void PutType ( + enum DataTypeEnum psDataType ); + void PutDirection ( + enum ParameterDirectionEnum plParmDirection ); + enum ParameterDirectionEnum GetDirection ( ); + void PutPrecision ( + unsigned char pbPrecision ); + unsigned char GetPrecision ( ); + void PutNumericScale ( + unsigned char pbScale ); + unsigned char GetNumericScale ( ); + void PutSize ( + ADO_LONGPTR pl ); + ADO_LONGPTR GetSize ( ); + HRESULT AppendChunk ( + const _variant_t & Val ); + long GetAttributes ( ); + void PutAttributes ( + long plParmAttribs ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * psDataType ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum psDataType ) = 0; + virtual HRESULT __stdcall put_Direction ( + /*[in]*/ enum ParameterDirectionEnum plParmDirection ) = 0; + virtual HRESULT __stdcall get_Direction ( + /*[out,retval]*/ enum ParameterDirectionEnum * plParmDirection ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbScale ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbScale ) = 0; + virtual HRESULT __stdcall put_Size ( + /*[in]*/ ADO_LONGPTR pl ) = 0; + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Val ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plParmAttribs ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plParmAttribs ) = 0; +}; + +struct __declspec(uuid("0000050d-0000-0010-8000-00aa006d2ea4")) +Parameters_Deprecated : _DynaCollection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + _Parameter_DeprecatedPtr Item[]; + + // + // Wrapper methods for error-handling + // + + _Parameter_DeprecatedPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct _Parameter_Deprecated * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000400-0000-0010-8000-00aa006d2ea4")) +ConnectionEvents_Deprecated : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); +}; + +struct __declspec(uuid("00000266-0000-0010-8000-00aa006d2ea4")) +RecordsetEvents_Deprecated : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); +}; + +struct __declspec(uuid("00000565-0000-0010-8000-00aa006d2ea4")) +_Stream_Deprecated : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetSize)) + ADO_LONGPTR Size; + __declspec(property(get=GetEOS)) + VARIANT_BOOL EOS; + __declspec(property(get=GetPosition,put=PutPosition)) + ADO_LONGPTR Position; + __declspec(property(get=GetType,put=PutType)) + enum StreamTypeEnum Type; + __declspec(property(get=GetLineSeparator,put=PutLineSeparator)) + enum LineSeparatorEnum LineSeparator; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetCharset,put=PutCharset)) + _bstr_t Charset; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetSize ( ); + VARIANT_BOOL GetEOS ( ); + ADO_LONGPTR GetPosition ( ); + void PutPosition ( + ADO_LONGPTR pPos ); + enum StreamTypeEnum GetType ( ); + void PutType ( + enum StreamTypeEnum ptype ); + enum LineSeparatorEnum GetLineSeparator ( ); + void PutLineSeparator ( + enum LineSeparatorEnum pLS ); + enum ObjectStateEnum GetState ( ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetCharset ( ); + void PutCharset ( + _bstr_t pbstrCharset ); + _variant_t Read ( + long NumBytes ); + HRESULT Open ( + const _variant_t & Source, + enum ConnectModeEnum Mode, + enum StreamOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + HRESULT SkipLine ( ); + HRESULT Write ( + const _variant_t & Buffer ); + HRESULT SetEOS ( ); + HRESULT CopyTo ( + struct _Stream_Deprecated * DestStream, + ADO_LONGPTR CharNumber ); + HRESULT Flush ( ); + HRESULT SaveToFile ( + _bstr_t FileName, + enum SaveOptionsEnum Options ); + HRESULT LoadFromFile ( + _bstr_t FileName ); + _bstr_t ReadText ( + long NumChars ); + HRESULT WriteText ( + _bstr_t Data, + enum StreamWriteEnum Options ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ ADO_LONGPTR * pSize ) = 0; + virtual HRESULT __stdcall get_EOS ( + /*[out,retval]*/ VARIANT_BOOL * pEOS ) = 0; + virtual HRESULT __stdcall get_Position ( + /*[out,retval]*/ ADO_LONGPTR * pPos ) = 0; + virtual HRESULT __stdcall put_Position ( + /*[in]*/ ADO_LONGPTR pPos ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum StreamTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum StreamTypeEnum ptype ) = 0; + virtual HRESULT __stdcall get_LineSeparator ( + /*[out,retval]*/ enum LineSeparatorEnum * pLS ) = 0; + virtual HRESULT __stdcall put_LineSeparator ( + /*[in]*/ enum LineSeparatorEnum pLS ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_Charset ( + /*[out,retval]*/ BSTR * pbstrCharset ) = 0; + virtual HRESULT __stdcall put_Charset ( + /*[in]*/ BSTR pbstrCharset ) = 0; + virtual HRESULT __stdcall raw_Read ( + /*[in]*/ long NumBytes, + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum StreamOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_SkipLine ( ) = 0; + virtual HRESULT __stdcall raw_Write ( + /*[in]*/ VARIANT Buffer ) = 0; + virtual HRESULT __stdcall raw_SetEOS ( ) = 0; + virtual HRESULT __stdcall raw_CopyTo ( + /*[in]*/ struct _Stream_Deprecated * DestStream, + /*[in]*/ ADO_LONGPTR CharNumber ) = 0; + virtual HRESULT __stdcall raw_Flush ( ) = 0; + virtual HRESULT __stdcall raw_SaveToFile ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum SaveOptionsEnum Options ) = 0; + virtual HRESULT __stdcall raw_LoadFromFile ( + /*[in]*/ BSTR FileName ) = 0; + virtual HRESULT __stdcall raw_ReadText ( + /*[in]*/ long NumChars, + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_WriteText ( + /*[in]*/ BSTR Data, + /*[in]*/ enum StreamWriteEnum Options ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000505-0000-0010-8000-00aa006d2ea4")) +Field15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize)) + ADO_LONGPTR DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + ADO_LONGPTR ActualSize; + __declspec(property(get=GetPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetActualSize ( ); + long GetAttributes ( ); + ADO_LONGPTR GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; +}; + +struct __declspec(uuid("00001508-0000-0010-8000-00aa006d2ea4")) +Command15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetParameters)) + ParametersPtr Parameters; + __declspec(property(get=GetActiveConnection,put=PutRefActiveConnection)) + _ConnectionPtr ActiveConnection; + __declspec(property(get=GetCommandText,put=PutCommandText)) + _bstr_t CommandText; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetPrepared,put=PutPrepared)) + VARIANT_BOOL Prepared; + __declspec(property(get=GetCommandType,put=PutCommandType)) + enum CommandTypeEnum CommandType; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + + // + // Wrapper methods for error-handling + // + + _ConnectionPtr GetActiveConnection ( ); + void PutRefActiveConnection ( + struct _Connection * ppvObject ); + void PutActiveConnection ( + const _variant_t & ppvObject ); + _bstr_t GetCommandText ( ); + void PutCommandText ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long pl ); + VARIANT_BOOL GetPrepared ( ); + void PutPrepared ( + VARIANT_BOOL pfPrepared ); + _RecordsetPtr Execute ( + VARIANT * RecordsAffected, + VARIANT * Parameters, + long Options ); + _ParameterPtr CreateParameter ( + _bstr_t Name, + enum DataTypeEnum Type, + enum ParameterDirectionEnum Direction, + long Size, + const _variant_t & Value = vtMissing ); + ParametersPtr GetParameters ( ); + void PutCommandType ( + enum CommandTypeEnum plCmdType ); + enum CommandTypeEnum GetCommandType ( ); + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstrName ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ struct _Connection * * ppvObject ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection * ppvObject ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT ppvObject ) = 0; + virtual HRESULT __stdcall get_CommandText ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_CommandText ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Prepared ( + /*[out,retval]*/ VARIANT_BOOL * pfPrepared ) = 0; + virtual HRESULT __stdcall put_Prepared ( + /*[in]*/ VARIANT_BOOL pfPrepared ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ VARIANT * Parameters, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_CreateParameter ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ enum ParameterDirectionEnum Direction, + /*[in]*/ long Size, + /*[in]*/ VARIANT Value, + /*[out,retval]*/ struct _Parameter * * ppiprm ) = 0; + virtual HRESULT __stdcall get_Parameters ( + /*[out,retval]*/ struct Parameters * * ppvObject ) = 0; + virtual HRESULT __stdcall put_CommandType ( + /*[in]*/ enum CommandTypeEnum plCmdType ) = 0; + virtual HRESULT __stdcall get_CommandType ( + /*[out,retval]*/ enum CommandTypeEnum * plCmdType ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstrName ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstrName ) = 0; +}; + +struct __declspec(uuid("0000154e-0000-0010-8000-00aa006d2ea4")) +Command25 : Command15 +{ + // + // Property data + // + + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + long GetState ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("986761e8-7269-4890-aa65-ad7c03697a6d")) +_Command : Command25 +{ + // + // Property data + // + + __declspec(property(get=GetDialect,put=PutDialect)) + _bstr_t Dialect; + __declspec(property(get=GetNamedParameters,put=PutNamedParameters)) + VARIANT_BOOL NamedParameters; + + // + // Wrapper methods for error-handling + // + + void PutRefCommandStream ( + IUnknown * pvStream ); + _variant_t GetCommandStream ( ); + void PutDialect ( + _bstr_t pbstrDialect ); + _bstr_t GetDialect ( ); + void PutNamedParameters ( + VARIANT_BOOL pfNamedParameters ); + VARIANT_BOOL GetNamedParameters ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall putref_CommandStream ( + /*[in]*/ IUnknown * pvStream ) = 0; + virtual HRESULT __stdcall get_CommandStream ( + /*[out,retval]*/ VARIANT * pvStream ) = 0; + virtual HRESULT __stdcall put_Dialect ( + /*[in]*/ BSTR pbstrDialect ) = 0; + virtual HRESULT __stdcall get_Dialect ( + /*[out,retval]*/ BSTR * pbstrDialect ) = 0; + virtual HRESULT __stdcall put_NamedParameters ( + /*[in]*/ VARIANT_BOOL pfNamedParameters ) = 0; + virtual HRESULT __stdcall get_NamedParameters ( + /*[out,retval]*/ VARIANT_BOOL * pfNamedParameters ) = 0; +}; + +struct __declspec(uuid("00001515-0000-0010-8000-00aa006d2ea4")) +Connection15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetConnectionString,put=PutConnectionString)) + _bstr_t ConnectionString; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetConnectionTimeout,put=PutConnectionTimeout)) + long ConnectionTimeout; + __declspec(property(get=GetVersion)) + _bstr_t Version; + __declspec(property(get=GetErrors)) + ErrorsPtr Errors; + __declspec(property(get=GetDefaultDatabase,put=PutDefaultDatabase)) + _bstr_t DefaultDatabase; + __declspec(property(get=GetIsolationLevel,put=PutIsolationLevel)) + enum IsolationLevelEnum IsolationLevel; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetProvider,put=PutProvider)) + _bstr_t Provider; + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetConnectionString ( ); + void PutConnectionString ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long plTimeout ); + long GetConnectionTimeout ( ); + void PutConnectionTimeout ( + long plTimeout ); + _bstr_t GetVersion ( ); + HRESULT Close ( ); + _RecordsetPtr Execute ( + _bstr_t CommandText, + VARIANT * RecordsAffected, + long Options ); + long BeginTrans ( ); + HRESULT CommitTrans ( ); + HRESULT RollbackTrans ( ); + HRESULT Open ( + _bstr_t ConnectionString, + _bstr_t UserID, + _bstr_t Password, + long Options ); + ErrorsPtr GetErrors ( ); + _bstr_t GetDefaultDatabase ( ); + void PutDefaultDatabase ( + _bstr_t pbstr ); + enum IsolationLevelEnum GetIsolationLevel ( ); + void PutIsolationLevel ( + enum IsolationLevelEnum Level ); + long GetAttributes ( ); + void PutAttributes ( + long plAttr ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum plMode ); + _bstr_t GetProvider ( ); + void PutProvider ( + _bstr_t pbstr ); + long GetState ( ); + _RecordsetPtr OpenSchema ( + enum SchemaEnum Schema, + const _variant_t & Restrictions = vtMissing, + const _variant_t & SchemaID = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ConnectionString ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_ConnectionString ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_ConnectionTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_ConnectionTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_Version ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[in]*/ BSTR CommandText, + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset * * ppiRset ) = 0; + virtual HRESULT __stdcall raw_BeginTrans ( + /*[out,retval]*/ long * TransactionLevel ) = 0; + virtual HRESULT __stdcall raw_CommitTrans ( ) = 0; + virtual HRESULT __stdcall raw_RollbackTrans ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ BSTR ConnectionString, + /*[in]*/ BSTR UserID, + /*[in]*/ BSTR Password, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall get_Errors ( + /*[out,retval]*/ struct Errors * * ppvObject ) = 0; + virtual HRESULT __stdcall get_DefaultDatabase ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_DefaultDatabase ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_IsolationLevel ( + /*[out,retval]*/ enum IsolationLevelEnum * Level ) = 0; + virtual HRESULT __stdcall put_IsolationLevel ( + /*[in]*/ enum IsolationLevelEnum Level ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttr ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttr ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * plMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum plMode ) = 0; + virtual HRESULT __stdcall get_Provider ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Provider ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_OpenSchema ( + /*[in]*/ enum SchemaEnum Schema, + /*[in]*/ VARIANT Restrictions, + /*[in]*/ VARIANT SchemaID, + /*[out,retval]*/ struct _Recordset * * pprset ) = 0; +}; + +struct __declspec(uuid("00001550-0000-0010-8000-00aa006d2ea4")) +_Connection : Connection15 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("0000150e-0000-0010-8000-00aa006d2ea4")) +Recordset15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + FieldsPtr Fields; + __declspec(property(get=GetPageSize,put=PutPageSize)) + long PageSize; + __declspec(property(get=GetPageCount)) + long PageCount; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetState)) + long State; + __declspec(property(get=GetMarshalOptions,put=PutMarshalOptions)) + enum MarshalOptionsEnum MarshalOptions; + __declspec(property(get=GetCollect,put=PutCollect)) + _variant_t Collect[]; + __declspec(property(get=GetEditMode)) + enum EditModeEnum EditMode; + __declspec(property(get=GetStatus)) + long Status; + __declspec(property(get=GetFilter,put=PutFilter)) + _variant_t Filter; + __declspec(property(get=GetSort,put=PutSort)) + _bstr_t Sort; + __declspec(property(get=GetAbsolutePosition,put=PutAbsolutePosition)) + enum PositionEnum AbsolutePosition; + __declspec(property(get=GetBOF)) + VARIANT_BOOL BOF; + __declspec(property(get=GetBookmark,put=PutBookmark)) + _variant_t Bookmark; + __declspec(property(get=GetCacheSize,put=PutCacheSize)) + long CacheSize; + __declspec(property(get=GetCursorType,put=PutCursorType)) + enum CursorTypeEnum CursorType; + __declspec(property(get=GetadoEOF)) + VARIANT_BOOL adoEOF; + __declspec(property(get=GetAbsolutePage,put=PutAbsolutePage)) + enum PositionEnum AbsolutePage; + __declspec(property(get=GetLockType,put=PutLockType)) + enum LockTypeEnum LockType; + __declspec(property(get=GetMaxRecords,put=PutMaxRecords)) + long MaxRecords; + __declspec(property(get=GetRecordCount)) + long RecordCount; + + // + // Wrapper methods for error-handling + // + + enum PositionEnum GetAbsolutePosition ( ); + void PutAbsolutePosition ( + enum PositionEnum pl ); + void PutRefActiveConnection ( + IDispatch * pvar ); + void PutActiveConnection ( + const _variant_t & pvar ); + _variant_t GetActiveConnection ( ); + VARIANT_BOOL GetBOF ( ); + _variant_t GetBookmark ( ); + void PutBookmark ( + const _variant_t & pvBookmark ); + long GetCacheSize ( ); + void PutCacheSize ( + long pl ); + enum CursorTypeEnum GetCursorType ( ); + void PutCursorType ( + enum CursorTypeEnum plCursorType ); + VARIANT_BOOL GetadoEOF ( ); + FieldsPtr GetFields ( ); + enum LockTypeEnum GetLockType ( ); + void PutLockType ( + enum LockTypeEnum plLockType ); + long GetMaxRecords ( ); + void PutMaxRecords ( + long plMaxRecords ); + long GetRecordCount ( ); + void PutRefSource ( + IDispatch * pvSource ); + void PutSource ( + _bstr_t pvSource ); + _variant_t GetSource ( ); + HRESULT AddNew ( + const _variant_t & FieldList = vtMissing, + const _variant_t & Values = vtMissing ); + HRESULT CancelUpdate ( ); + HRESULT Close ( ); + HRESULT Delete ( + enum AffectEnum AffectRecords ); + _variant_t GetRows ( + long Rows, + const _variant_t & Start = vtMissing, + const _variant_t & Fields = vtMissing ); + HRESULT Move ( + long NumRecords, + const _variant_t & Start = vtMissing ); + HRESULT MoveNext ( ); + HRESULT MovePrevious ( ); + HRESULT MoveFirst ( ); + HRESULT MoveLast ( ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum CursorTypeEnum CursorType, + enum LockTypeEnum LockType, + long Options ); + HRESULT Requery ( + long Options ); + HRESULT _xResync ( + enum AffectEnum AffectRecords ); + HRESULT Update ( + const _variant_t & Fields = vtMissing, + const _variant_t & Values = vtMissing ); + enum PositionEnum GetAbsolutePage ( ); + void PutAbsolutePage ( + enum PositionEnum pl ); + enum EditModeEnum GetEditMode ( ); + _variant_t GetFilter ( ); + void PutFilter ( + const _variant_t & Criteria ); + long GetPageCount ( ); + long GetPageSize ( ); + void PutPageSize ( + long pl ); + _bstr_t GetSort ( ); + void PutSort ( + _bstr_t Criteria ); + long GetStatus ( ); + long GetState ( ); + _RecordsetPtr _xClone ( ); + HRESULT UpdateBatch ( + enum AffectEnum AffectRecords ); + HRESULT CancelBatch ( + enum AffectEnum AffectRecords ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + _RecordsetPtr NextRecordset ( + VARIANT * RecordsAffected ); + VARIANT_BOOL Supports ( + enum CursorOptionEnum CursorOptions ); + _variant_t GetCollect ( + const _variant_t & Index ); + void PutCollect ( + const _variant_t & Index, + const _variant_t & pvar ); + enum MarshalOptionsEnum GetMarshalOptions ( ); + void PutMarshalOptions ( + enum MarshalOptionsEnum peMarshal ); + HRESULT Find ( + _bstr_t Criteria, + long SkipRecords, + enum SearchDirectionEnum SearchDirection, + const _variant_t & Start = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_AbsolutePosition ( + /*[out,retval]*/ enum PositionEnum * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePosition ( + /*[in]*/ enum PositionEnum pl ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_BOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Bookmark ( + /*[out,retval]*/ VARIANT * pvBookmark ) = 0; + virtual HRESULT __stdcall put_Bookmark ( + /*[in]*/ VARIANT pvBookmark ) = 0; + virtual HRESULT __stdcall get_CacheSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CacheSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_CursorType ( + /*[out,retval]*/ enum CursorTypeEnum * plCursorType ) = 0; + virtual HRESULT __stdcall put_CursorType ( + /*[in]*/ enum CursorTypeEnum plCursorType ) = 0; + virtual HRESULT __stdcall get_adoEOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields * * ppvObject ) = 0; + virtual HRESULT __stdcall get_LockType ( + /*[out,retval]*/ enum LockTypeEnum * plLockType ) = 0; + virtual HRESULT __stdcall put_LockType ( + /*[in]*/ enum LockTypeEnum plLockType ) = 0; + virtual HRESULT __stdcall get_MaxRecords ( + /*[out,retval]*/ long * plMaxRecords ) = 0; + virtual HRESULT __stdcall put_MaxRecords ( + /*[in]*/ long plMaxRecords ) = 0; + virtual HRESULT __stdcall get_RecordCount ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvSource ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvSource ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvSource ) = 0; + virtual HRESULT __stdcall raw_AddNew ( + /*[in]*/ VARIANT FieldList = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_GetRows ( + /*[in]*/ long Rows, + /*[in]*/ VARIANT Start, + /*[in]*/ VARIANT Fields, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall raw_Move ( + /*[in]*/ long NumRecords, + /*[in]*/ VARIANT Start = vtMissing ) = 0; + virtual HRESULT __stdcall raw_MoveNext ( ) = 0; + virtual HRESULT __stdcall raw_MovePrevious ( ) = 0; + virtual HRESULT __stdcall raw_MoveFirst ( ) = 0; + virtual HRESULT __stdcall raw_MoveLast ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum CursorTypeEnum CursorType, + /*[in]*/ enum LockTypeEnum LockType, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw_Requery ( + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw__xResync ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_Update ( + /*[in]*/ VARIANT Fields = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall get_AbsolutePage ( + /*[out,retval]*/ enum PositionEnum * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePage ( + /*[in]*/ enum PositionEnum pl ) = 0; + virtual HRESULT __stdcall get_EditMode ( + /*[out,retval]*/ enum EditModeEnum * pl ) = 0; + virtual HRESULT __stdcall get_Filter ( + /*[out,retval]*/ VARIANT * Criteria ) = 0; + virtual HRESULT __stdcall put_Filter ( + /*[in]*/ VARIANT Criteria ) = 0; + virtual HRESULT __stdcall get_PageCount ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_PageSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_PageSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Sort ( + /*[out,retval]*/ BSTR * Criteria ) = 0; + virtual HRESULT __stdcall put_Sort ( + /*[in]*/ BSTR Criteria ) = 0; + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw__xClone ( + /*[out,retval]*/ struct _Recordset * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_UpdateBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_CancelBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall raw_NextRecordset ( + /*[out]*/ VARIANT * RecordsAffected, + /*[out,retval]*/ struct _Recordset * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_Supports ( + /*[in]*/ enum CursorOptionEnum CursorOptions, + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Collect ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Collect ( + /*[in]*/ VARIANT Index, + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_MarshalOptions ( + /*[out,retval]*/ enum MarshalOptionsEnum * peMarshal ) = 0; + virtual HRESULT __stdcall put_MarshalOptions ( + /*[in]*/ enum MarshalOptionsEnum peMarshal ) = 0; + virtual HRESULT __stdcall raw_Find ( + /*[in]*/ BSTR Criteria, + /*[in]*/ long SkipRecords, + /*[in]*/ enum SearchDirectionEnum SearchDirection, + /*[in]*/ VARIANT Start = vtMissing ) = 0; +}; + +struct __declspec(uuid("0000154f-0000-0010-8000-00aa006d2ea4")) +Recordset20 : Recordset15 +{ + // + // Property data + // + + __declspec(property(get=GetDataSource,put=PutRefDataSource)) + IUnknownPtr DataSource; + __declspec(property(get=GetActiveCommand)) + IDispatchPtr ActiveCommand; + __declspec(property(get=GetStayInSync,put=PutStayInSync)) + VARIANT_BOOL StayInSync; + __declspec(property(get=GetDataMember,put=PutDataMember)) + _bstr_t DataMember; + + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + IUnknownPtr GetDataSource ( ); + void PutRefDataSource ( + IUnknown * ppunkDataSource ); + HRESULT _xSave ( + _bstr_t FileName, + enum PersistFormatEnum PersistFormat ); + IDispatchPtr GetActiveCommand ( ); + void PutStayInSync ( + VARIANT_BOOL pbStayInSync ); + VARIANT_BOOL GetStayInSync ( ); + _bstr_t GetString ( + enum StringFormatEnum StringFormat, + long NumRows, + _bstr_t ColumnDelimeter, + _bstr_t RowDelimeter, + _bstr_t NullExpr ); + _bstr_t GetDataMember ( ); + void PutDataMember ( + _bstr_t pbstrDataMember ); + enum CompareEnum CompareBookmarks ( + const _variant_t & Bookmark1, + const _variant_t & Bookmark2 ); + _RecordsetPtr Clone ( + enum LockTypeEnum LockType ); + HRESULT Resync ( + enum AffectEnum AffectRecords, + enum ResyncEnum ResyncValues ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; + virtual HRESULT __stdcall get_DataSource ( + /*[out,retval]*/ IUnknown * * ppunkDataSource ) = 0; + virtual HRESULT __stdcall putref_DataSource ( + /*[in]*/ IUnknown * ppunkDataSource ) = 0; + virtual HRESULT __stdcall raw__xSave ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; + virtual HRESULT __stdcall get_ActiveCommand ( + /*[out,retval]*/ IDispatch * * ppCmd ) = 0; + virtual HRESULT __stdcall put_StayInSync ( + /*[in]*/ VARIANT_BOOL pbStayInSync ) = 0; + virtual HRESULT __stdcall get_StayInSync ( + /*[out,retval]*/ VARIANT_BOOL * pbStayInSync ) = 0; + virtual HRESULT __stdcall raw_GetString ( + /*[in]*/ enum StringFormatEnum StringFormat, + /*[in]*/ long NumRows, + /*[in]*/ BSTR ColumnDelimeter, + /*[in]*/ BSTR RowDelimeter, + /*[in]*/ BSTR NullExpr, + /*[out,retval]*/ BSTR * pRetString ) = 0; + virtual HRESULT __stdcall get_DataMember ( + /*[out,retval]*/ BSTR * pbstrDataMember ) = 0; + virtual HRESULT __stdcall put_DataMember ( + /*[in]*/ BSTR pbstrDataMember ) = 0; + virtual HRESULT __stdcall raw_CompareBookmarks ( + /*[in]*/ VARIANT Bookmark1, + /*[in]*/ VARIANT Bookmark2, + /*[out,retval]*/ enum CompareEnum * pCompare ) = 0; + virtual HRESULT __stdcall raw_Clone ( + /*[in]*/ enum LockTypeEnum LockType, + /*[out,retval]*/ struct _Recordset * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum AffectEnum AffectRecords, + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; +}; + +struct __declspec(uuid("00001555-0000-0010-8000-00aa006d2ea4")) +Recordset21 : Recordset20 +{ + // + // Property data + // + + __declspec(property(get=GetIndex,put=PutIndex)) + _bstr_t Index; + + // + // Wrapper methods for error-handling + // + + HRESULT Seek ( + const _variant_t & KeyValues, + enum SeekEnum SeekOption ); + void PutIndex ( + _bstr_t pbstrIndex ); + _bstr_t GetIndex ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Seek ( + /*[in]*/ VARIANT KeyValues, + /*[in]*/ enum SeekEnum SeekOption ) = 0; + virtual HRESULT __stdcall put_Index ( + /*[in]*/ BSTR pbstrIndex ) = 0; + virtual HRESULT __stdcall get_Index ( + /*[out,retval]*/ BSTR * pbstrIndex ) = 0; +}; + +struct __declspec(uuid("00001556-0000-0010-8000-00aa006d2ea4")) +_Recordset : Recordset21 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Save ( + const _variant_t & Destination, + enum PersistFormatEnum PersistFormat ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Save ( + /*[in]*/ VARIANT Destination, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; +}; + +struct __declspec(uuid("00001402-0000-0010-8000-00aa006d2ea4")) +ConnectionEventsVt : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_InfoMessage ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_BeginTransComplete ( + /*[in]*/ long TransactionLevel, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_CommitTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_RollbackTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillExecute ( + /*[in,out]*/ BSTR * Source, + /*[in,out]*/ enum CursorTypeEnum * CursorType, + /*[in,out]*/ enum LockTypeEnum * LockType, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command * pCommand, + /*[in]*/ struct _Recordset * pRecordset, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_ExecuteComplete ( + /*[in]*/ long RecordsAffected, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command * pCommand, + /*[in]*/ struct _Recordset * pRecordset, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillConnect ( + /*[in,out]*/ BSTR * ConnectionString, + /*[in,out]*/ BSTR * UserID, + /*[in,out]*/ BSTR * Password, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_ConnectComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_Disconnect ( + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; +}; + +struct __declspec(uuid("00001403-0000-0010-8000-00aa006d2ea4")) +RecordsetEventsVt : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_WillChangeField ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FieldChangeComplete ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecord ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecordset ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordsetChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillMove ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_MoveComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_EndOfRecordset ( + /*[in,out]*/ VARIANT_BOOL * fMoreData, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchProgress ( + /*[in]*/ long Progress, + /*[in]*/ long MaxProgress, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; +}; + +struct __declspec(uuid("00001562-0000-0010-8000-00aa006d2ea4")) +_Record : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + FieldsPtr Fields; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetParentURL)) + _bstr_t ParentURL; + __declspec(property(get=GetRecordType)) + enum RecordTypeEnum RecordType; + + // + // Wrapper methods for error-handling + // + + _variant_t GetActiveConnection ( ); + void PutActiveConnection ( + _bstr_t pvar ); + void PutRefActiveConnection ( + struct _Connection * pvar ); + enum ObjectStateEnum GetState ( ); + _variant_t GetSource ( ); + void PutSource ( + _bstr_t pvar ); + void PutRefSource ( + IDispatch * pvar ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetParentURL ( ); + _bstr_t MoveRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum MoveRecordOptionsEnum Options, + VARIANT_BOOL Async ); + _bstr_t CopyRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum CopyRecordOptionsEnum Options, + VARIANT_BOOL Async ); + HRESULT DeleteRecord ( + _bstr_t Source, + VARIANT_BOOL Async ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum ConnectModeEnum Mode, + enum RecordCreateOptionsEnum CreateOptions, + enum RecordOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + FieldsPtr GetFields ( ); + enum RecordTypeEnum GetRecordType ( ); + _RecordsetPtr GetChildren ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection * pvar ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_ParentURL ( + /*[out,retval]*/ BSTR * pbstrParentURL ) = 0; + virtual HRESULT __stdcall raw_MoveRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum MoveRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_CopyRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum CopyRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_DeleteRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ VARIANT_BOOL Async ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum RecordCreateOptionsEnum CreateOptions, + /*[in]*/ enum RecordOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields * * ppFlds ) = 0; + virtual HRESULT __stdcall get_RecordType ( + /*[out,retval]*/ enum RecordTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall raw_GetChildren ( + /*[out,retval]*/ struct _Recordset * * pprset ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000402-0000-0010-8000-00aa006d2ea4")) +ConnectionEventsVt_Deprecated : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_InfoMessage ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_BeginTransComplete ( + /*[in]*/ long TransactionLevel, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_CommitTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_RollbackTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillExecute ( + /*[in,out]*/ BSTR * Source, + /*[in,out]*/ enum CursorTypeEnum * CursorType, + /*[in,out]*/ enum LockTypeEnum * LockType, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command_Deprecated * pCommand, + /*[in]*/ struct _Recordset_Deprecated * pRecordset, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_ExecuteComplete ( + /*[in]*/ long RecordsAffected, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command_Deprecated * pCommand, + /*[in]*/ struct _Recordset_Deprecated * pRecordset, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillConnect ( + /*[in,out]*/ BSTR * ConnectionString, + /*[in,out]*/ BSTR * UserID, + /*[in,out]*/ BSTR * Password, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_ConnectComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_Disconnect ( + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; +}; + +struct __declspec(uuid("00000515-0000-0010-8000-00aa006d2ea4")) +Connection15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetConnectionString,put=PutConnectionString)) + _bstr_t ConnectionString; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetConnectionTimeout,put=PutConnectionTimeout)) + long ConnectionTimeout; + __declspec(property(get=GetVersion)) + _bstr_t Version; + __declspec(property(get=GetErrors)) + ErrorsPtr Errors; + __declspec(property(get=GetDefaultDatabase,put=PutDefaultDatabase)) + _bstr_t DefaultDatabase; + __declspec(property(get=GetIsolationLevel,put=PutIsolationLevel)) + enum IsolationLevelEnum IsolationLevel; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetProvider,put=PutProvider)) + _bstr_t Provider; + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetConnectionString ( ); + void PutConnectionString ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long plTimeout ); + long GetConnectionTimeout ( ); + void PutConnectionTimeout ( + long plTimeout ); + _bstr_t GetVersion ( ); + HRESULT Close ( ); + _Recordset_DeprecatedPtr Execute ( + _bstr_t CommandText, + VARIANT * RecordsAffected, + long Options ); + long BeginTrans ( ); + HRESULT CommitTrans ( ); + HRESULT RollbackTrans ( ); + HRESULT Open ( + _bstr_t ConnectionString, + _bstr_t UserID, + _bstr_t Password, + long Options ); + ErrorsPtr GetErrors ( ); + _bstr_t GetDefaultDatabase ( ); + void PutDefaultDatabase ( + _bstr_t pbstr ); + enum IsolationLevelEnum GetIsolationLevel ( ); + void PutIsolationLevel ( + enum IsolationLevelEnum Level ); + long GetAttributes ( ); + void PutAttributes ( + long plAttr ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum plMode ); + _bstr_t GetProvider ( ); + void PutProvider ( + _bstr_t pbstr ); + long GetState ( ); + _Recordset_DeprecatedPtr OpenSchema ( + enum SchemaEnum Schema, + const _variant_t & Restrictions = vtMissing, + const _variant_t & SchemaID = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ConnectionString ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_ConnectionString ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_ConnectionTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_ConnectionTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_Version ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[in]*/ BSTR CommandText, + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRset ) = 0; + virtual HRESULT __stdcall raw_BeginTrans ( + /*[out,retval]*/ long * TransactionLevel ) = 0; + virtual HRESULT __stdcall raw_CommitTrans ( ) = 0; + virtual HRESULT __stdcall raw_RollbackTrans ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ BSTR ConnectionString, + /*[in]*/ BSTR UserID, + /*[in]*/ BSTR Password, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall get_Errors ( + /*[out,retval]*/ struct Errors * * ppvObject ) = 0; + virtual HRESULT __stdcall get_DefaultDatabase ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_DefaultDatabase ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_IsolationLevel ( + /*[out,retval]*/ enum IsolationLevelEnum * Level ) = 0; + virtual HRESULT __stdcall put_IsolationLevel ( + /*[in]*/ enum IsolationLevelEnum Level ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttr ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttr ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * plMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum plMode ) = 0; + virtual HRESULT __stdcall get_Provider ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Provider ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_OpenSchema ( + /*[in]*/ enum SchemaEnum Schema, + /*[in]*/ VARIANT Restrictions, + /*[in]*/ VARIANT SchemaID, + /*[out,retval]*/ struct _Recordset_Deprecated * * pprset ) = 0; +}; + +struct __declspec(uuid("00000550-0000-0010-8000-00aa006d2ea4")) +_Connection_Deprecated : Connection15_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("0000050e-0000-0010-8000-00aa006d2ea4")) +Recordset15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + Fields_DeprecatedPtr Fields; + __declspec(property(get=GetPageSize,put=PutPageSize)) + long PageSize; + __declspec(property(get=GetPageCount)) + ADO_LONGPTR PageCount; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetState)) + long State; + __declspec(property(get=GetMarshalOptions,put=PutMarshalOptions)) + enum MarshalOptionsEnum MarshalOptions; + __declspec(property(get=GetCollect,put=PutCollect)) + _variant_t Collect[]; + __declspec(property(get=GetEditMode)) + enum EditModeEnum EditMode; + __declspec(property(get=GetStatus)) + long Status; + __declspec(property(get=GetFilter,put=PutFilter)) + _variant_t Filter; + __declspec(property(get=GetSort,put=PutSort)) + _bstr_t Sort; + __declspec(property(get=GetAbsolutePosition,put=PutAbsolutePosition)) + PositionEnum_Param AbsolutePosition; + __declspec(property(get=GetBOF)) + VARIANT_BOOL BOF; + __declspec(property(get=GetBookmark,put=PutBookmark)) + _variant_t Bookmark; + __declspec(property(get=GetCacheSize,put=PutCacheSize)) + long CacheSize; + __declspec(property(get=GetCursorType,put=PutCursorType)) + enum CursorTypeEnum CursorType; + __declspec(property(get=GetadoEOF)) + VARIANT_BOOL adoEOF; + __declspec(property(get=GetAbsolutePage,put=PutAbsolutePage)) + PositionEnum_Param AbsolutePage; + __declspec(property(get=GetLockType,put=PutLockType)) + enum LockTypeEnum LockType; + __declspec(property(get=GetMaxRecords,put=PutMaxRecords)) + ADO_LONGPTR MaxRecords; + __declspec(property(get=GetRecordCount)) + ADO_LONGPTR RecordCount; + + // + // Wrapper methods for error-handling + // + + PositionEnum_Param GetAbsolutePosition ( ); + void PutAbsolutePosition ( + PositionEnum_Param pl ); + void PutRefActiveConnection ( + IDispatch * pvar ); + void PutActiveConnection ( + const _variant_t & pvar ); + _variant_t GetActiveConnection ( ); + VARIANT_BOOL GetBOF ( ); + _variant_t GetBookmark ( ); + void PutBookmark ( + const _variant_t & pvBookmark ); + long GetCacheSize ( ); + void PutCacheSize ( + long pl ); + enum CursorTypeEnum GetCursorType ( ); + void PutCursorType ( + enum CursorTypeEnum plCursorType ); + VARIANT_BOOL GetadoEOF ( ); + Fields_DeprecatedPtr GetFields ( ); + enum LockTypeEnum GetLockType ( ); + void PutLockType ( + enum LockTypeEnum plLockType ); + ADO_LONGPTR GetMaxRecords ( ); + void PutMaxRecords ( + ADO_LONGPTR plMaxRecords ); + ADO_LONGPTR GetRecordCount ( ); + void PutRefSource ( + IDispatch * pvSource ); + void PutSource ( + _bstr_t pvSource ); + _variant_t GetSource ( ); + HRESULT AddNew ( + const _variant_t & FieldList = vtMissing, + const _variant_t & Values = vtMissing ); + HRESULT CancelUpdate ( ); + HRESULT Close ( ); + HRESULT Delete ( + enum AffectEnum AffectRecords ); + _variant_t GetRows ( + long Rows, + const _variant_t & Start = vtMissing, + const _variant_t & Fields = vtMissing ); + HRESULT Move ( + ADO_LONGPTR NumRecords, + const _variant_t & Start = vtMissing ); + HRESULT MoveNext ( ); + HRESULT MovePrevious ( ); + HRESULT MoveFirst ( ); + HRESULT MoveLast ( ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum CursorTypeEnum CursorType, + enum LockTypeEnum LockType, + long Options ); + HRESULT Requery ( + long Options ); + HRESULT _xResync ( + enum AffectEnum AffectRecords ); + HRESULT Update ( + const _variant_t & Fields = vtMissing, + const _variant_t & Values = vtMissing ); + PositionEnum_Param GetAbsolutePage ( ); + void PutAbsolutePage ( + PositionEnum_Param pl ); + enum EditModeEnum GetEditMode ( ); + _variant_t GetFilter ( ); + void PutFilter ( + const _variant_t & Criteria ); + ADO_LONGPTR GetPageCount ( ); + long GetPageSize ( ); + void PutPageSize ( + long pl ); + _bstr_t GetSort ( ); + void PutSort ( + _bstr_t Criteria ); + long GetStatus ( ); + long GetState ( ); + _Recordset_DeprecatedPtr _xClone ( ); + HRESULT UpdateBatch ( + enum AffectEnum AffectRecords ); + HRESULT CancelBatch ( + enum AffectEnum AffectRecords ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + _Recordset_DeprecatedPtr NextRecordset ( + VARIANT * RecordsAffected ); + VARIANT_BOOL Supports ( + enum CursorOptionEnum CursorOptions ); + _variant_t GetCollect ( + const _variant_t & Index ); + void PutCollect ( + const _variant_t & Index, + const _variant_t & pvar ); + enum MarshalOptionsEnum GetMarshalOptions ( ); + void PutMarshalOptions ( + enum MarshalOptionsEnum peMarshal ); + HRESULT Find ( + _bstr_t Criteria, + ADO_LONGPTR SkipRecords, + enum SearchDirectionEnum SearchDirection, + const _variant_t & Start = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_AbsolutePosition ( + /*[out,retval]*/ PositionEnum_Param * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePosition ( + /*[in]*/ PositionEnum_Param pl ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_BOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Bookmark ( + /*[out,retval]*/ VARIANT * pvBookmark ) = 0; + virtual HRESULT __stdcall put_Bookmark ( + /*[in]*/ VARIANT pvBookmark ) = 0; + virtual HRESULT __stdcall get_CacheSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CacheSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_CursorType ( + /*[out,retval]*/ enum CursorTypeEnum * plCursorType ) = 0; + virtual HRESULT __stdcall put_CursorType ( + /*[in]*/ enum CursorTypeEnum plCursorType ) = 0; + virtual HRESULT __stdcall get_adoEOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall get_LockType ( + /*[out,retval]*/ enum LockTypeEnum * plLockType ) = 0; + virtual HRESULT __stdcall put_LockType ( + /*[in]*/ enum LockTypeEnum plLockType ) = 0; + virtual HRESULT __stdcall get_MaxRecords ( + /*[out,retval]*/ ADO_LONGPTR * plMaxRecords ) = 0; + virtual HRESULT __stdcall put_MaxRecords ( + /*[in]*/ ADO_LONGPTR plMaxRecords ) = 0; + virtual HRESULT __stdcall get_RecordCount ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvSource ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvSource ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvSource ) = 0; + virtual HRESULT __stdcall raw_AddNew ( + /*[in]*/ VARIANT FieldList = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_GetRows ( + /*[in]*/ long Rows, + /*[in]*/ VARIANT Start, + /*[in]*/ VARIANT Fields, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall raw_Move ( + /*[in]*/ ADO_LONGPTR NumRecords, + /*[in]*/ VARIANT Start = vtMissing ) = 0; + virtual HRESULT __stdcall raw_MoveNext ( ) = 0; + virtual HRESULT __stdcall raw_MovePrevious ( ) = 0; + virtual HRESULT __stdcall raw_MoveFirst ( ) = 0; + virtual HRESULT __stdcall raw_MoveLast ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum CursorTypeEnum CursorType, + /*[in]*/ enum LockTypeEnum LockType, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw_Requery ( + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw__xResync ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_Update ( + /*[in]*/ VARIANT Fields = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall get_AbsolutePage ( + /*[out,retval]*/ PositionEnum_Param * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePage ( + /*[in]*/ PositionEnum_Param pl ) = 0; + virtual HRESULT __stdcall get_EditMode ( + /*[out,retval]*/ enum EditModeEnum * pl ) = 0; + virtual HRESULT __stdcall get_Filter ( + /*[out,retval]*/ VARIANT * Criteria ) = 0; + virtual HRESULT __stdcall put_Filter ( + /*[in]*/ VARIANT Criteria ) = 0; + virtual HRESULT __stdcall get_PageCount ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_PageSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_PageSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Sort ( + /*[out,retval]*/ BSTR * Criteria ) = 0; + virtual HRESULT __stdcall put_Sort ( + /*[in]*/ BSTR Criteria ) = 0; + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw__xClone ( + /*[out,retval]*/ struct _Recordset_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_UpdateBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_CancelBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall raw_NextRecordset ( + /*[out]*/ VARIANT * RecordsAffected, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_Supports ( + /*[in]*/ enum CursorOptionEnum CursorOptions, + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Collect ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Collect ( + /*[in]*/ VARIANT Index, + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_MarshalOptions ( + /*[out,retval]*/ enum MarshalOptionsEnum * peMarshal ) = 0; + virtual HRESULT __stdcall put_MarshalOptions ( + /*[in]*/ enum MarshalOptionsEnum peMarshal ) = 0; + virtual HRESULT __stdcall raw_Find ( + /*[in]*/ BSTR Criteria, + /*[in]*/ ADO_LONGPTR SkipRecords, + /*[in]*/ enum SearchDirectionEnum SearchDirection, + /*[in]*/ VARIANT Start = vtMissing ) = 0; +}; + +struct __declspec(uuid("0000054f-0000-0010-8000-00aa006d2ea4")) +Recordset20_Deprecated : Recordset15_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetDataSource,put=PutRefDataSource)) + IUnknownPtr DataSource; + __declspec(property(get=GetActiveCommand)) + IDispatchPtr ActiveCommand; + __declspec(property(get=GetStayInSync,put=PutStayInSync)) + VARIANT_BOOL StayInSync; + __declspec(property(get=GetDataMember,put=PutDataMember)) + _bstr_t DataMember; + + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + IUnknownPtr GetDataSource ( ); + void PutRefDataSource ( + IUnknown * ppunkDataSource ); + HRESULT _xSave ( + _bstr_t FileName, + enum PersistFormatEnum PersistFormat ); + IDispatchPtr GetActiveCommand ( ); + void PutStayInSync ( + VARIANT_BOOL pbStayInSync ); + VARIANT_BOOL GetStayInSync ( ); + _bstr_t GetString ( + enum StringFormatEnum StringFormat, + long NumRows, + _bstr_t ColumnDelimeter, + _bstr_t RowDelimeter, + _bstr_t NullExpr ); + _bstr_t GetDataMember ( ); + void PutDataMember ( + _bstr_t pbstrDataMember ); + enum CompareEnum CompareBookmarks ( + const _variant_t & Bookmark1, + const _variant_t & Bookmark2 ); + _Recordset_DeprecatedPtr Clone ( + enum LockTypeEnum LockType ); + HRESULT Resync ( + enum AffectEnum AffectRecords, + enum ResyncEnum ResyncValues ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; + virtual HRESULT __stdcall get_DataSource ( + /*[out,retval]*/ IUnknown * * ppunkDataSource ) = 0; + virtual HRESULT __stdcall putref_DataSource ( + /*[in]*/ IUnknown * ppunkDataSource ) = 0; + virtual HRESULT __stdcall raw__xSave ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; + virtual HRESULT __stdcall get_ActiveCommand ( + /*[out,retval]*/ IDispatch * * ppCmd ) = 0; + virtual HRESULT __stdcall put_StayInSync ( + /*[in]*/ VARIANT_BOOL pbStayInSync ) = 0; + virtual HRESULT __stdcall get_StayInSync ( + /*[out,retval]*/ VARIANT_BOOL * pbStayInSync ) = 0; + virtual HRESULT __stdcall raw_GetString ( + /*[in]*/ enum StringFormatEnum StringFormat, + /*[in]*/ long NumRows, + /*[in]*/ BSTR ColumnDelimeter, + /*[in]*/ BSTR RowDelimeter, + /*[in]*/ BSTR NullExpr, + /*[out,retval]*/ BSTR * pRetString ) = 0; + virtual HRESULT __stdcall get_DataMember ( + /*[out,retval]*/ BSTR * pbstrDataMember ) = 0; + virtual HRESULT __stdcall put_DataMember ( + /*[in]*/ BSTR pbstrDataMember ) = 0; + virtual HRESULT __stdcall raw_CompareBookmarks ( + /*[in]*/ VARIANT Bookmark1, + /*[in]*/ VARIANT Bookmark2, + /*[out,retval]*/ enum CompareEnum * pCompare ) = 0; + virtual HRESULT __stdcall raw_Clone ( + /*[in]*/ enum LockTypeEnum LockType, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum AffectEnum AffectRecords, + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; +}; + +struct __declspec(uuid("00000555-0000-0010-8000-00aa006d2ea4")) +Recordset21_Deprecated : Recordset20_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetIndex,put=PutIndex)) + _bstr_t Index; + + // + // Wrapper methods for error-handling + // + + HRESULT Seek ( + const _variant_t & KeyValues, + enum SeekEnum SeekOption ); + void PutIndex ( + _bstr_t pbstrIndex ); + _bstr_t GetIndex ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Seek ( + /*[in]*/ VARIANT KeyValues, + /*[in]*/ enum SeekEnum SeekOption ) = 0; + virtual HRESULT __stdcall put_Index ( + /*[in]*/ BSTR pbstrIndex ) = 0; + virtual HRESULT __stdcall get_Index ( + /*[out,retval]*/ BSTR * pbstrIndex ) = 0; +}; + +struct __declspec(uuid("00000556-0000-0010-8000-00aa006d2ea4")) +_Recordset_Deprecated : Recordset21_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Save ( + const _variant_t & Destination, + enum PersistFormatEnum PersistFormat ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Save ( + /*[in]*/ VARIANT Destination, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; +}; + +struct __declspec(uuid("00000508-0000-0010-8000-00aa006d2ea4")) +Command15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetParameters)) + Parameters_DeprecatedPtr Parameters; + __declspec(property(get=GetActiveConnection,put=PutRefActiveConnection)) + _Connection_DeprecatedPtr ActiveConnection; + __declspec(property(get=GetCommandText,put=PutCommandText)) + _bstr_t CommandText; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetPrepared,put=PutPrepared)) + VARIANT_BOOL Prepared; + __declspec(property(get=GetCommandType,put=PutCommandType)) + enum CommandTypeEnum CommandType; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + + // + // Wrapper methods for error-handling + // + + _Connection_DeprecatedPtr GetActiveConnection ( ); + void PutRefActiveConnection ( + struct _Connection_Deprecated * ppvObject ); + void PutActiveConnection ( + const _variant_t & ppvObject ); + _bstr_t GetCommandText ( ); + void PutCommandText ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long pl ); + VARIANT_BOOL GetPrepared ( ); + void PutPrepared ( + VARIANT_BOOL pfPrepared ); + _Recordset_DeprecatedPtr Execute ( + VARIANT * RecordsAffected, + VARIANT * Parameters, + long Options ); + _Parameter_DeprecatedPtr CreateParameter ( + _bstr_t Name, + enum DataTypeEnum Type, + enum ParameterDirectionEnum Direction, + ADO_LONGPTR Size, + const _variant_t & Value = vtMissing ); + Parameters_DeprecatedPtr GetParameters ( ); + void PutCommandType ( + enum CommandTypeEnum plCmdType ); + enum CommandTypeEnum GetCommandType ( ); + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstrName ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ struct _Connection_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection_Deprecated * ppvObject ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT ppvObject ) = 0; + virtual HRESULT __stdcall get_CommandText ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_CommandText ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Prepared ( + /*[out,retval]*/ VARIANT_BOOL * pfPrepared ) = 0; + virtual HRESULT __stdcall put_Prepared ( + /*[in]*/ VARIANT_BOOL pfPrepared ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ VARIANT * Parameters, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_CreateParameter ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ enum ParameterDirectionEnum Direction, + /*[in]*/ ADO_LONGPTR Size, + /*[in]*/ VARIANT Value, + /*[out,retval]*/ struct _Parameter_Deprecated * * ppiprm ) = 0; + virtual HRESULT __stdcall get_Parameters ( + /*[out,retval]*/ struct Parameters_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall put_CommandType ( + /*[in]*/ enum CommandTypeEnum plCmdType ) = 0; + virtual HRESULT __stdcall get_CommandType ( + /*[out,retval]*/ enum CommandTypeEnum * plCmdType ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstrName ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstrName ) = 0; +}; + +struct __declspec(uuid("0000054e-0000-0010-8000-00aa006d2ea4")) +Command25_Deprecated : Command15_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + long GetState ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("b08400bd-f9d1-4d02-b856-71d5dba123e9")) +_Command_Deprecated : Command25_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetDialect,put=PutDialect)) + _bstr_t Dialect; + __declspec(property(get=GetNamedParameters,put=PutNamedParameters)) + VARIANT_BOOL NamedParameters; + + // + // Wrapper methods for error-handling + // + + void PutRefCommandStream ( + IUnknown * pvStream ); + _variant_t GetCommandStream ( ); + void PutDialect ( + _bstr_t pbstrDialect ); + _bstr_t GetDialect ( ); + void PutNamedParameters ( + VARIANT_BOOL pfNamedParameters ); + VARIANT_BOOL GetNamedParameters ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall putref_CommandStream ( + /*[in]*/ IUnknown * pvStream ) = 0; + virtual HRESULT __stdcall get_CommandStream ( + /*[out,retval]*/ VARIANT * pvStream ) = 0; + virtual HRESULT __stdcall put_Dialect ( + /*[in]*/ BSTR pbstrDialect ) = 0; + virtual HRESULT __stdcall get_Dialect ( + /*[out,retval]*/ BSTR * pbstrDialect ) = 0; + virtual HRESULT __stdcall put_NamedParameters ( + /*[in]*/ VARIANT_BOOL pfNamedParameters ) = 0; + virtual HRESULT __stdcall get_NamedParameters ( + /*[out,retval]*/ VARIANT_BOOL * pfNamedParameters ) = 0; +}; + +struct __declspec(uuid("00000403-0000-0010-8000-00aa006d2ea4")) +RecordsetEventsVt_Deprecated : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_WillChangeField ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FieldChangeComplete ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecord ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecordset ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordsetChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillMove ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_MoveComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_EndOfRecordset ( + /*[in,out]*/ VARIANT_BOOL * fMoreData, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchProgress ( + /*[in]*/ long Progress, + /*[in]*/ long MaxProgress, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; +}; + +struct __declspec(uuid("00000562-0000-0010-8000-00aa006d2ea4")) +_Record_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + Fields_DeprecatedPtr Fields; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetParentURL)) + _bstr_t ParentURL; + __declspec(property(get=GetRecordType)) + enum RecordTypeEnum RecordType; + + // + // Wrapper methods for error-handling + // + + _variant_t GetActiveConnection ( ); + void PutActiveConnection ( + _bstr_t pvar ); + void PutRefActiveConnection ( + struct _Connection_Deprecated * pvar ); + enum ObjectStateEnum GetState ( ); + _variant_t GetSource ( ); + void PutSource ( + _bstr_t pvar ); + void PutRefSource ( + IDispatch * pvar ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetParentURL ( ); + _bstr_t MoveRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum MoveRecordOptionsEnum Options, + VARIANT_BOOL Async ); + _bstr_t CopyRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum CopyRecordOptionsEnum Options, + VARIANT_BOOL Async ); + HRESULT DeleteRecord ( + _bstr_t Source, + VARIANT_BOOL Async ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum ConnectModeEnum Mode, + enum RecordCreateOptionsEnum CreateOptions, + enum RecordOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + Fields_DeprecatedPtr GetFields ( ); + enum RecordTypeEnum GetRecordType ( ); + _Recordset_DeprecatedPtr GetChildren ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection_Deprecated * pvar ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_ParentURL ( + /*[out,retval]*/ BSTR * pbstrParentURL ) = 0; + virtual HRESULT __stdcall raw_MoveRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum MoveRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_CopyRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum CopyRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_DeleteRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ VARIANT_BOOL Async ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum RecordCreateOptionsEnum CreateOptions, + /*[in]*/ enum RecordOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields_Deprecated * * ppFlds ) = 0; + virtual HRESULT __stdcall get_RecordType ( + /*[out,retval]*/ enum RecordTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall raw_GetChildren ( + /*[out,retval]*/ struct _Recordset_Deprecated * * pprset ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +// +// Wrapper method implementations +// + +#include "D:\source\力源\SignOff_itk\SignOff_itk\x64\Release\msado15.tli" + +#pragma pack(pop) diff --git a/SignOff_itk/SignOff_itk/x64/Release/msado15.tli b/SignOff_itk/SignOff_itk/x64/Release/msado15.tli new file mode 100644 index 0000000..eb7e96d --- /dev/null +++ b/SignOff_itk/SignOff_itk/x64/Release/msado15.tli @@ -0,0 +1,3952 @@ +// Created by Microsoft (R) C/C++ Compiler Version 14.29.30159.0 (dad71ecd). +// +// D:\source\力源\SignOff_itk\SignOff_itk\x64\Release\msado15.tli +// +// Wrapper implementations for type library c:\program files\common files\system\ado\msado15.dll +// compiler-generated file created 01/20/26 at 11:27:32 - DO NOT EDIT! + +#pragma once + +// +// interface _Collection wrapper method implementations +// + +inline long _Collection::GetCount ( ) { + long _result = 0; + HRESULT _hr = get_Count(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline IUnknownPtr _Collection::_NewEnum ( ) { + IUnknown * _result = 0; + HRESULT _hr = raw__NewEnum(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline HRESULT _Collection::Refresh ( ) { + HRESULT _hr = raw_Refresh(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _DynaCollection wrapper method implementations +// + +inline HRESULT _DynaCollection::Append ( IDispatch * Object ) { + HRESULT _hr = raw_Append(Object); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _DynaCollection::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Property wrapper method implementations +// + +inline _variant_t Property::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Property::PutValue ( const _variant_t & pval ) { + HRESULT _hr = put_Value(pval); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Property::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Property::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Property::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Property::PutAttributes ( long plAttributes ) { + HRESULT _hr = put_Attributes(plAttributes); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Properties wrapper method implementations +// + +inline PropertyPtr Properties::GetItem ( const _variant_t & Index ) { + struct Property * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return PropertyPtr(_result, false); +} + +// +// interface _ADO wrapper method implementations +// + +inline PropertiesPtr _ADO::GetProperties ( ) { + struct Properties * _result = 0; + HRESULT _hr = get_Properties(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return PropertiesPtr(_result, false); +} + +// +// interface Error wrapper method implementations +// + +inline long Error::GetNumber ( ) { + long _result = 0; + HRESULT _hr = get_Number(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Error::GetSource ( ) { + BSTR _result = 0; + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Error::GetDescription ( ) { + BSTR _result = 0; + HRESULT _hr = get_Description(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Error::GetHelpFile ( ) { + BSTR _result = 0; + HRESULT _hr = get_HelpFile(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline long Error::GetHelpContext ( ) { + long _result = 0; + HRESULT _hr = get_HelpContext(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Error::GetSQLState ( ) { + BSTR _result = 0; + HRESULT _hr = get_SQLState(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline long Error::GetNativeError ( ) { + long _result = 0; + HRESULT _hr = get_NativeError(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Errors wrapper method implementations +// + +inline ErrorPtr Errors::GetItem ( const _variant_t & Index ) { + struct Error * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorPtr(_result, false); +} + +inline HRESULT Errors::Clear ( ) { + HRESULT _hr = raw_Clear(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Field20 wrapper method implementations +// + +inline long Field20::GetActualSize ( ) { + long _result = 0; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20::GetDefinedSize ( ) { + long _result = 0; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field20::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field20::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field20::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field20::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field20::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field20::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field20::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field20::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline IUnknownPtr Field20::GetDataFormat ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataFormat(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Field20::PutRefDataFormat ( IUnknown * ppiDF ) { + HRESULT _hr = putref_DataFormat(ppiDF); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutNumericScale ( unsigned char pbNumericScale ) { + HRESULT _hr = put_NumericScale(pbNumericScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutType ( enum DataTypeEnum pDataType ) { + HRESULT _hr = put_Type(pDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutDefinedSize ( long pl ) { + HRESULT _hr = put_DefinedSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutAttributes ( long pl ) { + HRESULT _hr = put_Attributes(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field wrapper method implementations +// + +inline long Field::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Fields15 wrapper method implementations +// + +inline FieldPtr Fields15::GetItem ( const _variant_t & Index ) { + struct Field * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldPtr(_result, false); +} + +// +// interface Fields20 wrapper method implementations +// + +inline HRESULT Fields20::_Append ( _bstr_t Name, enum DataTypeEnum Type, long DefinedSize, enum FieldAttributeEnum Attrib ) { + HRESULT _hr = raw__Append(Name, Type, DefinedSize, Attrib); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields20::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Fields wrapper method implementations +// + +inline HRESULT Fields::Append ( _bstr_t Name, enum DataTypeEnum Type, long DefinedSize, enum FieldAttributeEnum Attrib, const _variant_t & FieldValue ) { + HRESULT _hr = raw_Append(Name, Type, DefinedSize, Attrib, FieldValue); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::Update ( ) { + HRESULT _hr = raw_Update(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::Resync ( enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Parameter wrapper method implementations +// + +inline _bstr_t _Parameter::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Parameter::PutName ( _bstr_t pbstr ) { + HRESULT _hr = put_Name(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Parameter::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Parameter::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum DataTypeEnum _Parameter::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutType ( enum DataTypeEnum psDataType ) { + HRESULT _hr = put_Type(psDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Parameter::PutDirection ( enum ParameterDirectionEnum plParmDirection ) { + HRESULT _hr = put_Direction(plParmDirection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ParameterDirectionEnum _Parameter::GetDirection ( ) { + enum ParameterDirectionEnum _result; + HRESULT _hr = get_Direction(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutNumericScale ( unsigned char pbScale ) { + HRESULT _hr = put_NumericScale(pbScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutSize ( long pl ) { + HRESULT _hr = put_Size(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long _Parameter::GetSize ( ) { + long _result = 0; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT _Parameter::AppendChunk ( const _variant_t & Val ) { + HRESULT _hr = raw_AppendChunk(Val); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline long _Parameter::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutAttributes ( long plParmAttribs ) { + HRESULT _hr = put_Attributes(plParmAttribs); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Parameters wrapper method implementations +// + +inline _ParameterPtr Parameters::GetItem ( const _variant_t & Index ) { + struct _Parameter * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ParameterPtr(_result, false); +} + +// +// dispinterface ConnectionEvents wrapper method implementations +// + +inline HRESULT ConnectionEvents::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x0, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x1, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", TransactionLevel, pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x3, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x4, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4003\x4003\x4003\x4003\x0009\x0009\x0009", Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x5, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009\x0009\x0009", RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x6, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4008\x4008\x4003\x4003\x0009", ConnectionString, UserID, Password, Options, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x7, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x8, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4003\x0009", adStatus, pConnection); + return _result; +} + +// +// dispinterface RecordsetEvents wrapper method implementations +// + +inline HRESULT RecordsetEvents::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x9, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x4003\x0009", cFields, &Fields, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xa, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x0009\x4003\x0009", cFields, &Fields, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xb, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", adReason, cRecords, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xc, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x0009\x4003\x0009", adReason, cRecords, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xd, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xe, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xf, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x10, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x11, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x400b\x4003\x0009", fMoreData, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x12, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", Progress, MaxProgress, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x13, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pRecordset); + return _result; +} + +// +// interface ADOConnectionConstruction15 wrapper method implementations +// + +inline IUnknownPtr ADOConnectionConstruction15::GetDSO ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DSO(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline IUnknownPtr ADOConnectionConstruction15::GetSession ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Session(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline HRESULT ADOConnectionConstruction15::WrapDSOandSession ( IUnknown * pDSO, IUnknown * pSession ) { + HRESULT _hr = raw_WrapDSOandSession(pDSO, pSession); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Stream wrapper method implementations +// + +inline long _Stream::GetSize ( ) { + long _result = 0; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline VARIANT_BOOL _Stream::GetEOS ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_EOS(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long _Stream::GetPosition ( ) { + long _result = 0; + HRESULT _hr = get_Position(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutPosition ( long pPos ) { + HRESULT _hr = put_Position(pPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum StreamTypeEnum _Stream::GetType ( ) { + enum StreamTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutType ( enum StreamTypeEnum ptype ) { + HRESULT _hr = put_Type(ptype); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum LineSeparatorEnum _Stream::GetLineSeparator ( ) { + enum LineSeparatorEnum _result; + HRESULT _hr = get_LineSeparator(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutLineSeparator ( enum LineSeparatorEnum pLS ) { + HRESULT _hr = put_LineSeparator(pLS); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Stream::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline enum ConnectModeEnum _Stream::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Stream::GetCharset ( ) { + BSTR _result = 0; + HRESULT _hr = get_Charset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Stream::PutCharset ( _bstr_t pbstrCharset ) { + HRESULT _hr = put_Charset(pbstrCharset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Stream::Read ( long NumBytes ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_Read(NumBytes, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT _Stream::Open ( const _variant_t & Source, enum ConnectModeEnum Mode, enum StreamOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, Mode, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SkipLine ( ) { + HRESULT _hr = raw_SkipLine(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Write ( const _variant_t & Buffer ) { + HRESULT _hr = raw_Write(Buffer); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SetEOS ( ) { + HRESULT _hr = raw_SetEOS(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::CopyTo ( struct _Stream * DestStream, long CharNumber ) { + HRESULT _hr = raw_CopyTo(DestStream, CharNumber); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Flush ( ) { + HRESULT _hr = raw_Flush(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SaveToFile ( _bstr_t FileName, enum SaveOptionsEnum Options ) { + HRESULT _hr = raw_SaveToFile(FileName, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::LoadFromFile ( _bstr_t FileName ) { + HRESULT _hr = raw_LoadFromFile(FileName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _bstr_t _Stream::ReadText ( long NumChars ) { + BSTR _result = 0; + HRESULT _hr = raw_ReadText(NumChars, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Stream::WriteText ( _bstr_t Data, enum StreamWriteEnum Options ) { + HRESULT _hr = raw_WriteText(Data, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ADORecordConstruction wrapper method implementations +// + +inline IUnknownPtr ADORecordConstruction::GetRow ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Row(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordConstruction::PutRow ( IUnknown * ppRow ) { + HRESULT _hr = put_Row(ppRow); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void ADORecordConstruction::PutParentRow ( IUnknown * _arg1 ) { + HRESULT _hr = put_ParentRow(_arg1); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADOStreamConstruction wrapper method implementations +// + +inline IUnknownPtr ADOStreamConstruction::GetStream ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Stream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADOStreamConstruction::PutStream ( IUnknown * ppStm ) { + HRESULT _hr = put_Stream(ppStm); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADOCommandConstruction wrapper method implementations +// + +inline IUnknownPtr ADOCommandConstruction::GetOLEDBCommand ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_OLEDBCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADOCommandConstruction::PutOLEDBCommand ( IUnknown * ppOLEDBCommand ) { + HRESULT _hr = put_OLEDBCommand(ppOLEDBCommand); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADORecordsetConstruction wrapper method implementations +// + +inline IUnknownPtr ADORecordsetConstruction::GetRowset ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Rowset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordsetConstruction::PutRowset ( IUnknown * ppRowset ) { + HRESULT _hr = put_Rowset(ppRowset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR ADORecordsetConstruction::GetChapter ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Chapter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void ADORecordsetConstruction::PutChapter ( ADO_LONGPTR plChapter ) { + HRESULT _hr = put_Chapter(plChapter); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline IUnknownPtr ADORecordsetConstruction::GetRowPosition ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_RowPosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordsetConstruction::PutRowPosition ( IUnknown * ppRowPos ) { + HRESULT _hr = put_RowPosition(ppRowPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field15 wrapper method implementations +// + +inline long Field15::GetActualSize ( ) { + long _result = 0; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15::GetDefinedSize ( ) { + long _result = 0; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field15::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field15::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field15::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field15::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field15::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field15::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field15::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field15::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +// +// interface Field20_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR Field20_Deprecated::GetActualSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR Field20_Deprecated::GetDefinedSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field20_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field20_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field20_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field20_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field20_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field20_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field20_Deprecated::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field20_Deprecated::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20_Deprecated::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20_Deprecated::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline IUnknownPtr Field20_Deprecated::GetDataFormat ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataFormat(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Field20_Deprecated::PutRefDataFormat ( IUnknown * ppiDF ) { + HRESULT _hr = putref_DataFormat(ppiDF); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutNumericScale ( unsigned char pbNumericScale ) { + HRESULT _hr = put_NumericScale(pbNumericScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutType ( enum DataTypeEnum pDataType ) { + HRESULT _hr = put_Type(pDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutDefinedSize ( ADO_LONGPTR pl ) { + HRESULT _hr = put_DefinedSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutAttributes ( long pl ) { + HRESULT _hr = put_Attributes(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field_Deprecated wrapper method implementations +// + +inline long Field_Deprecated::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Fields15_Deprecated wrapper method implementations +// + +inline Field_DeprecatedPtr Fields15_Deprecated::GetItem ( const _variant_t & Index ) { + struct Field_Deprecated * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Field_DeprecatedPtr(_result, false); +} + +// +// interface Fields20_Deprecated wrapper method implementations +// + +inline HRESULT Fields20_Deprecated::_Append ( _bstr_t Name, enum DataTypeEnum Type, ADO_LONGPTR DefinedSize, enum FieldAttributeEnum Attrib ) { + HRESULT _hr = raw__Append(Name, Type, DefinedSize, Attrib); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields20_Deprecated::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Fields_Deprecated wrapper method implementations +// + +inline HRESULT Fields_Deprecated::Append ( _bstr_t Name, enum DataTypeEnum Type, ADO_LONGPTR DefinedSize, enum FieldAttributeEnum Attrib, const _variant_t & FieldValue ) { + HRESULT _hr = raw_Append(Name, Type, DefinedSize, Attrib, FieldValue); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::Update ( ) { + HRESULT _hr = raw_Update(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::Resync ( enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Parameter_Deprecated wrapper method implementations +// + +inline _bstr_t _Parameter_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Parameter_Deprecated::PutName ( _bstr_t pbstr ) { + HRESULT _hr = put_Name(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Parameter_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Parameter_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum DataTypeEnum _Parameter_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutType ( enum DataTypeEnum psDataType ) { + HRESULT _hr = put_Type(psDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Parameter_Deprecated::PutDirection ( enum ParameterDirectionEnum plParmDirection ) { + HRESULT _hr = put_Direction(plParmDirection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ParameterDirectionEnum _Parameter_Deprecated::GetDirection ( ) { + enum ParameterDirectionEnum _result; + HRESULT _hr = get_Direction(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutNumericScale ( unsigned char pbScale ) { + HRESULT _hr = put_NumericScale(pbScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutSize ( ADO_LONGPTR pl ) { + HRESULT _hr = put_Size(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR _Parameter_Deprecated::GetSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT _Parameter_Deprecated::AppendChunk ( const _variant_t & Val ) { + HRESULT _hr = raw_AppendChunk(Val); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline long _Parameter_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutAttributes ( long plParmAttribs ) { + HRESULT _hr = put_Attributes(plParmAttribs); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Parameters_Deprecated wrapper method implementations +// + +inline _Parameter_DeprecatedPtr Parameters_Deprecated::GetItem ( const _variant_t & Index ) { + struct _Parameter_Deprecated * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Parameter_DeprecatedPtr(_result, false); +} + +// +// dispinterface ConnectionEvents_Deprecated wrapper method implementations +// + +inline HRESULT ConnectionEvents_Deprecated::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x0, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x1, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", TransactionLevel, pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x3, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x4, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4003\x4003\x4003\x4003\x0009\x0009\x0009", Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x5, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009\x0009\x0009", RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x6, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4008\x4008\x4003\x4003\x0009", ConnectionString, UserID, Password, Options, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x7, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x8, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4003\x0009", adStatus, pConnection); + return _result; +} + +// +// dispinterface RecordsetEvents_Deprecated wrapper method implementations +// + +inline HRESULT RecordsetEvents_Deprecated::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x9, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x4003\x0009", cFields, &Fields, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xa, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x0009\x4003\x0009", cFields, &Fields, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xb, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", adReason, cRecords, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xc, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x0009\x4003\x0009", adReason, cRecords, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xd, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xe, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xf, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x10, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x11, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x400b\x4003\x0009", fMoreData, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x12, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", Progress, MaxProgress, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x13, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pRecordset); + return _result; +} + +// +// interface _Stream_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR _Stream_Deprecated::GetSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline VARIANT_BOOL _Stream_Deprecated::GetEOS ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_EOS(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR _Stream_Deprecated::GetPosition ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Position(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutPosition ( ADO_LONGPTR pPos ) { + HRESULT _hr = put_Position(pPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum StreamTypeEnum _Stream_Deprecated::GetType ( ) { + enum StreamTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutType ( enum StreamTypeEnum ptype ) { + HRESULT _hr = put_Type(ptype); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum LineSeparatorEnum _Stream_Deprecated::GetLineSeparator ( ) { + enum LineSeparatorEnum _result; + HRESULT _hr = get_LineSeparator(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutLineSeparator ( enum LineSeparatorEnum pLS ) { + HRESULT _hr = put_LineSeparator(pLS); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Stream_Deprecated::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline enum ConnectModeEnum _Stream_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Stream_Deprecated::GetCharset ( ) { + BSTR _result = 0; + HRESULT _hr = get_Charset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Stream_Deprecated::PutCharset ( _bstr_t pbstrCharset ) { + HRESULT _hr = put_Charset(pbstrCharset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Stream_Deprecated::Read ( long NumBytes ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_Read(NumBytes, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT _Stream_Deprecated::Open ( const _variant_t & Source, enum ConnectModeEnum Mode, enum StreamOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, Mode, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SkipLine ( ) { + HRESULT _hr = raw_SkipLine(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Write ( const _variant_t & Buffer ) { + HRESULT _hr = raw_Write(Buffer); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SetEOS ( ) { + HRESULT _hr = raw_SetEOS(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::CopyTo ( struct _Stream_Deprecated * DestStream, ADO_LONGPTR CharNumber ) { + HRESULT _hr = raw_CopyTo(DestStream, CharNumber); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Flush ( ) { + HRESULT _hr = raw_Flush(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SaveToFile ( _bstr_t FileName, enum SaveOptionsEnum Options ) { + HRESULT _hr = raw_SaveToFile(FileName, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::LoadFromFile ( _bstr_t FileName ) { + HRESULT _hr = raw_LoadFromFile(FileName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _bstr_t _Stream_Deprecated::ReadText ( long NumChars ) { + BSTR _result = 0; + HRESULT _hr = raw_ReadText(NumChars, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Stream_Deprecated::WriteText ( _bstr_t Data, enum StreamWriteEnum Options ) { + HRESULT _hr = raw_WriteText(Data, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Field15_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR Field15_Deprecated::GetActualSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR Field15_Deprecated::GetDefinedSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field15_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field15_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field15_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field15_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field15_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field15_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field15_Deprecated::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field15_Deprecated::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15_Deprecated::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15_Deprecated::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +// +// interface Command15 wrapper method implementations +// + +inline _ConnectionPtr Command15::GetActiveConnection ( ) { + struct _Connection * _result = 0; + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ConnectionPtr(_result, false); +} + +inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) { + HRESULT _hr = putref_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Command15::PutActiveConnection ( const _variant_t & ppvObject ) { + HRESULT _hr = put_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Command15::GetCommandText ( ) { + BSTR _result = 0; + HRESULT _hr = get_CommandText(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15::PutCommandText ( _bstr_t pbstr ) { + HRESULT _hr = put_CommandText(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Command15::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15::PutCommandTimeout ( long pl ) { + HRESULT _hr = put_CommandTimeout(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Command15::GetPrepared ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_Prepared(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15::PutPrepared ( VARIANT_BOOL pfPrepared ) { + HRESULT _hr = put_Prepared(pfPrepared); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline _ParameterPtr Command15::CreateParameter ( _bstr_t Name, enum DataTypeEnum Type, enum ParameterDirectionEnum Direction, long Size, const _variant_t & Value ) { + struct _Parameter * _result = 0; + HRESULT _hr = raw_CreateParameter(Name, Type, Direction, Size, Value, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ParameterPtr(_result, false); +} + +inline ParametersPtr Command15::GetParameters ( ) { + struct Parameters * _result = 0; + HRESULT _hr = get_Parameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ParametersPtr(_result, false); +} + +inline void Command15::PutCommandType ( enum CommandTypeEnum plCmdType ) { + HRESULT _hr = put_CommandType(plCmdType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CommandTypeEnum Command15::GetCommandType ( ) { + enum CommandTypeEnum _result; + HRESULT _hr = get_CommandType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Command15::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15::PutName ( _bstr_t pbstrName ) { + HRESULT _hr = put_Name(pbstrName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Command25 wrapper method implementations +// + +inline long Command25::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Command25::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Command wrapper method implementations +// + +inline void _Command::PutRefCommandStream ( IUnknown * pvStream ) { + HRESULT _hr = putref_CommandStream(pvStream); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Command::GetCommandStream ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_CommandStream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Command::PutDialect ( _bstr_t pbstrDialect ) { + HRESULT _hr = put_Dialect(pbstrDialect); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Command::GetDialect ( ) { + BSTR _result = 0; + HRESULT _hr = get_Dialect(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Command::PutNamedParameters ( VARIANT_BOOL pfNamedParameters ) { + HRESULT _hr = put_NamedParameters(pfNamedParameters); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL _Command::GetNamedParameters ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_NamedParameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Connection15 wrapper method implementations +// + +inline _bstr_t Connection15::GetConnectionString ( ) { + BSTR _result = 0; + HRESULT _hr = get_ConnectionString(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutConnectionString ( _bstr_t pbstr ) { + HRESULT _hr = put_ConnectionString(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutCommandTimeout ( long plTimeout ) { + HRESULT _hr = put_CommandTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetConnectionTimeout ( ) { + long _result = 0; + HRESULT _hr = get_ConnectionTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutConnectionTimeout ( long plTimeout ) { + HRESULT _hr = put_ConnectionTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15::GetVersion ( ) { + BSTR _result = 0; + HRESULT _hr = get_Version(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT Connection15::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _RecordsetPtr Connection15::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline long Connection15::BeginTrans ( ) { + long _result = 0; + HRESULT _hr = raw_BeginTrans(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Connection15::CommitTrans ( ) { + HRESULT _hr = raw_CommitTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15::RollbackTrans ( ) { + HRESULT _hr = raw_RollbackTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) { + HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline ErrorsPtr Connection15::GetErrors ( ) { + struct Errors * _result = 0; + HRESULT _hr = get_Errors(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorsPtr(_result, false); +} + +inline _bstr_t Connection15::GetDefaultDatabase ( ) { + BSTR _result = 0; + HRESULT _hr = get_DefaultDatabase(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutDefaultDatabase ( _bstr_t pbstr ) { + HRESULT _hr = put_DefaultDatabase(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum IsolationLevelEnum Connection15::GetIsolationLevel ( ) { + enum IsolationLevelEnum _result; + HRESULT _hr = get_IsolationLevel(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutIsolationLevel ( enum IsolationLevelEnum Level ) { + HRESULT _hr = put_IsolationLevel(Level); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutAttributes ( long plAttr ) { + HRESULT _hr = put_Attributes(plAttr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorLocationEnum Connection15::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum Connection15::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutMode ( enum ConnectModeEnum plMode ) { + HRESULT _hr = put_Mode(plMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15::GetProvider ( ) { + BSTR _result = 0; + HRESULT _hr = get_Provider(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutProvider ( _bstr_t pbstr ) { + HRESULT _hr = put_Provider(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Connection15::OpenSchema ( enum SchemaEnum Schema, const _variant_t & Restrictions, const _variant_t & SchemaID ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_OpenSchema(Schema, Restrictions, SchemaID, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +// +// interface _Connection wrapper method implementations +// + +inline HRESULT _Connection::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset15 wrapper method implementations +// + +inline enum PositionEnum Recordset15::GetAbsolutePosition ( ) { + enum PositionEnum _result; + HRESULT _hr = get_AbsolutePosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutAbsolutePosition ( enum PositionEnum pl ) { + HRESULT _hr = put_AbsolutePosition(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutRefActiveConnection ( IDispatch * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutActiveConnection ( const _variant_t & pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline VARIANT_BOOL Recordset15::GetBOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_BOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetBookmark ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Bookmark(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutBookmark ( const _variant_t & pvBookmark ) { + HRESULT _hr = put_Bookmark(pvBookmark); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetCacheSize ( ) { + long _result = 0; + HRESULT _hr = get_CacheSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCacheSize ( long pl ) { + HRESULT _hr = put_CacheSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorTypeEnum Recordset15::GetCursorType ( ) { + enum CursorTypeEnum _result; + HRESULT _hr = get_CursorType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCursorType ( enum CursorTypeEnum plCursorType ) { + HRESULT _hr = put_CursorType(plCursorType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset15::GetadoEOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_adoEOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline FieldsPtr Recordset15::GetFields ( ) { + struct Fields * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldsPtr(_result, false); +} + +inline enum LockTypeEnum Recordset15::GetLockType ( ) { + enum LockTypeEnum _result; + HRESULT _hr = get_LockType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutLockType ( enum LockTypeEnum plLockType ) { + HRESULT _hr = put_LockType(plLockType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetMaxRecords ( ) { + long _result = 0; + HRESULT _hr = get_MaxRecords(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutMaxRecords ( long plMaxRecords ) { + HRESULT _hr = put_MaxRecords(plMaxRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetRecordCount ( ) { + long _result = 0; + HRESULT _hr = get_RecordCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutRefSource ( IDispatch * pvSource ) { + HRESULT _hr = putref_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutSource ( _bstr_t pvSource ) { + HRESULT _hr = put_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15::AddNew ( const _variant_t & FieldList, const _variant_t & Values ) { + HRESULT _hr = raw_AddNew(FieldList, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Delete ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_Delete(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Recordset15::GetRows ( long Rows, const _variant_t & Start, const _variant_t & Fields ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15::Move ( long NumRecords, const _variant_t & Start ) { + HRESULT _hr = raw_Move(NumRecords, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveNext ( ) { + HRESULT _hr = raw_MoveNext(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MovePrevious ( ) { + HRESULT _hr = raw_MovePrevious(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveFirst ( ) { + HRESULT _hr = raw_MoveFirst(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveLast ( ) { + HRESULT _hr = raw_MoveLast(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Requery ( long Options ) { + HRESULT _hr = raw_Requery(Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::_xResync ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw__xResync(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Update ( const _variant_t & Fields, const _variant_t & Values ) { + HRESULT _hr = raw_Update(Fields, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum PositionEnum Recordset15::GetAbsolutePage ( ) { + enum PositionEnum _result; + HRESULT _hr = get_AbsolutePage(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutAbsolutePage ( enum PositionEnum pl ) { + HRESULT _hr = put_AbsolutePage(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum EditModeEnum Recordset15::GetEditMode ( ) { + enum EditModeEnum _result; + HRESULT _hr = get_EditMode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetFilter ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Filter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutFilter ( const _variant_t & Criteria ) { + HRESULT _hr = put_Filter(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetPageCount ( ) { + long _result = 0; + HRESULT _hr = get_PageCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15::GetPageSize ( ) { + long _result = 0; + HRESULT _hr = get_PageSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutPageSize ( long pl ) { + HRESULT _hr = put_PageSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset15::GetSort ( ) { + BSTR _result = 0; + HRESULT _hr = get_Sort(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset15::PutSort ( _bstr_t Criteria ) { + HRESULT _hr = put_Sort(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Recordset15::_xClone ( ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw__xClone(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT Recordset15::UpdateBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_UpdateBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::CancelBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_CancelBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum CursorLocationEnum Recordset15::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _RecordsetPtr Recordset15::NextRecordset ( VARIANT * RecordsAffected ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_NextRecordset(RecordsAffected, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline VARIANT_BOOL Recordset15::Supports ( enum CursorOptionEnum CursorOptions ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = raw_Supports(CursorOptions, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetCollect ( const _variant_t & Index ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Collect(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutCollect ( const _variant_t & Index, const _variant_t & pvar ) { + HRESULT _hr = put_Collect(Index, pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum MarshalOptionsEnum Recordset15::GetMarshalOptions ( ) { + enum MarshalOptionsEnum _result; + HRESULT _hr = get_MarshalOptions(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutMarshalOptions ( enum MarshalOptionsEnum peMarshal ) { + HRESULT _hr = put_MarshalOptions(peMarshal); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset15::Find ( _bstr_t Criteria, long SkipRecords, enum SearchDirectionEnum SearchDirection, const _variant_t & Start ) { + HRESULT _hr = raw_Find(Criteria, SkipRecords, SearchDirection, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset20 wrapper method implementations +// + +inline HRESULT Recordset20::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IUnknownPtr Recordset20::GetDataSource ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataSource(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Recordset20::PutRefDataSource ( IUnknown * ppunkDataSource ) { + HRESULT _hr = putref_DataSource(ppunkDataSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset20::_xSave ( _bstr_t FileName, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw__xSave(FileName, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IDispatchPtr Recordset20::GetActiveCommand ( ) { + IDispatch * _result = 0; + HRESULT _hr = get_ActiveCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IDispatchPtr(_result, false); +} + +inline void Recordset20::PutStayInSync ( VARIANT_BOOL pbStayInSync ) { + HRESULT _hr = put_StayInSync(pbStayInSync); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset20::GetStayInSync ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_StayInSync(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Recordset20::GetString ( enum StringFormatEnum StringFormat, long NumRows, _bstr_t ColumnDelimeter, _bstr_t RowDelimeter, _bstr_t NullExpr ) { + BSTR _result = 0; + HRESULT _hr = raw_GetString(StringFormat, NumRows, ColumnDelimeter, RowDelimeter, NullExpr, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Recordset20::GetDataMember ( ) { + BSTR _result = 0; + HRESULT _hr = get_DataMember(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset20::PutDataMember ( _bstr_t pbstrDataMember ) { + HRESULT _hr = put_DataMember(pbstrDataMember); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CompareEnum Recordset20::CompareBookmarks ( const _variant_t & Bookmark1, const _variant_t & Bookmark2 ) { + enum CompareEnum _result; + HRESULT _hr = raw_CompareBookmarks(Bookmark1, Bookmark2, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Recordset20::Clone ( enum LockTypeEnum LockType ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Clone(LockType, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT Recordset20::Resync ( enum AffectEnum AffectRecords, enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(AffectRecords, ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset21 wrapper method implementations +// + +inline HRESULT Recordset21::Seek ( const _variant_t & KeyValues, enum SeekEnum SeekOption ) { + HRESULT _hr = raw_Seek(KeyValues, SeekOption); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline void Recordset21::PutIndex ( _bstr_t pbstrIndex ) { + HRESULT _hr = put_Index(pbstrIndex); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset21::GetIndex ( ) { + BSTR _result = 0; + HRESULT _hr = get_Index(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +// +// interface _Recordset wrapper method implementations +// + +inline HRESULT _Recordset::Save ( const _variant_t & Destination, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw_Save(Destination, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ConnectionEventsVt wrapper method implementations +// + +inline HRESULT ConnectionEventsVt::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_InfoMessage(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_BeginTransComplete(TransactionLevel, pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_CommitTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_RollbackTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _hr = raw_WillExecute(Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _hr = raw_ExecuteComplete(RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_WillConnect(ConnectionString, UserID, Password, Options, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_ConnectComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_Disconnect(adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface RecordsetEventsVt wrapper method implementations +// + +inline HRESULT RecordsetEventsVt::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeField(cFields, Fields, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FieldChangeComplete(cFields, Fields, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeRecord(adReason, cRecords, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_RecordChangeComplete(adReason, cRecords, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeRecordset(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_RecordsetChangeComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillMove(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_MoveComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_EndOfRecordset(fMoreData, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FetchProgress(Progress, MaxProgress, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FetchComplete(pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Record wrapper method implementations +// + +inline _variant_t _Record::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record::PutActiveConnection ( _bstr_t pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record::PutRefActiveConnection ( struct _Connection * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Record::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t _Record::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record::PutSource ( _bstr_t pvar ) { + HRESULT _hr = put_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record::PutRefSource ( IDispatch * pvar ) { + HRESULT _hr = putref_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum _Record::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Record::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Record::GetParentURL ( ) { + BSTR _result = 0; + HRESULT _hr = get_ParentURL(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record::MoveRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum MoveRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_MoveRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record::CopyRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum CopyRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_CopyRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Record::DeleteRecord ( _bstr_t Source, VARIANT_BOOL Async ) { + HRESULT _hr = raw_DeleteRecord(Source, Async); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum ConnectModeEnum Mode, enum RecordCreateOptionsEnum CreateOptions, enum RecordOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, Mode, CreateOptions, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline FieldsPtr _Record::GetFields ( ) { + struct Fields * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldsPtr(_result, false); +} + +inline enum RecordTypeEnum _Record::GetRecordType ( ) { + enum RecordTypeEnum _result; + HRESULT _hr = get_RecordType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr _Record::GetChildren ( ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_GetChildren(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT _Record::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ConnectionEventsVt_Deprecated wrapper method implementations +// + +inline HRESULT ConnectionEventsVt_Deprecated::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_InfoMessage(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_BeginTransComplete(TransactionLevel, pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_CommitTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_RollbackTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_WillExecute(Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_ExecuteComplete(RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_WillConnect(ConnectionString, UserID, Password, Options, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_ConnectComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_Disconnect(adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Connection15_Deprecated wrapper method implementations +// + +inline _bstr_t Connection15_Deprecated::GetConnectionString ( ) { + BSTR _result = 0; + HRESULT _hr = get_ConnectionString(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutConnectionString ( _bstr_t pbstr ) { + HRESULT _hr = put_ConnectionString(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutCommandTimeout ( long plTimeout ) { + HRESULT _hr = put_CommandTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetConnectionTimeout ( ) { + long _result = 0; + HRESULT _hr = get_ConnectionTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutConnectionTimeout ( long plTimeout ) { + HRESULT _hr = put_ConnectionTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15_Deprecated::GetVersion ( ) { + BSTR _result = 0; + HRESULT _hr = get_Version(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT Connection15_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _Recordset_DeprecatedPtr Connection15_Deprecated::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline long Connection15_Deprecated::BeginTrans ( ) { + long _result = 0; + HRESULT _hr = raw_BeginTrans(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Connection15_Deprecated::CommitTrans ( ) { + HRESULT _hr = raw_CommitTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15_Deprecated::RollbackTrans ( ) { + HRESULT _hr = raw_RollbackTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15_Deprecated::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) { + HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline ErrorsPtr Connection15_Deprecated::GetErrors ( ) { + struct Errors * _result = 0; + HRESULT _hr = get_Errors(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorsPtr(_result, false); +} + +inline _bstr_t Connection15_Deprecated::GetDefaultDatabase ( ) { + BSTR _result = 0; + HRESULT _hr = get_DefaultDatabase(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutDefaultDatabase ( _bstr_t pbstr ) { + HRESULT _hr = put_DefaultDatabase(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum IsolationLevelEnum Connection15_Deprecated::GetIsolationLevel ( ) { + enum IsolationLevelEnum _result; + HRESULT _hr = get_IsolationLevel(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutIsolationLevel ( enum IsolationLevelEnum Level ) { + HRESULT _hr = put_IsolationLevel(Level); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutAttributes ( long plAttr ) { + HRESULT _hr = put_Attributes(plAttr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorLocationEnum Connection15_Deprecated::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum Connection15_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutMode ( enum ConnectModeEnum plMode ) { + HRESULT _hr = put_Mode(plMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15_Deprecated::GetProvider ( ) { + BSTR _result = 0; + HRESULT _hr = get_Provider(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutProvider ( _bstr_t pbstr ) { + HRESULT _hr = put_Provider(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Connection15_Deprecated::OpenSchema ( enum SchemaEnum Schema, const _variant_t & Restrictions, const _variant_t & SchemaID ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_OpenSchema(Schema, Restrictions, SchemaID, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +// +// interface _Connection_Deprecated wrapper method implementations +// + +inline HRESULT _Connection_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset15_Deprecated wrapper method implementations +// + +inline PositionEnum_Param Recordset15_Deprecated::GetAbsolutePosition ( ) { + PositionEnum_Param _result; + HRESULT _hr = get_AbsolutePosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutAbsolutePosition ( PositionEnum_Param pl ) { + HRESULT _hr = put_AbsolutePosition(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutRefActiveConnection ( IDispatch * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutActiveConnection ( const _variant_t & pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15_Deprecated::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline VARIANT_BOOL Recordset15_Deprecated::GetBOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_BOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetBookmark ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Bookmark(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutBookmark ( const _variant_t & pvBookmark ) { + HRESULT _hr = put_Bookmark(pvBookmark); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15_Deprecated::GetCacheSize ( ) { + long _result = 0; + HRESULT _hr = get_CacheSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCacheSize ( long pl ) { + HRESULT _hr = put_CacheSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorTypeEnum Recordset15_Deprecated::GetCursorType ( ) { + enum CursorTypeEnum _result; + HRESULT _hr = get_CursorType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCursorType ( enum CursorTypeEnum plCursorType ) { + HRESULT _hr = put_CursorType(plCursorType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset15_Deprecated::GetadoEOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_adoEOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline Fields_DeprecatedPtr Recordset15_Deprecated::GetFields ( ) { + struct Fields_Deprecated * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Fields_DeprecatedPtr(_result, false); +} + +inline enum LockTypeEnum Recordset15_Deprecated::GetLockType ( ) { + enum LockTypeEnum _result; + HRESULT _hr = get_LockType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutLockType ( enum LockTypeEnum plLockType ) { + HRESULT _hr = put_LockType(plLockType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetMaxRecords ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_MaxRecords(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutMaxRecords ( ADO_LONGPTR plMaxRecords ) { + HRESULT _hr = put_MaxRecords(plMaxRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetRecordCount ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_RecordCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutRefSource ( IDispatch * pvSource ) { + HRESULT _hr = putref_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutSource ( _bstr_t pvSource ) { + HRESULT _hr = put_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15_Deprecated::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15_Deprecated::AddNew ( const _variant_t & FieldList, const _variant_t & Values ) { + HRESULT _hr = raw_AddNew(FieldList, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Delete ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_Delete(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Recordset15_Deprecated::GetRows ( long Rows, const _variant_t & Start, const _variant_t & Fields ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15_Deprecated::Move ( ADO_LONGPTR NumRecords, const _variant_t & Start ) { + HRESULT _hr = raw_Move(NumRecords, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveNext ( ) { + HRESULT _hr = raw_MoveNext(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MovePrevious ( ) { + HRESULT _hr = raw_MovePrevious(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveFirst ( ) { + HRESULT _hr = raw_MoveFirst(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveLast ( ) { + HRESULT _hr = raw_MoveLast(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Requery ( long Options ) { + HRESULT _hr = raw_Requery(Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::_xResync ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw__xResync(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Update ( const _variant_t & Fields, const _variant_t & Values ) { + HRESULT _hr = raw_Update(Fields, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline PositionEnum_Param Recordset15_Deprecated::GetAbsolutePage ( ) { + PositionEnum_Param _result; + HRESULT _hr = get_AbsolutePage(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutAbsolutePage ( PositionEnum_Param pl ) { + HRESULT _hr = put_AbsolutePage(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum EditModeEnum Recordset15_Deprecated::GetEditMode ( ) { + enum EditModeEnum _result; + HRESULT _hr = get_EditMode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetFilter ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Filter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutFilter ( const _variant_t & Criteria ) { + HRESULT _hr = put_Filter(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetPageCount ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_PageCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15_Deprecated::GetPageSize ( ) { + long _result = 0; + HRESULT _hr = get_PageSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutPageSize ( long pl ) { + HRESULT _hr = put_PageSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset15_Deprecated::GetSort ( ) { + BSTR _result = 0; + HRESULT _hr = get_Sort(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset15_Deprecated::PutSort ( _bstr_t Criteria ) { + HRESULT _hr = put_Sort(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15_Deprecated::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Recordset15_Deprecated::_xClone ( ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw__xClone(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT Recordset15_Deprecated::UpdateBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_UpdateBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::CancelBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_CancelBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum CursorLocationEnum Recordset15_Deprecated::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _Recordset_DeprecatedPtr Recordset15_Deprecated::NextRecordset ( VARIANT * RecordsAffected ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_NextRecordset(RecordsAffected, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline VARIANT_BOOL Recordset15_Deprecated::Supports ( enum CursorOptionEnum CursorOptions ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = raw_Supports(CursorOptions, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetCollect ( const _variant_t & Index ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Collect(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutCollect ( const _variant_t & Index, const _variant_t & pvar ) { + HRESULT _hr = put_Collect(Index, pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum MarshalOptionsEnum Recordset15_Deprecated::GetMarshalOptions ( ) { + enum MarshalOptionsEnum _result; + HRESULT _hr = get_MarshalOptions(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutMarshalOptions ( enum MarshalOptionsEnum peMarshal ) { + HRESULT _hr = put_MarshalOptions(peMarshal); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset15_Deprecated::Find ( _bstr_t Criteria, ADO_LONGPTR SkipRecords, enum SearchDirectionEnum SearchDirection, const _variant_t & Start ) { + HRESULT _hr = raw_Find(Criteria, SkipRecords, SearchDirection, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset20_Deprecated wrapper method implementations +// + +inline HRESULT Recordset20_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IUnknownPtr Recordset20_Deprecated::GetDataSource ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataSource(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Recordset20_Deprecated::PutRefDataSource ( IUnknown * ppunkDataSource ) { + HRESULT _hr = putref_DataSource(ppunkDataSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset20_Deprecated::_xSave ( _bstr_t FileName, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw__xSave(FileName, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IDispatchPtr Recordset20_Deprecated::GetActiveCommand ( ) { + IDispatch * _result = 0; + HRESULT _hr = get_ActiveCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IDispatchPtr(_result, false); +} + +inline void Recordset20_Deprecated::PutStayInSync ( VARIANT_BOOL pbStayInSync ) { + HRESULT _hr = put_StayInSync(pbStayInSync); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset20_Deprecated::GetStayInSync ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_StayInSync(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Recordset20_Deprecated::GetString ( enum StringFormatEnum StringFormat, long NumRows, _bstr_t ColumnDelimeter, _bstr_t RowDelimeter, _bstr_t NullExpr ) { + BSTR _result = 0; + HRESULT _hr = raw_GetString(StringFormat, NumRows, ColumnDelimeter, RowDelimeter, NullExpr, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Recordset20_Deprecated::GetDataMember ( ) { + BSTR _result = 0; + HRESULT _hr = get_DataMember(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset20_Deprecated::PutDataMember ( _bstr_t pbstrDataMember ) { + HRESULT _hr = put_DataMember(pbstrDataMember); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CompareEnum Recordset20_Deprecated::CompareBookmarks ( const _variant_t & Bookmark1, const _variant_t & Bookmark2 ) { + enum CompareEnum _result; + HRESULT _hr = raw_CompareBookmarks(Bookmark1, Bookmark2, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Recordset20_Deprecated::Clone ( enum LockTypeEnum LockType ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Clone(LockType, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT Recordset20_Deprecated::Resync ( enum AffectEnum AffectRecords, enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(AffectRecords, ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset21_Deprecated wrapper method implementations +// + +inline HRESULT Recordset21_Deprecated::Seek ( const _variant_t & KeyValues, enum SeekEnum SeekOption ) { + HRESULT _hr = raw_Seek(KeyValues, SeekOption); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline void Recordset21_Deprecated::PutIndex ( _bstr_t pbstrIndex ) { + HRESULT _hr = put_Index(pbstrIndex); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset21_Deprecated::GetIndex ( ) { + BSTR _result = 0; + HRESULT _hr = get_Index(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +// +// interface _Recordset_Deprecated wrapper method implementations +// + +inline HRESULT _Recordset_Deprecated::Save ( const _variant_t & Destination, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw_Save(Destination, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Command15_Deprecated wrapper method implementations +// + +inline _Connection_DeprecatedPtr Command15_Deprecated::GetActiveConnection ( ) { + struct _Connection_Deprecated * _result = 0; + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Connection_DeprecatedPtr(_result, false); +} + +inline void Command15_Deprecated::PutRefActiveConnection ( struct _Connection_Deprecated * ppvObject ) { + HRESULT _hr = putref_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Command15_Deprecated::PutActiveConnection ( const _variant_t & ppvObject ) { + HRESULT _hr = put_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Command15_Deprecated::GetCommandText ( ) { + BSTR _result = 0; + HRESULT _hr = get_CommandText(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15_Deprecated::PutCommandText ( _bstr_t pbstr ) { + HRESULT _hr = put_CommandText(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Command15_Deprecated::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15_Deprecated::PutCommandTimeout ( long pl ) { + HRESULT _hr = put_CommandTimeout(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Command15_Deprecated::GetPrepared ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_Prepared(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15_Deprecated::PutPrepared ( VARIANT_BOOL pfPrepared ) { + HRESULT _hr = put_Prepared(pfPrepared); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _Recordset_DeprecatedPtr Command15_Deprecated::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline _Parameter_DeprecatedPtr Command15_Deprecated::CreateParameter ( _bstr_t Name, enum DataTypeEnum Type, enum ParameterDirectionEnum Direction, ADO_LONGPTR Size, const _variant_t & Value ) { + struct _Parameter_Deprecated * _result = 0; + HRESULT _hr = raw_CreateParameter(Name, Type, Direction, Size, Value, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Parameter_DeprecatedPtr(_result, false); +} + +inline Parameters_DeprecatedPtr Command15_Deprecated::GetParameters ( ) { + struct Parameters_Deprecated * _result = 0; + HRESULT _hr = get_Parameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Parameters_DeprecatedPtr(_result, false); +} + +inline void Command15_Deprecated::PutCommandType ( enum CommandTypeEnum plCmdType ) { + HRESULT _hr = put_CommandType(plCmdType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CommandTypeEnum Command15_Deprecated::GetCommandType ( ) { + enum CommandTypeEnum _result; + HRESULT _hr = get_CommandType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Command15_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15_Deprecated::PutName ( _bstr_t pbstrName ) { + HRESULT _hr = put_Name(pbstrName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Command25_Deprecated wrapper method implementations +// + +inline long Command25_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Command25_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Command_Deprecated wrapper method implementations +// + +inline void _Command_Deprecated::PutRefCommandStream ( IUnknown * pvStream ) { + HRESULT _hr = putref_CommandStream(pvStream); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Command_Deprecated::GetCommandStream ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_CommandStream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Command_Deprecated::PutDialect ( _bstr_t pbstrDialect ) { + HRESULT _hr = put_Dialect(pbstrDialect); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Command_Deprecated::GetDialect ( ) { + BSTR _result = 0; + HRESULT _hr = get_Dialect(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Command_Deprecated::PutNamedParameters ( VARIANT_BOOL pfNamedParameters ) { + HRESULT _hr = put_NamedParameters(pfNamedParameters); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL _Command_Deprecated::GetNamedParameters ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_NamedParameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface RecordsetEventsVt_Deprecated wrapper method implementations +// + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeField(cFields, Fields, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FieldChangeComplete(cFields, Fields, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeRecord(adReason, cRecords, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_RecordChangeComplete(adReason, cRecords, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeRecordset(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_RecordsetChangeComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillMove(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_MoveComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_EndOfRecordset(fMoreData, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FetchProgress(Progress, MaxProgress, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FetchComplete(pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Record_Deprecated wrapper method implementations +// + +inline _variant_t _Record_Deprecated::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record_Deprecated::PutActiveConnection ( _bstr_t pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record_Deprecated::PutRefActiveConnection ( struct _Connection_Deprecated * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Record_Deprecated::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t _Record_Deprecated::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record_Deprecated::PutSource ( _bstr_t pvar ) { + HRESULT _hr = put_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record_Deprecated::PutRefSource ( IDispatch * pvar ) { + HRESULT _hr = putref_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum _Record_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Record_Deprecated::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Record_Deprecated::GetParentURL ( ) { + BSTR _result = 0; + HRESULT _hr = get_ParentURL(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record_Deprecated::MoveRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum MoveRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_MoveRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record_Deprecated::CopyRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum CopyRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_CopyRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Record_Deprecated::DeleteRecord ( _bstr_t Source, VARIANT_BOOL Async ) { + HRESULT _hr = raw_DeleteRecord(Source, Async); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record_Deprecated::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum ConnectModeEnum Mode, enum RecordCreateOptionsEnum CreateOptions, enum RecordOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, Mode, CreateOptions, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline Fields_DeprecatedPtr _Record_Deprecated::GetFields ( ) { + struct Fields_Deprecated * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Fields_DeprecatedPtr(_result, false); +} + +inline enum RecordTypeEnum _Record_Deprecated::GetRecordType ( ) { + enum RecordTypeEnum _result; + HRESULT _hr = get_RecordType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr _Record_Deprecated::GetChildren ( ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_GetChildren(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT _Record_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} diff --git a/java_git/.gitignore b/java_git/.gitignore new file mode 100644 index 0000000..82eca33 --- /dev/null +++ b/java_git/.gitignore @@ -0,0 +1,25 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ \ No newline at end of file diff --git a/java_git/.mvn/wrapper/maven-wrapper.jar b/java_git/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..9cc84ea Binary files /dev/null and b/java_git/.mvn/wrapper/maven-wrapper.jar differ diff --git a/java_git/.mvn/wrapper/maven-wrapper.properties b/java_git/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..b573bb5 --- /dev/null +++ b/java_git/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip diff --git a/java_git/README.md b/java_git/README.md new file mode 100644 index 0000000..fe06b4a --- /dev/null +++ b/java_git/README.md @@ -0,0 +1 @@ +SpringBoot集成JWT实现token验证 \ No newline at end of file diff --git a/java_git/lib/javax.ejb.jar b/java_git/lib/javax.ejb.jar new file mode 100644 index 0000000..4ebf5ec Binary files /dev/null and b/java_git/lib/javax.ejb.jar differ diff --git a/java_git/lib/javax.jms.jar b/java_git/lib/javax.jms.jar new file mode 100644 index 0000000..d31451a Binary files /dev/null and b/java_git/lib/javax.jms.jar differ diff --git a/java_git/lib/javax.persistence.jar b/java_git/lib/javax.persistence.jar new file mode 100644 index 0000000..21d80e0 Binary files /dev/null and b/java_git/lib/javax.persistence.jar differ diff --git a/java_git/lib/javax.resource.jar b/java_git/lib/javax.resource.jar new file mode 100644 index 0000000..696a234 Binary files /dev/null and b/java_git/lib/javax.resource.jar differ diff --git a/java_git/lib/javax.servlet.jsp.jar b/java_git/lib/javax.servlet.jsp.jar new file mode 100644 index 0000000..9c0631c Binary files /dev/null and b/java_git/lib/javax.servlet.jsp.jar differ diff --git a/java_git/lib/javax.servlet.jsp.jstl.jar b/java_git/lib/javax.servlet.jsp.jstl.jar new file mode 100644 index 0000000..7be17cc Binary files /dev/null and b/java_git/lib/javax.servlet.jsp.jstl.jar differ diff --git a/java_git/lib/javax.transaction.jar b/java_git/lib/javax.transaction.jar new file mode 100644 index 0000000..729c695 Binary files /dev/null and b/java_git/lib/javax.transaction.jar differ diff --git a/java_git/mvnw b/java_git/mvnw new file mode 100644 index 0000000..5bf251c --- /dev/null +++ b/java_git/mvnw @@ -0,0 +1,225 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Migwn, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +echo $MAVEN_PROJECTBASEDIR +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/java_git/mvnw.cmd b/java_git/mvnw.cmd new file mode 100644 index 0000000..019bd74 --- /dev/null +++ b/java_git/mvnw.cmd @@ -0,0 +1,143 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/java_git/pom.xml b/java_git/pom.xml new file mode 100644 index 0000000..ef5707d --- /dev/null +++ b/java_git/pom.xml @@ -0,0 +1,356 @@ + + + 4.0.0 + + com.pjb + ConnorSendMail + 2.0.0 + jar + + springboot-jjwt + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.3.7.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + true + + + + + + org.springframework.boot + spring-boot-starter-mail + 2.3.7.RELEASE + + + + org.springframework.boot + spring-boot-starter-amqp + 2.3.7.RELEASE + + + com.microsoft.sqlserver + mssql-jdbc + 6.1.0.jre8 + + + + io.springfox + springfox-swagger2 + 2.9.2 + + + + io.springfox + springfox-swagger-ui + 2.9.2 + + + + org.springframework.boot + spring-boot-starter-web + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 1.3.2 + + + com.alibaba + fastjson + 1.2.47 + + + io.jsonwebtoken + jjwt + 0.9.1 + + + com.auth0 + java-jwt + 3.4.0 + + + + mysql + mysql-connector-java + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.oracle + ojdbc8 + 12.2.0.1 + + + + org.springframework.boot + spring-boot-starter + 2.0.3.RELEASE + + + + com.itextpdf + itextpdf + 5.2.0 + + + com.itextpdf + itext-asian + 5.2.0 + + + + javax.xml.bind + jaxb-api + 2.4.0-b180830.0359 + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + true + lib/ + com.pjb.springbootjjwt.SpringbootJjwtApplication + + + + + + + + + + diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/SpringbootJjwtApplication.java b/java_git/src/main/java/com/pjb/springbootjjwt/SpringbootJjwtApplication.java new file mode 100644 index 0000000..f6bde4b --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/SpringbootJjwtApplication.java @@ -0,0 +1,16 @@ +package com.pjb.springbootjjwt; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; + + +@SpringBootApplication +//@MapperScan("com.pjb.springbootjjwt.mapper") +public class SpringbootJjwtApplication { + + public static void main(String[] args) { + ConfigurableApplicationContext contenxt = SpringApplication.run(SpringbootJjwtApplication.class, args); + } +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/annotation/PassToken.java b/java_git/src/main/java/com/pjb/springbootjjwt/annotation/PassToken.java new file mode 100644 index 0000000..4ab52b1 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/annotation/PassToken.java @@ -0,0 +1,13 @@ +package com.pjb.springbootjjwt.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface PassToken { + boolean required() default true; +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/annotation/UserLoginToken.java b/java_git/src/main/java/com/pjb/springbootjjwt/annotation/UserLoginToken.java new file mode 100644 index 0000000..612f366 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/annotation/UserLoginToken.java @@ -0,0 +1,13 @@ +package com.pjb.springbootjjwt.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserLoginToken { + boolean required() default true; +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/config/InterceptorConfig.java b/java_git/src/main/java/com/pjb/springbootjjwt/config/InterceptorConfig.java new file mode 100644 index 0000000..986f5da --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/config/InterceptorConfig.java @@ -0,0 +1,21 @@ +package com.pjb.springbootjjwt.config; + +import com.pjb.springbootjjwt.interceptor.AuthenticationInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + + +@Configuration +public class InterceptorConfig implements WebMvcConfigurer { + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authenticationInterceptor()) + .addPathPatterns("/**"); // 拦截所有请求,通过判断是否有 @LoginRequired 注解 决定是否需要登录 + } + @Bean + public AuthenticationInterceptor authenticationInterceptor() { + return new AuthenticationInterceptor(); + } +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/config/SwaggerConfig.java b/java_git/src/main/java/com/pjb/springbootjjwt/config/SwaggerConfig.java new file mode 100644 index 0000000..be5dff6 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/config/SwaggerConfig.java @@ -0,0 +1,10 @@ +package com.pjb.springbootjjwt.config; + +import org.springframework.context.annotation.Configuration; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Configuration //说明这是一个配置类 +@EnableSwagger2// 该注解开启Swagger2的自动配置 +public class SwaggerConfig { + +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/control/CNServerController.java b/java_git/src/main/java/com/pjb/springbootjjwt/control/CNServerController.java new file mode 100644 index 0000000..1939662 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/control/CNServerController.java @@ -0,0 +1,162 @@ +package com.pjb.springbootjjwt.control; + +import com.alibaba.fastjson.JSONObject; +import com.pjb.springbootjjwt.SpringbootJjwtApplication; +import com.pjb.springbootjjwt.entity.ServerDwgtopdfEntry; +import com.pjb.springbootjjwt.entity.ServerMailEntry; +import com.pjb.springbootjjwt.entity.ServerSignoffEntry; +import com.pjb.springbootjjwt.mapper.MailContentMapper; +import com.pjb.springbootjjwt.service.serviceImpl.IMailServiceImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +@RestController +@RequestMapping("server") +public class CNServerController { + + private final Logger logger = LoggerFactory.getLogger(CNServerController.class); + /**发送邮件服务*/ + @Autowired + IMailServiceImpl sendMailService; + + /**使用RabbitTemplate,这提供了接收/发送等等方法*/ + @Autowired + RabbitTemplate rabbitTemplate; + + @Autowired + private MailContentMapper mailMapper; + /** + * 后台发送邮件的服务 + * @param mailinfo 发送邮件的信息 + * @return + */ +// @PostMapping(value = "/sendmail") +// public Object sendMail(@RequestBody ServerMailEntry mailinfo) +// { +// System.out.println("请求发送邮件"); +// logger.warn("请求发送邮件"); +// JSONObject jsonObject=new JSONObject(); +// if(mailinfo == null){ +// System.out.println("发送邮件失败,获取接口参数内容为空!!!"); +// logger.warn("发送邮件失败,获取接口参数内容为空!!!"); +// jsonObject.put("success", false); +// jsonObject.put("message", "发送邮件失败"); +// jsonObject.put("errorMessage","接口入参,参数不正确"); +// return jsonObject; +// } +// System.out.println("请求的数据:"+mailinfo.toString()); +// logger.warn("请求的数据:"+mailinfo.toString()); +// try { +// jsonObject.put("mailInfo",mailinfo.toString()); +// if(mailinfo.getFinddb()!=null&&!"".equals(mailinfo.getFinddb())){ +// String content = mailMapper.findMailContent(mailinfo.getFinddb(),mailinfo.getTo()[0]); +// if(content!=null&&!"".equals(content)) { +// String[] contents = content.split("#-#"); +// String[] tagters = contents[0].split("="); +// String[] references = contents[1].split("="); +// String alltagters = "

目标:

"; +// if (tagters.length > 1) { +// String[] tagter = tagters[1].split("\\|"); +// for (int i = 0; i < tagter.length; i++) { +// String[] value = tagter[i].split("#~#"); +// alltagters = alltagters + ""; +// } +// } +// alltagters = alltagters + "
名称类型
" + value[0] + "" + value[1] + "

引用:

"; +// if (references.length > 1) { +// String[] tagter = references[1].split("\\|"); +// for (int i = 0; i < tagter.length; i++) { +// String[] value = tagter[i].split("#~#"); +// alltagters = alltagters + ""; +// } +// } +// alltagters = alltagters + "
名称类型
" + value[0] + "" + value[1] + "
"; +// mailinfo.setContent(mailinfo.getContent() + alltagters); +// } +// } +// sendMailService.sendHtmlMail(mailinfo.getNickname(),mailinfo.getTo(),mailinfo.getCc(),mailinfo.getSubject(),mailinfo.getContent()); +// jsonObject.put("success", true); +// jsonObject.put("message", "发送邮件完成"); +// System.out.println("邮件内容:"+mailinfo.getContent()); +// logger.warn("邮件内容:"+mailinfo.getContent()); +// System.out.println("发送邮件完成!!!"); +// logger.warn("发送邮件完成!!!"); +// } catch (Exception e) { +// System.out.println("发送邮件失败:"+e.getMessage()); +// logger.warn("发送邮件失败:",e); +// jsonObject.put("success", false); +// jsonObject.put("message", "发送邮件失败"); +// jsonObject.put("errorMessage",e.getMessage()); +// } +// System.gc(); +// return jsonObject; +// } + + +// /** +// * 后台dwg转PDF服务,转好后直接将转换成功的pdf文件下挂到teamcenter中 +// * @param dwgtopdfEntry +// * @return +// */ +// @PostMapping(value = "/dwgtopdf") +// public Object dwgToPdf(@RequestBody ServerDwgtopdfEntry dwgtopdfEntry) +// { +// logger.info("请求DWG转PDF"); +// logger.info("请求的数据:"+dwgtopdfEntry.toString()); +// System.out.println("in dwgtopdf server "+new Date()); +// JSONObject jsonObject=new JSONObject(); +// System.out.println(dwgtopdfEntry.toString()); +// jsonObject.put("data",dwgtopdfEntry); +// String messageId = String.valueOf(UUID.randomUUID()); +// String createTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); +// Map map=new HashMap<>(); +// map.put("messageId",messageId); +// map.put("messageData",dwgtopdfEntry); +// map.put("createTime",createTime); +// //将消息携带绑定键值:TestDirectRouting 发送到交换机TestDirectExchange +// rabbitTemplate.convertAndSend("SuporDwgtopdfQueueExchange", "SuporDwgtopdfQueueRouting", map); +// logger.info("发送数据到队列成功!!!"); +// return jsonObject; +// } + + /** + * 后台电子签名 + * @param signoffEntry 电子签名信息 + * @return + */ + @PostMapping(value = "/signoff") + public Object signoff(@RequestBody ServerSignoffEntry signoffEntry) + { + logger.info("请求PDF签字"); + logger.info("请求的数据:"+signoffEntry.toString()); + System.out.println("in signoff server "+new Date()); + JSONObject jsonObject=new JSONObject(); + System.out.println(signoffEntry.toString()); + + jsonObject.put("data",signoffEntry); + String messageId = String.valueOf(UUID.randomUUID()); + String createTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + Map map=new HashMap<>(); + map.put("messageId",messageId); + map.put("messageData",signoffEntry); + map.put("createTime",createTime); + //将消息携带绑定键值:TestDirectRouting 发送到交换机TestDirectExchange + rabbitTemplate.convertAndSend("SuporSignoffQueueExchange", "SuporSignoffQueueRouting", map); + logger.info("发送数据到队列成功!!!"); + return jsonObject; + } +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerDwgtopdfEntry.java b/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerDwgtopdfEntry.java new file mode 100644 index 0000000..0ac5079 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerDwgtopdfEntry.java @@ -0,0 +1,25 @@ +package com.pjb.springbootjjwt.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.HashMap; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ServerDwgtopdfEntry implements Serializable { + String[] tccomponentuid; + String[] tcdatasetuid; + String[] pdfuid; + String tccomponentrelation; + String dwgtype; + String dwgreferencename; + String tcoriginalfilename; + String tcdepartmentid; + String taskpuid; + String tcstatus; + HashMap signinfos; +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerMailEntry.java b/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerMailEntry.java new file mode 100644 index 0000000..effea38 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerMailEntry.java @@ -0,0 +1,19 @@ +package com.pjb.springbootjjwt.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ServerMailEntry { + String nickname; + String from; + String[] to; + String[] cc; + String subject; + String title; + String content; + String finddb; +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerSignoffEntry.java b/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerSignoffEntry.java new file mode 100644 index 0000000..86aa25d --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/entity/ServerSignoffEntry.java @@ -0,0 +1,41 @@ +package com.pjb.springbootjjwt.entity; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.HashMap; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ServerSignoffEntry implements Serializable { + /**是否签名PDF,如果不是PDF则转换成PDF后进行签名*/ + boolean issignpdf = true; + + boolean isoriginalfilepdf = false; + boolean isoriginalfiledwg = false; + boolean istranslatepdf = false; + /**基地代号*/ + String tcdepartmentid; + /**tc中的数据集UID*/ + String tcdatasetuid ; + /**tc中的对象UID*/ + String tccomponentuid; + /**tc中的签名后文件下挂到对象的关系*/ + String tccomponentrelation; + String pdfuid; + String tcpdfrelation; + String tcoriginalname; + String tcoriginalext; + String tcoriginalfilename; + String tcpdffilename; + String tcsigninfofilename; + String dwgtype; + String taskpuid; + //pdf发布状态 + String tcstatus; + HashMap signinfos; +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/entity/User.java b/java_git/src/main/java/com/pjb/springbootjjwt/entity/User.java new file mode 100644 index 0000000..a265963 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/entity/User.java @@ -0,0 +1,15 @@ +package com.pjb.springbootjjwt.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class User { + String app_secret; + String username; + String password; +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/interceptor/AuthenticationInterceptor.java b/java_git/src/main/java/com/pjb/springbootjjwt/interceptor/AuthenticationInterceptor.java new file mode 100644 index 0000000..62691ec --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/interceptor/AuthenticationInterceptor.java @@ -0,0 +1,82 @@ +package com.pjb.springbootjjwt.interceptor; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTDecodeException; +import com.auth0.jwt.exceptions.JWTVerificationException; +import com.pjb.springbootjjwt.annotation.PassToken; +import com.pjb.springbootjjwt.annotation.UserLoginToken; +import com.pjb.springbootjjwt.entity.User; +import com.pjb.springbootjjwt.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; + + + +public class AuthenticationInterceptor implements HandlerInterceptor { + @Autowired + UserService userService; + @Override + public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception { + String token = httpServletRequest.getHeader("access_token");// 从 http 请求头中取出 token + // 如果不是映射到方法直接通过 + if(!(object instanceof HandlerMethod)){ + return true; + } + HandlerMethod handlerMethod=(HandlerMethod)object; + Method method=handlerMethod.getMethod(); + //检查是否有passtoken注释,有则跳过认证 + if (method.isAnnotationPresent(PassToken.class)) { + PassToken passToken = method.getAnnotation(PassToken.class); + if (passToken.required()) { + return true; + } + } + //检查有没有需要用户权限的注解 + if (method.isAnnotationPresent(UserLoginToken.class)) { + UserLoginToken userLoginToken = method.getAnnotation(UserLoginToken.class); + if (userLoginToken.required()) { + // 执行认证 + if (token == null) { + throw new RuntimeException("无token,请重新登录"); + } + // 获取 token 中的 user id + String userId; + try { + userId = JWT.decode(token).getAudience().get(0); + } catch (JWTDecodeException j) { + throw new RuntimeException("token验证失败"); + } + User user = userService.findUserById(userId); + if (user == null) { + throw new RuntimeException("用户不存在,请重新登录"); + } + // 验证 token + JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(user.getPassword())).build(); + try { + jwtVerifier.verify(token); + } catch (JWTVerificationException e) { + throw new RuntimeException("token验证失败"); + } + return true; + } + } + return true; + } + + @Override + public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception { + + } + @Override + public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { + + } +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/interceptor/GloablExceptionHandler.java b/java_git/src/main/java/com/pjb/springbootjjwt/interceptor/GloablExceptionHandler.java new file mode 100644 index 0000000..73e29a1 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/interceptor/GloablExceptionHandler.java @@ -0,0 +1,22 @@ +package com.pjb.springbootjjwt.interceptor; + +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + + +@ControllerAdvice +public class GloablExceptionHandler { + @ResponseBody + @ExceptionHandler(Exception.class) + public Object handleException(Exception e) { + String msg = e.getMessage(); + if (msg == null || msg.equals("")) { + msg = "服务器出错"; + } + JSONObject jsonObject = new JSONObject(); + jsonObject.put("message", msg); + return jsonObject; + } +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/mapper/MailContentMapper.java b/java_git/src/main/java/com/pjb/springbootjjwt/mapper/MailContentMapper.java new file mode 100644 index 0000000..bf6bc4d --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/mapper/MailContentMapper.java @@ -0,0 +1,13 @@ +package com.pjb.springbootjjwt.mapper; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Mapper +@Repository +public interface MailContentMapper { + String findMailContent(@Param("puid")String puid,@Param("user_mail")String user_mail); +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/mapper/UserMapper.java b/java_git/src/main/java/com/pjb/springbootjjwt/mapper/UserMapper.java new file mode 100644 index 0000000..f361264 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/mapper/UserMapper.java @@ -0,0 +1,16 @@ +package com.pjb.springbootjjwt.mapper; + +import com.pjb.springbootjjwt.entity.User; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface UserMapper { + User findByUsername(@Param("username") String username); + + User findByUsernameAndId(@Param("username") String username, @Param("app_secret") String Id); + + User findUserById(@Param("app_secret") String Id); +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/service/IMailService.java b/java_git/src/main/java/com/pjb/springbootjjwt/service/IMailService.java new file mode 100644 index 0000000..e43e06f --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/service/IMailService.java @@ -0,0 +1,34 @@ +package com.pjb.springbootjjwt.service; + + +import javax.mail.MessagingException; + +public interface IMailService { + + /** + * 发送文本邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + */ + void sendSimpleMail(String to, String subject, String content); + + /** + * 发送HTML邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + */ + public void sendHtmlMail(String nickName,String[] to,String[] cc, String subject, String content) throws MessagingException, Exception; + + + + /** + * 发送带附件的邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + * @param filePath 附件 + */ + public void sendAttachmentsMail(String to, String subject, String content, String filePath); +} \ No newline at end of file diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/service/TokenService.java b/java_git/src/main/java/com/pjb/springbootjjwt/service/TokenService.java new file mode 100644 index 0000000..3a6316d --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/service/TokenService.java @@ -0,0 +1,18 @@ +package com.pjb.springbootjjwt.service; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.pjb.springbootjjwt.entity.User; +import org.springframework.stereotype.Service; + + + +@Service("TokenService") +public class TokenService { + public String getToken(User user) { + String token=""; + token = JWT.create().withAudience(user.getApp_secret())// 将 user id 保存到 token 里面 + .sign(Algorithm.HMAC256(user.getPassword()));// 以 password 作为 token 的密钥 + return token; + } +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/service/UserService.java b/java_git/src/main/java/com/pjb/springbootjjwt/service/UserService.java new file mode 100644 index 0000000..4896e91 --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/service/UserService.java @@ -0,0 +1,26 @@ +package com.pjb.springbootjjwt.service; + +import com.pjb.springbootjjwt.entity.User; +import com.pjb.springbootjjwt.mapper.UserMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service("UserService") +public class UserService { + @Autowired + UserMapper userMapper; + + public User findByUsername(User user) { + return userMapper.findByUsername(user.getUsername()); + } + + public User findByUsernameAndId(User user) { + return userMapper.findByUsernameAndId(user.getUsername(), user.getApp_secret()); + } + + public User findUserById(String userId) { + return userMapper.findUserById(userId); + } + +} diff --git a/java_git/src/main/java/com/pjb/springbootjjwt/service/serviceImpl/IMailServiceImpl.java b/java_git/src/main/java/com/pjb/springbootjjwt/service/serviceImpl/IMailServiceImpl.java new file mode 100644 index 0000000..86792fb --- /dev/null +++ b/java_git/src/main/java/com/pjb/springbootjjwt/service/serviceImpl/IMailServiceImpl.java @@ -0,0 +1,125 @@ +package com.pjb.springbootjjwt.service.serviceImpl; + +import com.pjb.springbootjjwt.service.IMailService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.FileSystemResource; +import org.springframework.mail.SimpleMailMessage; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.stereotype.Service; + +import javax.mail.MessagingException; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import java.io.File; + + +@Service("SendMailService") +public class IMailServiceImpl implements IMailService { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + + /** + * Spring Boot 提供了一个发送邮件的简单抽象,使用的是下面这个接口,这里直接注入即可使用 + */ + @Autowired + private JavaMailSender mailSender; + + /** + * 配置文件中我的qq邮箱 + */ + @Value("${spring.mail.from}") + private String from; + + /** + * 简单文本邮件 + * + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + */ + @Override + public void sendSimpleMail(String to, String subject, String content) { + //创建SimpleMailMessage对象 + SimpleMailMessage message = new SimpleMailMessage(); + //邮件发送人 + message.setFrom(from); + //邮件接收人 + message.setTo(to); + //邮件主题 + message.setSubject(subject); + //邮件内容 + message.setText(content); + //发送邮件 + mailSender.send(message); + } + + /** + * html邮件 + * + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + */ + @Override + public void sendHtmlMail(String nickName, String[] to, String[] cc, String subject, String content) throws Exception { + //获取MimeMessage对象 + MimeMessage message = mailSender.createMimeMessage(); + MimeMessageHelper messageHelper; + + messageHelper = new MimeMessageHelper(message, true); + //邮件发送人 + if (nickName == null) { + messageHelper.setFrom(from); + } else { + messageHelper.setFrom(new InternetAddress(from, nickName)); + } + //邮件接收人 + messageHelper.setTo(to); + //邮件抄送人 + if (cc != null) { + messageHelper.setCc(cc); + } + //邮件主题 + messageHelper.setSubject(subject); + //邮件内容,html格式 + String contents = content.replace("\\\\","\\"); + messageHelper.setText(content, true); + //发送 + mailSender.send(messageHelper.getMimeMessage()); + } + + /** + * 带附件的邮件 + * + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + * @param filePath 附件 + */ + @Override + public void sendAttachmentsMail(String to, String subject, String content, String filePath) { + MimeMessage message = mailSender.createMimeMessage(); + try { + MimeMessageHelper helper = new MimeMessageHelper(message, true); + helper.setFrom(from); + helper.setTo(to); + helper.setSubject(subject); + helper.setText(content, true); + + FileSystemResource file = new FileSystemResource(new File(filePath)); + String fileName = filePath.substring(filePath.lastIndexOf(File.separator)); + helper.addAttachment(fileName, file); + mailSender.send(message); + //日志信息 + logger.info("邮件已经发送。"); + } catch (MessagingException e) { + logger.error("发送邮件时发生异常!", e); + } + + + } +} diff --git a/java_git/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/java_git/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000..0af6036 --- /dev/null +++ b/java_git/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,29 @@ +{ + "properties": [ + { + "name": "teamcenter.url", + "type": "java.lang.String", + "description": "Description for teamcenter.url." + }, + { + "name": "teamcenter.user", + "type": "java.lang.String", + "description": "Description for teamcenter.user." + }, + { + "name": "teamcenter.pwd", + "type": "java.lang.String", + "description": "Description for teamcenter.pwd." + }, + { + "name": "teamcenter.fmsurl", + "type": "java.lang.String", + "description": "Description for teamcenter.fmsurl." + }, + { + "name": "teamcenter.fcccash", + "type": "java.lang.String", + "description": "Description for teamcenter.fcccash." + } + ] +} \ No newline at end of file diff --git a/java_git/src/main/resources/application.yaml b/java_git/src/main/resources/application.yaml new file mode 100644 index 0000000..febee6d --- /dev/null +++ b/java_git/src/main/resources/application.yaml @@ -0,0 +1,16 @@ +debug: false +server: + port: 9293 +spring: + application: + name: ConnorServer + rabbitmq: + host: localhost + port: 5672 + username: admin + password: admin + #虚拟host 可以不设置,使用server默认host + virtual-host: suporserver +##mybatis配置文件 +#mybatis: +# config-location: classpath:mybatis.xml \ No newline at end of file diff --git a/java_git/src/main/resources/com/pjb/springbootjjwt/mapper/MailContentMapper.xml b/java_git/src/main/resources/com/pjb/springbootjjwt/mapper/MailContentMapper.xml new file mode 100644 index 0000000..123799a --- /dev/null +++ b/java_git/src/main/resources/com/pjb/springbootjjwt/mapper/MailContentMapper.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/java_git/src/main/resources/com/pjb/springbootjjwt/mapper/UserMapper.xml b/java_git/src/main/resources/com/pjb/springbootjjwt/mapper/UserMapper.xml new file mode 100644 index 0000000..26a982f --- /dev/null +++ b/java_git/src/main/resources/com/pjb/springbootjjwt/mapper/UserMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/java_git/src/main/resources/logback-spring.xml b/java_git/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..65624d6 --- /dev/null +++ b/java_git/src/main/resources/logback-spring.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java_git/src/main/resources/mybatis.xml b/java_git/src/main/resources/mybatis.xml new file mode 100644 index 0000000..8637727 --- /dev/null +++ b/java_git/src/main/resources/mybatis.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/java_git/src/main/resources/signpdfconfig.json b/java_git/src/main/resources/signpdfconfig.json new file mode 100644 index 0000000..8554320 --- /dev/null +++ b/java_git/src/main/resources/signpdfconfig.json @@ -0,0 +1,26 @@ +[ + {"departmentid":"wuhan", + "isleft": true, + "pdfsizes": [ + { + "sizename": "A4", + "wmin": 123, + "wmax": 200, + "hmin": 123, + "hmax": 124, + "poisions":[ + { + "property": "设计", + "xposition": 12, + "yposition": 25 + }, + { + "property": "审核", + "xposition": 12, + "yposition": 25 + } + ] + } + ] + } +] \ No newline at end of file diff --git a/java_git/src/test/java/com/pjb/springbootjjwt/SpringbootJjwtApplicationTests.java b/java_git/src/test/java/com/pjb/springbootjjwt/SpringbootJjwtApplicationTests.java new file mode 100644 index 0000000..8c06bc4 --- /dev/null +++ b/java_git/src/test/java/com/pjb/springbootjjwt/SpringbootJjwtApplicationTests.java @@ -0,0 +1,16 @@ +package com.pjb.springbootjjwt; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SpringbootJjwtApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/rabbit_server/.gitignore b/rabbit_server/.gitignore new file mode 100644 index 0000000..82eca33 --- /dev/null +++ b/rabbit_server/.gitignore @@ -0,0 +1,25 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ \ No newline at end of file diff --git a/rabbit_server/.mvn/wrapper/maven-wrapper.jar b/rabbit_server/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..9cc84ea Binary files /dev/null and b/rabbit_server/.mvn/wrapper/maven-wrapper.jar differ diff --git a/rabbit_server/.mvn/wrapper/maven-wrapper.properties b/rabbit_server/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..b573bb5 --- /dev/null +++ b/rabbit_server/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip diff --git a/rabbit_server/README.md b/rabbit_server/README.md new file mode 100644 index 0000000..862d66f --- /dev/null +++ b/rabbit_server/README.md @@ -0,0 +1 @@ +电子签名 \ No newline at end of file diff --git a/rabbit_server/bin/META-INF/additional-spring-configuration-metadata.json b/rabbit_server/bin/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000..0af6036 --- /dev/null +++ b/rabbit_server/bin/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,29 @@ +{ + "properties": [ + { + "name": "teamcenter.url", + "type": "java.lang.String", + "description": "Description for teamcenter.url." + }, + { + "name": "teamcenter.user", + "type": "java.lang.String", + "description": "Description for teamcenter.user." + }, + { + "name": "teamcenter.pwd", + "type": "java.lang.String", + "description": "Description for teamcenter.pwd." + }, + { + "name": "teamcenter.fmsurl", + "type": "java.lang.String", + "description": "Description for teamcenter.fmsurl." + }, + { + "name": "teamcenter.fcccash", + "type": "java.lang.String", + "description": "Description for teamcenter.fcccash." + } + ] +} \ No newline at end of file diff --git a/rabbit_server/bin/application.yaml b/rabbit_server/bin/application.yaml new file mode 100644 index 0000000..53e0617 --- /dev/null +++ b/rabbit_server/bin/application.yaml @@ -0,0 +1,96 @@ +debug: false +server: + port: 9294 +spring: + application: + name: ConnorServer + #Oracle数据库配置 + datasource: + driver-class-name: oracle.jdbc.OracleDriver + url: jdbc:oracle:thin:@172.24.16.143:1521:tc12 + username: infodba + password: infodba + #邮件配置 + mail: + #苏泊尔邮件发送配置 + host: smtp.supor.com + username: plmnotice@supor.com + password: b@6ae5u&w8q7 + from: plmnotice@supor.com + port: 2525 + properties.mail.smtp.port: 2525 + properties.mail.smtp.starttls.enable: false + properties.mail.smtp.starttls.required: false + properties.mail.smtp.ssl.enable: false + default-encoding: utf-8 + #康勒邮箱配置,测试用 +# host: smtp.connor.net.cn +# username: liujl@connor.net.cn +# password: Admin@1234 +# from: liujl@connor.net.cn +# port: 465 +# properties.mail.smtp.port: 465 +# properties.mail.smtp.starttls.enable: true +# properties.mail.smtp.starttls.required: true +# properties.mail.smtp.ssl.enable: true +# default-encoding: utf-8 + #配置rabbitMq 服务器 + rabbitmq: + #host: 172.24.16.143 + #host: 172.24.16.143 + host: localhost + #host: 172.24.13.163 + port: 5672 + username: admin + password: admin + #虚拟host 可以不设置,使用server默认host + virtual-host: suporserver +#服务器关闭设置 +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + shutdown: + enabled: true +#mybatis配置文件 +mybatis: + config-location: classpath:mybatis.xml + mapper-locations: classpath:com/pjb/springbootjjwt/mapper/*.xml +#teamcenter连接配置 +teamcenter: + #测试机配置 + + url: http://172.24.16.143:8085/tc + user: admin + pwd: SuporPlm123 + hz_fmsurl: http://HAHPA01PLMVOLM.cn.supor.corp:4544 + oem_fmsurl: http://HAHPA01PLMVOLM.cn.supor.corp:4544 + sx_fmsurl: http://SHXPA01PLMVOL:4544 + kq_fmsurl: http://SHXPA01PLMVOL:4544 + wh_fmsurl: http://WUHPA01PLMVOL:4544 + fcccash: D:/new_tcserver/FMS_CACHE + assignpath: D:/new_tcserver/SCRIPT_DIR + hz_group: DQHZ.DQ + hz_role: Reader + sx_group: DQSX.DQ + sx_role: Reader + wh_group: CJWH.CJ + wh_role: Reader + kq_group: DQSX.DQ + kq_role: Reader + oem_group: DQHZ.DQ + oem_role: Reader + localdepartmentid: sx + picpath: D:\\PICTURE\\ + picext: .png + #正式机信息 +# url: http://HAH01PLMAPP.cn.supor.corp:7001/tc +# user: zzhyin +# pwd: SuporPlm123 +# hz_fmsurl: http://HAHPA01PLMVOLM.cn.supor.corp:4544 +# sx_fmsurl: http://SHXPA01PLMVOL:4544 +# wh_fmsurl: http://WUHPA01PLMVOL:4544 +# fcccash: D:/new_tcserver/FMS_CACHE2 +# assignpath: D:/new_tcserver/SCRIPT_DIR diff --git a/rabbit_server/bin/com/pjb/springbootjjwt/mapper/MessageEntryMapper.xml b/rabbit_server/bin/com/pjb/springbootjjwt/mapper/MessageEntryMapper.xml new file mode 100644 index 0000000..d3b6ba7 --- /dev/null +++ b/rabbit_server/bin/com/pjb/springbootjjwt/mapper/MessageEntryMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + update connor_pdfmessage + + pdfpuid=#{pdfPuid},stage=#{stage} + + where itempuid=#{itemPuid} and datasetpuid=#{datasetPuid} + + + + update connor_pdfmessage + + stage=#{stage} + + where itempuid=#{itemPuid} and datasetpuid=#{datasetPuid} + + \ No newline at end of file diff --git a/rabbit_server/bin/com/pjb/springbootjjwt/mapper/UserMapper.xml b/rabbit_server/bin/com/pjb/springbootjjwt/mapper/UserMapper.xml new file mode 100644 index 0000000..26a982f --- /dev/null +++ b/rabbit_server/bin/com/pjb/springbootjjwt/mapper/UserMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/rabbit_server/bin/log4j.properties b/rabbit_server/bin/log4j.properties new file mode 100644 index 0000000..1e9190e --- /dev/null +++ b/rabbit_server/bin/log4j.properties @@ -0,0 +1,48 @@ +############# +# ̨ +############# + +# log4j.rootLogger־ͼֻڸü־ϢDEBUG < INFO < WARN < ERROR < FATAL +# WARN־ CONSOLEλԼһ logfileλԼһ +log4j.rootLogger=WARN,CONSOLE,logfile +# CONSOLĘ +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +# CONSOLEΪԶ岼ģʽ +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +# CONSOLE־ʽ [frame] 2019-08-22 22:52:12,000 %rķѺ %p־ȼ %t߳ %CͨΪȫ %Lек %x߳NDC %m־ %n +log4j.appender.CONSOLE.layout.ConversionPattern=[frame] %d{yyyy-MM-dd HH:mm:ss,SSS} - %-4r %-5p [%t] %C:%L %x - %m%n + +################ +# ־ļ +################ + +# logfileļ ļСָߴʱµ־ļ +log4j.appender.logfile=org.apache.log4j.RollingFileAppender +# ʽ +log4j.appender.logfile.Encoding=UTF-8 +# ļλôΪĿĿ¼µlogsļ +log4j.appender.logfile.File=D:/new_tcserver/logs/root.log +# ׺KB,MB,GBﵽôС󴴽µ־ļ +log4j.appender.logfile.MaxFileSize=10MB +# ùļֵ3 ָԲroot.log.1root.log.2root.log.3root.logĸ־ļ +log4j.appender.logfile.MaxBackupIndex=3 +# logfileΪԶ岼ģʽ +log4j.appender.logfile.layout=org.apache.log4j.PatternLayout +log4j.appender.logfile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %F %p %m%n + +########################## +# Բͬͬ־ļ +########################## + +# club.bagedateµ־ +log4j.logger.club.bagedate=DEBUG,bagedate +# Ϊfalse־ϢͲ뵽rootLogger +log4j.additivity.club.bagedate=false +# ͺһ +log4j.appender.bagedate=org.apache.log4j.RollingFileAppender +log4j.appender.bagedate.Encoding=UTF-8 +log4j.appender.bagedate.File=D:/new_tcserver/logs/bagedate.log +log4j.appender.bagedate.MaxFileSize=10MB +log4j.appender.bagedate.MaxBackupIndex=3 +log4j.appender.bagedate.layout=org.apache.log4j.PatternLayout +log4j.appender.bagedate.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %F %p %m%n diff --git a/rabbit_server/bin/logback-spring.xml b/rabbit_server/bin/logback-spring.xml new file mode 100644 index 0000000..7a556b0 --- /dev/null +++ b/rabbit_server/bin/logback-spring.xml @@ -0,0 +1,193 @@ + + + + + + + logback + + + + + + + + + + + + + + + + + info + + + ${CONSOLE_LOG_PATTERN} + + GBK + + + + + + + + ${log.path}/web_debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/web-debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/web_info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/web-info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/web_warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/web-warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/web_error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/web-error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rabbit_server/bin/mybatis.xml b/rabbit_server/bin/mybatis.xml new file mode 100644 index 0000000..8637727 --- /dev/null +++ b/rabbit_server/bin/mybatis.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/rabbit_server/bin/signpdfconfig.json b/rabbit_server/bin/signpdfconfig.json new file mode 100644 index 0000000..8554320 --- /dev/null +++ b/rabbit_server/bin/signpdfconfig.json @@ -0,0 +1,26 @@ +[ + {"departmentid":"wuhan", + "isleft": true, + "pdfsizes": [ + { + "sizename": "A4", + "wmin": 123, + "wmax": 200, + "hmin": 123, + "hmax": 124, + "poisions":[ + { + "property": "设计", + "xposition": 12, + "yposition": 25 + }, + { + "property": "审核", + "xposition": 12, + "yposition": 25 + } + ] + } + ] + } +] \ No newline at end of file diff --git a/rabbit_server/bin/signpdfconfig.xml b/rabbit_server/bin/signpdfconfig.xml new file mode 100644 index 0000000..840e6a6 --- /dev/null +++ b/rabbit_server/bin/signpdfconfig.xml @@ -0,0 +1,470 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rabbit_server/lib/javax.ejb.jar b/rabbit_server/lib/javax.ejb.jar new file mode 100644 index 0000000..4ebf5ec Binary files /dev/null and b/rabbit_server/lib/javax.ejb.jar differ diff --git a/rabbit_server/lib/javax.jms.jar b/rabbit_server/lib/javax.jms.jar new file mode 100644 index 0000000..d31451a Binary files /dev/null and b/rabbit_server/lib/javax.jms.jar differ diff --git a/rabbit_server/lib/javax.persistence.jar b/rabbit_server/lib/javax.persistence.jar new file mode 100644 index 0000000..21d80e0 Binary files /dev/null and b/rabbit_server/lib/javax.persistence.jar differ diff --git a/rabbit_server/lib/javax.resource.jar b/rabbit_server/lib/javax.resource.jar new file mode 100644 index 0000000..696a234 Binary files /dev/null and b/rabbit_server/lib/javax.resource.jar differ diff --git a/rabbit_server/lib/javax.servlet.jsp.jar b/rabbit_server/lib/javax.servlet.jsp.jar new file mode 100644 index 0000000..9c0631c Binary files /dev/null and b/rabbit_server/lib/javax.servlet.jsp.jar differ diff --git a/rabbit_server/lib/javax.servlet.jsp.jstl.jar b/rabbit_server/lib/javax.servlet.jsp.jstl.jar new file mode 100644 index 0000000..7be17cc Binary files /dev/null and b/rabbit_server/lib/javax.servlet.jsp.jstl.jar differ diff --git a/rabbit_server/lib/javax.transaction.jar b/rabbit_server/lib/javax.transaction.jar new file mode 100644 index 0000000..729c695 Binary files /dev/null and b/rabbit_server/lib/javax.transaction.jar differ diff --git a/rabbit_server/mvnw b/rabbit_server/mvnw new file mode 100644 index 0000000..5bf251c --- /dev/null +++ b/rabbit_server/mvnw @@ -0,0 +1,225 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Migwn, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +echo $MAVEN_PROJECTBASEDIR +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/rabbit_server/mvnw.cmd b/rabbit_server/mvnw.cmd new file mode 100644 index 0000000..019bd74 --- /dev/null +++ b/rabbit_server/mvnw.cmd @@ -0,0 +1,143 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/rabbit_server/pom.xml b/rabbit_server/pom.xml new file mode 100644 index 0000000..eb84bdf --- /dev/null +++ b/rabbit_server/pom.xml @@ -0,0 +1,360 @@ + + + 4.0.0 + + com.pjb + ConnorRabbitServer + 2.0.0 + jar + + springboot-jjwt + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.6.6 + + + + + UTF-8 + UTF-8 + 1.8 + true + + + + + + com.microsoft.sqlserver + mssql-jdbc + 6.1.0.jre8 + + + org.springframework.boot + spring-boot-starter-mail + 2.3.7.RELEASE + + + + org.springframework.boot + spring-boot-starter-amqp + 2.3.7.RELEASE + + + + io.springfox + springfox-swagger2 + 2.9.2 + + + + io.springfox + springfox-swagger-ui + 2.9.2 + + + + org.springframework.boot + spring-boot-starter-web + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 1.3.2 + + + com.alibaba + fastjson + 1.2.47 + + + io.jsonwebtoken + jjwt + 0.9.1 + + + com.auth0 + java-jwt + 3.4.0 + + + com.squareup.okhttp3 + okhttp + 3.10.0 + + + + com.squareup.okio + okio + 2.10.0 + + + mysql + mysql-connector-java + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.oracle + ojdbc8 + 12.2.0.1 + + + teamcenter + commons-io + 2.5 + + + teamcenter + commons-logging + 2.5 + + + teamcenter + fccclient + 12.3.0 + + + + teamcenter + fscclient + 12.3.0 + + + + teamcenter + httpclient + 12.3.0 + + + + teamcenter + httpcore + 12.3.0 + + + + teamcenter + httpmime + 12.3.0 + + + + teamcenter + log4j + 12.3.0 + + + + teamcenter + TcSoaAdministrationStrong + 12.3.0 + + + + teamcenter + TcSoaAiStrong + 12.3.0 + + + + teamcenter + TcSoaAllocationsStrong + 12.3.0 + + + + teamcenter + TcSoaBomStrong + 12.3.0 + + + + teamcenter + TcSoaBusinessModelerStrong + 12.3.0 + + + + teamcenter + TcSoaCadBomAlignmentStrong + 12.3.0 + + + + teamcenter + TcSoaCadStrong + 12.3.0 + + + + teamcenter + TcSoaCaeStrong + 12.3.0 + + + + teamcenter + TcSoaCalendarManagementStrong + 12.3.0 + + + + teamcenter + TcSoaChangeManagementStrong + 12.3.0 + + + + teamcenter + TcSoaClassificationStrong + 12.3.0 + + + + teamcenter + TcSoaClient + 12.3.0 + + + + teamcenter + TcSoaCommon + 12.3.0 + + + + teamcenter + TcSoaConfigurationStrong + 12.3.0 + + + + teamcenter + TcSoaCoreLoose + 12.3.0 + + + + teamcenter + TcSoaCoreStrong + 12.3.0 + + + + teamcenter + TcSoaDocumentManagementStrong + 12.3.0 + + + + teamcenter + TcSoaImportExportStrong + 12.3.0 + + + + teamcenter + TcSoaQueryStrong + 12.3.0 + + + + teamcenter + TcSoaStrongModel + 12.3.0 + + + + teamcenter + TcSoaWorkflowLoose + 12.3.0 + + + teamcenter + TcSoaWorkflowStrong + 12.3.0 + + + + teamcenter + xercesImpl + 12.3.0 + + + + teamcenter + xml-apis + 12.3.0 + + + + org.springframework.boot + spring-boot-starter + 2.0.3.RELEASE + + + + com.itextpdf + itextpdf + 5.2.0 + + + com.itextpdf + itext-asian + 5.2.0 + + + javax.xml.bind + jaxb-api + 2.4.0-b180830.0359 + + + org.testng + testng + 7.4.0 + compile + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + true + lib/ + com.pjb.springbootjjwt.SpringbootJjwtApplication + + + + + + + + + + diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/SpringbootJjwtApplication.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/SpringbootJjwtApplication.java new file mode 100644 index 0000000..043b5ad --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/SpringbootJjwtApplication.java @@ -0,0 +1,46 @@ +package com.pjb.springbootjjwt; + +//import com.teamcenter.soa.client.Connection; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; + +@SpringBootApplication +@MapperScan("com.pjb.springbootjjwt.mapper") +public class SpringbootJjwtApplication { + public static String TC_URL; + public static String TC_USER; + public static String TC_PWD; + public static String TC_FMSURL; + public static String TC_FCCCACH; + public static String TC_WORD_TOOL; + public static String TC_EXCEL_TOOL; +// public static String TC_DWG_TOOL; +// public static String TC_DWG_TOOL2; + public static String PICPATH; + public static String PICEXT; + public static Resource TC_PDF_CONFIGER_RESOURCE; +// public static String TC_ADMIN_MAIL; +// public static String BAT_PATH; + + public static void main(String[] args) { + ConfigurableApplicationContext contenxt = SpringApplication.run(SpringbootJjwtApplication.class, args); + TC_URL = contenxt.getEnvironment().getProperty("teamcenter.url"); + TC_USER = contenxt.getEnvironment().getProperty("teamcenter.user"); + TC_PWD = contenxt.getEnvironment().getProperty("teamcenter.pwd"); + TC_FCCCACH = contenxt.getEnvironment().getProperty("teamcenter.fcccash"); + TC_WORD_TOOL = contenxt.getEnvironment().getProperty("teamcenter.word_tool"); + TC_EXCEL_TOOL = contenxt.getEnvironment().getProperty("teamcenter.excel_tool"); +// TC_DWG_TOOL = contenxt.getEnvironment().getProperty("teamcenter.dwg_tool"); +// TC_DWG_TOOL2 = contenxt.getEnvironment().getProperty("teamcenter.dwg_tool2"); + TC_PDF_CONFIGER_RESOURCE = new ClassPathResource("signpdfconfig.xml"); + TC_FMSURL = contenxt.getEnvironment().getProperty("teamcenter.fmsurl"); + PICPATH = contenxt.getEnvironment().getProperty("teamcenter.picpath"); + PICEXT = contenxt.getEnvironment().getProperty("teamcenter.picext"); +// TC_ADMIN_MAIL = contenxt.getEnvironment().getProperty("teamcenter.admin_mail"); +// BAT_PATH = contenxt.getEnvironment().getProperty("teamcenter.bat_path"); + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/annotation/PassToken.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/annotation/PassToken.java new file mode 100644 index 0000000..4ab52b1 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/annotation/PassToken.java @@ -0,0 +1,13 @@ +package com.pjb.springbootjjwt.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface PassToken { + boolean required() default true; +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/annotation/UserLoginToken.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/annotation/UserLoginToken.java new file mode 100644 index 0000000..612f366 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/annotation/UserLoginToken.java @@ -0,0 +1,13 @@ +package com.pjb.springbootjjwt.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserLoginToken { + boolean required() default true; +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/config/InterceptorConfig.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/config/InterceptorConfig.java new file mode 100644 index 0000000..986f5da --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/config/InterceptorConfig.java @@ -0,0 +1,21 @@ +package com.pjb.springbootjjwt.config; + +import com.pjb.springbootjjwt.interceptor.AuthenticationInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + + +@Configuration +public class InterceptorConfig implements WebMvcConfigurer { + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authenticationInterceptor()) + .addPathPatterns("/**"); // 拦截所有请求,通过判断是否有 @LoginRequired 注解 决定是否需要登录 + } + @Bean + public AuthenticationInterceptor authenticationInterceptor() { + return new AuthenticationInterceptor(); + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/config/SwaggerConfig.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/config/SwaggerConfig.java new file mode 100644 index 0000000..be5dff6 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/config/SwaggerConfig.java @@ -0,0 +1,10 @@ +package com.pjb.springbootjjwt.config; + +import org.springframework.context.annotation.Configuration; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Configuration //说明这是一个配置类 +@EnableSwagger2// 该注解开启Swagger2的自动配置 +public class SwaggerConfig { + +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/IMailServiceImpl.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/IMailServiceImpl.java new file mode 100644 index 0000000..11d6f09 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/IMailServiceImpl.java @@ -0,0 +1,124 @@ +//package com.pjb.springbootjjwt.control; +// +//import com.pjb.springbootjjwt.service.IMailService; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.core.io.FileSystemResource; +//import org.springframework.mail.SimpleMailMessage; +//import org.springframework.mail.javamail.JavaMailSender; +//import org.springframework.mail.javamail.MimeMessageHelper; +//import org.springframework.stereotype.Service; +// +//import javax.mail.MessagingException; +//import javax.mail.internet.InternetAddress; +//import javax.mail.internet.MimeMessage; +//import java.io.File; +// +// +//@Service("SendMailService") +//public class IMailServiceImpl implements IMailService { +// private final Logger logger = LoggerFactory.getLogger(this.getClass()); +// +// +// /** +// * Spring Boot 提供了一个发送邮件的简单抽象,使用的是下面这个接口,这里直接注入即可使用 +// */ +// @Autowired +// private JavaMailSender mailSender; +// +// /** +// * 配置文件中我的qq邮箱 +// */ +// @Value("${spring.mail.from}") +// private String from; +// +// /** +// * 简单文本邮件 +// * +// * @param to 收件人 +// * @param subject 主题 +// * @param content 内容 +// */ +// @Override +// public void sendSimpleMail(String to, String subject, String content) { +// //创建SimpleMailMessage对象 +// SimpleMailMessage message = new SimpleMailMessage(); +// //邮件发送人 +// message.setFrom(from); +// //邮件接收人 +// message.setTo(to); +// //邮件主题 +// message.setSubject(subject); +// //邮件内容 +// message.setText(content); +// //发送邮件 +// mailSender.send(message); +// } +// +// /** +// * html邮件 +// * +// * @param to 收件人 +// * @param subject 主题 +// * @param content 内容 +// */ +// @Override +// public void sendHtmlMail(String nickName, String[] to, String[] cc, String subject, String content) throws Exception { +// //获取MimeMessage对象 +// MimeMessage message = mailSender.createMimeMessage(); +// MimeMessageHelper messageHelper; +// +// messageHelper = new MimeMessageHelper(message, true); +// //邮件发送人 +// if (nickName == null) { +// messageHelper.setFrom(from); +// } else { +// messageHelper.setFrom(new InternetAddress(from, nickName)); +// } +// //邮件接收人 +// messageHelper.setTo(to); +// //邮件抄送人 +// if (cc != null) { +// messageHelper.setCc(cc); +// } +// //邮件主题 +// messageHelper.setSubject(subject); +// //邮件内容,html格式 +// messageHelper.setText(content, true); +// //发送 +// mailSender.send(messageHelper.getMimeMessage()); +// } +// +// /** +// * 带附件的邮件 +// * +// * @param to 收件人 +// * @param subject 主题 +// * @param content 内容 +// * @param filePath 附件 +// */ +// @Override +// public void sendAttachmentsMail(String to, String subject, String content, String filePath) { +// MimeMessage message = mailSender.createMimeMessage(); +// try { +// MimeMessageHelper helper = new MimeMessageHelper(message, true); +// helper.setFrom(from); +// helper.setTo(to); +// helper.setSubject(subject); +// helper.setText(content, true); +// +// FileSystemResource file = new FileSystemResource(new File(filePath)); +// String fileName = filePath.substring(filePath.lastIndexOf(File.separator)); +// helper.addAttachment(fileName, file); +// mailSender.send(message); +// //日志信息 +// logger.info("邮件已经发送。"); +// } catch (MessagingException e) { +// logger.error("发送邮件时发生异常!", e); +// } +// +// +// } +//} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/ITeamcenterServiceImpl.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/ITeamcenterServiceImpl.java new file mode 100644 index 0000000..b30276a --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/ITeamcenterServiceImpl.java @@ -0,0 +1,2541 @@ +package com.pjb.springbootjjwt.control; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.pjb.springbootjjwt.SpringbootJjwtApplication; +import com.pjb.springbootjjwt.entity.MessageEntry; +import com.pjb.springbootjjwt.entity.ServerDwgtopdfEntry; +import com.pjb.springbootjjwt.entity.ServerSignoffEntry; +import com.pjb.springbootjjwt.mapper.MessageEntryMapper; +import com.pjb.springbootjjwt.pdfbean.PDFUtil; +import com.pjb.springbootjjwt.pdfbean.PdfList; +import com.pjb.springbootjjwt.tcuserservice.TCSoaUserService; +import com.teamcenter.clientx.AppXSession; +import com.teamcenter.services.strong.core.ReservationService; +import com.teamcenter.services.loose.core._2006_03.FileManagement; +import com.teamcenter.services.strong.core.DataManagementService; +import com.teamcenter.services.strong.core.SessionService; +import com.teamcenter.services.strong.core._2006_03.Session; +import com.teamcenter.services.strong.core._2006_03.Session.LoginResponse; +import com.teamcenter.services.loose.core._2007_12.Session.StateNameValue; +import com.teamcenter.services.strong.core._2010_04.DataManagement; +import com.teamcenter.services.strong.workflow.WorkflowService; +import com.teamcenter.services.strong.workflow._2007_06.Workflow; +import com.teamcenter.services.strong.core._2007_09.DataManagement.NamedReferenceInfo; +import com.teamcenter.services.strong.core._2007_09.DataManagement.RemoveNamedReferenceFromDatasetInfo; +import com.teamcenter.services.loose.core._2007_01.Session.GetTCSessionInfoResponse; +import com.teamcenter.soa.client.model.ErrorValue; +import com.teamcenter.soa.client.Connection; +import com.teamcenter.soa.client.FileManagementUtility; +import com.teamcenter.soa.client.GetFileResponse; +import com.teamcenter.soa.client.model.ErrorValue; +import com.teamcenter.soa.client.model.ModelObject; +import com.teamcenter.soa.client.model.ServiceData; +import com.teamcenter.soa.client.model.strong.*; +import lombok.Getter; +import org.apache.commons.io.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.*; + +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +@Component +public class ITeamcenterServiceImpl { + + private static AppXSession tcSession; + private static User tcUser; + private static GroupMember tcGroupMember; + private static HashMap> typeMapping; +// public static final String MSEXCEL_ASSIGN_PROCESS_NAME = "SubstMacros-MSExcel.wsf"; +// public static final String MSWORD_ASSIGN_PROCESS_NAME = "SubstMacros-MSWord.wsf"; +// public static final String DWGTOPDF_PROCESS_NAME = "cad2pdf.exe"; +// public static final String DWGTOPDF2_PROCESS_NAME = "cad2pdf_app.exe"; + public static final long PDF_FILE_MIN_LEN = 5*1024; + public static Connection connection = null; + public static Connection connection2 = null; + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmSSsss"); + private static Resource PDF_ASSIGN_CONFIG; + public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); + private final Logger logger = LoggerFactory.getLogger(ITeamcenterServiceImpl.class); + @Autowired + public MessageEntryMapper messageMapper; + + @Autowired + private Environment env; // 注入envs + + static{ + if(typeMapping == null){ + typeMapping = new HashMap<>(); + } + typeMapping.clear(); + List excelExtList = new ArrayList<>(); + excelExtList.add("xls"); + excelExtList.add("xlsx"); + excelExtList.add("xlsm"); + List wordExtList = new ArrayList<>(); + wordExtList.add("doc"); + wordExtList.add("docx"); + wordExtList.add("docm"); + List cadExtList = new ArrayList<>(); + cadExtList.add("dwg"); + + typeMapping.put("MSExcel",excelExtList); + typeMapping.put("MSExcelX",excelExtList); + typeMapping.put("MSWord",wordExtList); + typeMapping.put("MSWordX",wordExtList); + typeMapping.put("S8AutoCAD",cadExtList); + + + if(PDF_ASSIGN_CONFIG == null){ + PDF_ASSIGN_CONFIG = new ClassPathResource("signpdfconfig.xml"); + } + } + + /** + * 进行Teamcenter文件签名 + * @param signoffEntry + * @return + */ + public Object signoffTeamcenterDataset(ServerSignoffEntry signoffEntry){ + logger.info("进行电子签名消费者收到消息 : " + signoffEntry.toString()); + JSONObject jsonObject = new JSONObject(); + if(connection==null){ + logger.info("当前会话为空,重新登录"); + LoginSoa login = new LoginSoa(); + connection = login.loginSoa(); + if(connection==null){ + logger.info("登录失败,不再登录"); + return null; + } + }else { + logger.info("连接已存在,判断连接是否正常"); + // logger.info(connection.getBinding()); + // GetTCSessionInfoResponse rep = null; + SessionService sessionService = SessionService.getService(connection); + Map stateMap = null; + try { + stateMap = connection.getClientSessionState(); + if(stateMap!=null){ + for(Map.Entry entry:stateMap.entrySet()){ + logger.info(entry.getKey()+" 值:"+entry.getValue()); + } + }else{ + sessionService.logout(); + logger.info("获取会话信息为空,重新登录"); + LoginSoa login = new LoginSoa(); + connection = login.loginSoa(); + if(connection==null){ + logger.info("登录失败,不再登录"); + return null; + } + } + }catch (Exception e){ + logger.info("异常:",e); + logger.info("获取会话信息出错,重新登录"); + try { + sessionService.logout(); + }catch (Exception e2) { + logger.info("登出错误:", e2); + } + LoginSoa login = new LoginSoa(); + connection = login.loginSoa(); + if(connection==null){ + logger.info("登录失败,不再登录"); + return null; + } + } + } + logger.info("开启旁路"); + TCSoaUserService userService = new TCSoaUserService(); + ExecutorService executor = Executors.newSingleThreadExecutor(); + FutureTask future= new FutureTask(new Callable() { + @Override + public String call() throws Exception { + userService.openByPass(connection); + return "0"; + } + }); + executor.execute(future); + String result=""; + try { + result = future.get(120,TimeUnit.SECONDS); + }catch (InterruptedException e){ + logger.info("开启旁路中断"); + future.cancel(true); + }catch (ExecutionException e) { + logger.info("开启旁路异常",e); + future.cancel(true); + }catch (TimeoutException e) { + logger.info("开启旁路超时"); + future.cancel(true); + } + try { + executor.shutdown(); + }catch (Exception e){ + logger.info("关闭线程失败"); + } + if("0".equals(result)){ + logger.info("开启旁路完成"); + }else { + logger.info("开始重新登录"); + try { + SessionService sessionService = SessionService.getService(connection); + sessionService.logout(); + }catch (Exception e2){ + logger.info("错误:",e2); + } + LoginSoa login = new LoginSoa(); + connection = login.loginSoa(); + if(connection==null){ + logger.info("登录失败,不再登录"); + return null; + } + try { + logger.info("重新开启旁路"); + userService.openByPass(connection); + }catch (Exception e2){ + logger.info("重新开启失败,错误:",e2); + return null; + } + } + try { + String revUID = signoffEntry.getTccomponentuid(); + String datasetUID = signoffEntry.getTcdatasetuid(); + String pdfUID = signoffEntry.getPdfuid(); + //获取tc中的操作数据服务 + DataManagementService dmService = DataManagementService.getService(connection); + MessageEntry messageEntry = new MessageEntry(); + //将uid转换为对象 + + ServiceData resultDate = dmService.loadObjects(new String[]{revUID, datasetUID}); + Dataset dataset = null; + ItemRevision revision = null; + EPMTask task = null; + if (resultDate.sizeOfPlainObjects() > 1) { + revision = (ItemRevision) resultDate.getPlainObject(0); + dataset = (Dataset) resultDate.getPlainObject(1); + } + resultDate = dmService.loadObjects(new String[]{signoffEntry.getTaskpuid()}); + if (resultDate.sizeOfPlainObjects() > 0) { + task = (EPMTask) resultDate.getPlainObject(0); + } + messageEntry.setItemPuid(revUID); + messageEntry.setDatasetPuid(datasetUID); + if (dataset == null || revision == null) { + messageEntry.setStage("获取版本或数据集失败"); + messageMapper.updateMessage(messageEntry); + logger.info(String.format("没有找到版本对象[%s]或者数据集对象[%s]", revUID, datasetUID)); + jsonObject.put("status", -1); + jsonObject.put("errormessage", String.format("没有找到版本对象[%s]或者数据集对象[%s]", revUID, datasetUID)); + dmService.unloadObjects(new ModelObject[]{dataset, revision, task}); + dmService.refreshObjects2(new ModelObject[]{dataset, revision, task}, false); + return null; + } + logger.info("加载的对象【"+revUID+"】数据集【"+datasetUID+"】pdf对象【"+pdfUID+"】"); + ModelObject[] datasets = new ModelObject[]{dataset}; + dmService.refreshObjects2(datasets, false); + dmService.getProperties(datasets, new String[]{"object_type", "object_name"}); + String datasetType = dataset.get_object_type(); + + String datasetName = dataset.get_object_name(); + ModelObject[] itemRevs = new ModelObject[]{revision}; + dmService.refreshObjects2(itemRevs,false); + dmService.getProperties(itemRevs,new String[]{"object_string"}); + String revisionString = revision.get_object_string(); + logger.info("加载的对象名【"+revisionString+"】数据集名【"+datasetName+"】"); + + File outFile = downloadFileFromDataset(dataset, signoffEntry, revisionString,datasetName); + if (outFile == null || !outFile.exists()) { + messageEntry.setStage("下载文件失败"); + messageMapper.updateMessage(messageEntry); + logger.info(String.format("对版本对象[%s]数据集对象[%s]进行签名,没有找到需要签名的文件", revisionString, datasetName)); + dmService.unloadObjects(new ModelObject[]{dataset, revision, task}); + dmService.refreshObjects2(new ModelObject[]{dataset, revision, task}, false); + return null; + } + logger.info(String.format("对版本对象[%s]数据集对象[%s]签名信息%s", revisionString, datasetName, signoffEntry.toString())); + logger.info("开始签名"); + //判断原始文件是否为PDF + logger.info("数据集类型:" + datasetType); + if (datasetType.equals("PDF")) { + signoffEntry.setIsoriginalfilepdf(true); + } else { + signoffEntry.setIsoriginalfilepdf(false); + } + + if (datasetType.equals(signoffEntry.getDwgtype())) { + signoffEntry.setIsoriginalfiledwg(true); + } else { + signoffEntry.setIsoriginalfiledwg(false); + } + if(signoffEntry.isIsoriginalfilepdf() && !signoffEntry.isIssignpdf()){ + logger.info("不需要签字,完成"); + messageEntry.setStage("转换PDF完成"); + messageMapper.updateMessage(messageEntry); + return null; + } + //创建excel word的签字中间文件 + logger.info("创建中间文件"); + createSignoffFile(signoffEntry); + File pdfFile = execAssignProcess(outFile, signoffEntry, messageEntry,revisionString,signoffEntry.getTcoriginalname(),datasetType); + + Thread.sleep(3000); + + System.out.println("转出的PDF文件 >" + pdfFile.getAbsolutePath()); +// if (pdfFile == null || !pdfFile.exists()) { +// logger.info(String.format("对版本对象[%s]数据集对象[%s]转换PDF失败", revisionString, datasetName)); +// messageEntry.setStage("转换PDF失败"); +// messageMapper.updateMessage(messageEntry); +// dmService.unloadObjects(new ModelObject[]{dataset, revision, task}); +// dmService.refreshObjects2(new ModelObject[]{dataset, revision, task}, false); +// return null; +// } + logger.info(String.format("对版本对象[%s]数据集对象[%s]上传PDF[%s]", revisionString, datasetName, pdfFile.getAbsolutePath())); + int finditem = 0; + //finditem = messageMapper.findItem(datasetUID); + File uploadFile = null; + File newFileName = null; +// if(finditem>0){ +// if(signoffEntry.isIsoriginalfilepdf()){ +// messageEntry.setPdfPuid(datasetUID); +// messageEntry.setStage("创建PDF成功"); +// messageMapper.updatePDFPuid(messageEntry); +// pdfUID = datasetUID; +// }else { +// String pdfuid_in_db = messageMapper.findPdfUid(revUID, datasetUID, signoffEntry.getTaskpuid()); +// logger.info("数据库pdf的puid:" + pdfuid_in_db); +// if (pdfuid_in_db != null && !"".equals(pdfuid_in_db) && !(pdfUID != null && !"nopdf".equals(pdfUID))) { +// logger.info("数据库中已有pdf的puid,不需要再创建,puid为:" + pdfuid_in_db); +// pdfUID = pdfuid_in_db; +// } +// } + //上传文件到TC + boolean isSuccesUpload = false; +// if(pdfFile.getAbsolutePath().endsWith("pdf")) { +// uploadFile = new File(signoffEntry.getTcpdffilename()); +// if (!uploadFile.exists()) { +// FileUtils.copyFile(pdfFile, uploadFile); +// } +// isSuccesUpload = uploadFileToTc(revision, dataset, task, signoffEntry, messageEntry, uploadFile, revisionString,datasetName,pdfUID); +// }else{ +// String tempPath = pdfFile.getAbsolutePath(); +// String end = tempPath.substring(tempPath.lastIndexOf("."),tempPath.length()); +// if(datasetName.endsWith(end)){ +// uploadFile = new File(tempPath.substring(0, tempPath.lastIndexOf("\\")) + "\\" + datasetName); +// }else +// { +// uploadFile = new File(tempPath.substring(0, tempPath.lastIndexOf("\\")) + "\\" + datasetName+end); +// } +// +// if (!uploadFile.exists()){ +// logger.info("源文件的大小为:" + pdfFile.length()); +// Thread.sleep(12000); +// FileUtils.copyFile(pdfFile, uploadFile); +// logger.info("新文件的大小为:" + uploadFile.length()); +// } +// +// isSuccesUpload = uploadFileToTc2(revision, dataset, task, signoffEntry, messageEntry, uploadFile, revisionString,datasetName,pdfUID); +// } + + + if(signoffEntry.getTcoriginalfilename().endsWith("pdf")) { + System.out.println("1111111111111111111111111111111111111"); + uploadFile = new File(signoffEntry.getTcpdffilename()); + if (!uploadFile.exists()) { + FileUtils.copyFile(pdfFile, uploadFile); + } + isSuccesUpload = uploadFileToTc(revision, dataset, task, signoffEntry, messageEntry, uploadFile, revisionString,signoffEntry.getTcoriginalname(),pdfUID); + }else{ + + // 创建Path对象 + Path sourcePath = Paths.get(signoffEntry.getTcoriginalfilename()); + // Path destinationPath = Paths.get(SpringbootJjwtApplication.TC_FCCCACH+"//"+signoffEntry.getTcoriginalname()); + Path destinationPath; + if(signoffEntry.getTcoriginalname().contains(".")){ + destinationPath = Paths.get(SpringbootJjwtApplication.TC_FCCCACH+"//"+signoffEntry.getTcoriginalname()); + + }else{ + destinationPath = Paths.get(SpringbootJjwtApplication.TC_FCCCACH+"//"+signoffEntry.getTcoriginalname()+signoffEntry.getTcoriginalext()); + + } + try { + // 检查源文件是否存在 + if (Files.exists(sourcePath)) { + // 复制文件到新位置 + Files.copy(sourcePath, destinationPath); + System.out.println("文件复制成功: "); + } else { + System.out.println("源文件不存在: "); + } + } catch (IOException e) { + System.err.println("文件复制失败: " + e.getMessage()); + } + System.out.println("getTcoriginalfilename================"+signoffEntry.getTcoriginalfilename()); + System.out.println("outFile.getAbsolutePath()============="+outFile.getAbsolutePath()); + uploadFile = new File(signoffEntry.getTcoriginalfilename()); + System.out.println("SpringbootJjwtApplication.TC_FCCCACH+datasetName====="+SpringbootJjwtApplication.TC_FCCCACH+"//"+datasetName); + if(signoffEntry.getTcoriginalname().contains(".")){ + newFileName = new File(SpringbootJjwtApplication.TC_FCCCACH+"//"+signoffEntry.getTcoriginalname()); + + }else{ + newFileName = new File(SpringbootJjwtApplication.TC_FCCCACH+"//"+signoffEntry.getTcoriginalname()+signoffEntry.getTcoriginalext()); + + } + +// if (uploadFile.exists()) { +// if (uploadFile.renameTo(newFileName)) { +// logger.info("文件名称修改成功!"); +// } else { +// logger.info("文件名称修改失败!"); +// } +// } else { +// logger.info("文件不存在!"); +// } + + + + if (!newFileName.exists()) { + FileUtils.copyFile(pdfFile, newFileName); + } + + uploadTempFileToTc(revision,dataset,task,signoffEntry,messageEntry,newFileName,revisionString,datasetName,pdfUID); + + //判断是否需要上传pdf + if( signoffEntry.isIstranslatepdf() && pdfFile.exists()){ + System.out.println("translatepdftranslatepdftranslatepdftranslatepdftranslatepdf"); + uploadFileToTc(revision, dataset, task, signoffEntry, messageEntry, pdfFile, revisionString,signoffEntry.getTcoriginalname(),pdfUID); + + } + + + } + + + + if(isSuccesUpload){ + messageEntry.setStage("转换PDF完成"); + messageMapper.updateMessage(messageEntry); + }else{ + messageEntry.setStage("转换PDF失败"); + messageMapper.updateMessage(messageEntry); + } +// }else { +// messageEntry.setStage("数据集被删除"); +// messageMapper.updateMessage(messageEntry); +// logger.info("要转PDF的数据集被删除"); +// } + + dmService.unloadObjects(new ModelObject[]{dataset, revision,task}); + dmService.refreshObjects2(new ModelObject[]{dataset, revision,task}, false); + logger.info("转换PDF完成"); + + if(uploadFile != null){ + logger.info("uploadFile 的路径" + uploadFile.getAbsolutePath()); + } + logger.info("pdfFile 的路径" + pdfFile.getAbsolutePath()); + logger.info("outFile 的路径" + outFile.getAbsolutePath()); + if(newFileName != null){ + logger.info("newFileName 的路径" + newFileName.getAbsolutePath()); + } + try { + + if(newFileName != null && newFileName.exists()) { + FileUtils.forceDelete(newFileName); + } + } catch (Exception ex) { + logger.info("未释放,删除失败"); + } + + try { + + if(uploadFile != null && uploadFile.exists()) { + FileUtils.forceDelete(uploadFile); + } + } catch (Exception ex) { + logger.info("未释放,删除失败2"); + } + try { + if(pdfFile != null && pdfFile.exists()){ + FileUtils.forceDelete(pdfFile); + } + } catch (Exception ex) { + logger.info("未释放,删除失败3"); + } + try { + if(outFile != null && outFile.exists()) { + FileUtils.forceDelete(outFile); + } + }catch (Exception ex) { + logger.info("未释放,删除失败4"); + } + //释放资源 + + }catch (Exception exception){ + logger.info("错误:",exception); + return jsonObject; + }finally { + logger.info("关闭旁路"); + userService.closeByPass(connection); + // SessionService sessionService = SessionService.getService(AppXSession.getConnection()); +// tcSession.logout(); +// AppXSession.getConnection().release(); +// tcSession = null; +// tcUser = null; + } + + return jsonObject; + } + + + + + + + + + /** + * 把签完的word或者excel 放到数据集下 + * @param revision 版本 + * @param sourceDataset 数据集 + * @param task 流程 + * @param signoffEntry 签名消息的bean + * @param messageEntry + * @param pdfFile 临时文件 + * @param revisionName 版本名称 + * @param srcdatasetName 数据集名称 + * @param pdfuid pdfUid + * @return + */ + private boolean uploadTempFileToTc(ItemRevision revision,Dataset sourceDataset,EPMTask task,ServerSignoffEntry signoffEntry,MessageEntry messageEntry,File pdfFile,String revisionName,String srcdatasetName,String pdfuid){ + String datasetReference = ""; + if(pdfFile.getAbsolutePath().endsWith("doc")){ + datasetReference = "word"; + }else if (pdfFile.getAbsolutePath().endsWith("docx")){ + datasetReference = "word"; + }else if (pdfFile.getAbsolutePath().endsWith("xls")){ + datasetReference = "excel"; + }else if (pdfFile.getAbsolutePath().endsWith("xlsx")){ + datasetReference = "excel"; + } + else if (pdfFile.getAbsolutePath().endsWith("PDF")){ + datasetReference = "PDF_Reference"; + } + else if (pdfFile.getAbsolutePath().endsWith("pdf")){ + datasetReference = "PDF_Reference"; + } + boolean isSuccess = true; + boolean isHavePdf = true; + logger.info("要上传的文件:"+pdfFile.getAbsolutePath()); + //如果不是PDF签名则进行PDF生成 + DataManagementService dmService = DataManagementService.getService(connection); + + FileManagement.DatasetFileInfo[] datasetFileInfos = new FileManagement.DatasetFileInfo[1]; + datasetFileInfos[0] = new FileManagement.DatasetFileInfo(); + datasetFileInfos[0].fileName = pdfFile.getAbsolutePath(); + datasetFileInfos[0].allowReplace = true; + datasetFileInfos[0].isText = false; + datasetFileInfos[0].namedReferencedName = datasetReference; + + FileManagement.GetDatasetWriteTicketsInputData inputData = new FileManagement.GetDatasetWriteTicketsInputData(); + inputData.dataset = sourceDataset; + //true 为增加,false为替换 + inputData.createNewVersion = true; + inputData.datasetFileInfos = datasetFileInfos; + + try { + // userService.openByPass(); + // logger.info("开启旁路2"); + dmService.refreshObjects2(new ModelObject[]{revision, sourceDataset}, false); + ReservationService reservationService = ReservationService.getService(connection); + ModelObject[] datasets = new ModelObject[]{sourceDataset}; + dmService.getProperties(datasets, new String[]{"checked_out","ref_list"}); + String check_out = sourceDataset.get_checked_out(); + logger.info("是否签出: "+check_out); + if("Y".equals(check_out)){ + reservationService.checkin(datasets); + } + + //移除命名引用 + ModelObject[] refModel = sourceDataset.get_ref_list(); + int refLength = refModel==null?0:refModel.length; + logger.info("命名引用数量"+refLength); +// if(refLength>0) { +// logger.info("开始移除命名引用"); +// com.teamcenter.services.strong.core._2007_09.DataManagement.RemoveNamedReferenceFromDatasetInfo[] info = new com.teamcenter.services.strong.core._2007_09.DataManagement.RemoveNamedReferenceFromDatasetInfo[1]; +// info[0] = new com.teamcenter.services.strong.core._2007_09.DataManagement.RemoveNamedReferenceFromDatasetInfo(); +// info[0].dataset = sourceDataset; +// com.teamcenter.services.strong.core._2007_09.DataManagement.NamedReferenceInfo[] nrInfo = new com.teamcenter.services.strong.core._2007_09.DataManagement.NamedReferenceInfo[refLength]; +// for(int i=0;i 0){ +// for(int size=0;size 0){ + for(int size=0;size 5){ + logger.info("循环25秒上传文件依旧失败,不再上传"); + break; + } + } + dmService.refreshObjects2(new ModelObject[]{revision, sourceDataset}, false); + if(serviceData!=null && serviceData.sizeOfPartialErrors() > 0){ + for(int size=0;size0){ + releaseStatusInputs[0].operations[0].operation = "Delete"; + workflowService.setReleaseStatus(releaseStatusInputs); + logger.info("移除多余状态完成"); + } + logger.info("添加的状态:"+signoffEntry.getTcstatus()); + releaseStatusInputs[0].operations[0].existingreleaseStatusTypeName = "delete"; + releaseStatusInputs[0].operations[0].newReleaseStatusTypeName = signoffEntry.getTcstatus(); + releaseStatusInputs[0].operations[0].operation = "Append"; + Workflow.SetReleaseStatusResponse releaseResponse = workflowService.setReleaseStatus(releaseStatusInputs); + logger.info(String.format("对版本对象[%s]数据集对象[%s]添加状态成功",revisionName,srcdatasetName)); + } + dmService.refreshObjects2(new ModelObject[]{revision, sourceDataset}, false); + } catch (Exception e) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]挂在数据集出现异常",revisionName,srcdatasetName),e); + return false; + }finally { + + if(isHavePdf) { + dmService.unloadObjects(new ModelObject[]{sourceDataset}); + dmService.refreshObjects2(new ModelObject[]{sourceDataset}, false); + } + // userService.closeByPass(); + // logger.info("关闭旁路2"); + } + return isSuccess; + } + + + + + + + + + + + + + + + + /** + * 上传文件到TC + * @param revision + * @param sourceDataset + * @param signoffEntry + * @param pdfFile + * @return + */ + private boolean uploadFileToTc(ItemRevision revision,Dataset sourceDataset,EPMTask task,ServerSignoffEntry signoffEntry,MessageEntry messageEntry,File pdfFile,String revisionName,String srcdatasetName,String pdfuid){ + boolean isSuccess = true; + Dataset dataset = null; + boolean isHavePdf = false; + logger.info("要上传的文件:"+pdfFile.getAbsolutePath()); + //如果不是PDF签名则进行PDF生成 + DataManagementService dmService = DataManagementService.getService(connection); + + // TCSoaUserService userService = new TCSoaUserService() + + if(pdfuid!=null && !"nopdf".equals(pdfuid)){ + logger.info("存在pdf"); + ServiceData resultDate = dmService.loadObjects(new String[]{pdfuid}); + if (resultDate.sizeOfPlainObjects() > 0){ + dataset = (Dataset)resultDate.getPlainObject(0); + } + if(dataset != null){ + isHavePdf=true; + } + } + try { + if(!isHavePdf) { + logger.info("开始创建数据集ok"); + DataManagement.DatasetInfo[] datasetInfos = new DataManagement.DatasetInfo[1]; + datasetInfos[0] = new DataManagement.DatasetInfo(); + datasetInfos[0].name = srcdatasetName.replace(signoffEntry.getTcoriginalext(), ".pdf"); + datasetInfos[0].type = "PDF"; + datasetInfos[0].description = "TCServerCreate"; + //datasetInfos[0].container = revision; + //datasetInfos[0].relationType = signoffEntry.getTccomponentrelation(); + DataManagement.CreateDatasetsResponse response = dmService.createDatasets(datasetInfos); + if (response.servData.sizeOfPartialErrors() > 0) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]创建PDF数据集失败1",revisionName,srcdatasetName)); + return false; + } + logger.info("创建数据集ok"); + dataset = response.datasetOutput[0].dataset; + if(dataset == null){ + logger.info(String.format("对版本对象[%s]数据集对象[%s]创建PDF数据集失败",revisionName,srcdatasetName)); + return false; + }else { + messageEntry.setPdfPuid(dataset.getUid()); + messageEntry.setStage("创建PDF成功"); + messageMapper.updatePDFPuid(messageEntry); + } + } + }catch (Exception ex){ + logger.info(String.format("对版本对象[%s]数据集对象[%s]创建PDF数据集出现异常",revisionName,srcdatasetName),ex); + return false; + } + + FileManagement.DatasetFileInfo[] datasetFileInfos = new FileManagement.DatasetFileInfo[1]; + datasetFileInfos[0] = new FileManagement.DatasetFileInfo(); + datasetFileInfos[0].fileName = pdfFile.getAbsolutePath(); + datasetFileInfos[0].allowReplace = true; + datasetFileInfos[0].isText = false; + datasetFileInfos[0].namedReferencedName = "PDF_Reference"; + + FileManagement.GetDatasetWriteTicketsInputData inputData = new FileManagement.GetDatasetWriteTicketsInputData(); + inputData.dataset = dataset; + //true 为增加,false为替换 + inputData.createNewVersion = true; + inputData.datasetFileInfos = datasetFileInfos; + + try { + // userService.openByPass(); + // logger.info("开启旁路2"); + dmService.refreshObjects2(new ModelObject[]{revision, dataset}, false); + ReservationService reservationService = ReservationService.getService(connection); + ModelObject[] datasets = new ModelObject[]{dataset}; + dmService.getProperties(datasets, new String[]{"checked_out","ref_list"}); + String check_out = dataset.get_checked_out(); + logger.info("是否签出: "+check_out); + if("Y".equals(check_out)){ + reservationService.checkin(datasets); + } + ModelObject[] refModel = dataset.get_ref_list(); + int refLength = refModel==null?0:refModel.length; + logger.info("命名引用数量"+refLength); + if(refLength>0) { + logger.info("开始移除命名引用"); + RemoveNamedReferenceFromDatasetInfo[] info = new RemoveNamedReferenceFromDatasetInfo[1]; + info[0] = new RemoveNamedReferenceFromDatasetInfo(); + info[0].dataset = dataset; + NamedReferenceInfo[] nrInfo = new NamedReferenceInfo[refLength]; + for(int i=0;i 0){ + for(int size=0;size 0){ + for(int size=0;size 5){ + logger.info("循环25秒上传文件依旧失败,不再上传"); + break; + } + } + dmService.refreshObjects2(new ModelObject[]{revision, dataset}, false); + if(serviceData!=null && serviceData.sizeOfPartialErrors() > 0){ + for(int size=0;size0){ + releaseStatusInputs[0].operations[0].operation = "Delete"; + workflowService.setReleaseStatus(releaseStatusInputs); + logger.info("移除多余状态完成"); + } + logger.info("添加的状态:"+signoffEntry.getTcstatus()); + releaseStatusInputs[0].operations[0].existingreleaseStatusTypeName = "delete"; + releaseStatusInputs[0].operations[0].newReleaseStatusTypeName = signoffEntry.getTcstatus(); + releaseStatusInputs[0].operations[0].operation = "Append"; + Workflow.SetReleaseStatusResponse releaseResponse = workflowService.setReleaseStatus(releaseStatusInputs); + logger.info(String.format("对版本对象[%s]数据集对象[%s]添加状态成功",revisionName,srcdatasetName)); + } + logger.info("开始添加到流程"); + if(task!=null){ + ModelObject[] tasks = new ModelObject[]{task}; + dmService.refreshObjects2(tasks, false); + dmService.getProperties(tasks, new String[]{"task_result"}); + + boolean createRelation_task_Success = true; + for(int num=0;num<3;num++){ + String task_result = task.get_task_result(); + logger.info("流程状态:"+task_result); + if(!"Completed".equals(task_result)) { + int task_relationCount = messageMapper.findCount(task.getUid(), dataset.getUid()); + logger.info("流程关系数量:" + task_relationCount); + if (task_relationCount <= 0) { + if (!createRelation(task, dataset, dmService, "target_attachments")) { + createRelation_task_Success = false; + } + } else { + break; + } + }else { + createRelation_task_Success = true; + break; + } + } + //获取版本的所有者和所有组 + logger.info("开始更改所有者"); + dmService.getProperties(new ModelObject[]{revision},new String[]{"owning_user","owning_group"}); + User ownUser =(User) revision.get_owning_user(); + Group ownGroup =(Group) revision.get_owning_group(); + com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner objectOwner + =new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner(); + objectOwner.object = dataset; + objectOwner.owner = ownUser; + objectOwner.group = ownGroup; + //更改所有者 + dmService.changeOwnership(new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner[]{objectOwner}); + logger.info("更改所有者完成"); + //解除对象锁定 + dmService.refreshObjects2(new ModelObject[]{revision,dataset},false); + if(!createRelation_task_Success){ + logger.info(String.format("对版本对象[%s]数据集对象[%s]挂载数据集到流程失败",revisionName,srcdatasetName)); + return false; + } + }else { + //获取版本的所有者和所有组 + logger.info("开始更改所有者"); + dmService.getProperties(new ModelObject[]{revision},new String[]{"owning_user","owning_group"}); + User ownUser =(User) revision.get_owning_user(); + Group ownGroup =(Group) revision.get_owning_group(); + com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner objectOwner + =new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner(); + objectOwner.object = dataset; + objectOwner.owner = ownUser; + objectOwner.group = ownGroup; + //更改所有者 + dmService.changeOwnership(new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner[]{objectOwner}); + logger.info("更改所有者完成"); + //解除对象锁定 + dmService.refreshObjects2(new ModelObject[]{revision,dataset},false); + } +// int task_relationCount = messageMapper.findCount(task.getUid(),dataset.getUid()); +// logger.info("流程关系数量:"+task_relationCount); +// if(task_relationCount<=0) { +// dmService.refreshObjects2(new ModelObject[]{task, dataset}, false); +// com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship[] +// task_vec = new com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship[1]; +// com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship +// relation_rela = new com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship(); +// relation_rela.clientId = ""; +// relation_rela.primaryObject = task; +// relation_rela.secondaryObject = dataset; +// relation_rela.relationType = "target_attachments"; +// relation_rela.userData = null; +// task_vec[0] = relation_rela; +// com.teamcenter.services.strong.core._2006_03.DataManagement.CreateRelationsResponse reResp = null; +// int outTime = 0; +// boolean createSuccess = false; +// while (!createSuccess){ +// try { +// reResp= dmService.createRelations(task_vec); +// createSuccess = true; +// }catch (Exception e){ +// createSuccess = false; +// logger.info("建立流程关系出错:",e); +// } +// outTime ++; +// Thread.sleep(1000); +// if(outTime > 15){ +// logger.info("循环15秒创建流程关系依旧失败,不再创建流程关系"); +// break; +// } +// } +// dmService.refreshObjects2(new ModelObject[]{task, dataset}, false); +// if(reResp!=null && reResp.serviceData.sizeOfPartialErrors() > 0){ +// logger.info("建立流程关系出错"); +// messageEntry.setStage("建立流程关系出错"); +// messageMapper.updateMessage(messageEntry); +// return false; +// } +// } +// task_relationCount = messageMapper.findCount(task.getUid(),dataset.getUid()); +// logger.info("流程关系数量:"+task_relationCount); +// } + logger.info("结束添加到流程"); + } catch (Exception e) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]挂在数据集出现异常",revisionName,srcdatasetName),e); + return false; + }finally { + if(isHavePdf) { + dmService.unloadObjects(new ModelObject[]{dataset}); + dmService.refreshObjects2(new ModelObject[]{dataset}, false); + } + // userService.closeByPass(); + // logger.info("关闭旁路2"); + } + return isSuccess; + } + private boolean uploadFileToTc2(ItemRevision revision,Dataset sourceDataset,EPMTask task,ServerSignoffEntry signoffEntry,MessageEntry messageEntry,File pdfFile,String revisionName,String srcdatasetName,String pdfuid){ + String datasetReference = ""; + if(pdfFile.getAbsolutePath().endsWith("doc")){ + datasetReference = "word"; + }else if (pdfFile.getAbsolutePath().endsWith("docx")){ + datasetReference = "word"; + }else if (pdfFile.getAbsolutePath().endsWith("xls")){ + datasetReference = "excel"; + }else if (pdfFile.getAbsolutePath().endsWith("xlsx")){ + datasetReference = "excel"; + } + boolean isSuccess = true; + boolean isHavePdf = true; + logger.info("要上传的文件:"+pdfFile.getAbsolutePath()); + //如果不是PDF签名则进行PDF生成 + DataManagementService dmService = DataManagementService.getService(connection); + + FileManagement.DatasetFileInfo[] datasetFileInfos = new FileManagement.DatasetFileInfo[1]; + datasetFileInfos[0] = new FileManagement.DatasetFileInfo(); + datasetFileInfos[0].fileName = pdfFile.getAbsolutePath(); + datasetFileInfos[0].allowReplace = true; + datasetFileInfos[0].isText = false; + datasetFileInfos[0].namedReferencedName = datasetReference; + + FileManagement.GetDatasetWriteTicketsInputData inputData = new FileManagement.GetDatasetWriteTicketsInputData(); + inputData.dataset = sourceDataset; + //true 为增加,false为替换 + inputData.createNewVersion = true; + inputData.datasetFileInfos = datasetFileInfos; + + try { + // userService.openByPass(); + // logger.info("开启旁路2"); + dmService.refreshObjects2(new ModelObject[]{revision, sourceDataset}, false); + ReservationService reservationService = ReservationService.getService(connection); + ModelObject[] datasets = new ModelObject[]{sourceDataset}; + dmService.getProperties(datasets, new String[]{"checked_out","ref_list"}); + String check_out = sourceDataset.get_checked_out(); + logger.info("是否签出: "+check_out); + if("Y".equals(check_out)){ + reservationService.checkin(datasets); + } + ModelObject[] refModel = sourceDataset.get_ref_list(); + int refLength = refModel==null?0:refModel.length; + logger.info("命名引用数量"+refLength); + if(refLength>0) { + logger.info("开始移除命名引用"); + RemoveNamedReferenceFromDatasetInfo[] info = new RemoveNamedReferenceFromDatasetInfo[1]; + info[0] = new RemoveNamedReferenceFromDatasetInfo(); + info[0].dataset = sourceDataset; + NamedReferenceInfo[] nrInfo = new NamedReferenceInfo[refLength]; + for(int i=0;i 0){ + for(int size=0;size 0){ + for(int size=0;size 5){ + logger.info("循环25秒上传文件依旧失败,不再上传"); + break; + } + } + dmService.refreshObjects2(new ModelObject[]{revision, sourceDataset}, false); + if(serviceData!=null && serviceData.sizeOfPartialErrors() > 0){ + for(int size=0;size0){ + releaseStatusInputs[0].operations[0].operation = "Delete"; + workflowService.setReleaseStatus(releaseStatusInputs); + logger.info("移除多余状态完成"); + } + logger.info("添加的状态:"+signoffEntry.getTcstatus()); + releaseStatusInputs[0].operations[0].existingreleaseStatusTypeName = "delete"; + releaseStatusInputs[0].operations[0].newReleaseStatusTypeName = signoffEntry.getTcstatus(); + releaseStatusInputs[0].operations[0].operation = "Append"; + Workflow.SetReleaseStatusResponse releaseResponse = workflowService.setReleaseStatus(releaseStatusInputs); + logger.info(String.format("对版本对象[%s]数据集对象[%s]添加状态成功",revisionName,srcdatasetName)); + } + dmService.refreshObjects2(new ModelObject[]{revision, sourceDataset}, false); + } catch (Exception e) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]挂在数据集出现异常",revisionName,srcdatasetName),e); + return false; + }finally { + + if(isHavePdf) { + dmService.unloadObjects(new ModelObject[]{sourceDataset}); + dmService.refreshObjects2(new ModelObject[]{sourceDataset}, false); + } + // userService.closeByPass(); + // logger.info("关闭旁路2"); + } + return isSuccess; + } + + private boolean createRelation(ModelObject primaryObject,ModelObject secondaryObject,DataManagementService dmService,String relation){ + logger.info("开始创建关系"); + try { + com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship[] + rela_vec = new com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship[1]; + com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship + one_rela = new com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship(); + one_rela.clientId = ""; + one_rela.primaryObject = primaryObject; + one_rela.secondaryObject = secondaryObject; + one_rela.relationType = relation; + one_rela.userData = null; + rela_vec[0] = one_rela; + //锁定对象 + dmService.refreshObjects2(new ModelObject[]{primaryObject,secondaryObject},false); + //创建关系 + com.teamcenter.services.strong.core._2006_03.DataManagement.CreateRelationsResponse + reResp = null; + int breakTime = 0; + boolean createSuccess = false; + while (!createSuccess){ + try { + reResp= dmService.createRelations(rela_vec); + createSuccess = true; + }catch (Exception e){ + createSuccess = false; + logger.info("创建关系失败:",e); + } + breakTime ++; + Thread.sleep(1000); + if(breakTime > 15){ + logger.info("循环15次创建关系依旧失败,不再创建关系"); + break; + } + } + Thread.sleep(1000); + logger.info("创建关系结束"); + if(reResp!=null && reResp.serviceData.sizeOfPartialErrors() > 0) { + logger.info("创建关系失败:原因:"); + for(int size=0;size 0){ + dataset = (Dataset)resultDate.getPlainObject(0); + } + if(dataset != null){ + isHavePdf=true; + } + } + try { + if(!isHavePdf) { + String objecName = ""; + if (datasetName.lastIndexOf(".") != -1) { + objecName = datasetName.substring(0, datasetName.lastIndexOf(".")); + } else { + objecName = datasetName; + } + logger.info("开始创建数据集"); + DataManagement.DatasetInfo[] datasetInfos = new DataManagement.DatasetInfo[1]; + datasetInfos[0] = new DataManagement.DatasetInfo(); + datasetInfos[0].name = objecName + ".pdf"; + datasetInfos[0].type = "PDF"; + datasetInfos[0].description = "TCServerCreate"; + DataManagement.CreateDatasetsResponse response = dmService.createDatasets(datasetInfos); + if (response.servData.sizeOfPartialErrors() > 0) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]创建PDF数据集失败1", itemrevString, datasetName)); + messageEntry.setStage("创建PDF数据集失败"); + messageMapper.updateMessage(messageEntry); + return false; + } + logger.info("创建数据集完成"); + dataset = response.datasetOutput[0].dataset; + if (dataset == null) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]创建PDF数据集失败", itemrevString, datasetName)); + messageEntry.setStage("创建PDF数据集失败"); + messageMapper.updateMessage(messageEntry); + return false; + }else { + messageEntry.setPdfPuid(dataset.getUid()); + messageEntry.setStage("PDF数据集创建完成"); + messageMapper.updatePDFPuid(messageEntry); + } + } + } catch (Exception ex) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]创建PDF数据集出现异常", itemrevString, datasetName),ex); + return false; + } + + logger.info("开始上传文件"); + //添加文件 + FileManagement.DatasetFileInfo[] datasetFileInfos = new FileManagement.DatasetFileInfo[1]; + datasetFileInfos[0] = new FileManagement.DatasetFileInfo(); + datasetFileInfos[0].fileName = pdfFile.getAbsolutePath(); + datasetFileInfos[0].allowReplace = true; + datasetFileInfos[0].isText = false; + datasetFileInfos[0].namedReferencedName = "PDF_Reference"; + + FileManagement.GetDatasetWriteTicketsInputData inputData = new FileManagement.GetDatasetWriteTicketsInputData(); + inputData.dataset = dataset; + inputData.createNewVersion = true; + inputData.datasetFileInfos = datasetFileInfos; + + try { + // logger.info("开启旁路2"); + // userService.openByPass(); + dmService.refreshObjects2(new ModelObject[]{revision, dataset}, false); + ReservationService reservationService = ReservationService.getService(connection2); + ModelObject[] datasets = new ModelObject[]{dataset}; + dmService.getProperties(datasets, new String[]{"checked_out","ref_list"}); + String check_out = dataset.get_checked_out(); + logger.info("是否签出: "+check_out); + if("Y".equals(check_out)){ + reservationService.checkin(datasets); + } + ModelObject[] refModel = dataset.get_ref_list(); + int refLength = refModel==null?0:refModel.length; + logger.info("命名引用数量"+refLength); + if(refLength>0) { + logger.info("开始移除命名引用"); + RemoveNamedReferenceFromDatasetInfo[] info = new RemoveNamedReferenceFromDatasetInfo[1]; + info[0] = new RemoveNamedReferenceFromDatasetInfo(); + info[0].dataset = dataset; + NamedReferenceInfo[] nrInfo = new NamedReferenceInfo[refLength]; + for(int i=0;i 0){ + for(int size=0;size 0){ + for(int size=0;size 5){ + logger.info("循环25秒上传文件依旧失败,不再上传"); + break; + } + } + dmService.refreshObjects2(new ModelObject[]{revision, dataset}, false); + if(serviceData!=null && serviceData.sizeOfPartialErrors() > 0){ + for(int size=0;size0){ + releaseStatusInputs[0].operations[0].operation = "Delete"; + workflowService.setReleaseStatus(releaseStatusInputs); + logger.info("移除多余状态完成"); + } + logger.info("添加的状态:"+dwgEntry.getTcstatus()); + releaseStatusInputs[0].operations[0].existingreleaseStatusTypeName = "delete"; + releaseStatusInputs[0].operations[0].newReleaseStatusTypeName = dwgEntry.getTcstatus(); + releaseStatusInputs[0].operations[0].operation = "Append"; + Workflow.SetReleaseStatusResponse releaseResponse = workflowService.setReleaseStatus(releaseStatusInputs); + logger.info(String.format("对版本对象[%s]数据集对象[%s]添加状态成功",itemrevString,datasetName)); + } + logger.info("结束添加状态"); + } + if(task!=null){ + logger.info("开始添加到流程"); + ModelObject[] tasks = new ModelObject[]{task}; + dmService.refreshObjects2(tasks, false); + dmService.getProperties(tasks, new String[]{"task_result"}); + + boolean createRelation_task_Success = true; + for(int num=0;num<3;num++){ + int task_relationCount = messageMapper.findCount(task.getUid(),dataset.getUid()); + logger.info("流程关系数量:"+task_relationCount); + String task_result = task.get_task_result(); + logger.info("流程状态:"+task_result); + if(!"Completed".equals(task_result)) { + if (task_relationCount <= 0) { + if (!createRelation(task, dataset, dmService, "target_attachments")) { + createRelation_task_Success = false; + } + } else { + break; + } + }else { + createRelation_task_Success = true; + break; + } + } + + logger.info("开始更改所有者"); + //获取版本的所有者和所有组 + dmService.getProperties(new ModelObject[]{revision}, new String[]{"owning_user", "owning_group"}); + + User ownUser = (User) revision.get_owning_user(); + Group ownGroup = (Group) revision.get_owning_group(); + com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner objectOwner + = new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner(); + objectOwner.object = dataset; + objectOwner.owner = ownUser; + objectOwner.group = ownGroup; + //更改所有者 + dmService.changeOwnership(new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner[]{objectOwner}); + logger.info("结束更改所有者"); + //解除对象锁定 + dmService.refreshObjects2(new ModelObject[]{revision, dataset}, false); + if(!createRelation_task_Success){ + logger.info("挂载数据集到流程失败"); + return false; + } + }else { + logger.info("开始更改所有者"); + //获取版本的所有者和所有组 + dmService.getProperties(new ModelObject[]{revision}, new String[]{"owning_user", "owning_group"}); + + User ownUser = (User) revision.get_owning_user(); + Group ownGroup = (Group) revision.get_owning_group(); + com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner objectOwner + = new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner(); + objectOwner.object = dataset; + objectOwner.owner = ownUser; + objectOwner.group = ownGroup; + //更改所有者 + dmService.changeOwnership(new com.teamcenter.services.strong.core._2006_03.DataManagement.ObjectOwner[]{objectOwner}); + logger.info("结束更改所有者"); + //解除对象锁定 + dmService.refreshObjects2(new ModelObject[]{revision, dataset}, false); + } +// int task_relationCount = messageMapper.findCount(task.getUid(),dataset.getUid()); +// logger.info("流程关系数量:"+task_relationCount); +// if(task_relationCount<=0) { +// dmService.refreshObjects2(new ModelObject[]{task, dataset}, false); +// com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship[] +// task_vec = new com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship[1]; +// com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship +// relation_rela = new com.teamcenter.services.strong.core._2006_03.DataManagement.Relationship(); +// relation_rela.clientId = ""; +// relation_rela.primaryObject = task; +// relation_rela.secondaryObject = dataset; +// relation_rela.relationType = "target_attachments"; +// relation_rela.userData = null; +// task_vec[0] = relation_rela; +// com.teamcenter.services.strong.core._2006_03.DataManagement.CreateRelationsResponse reResp = null; +// int outTime = 0; +// boolean createSuccess = false; +// while (!createSuccess) { +// try { +// reResp = dmService.createRelations(task_vec); +// createSuccess = true; +// } catch (Exception e) { +// createSuccess = false; +// logger.info("建立流程关系出错:", e); +// } +// outTime++; +// Thread.sleep(1000); +// if (outTime > 15) { +// logger.info("循环15秒创建流程关系依旧失败,不再创建流程关系"); +// break; +// } +// } +// Thread.sleep(1000); +// dmService.refreshObjects2(new ModelObject[]{task, dataset}, false); +// if (reResp != null && reResp.serviceData.sizeOfPartialErrors() > 0) { +// logger.info("建立流程关系出错"); +// messageEntry.setStage("建立流程关系出错"); +// messageMapper.updateMessage(messageEntry); +// return false; +// } +// } +// task_relationCount = messageMapper.findCount(task.getUid(),dataset.getUid()); +// logger.info("流程关系数量:"+task_relationCount); +// } + logger.info("结束添加到流程"); + } catch (Exception e) { + logger.info(String.format("对版本对象[%s]数据集对象[%s]挂在数据集出现异常",itemrevString,datasetName),e); + return false; + }finally { + if(isHavePdf) { + dmService.unloadObjects(new ModelObject[]{dataset}); + dmService.refreshObjects2(new ModelObject[]{dataset}, false); + } + // userService.closeByPass(); + // logger.info("关闭旁路2"); + } + return isSuccess; + } + + private int execCmd(String command, int timeoutSecond) throws IOException, TimeoutException { + ProcessBuilder processBuilder = new ProcessBuilder(command.split(" ")); + // 合并错误输出流 + processBuilder.redirectErrorStream(true); + Process process = processBuilder.start(); + ProcessWorker processWorker = new ProcessWorker(process); + int exitCode = processWorker.getExitCode(); + processWorker.start(); + try { + processWorker.join(timeoutSecond * 1000); + if (processWorker.isCompleted()) { + exitCode = processWorker.getExitCode(); + } else { + process.destroy(); + processWorker.interrupt(); + logger.info("进程执行时间超时"); + throw new TimeoutException("进程执行时间超时"); + } + } catch (InterruptedException e) { + processWorker.interrupt(); + } + return exitCode; + } + +// private File assignDWG(File sourcePdfFile,String revisionString){ +// File outPdfFile = null; +// File outPdfFile2 = null; +// String dwgFileName = sourcePdfFile.getAbsolutePath(); +// String pdfFileName = dwgFileName.substring(0,dwgFileName.lastIndexOf("."))+".pdf"; +// String newfileName = dwgFileName.substring(0,dwgFileName.lastIndexOf("."))+"1.pdf"; +// long fileLength = sourcePdfFile.length(); +// logger.info("源文件大小:"+fileLength); +// int outTime = 0; +// if(fileLength<307200){ +// outTime = 120; +// }else if(fileLength>=307200 && fileLength<614400){ +// outTime = 300; +// }else if(fileLength>=614400){ +// outTime = 600; +// } +// logger.info("超时时间:"+outTime); +// try { +// String processFullName = SpringbootJjwtApplication.TC_DWG_TOOL; +// outPdfFile = new File(pdfFileName); +// outPdfFile2 = new File(newfileName); +//// String cmd = String.format("cmd.exe /c start %s %s", +//// processFullName, +//// dwgFileName); +// String cmd = String.format("%s %s", +// processFullName, +// dwgFileName); +// logger.info("cmd=>"+cmd); +// try { +// execCmd(cmd, outTime); +// }catch (IOException e2){ +// logger.info(e2.getMessage()); +// } catch (TimeoutException e){ +// Process proc = Runtime.getRuntime().exec(SpringbootJjwtApplication.BAT_PATH); +// Thread.sleep(120000); +// try { +// execCmd(cmd, outTime); +// }catch (IOException e5){ +// System.out.println(e5.getMessage()); +// }catch (TimeoutException e4){ +// e4.printStackTrace(); +// } +// JSONObject object = new JSONObject(); +// JSONArray array = new JSONArray(); +// String[] admin_mails = SpringbootJjwtApplication.TC_ADMIN_MAIL.split(";"); +// for(String admin_mail:admin_mails) { +// array.add(admin_mail); +// } +// object.put("to", array); +// object.put("subject", "服务器的中望可能卡死,已重启中望,请查看"); +// object.put("content", "对象:"+revisionString); +// String server_url = SpringbootJjwtApplication.TC_FMSURL.replace(":4544","")+":9293/server/sendmail"; +// OkHttpClient client = new OkHttpClient(); +// RequestBody requestBody = RequestBody.create(JSON,object.toString()); +// Request request = new Request.Builder().url(server_url).post(requestBody).build(); +// try { +// Response response = client.newCall(request).execute(); +// String responseString = response.body().string(); +// logger.info(responseString); +// } catch (IOException e3) { +// e3.printStackTrace(); +// } +// e.printStackTrace(); +// } +//// Process proc = Runtime.getRuntime().exec(cmd); +//// String line; +//// try { +//// int i=0; +//// BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream())); +//// while((line=br.readLine()) != null) { +//// System.out.println(line); +//// Thread.sleep(1000); +//// i++; +//// if(i>outTime){ +//// logger.info("超时"); +//// break; +//// } +//// } +//// }catch (IOException e2){ +//// System.out.println(e2.getMessage()); +//// } +// +//// if(!proc.waitFor(outTime, TimeUnit.SECONDS)){ +//// logger.info("超时"); +//// } +// logger.info("调用程序结束"); +// int tempIndex = 0; +// while(!outPdfFile.exists()){ +// tempIndex ++; +// Thread.sleep(1000); +// if(tempIndex > 15){ +// break; +// } +// } +// if(outPdfFile.exists()){ +// int breakTime = 0; +// boolean isBreakTime = false; +// while (!outPdfFile.renameTo(outPdfFile2)){ +// logger.info("被占用"); +// breakTime ++; +// Thread.sleep(1000); +// if(breakTime > 15){ +// isBreakTime = true; +// break; +// } +// } +// if(!isBreakTime){ +// outPdfFile = outPdfFile2; +// } +// } +// } catch (Exception ex) { +// logger.info("调用出错:",ex); +// } +// if(outPdfFile.exists()){ +// logger.info("生成PDF"); +// }else{ +// logger.info("生成PDF失败"); +// } +// return outPdfFile; +// } + +// private File assignDWGApp(File sourcePdfFile,String revisionString){ +// File outPdfFile = null; +// File outPdfFile2 = null; +// String dwgFileName = sourcePdfFile.getAbsolutePath(); +// String pdfFileName = dwgFileName.substring(0,dwgFileName.lastIndexOf("."))+".pdf"; +// String newfileName = dwgFileName.substring(0,dwgFileName.lastIndexOf("."))+"1.pdf"; +// //outPdfFile = new File(pdfFileName); +// long fileLength = sourcePdfFile.length(); +// logger.info("源文件大小:"+fileLength); +// int outTime = 0; +// if(fileLength<307200){ +// outTime = 120; +// }else if(fileLength>=307200 && fileLength<614400){ +// outTime = 300; +// }else if(fileLength>=614400){ +// outTime = 600; +// } +// logger.info("超时时间:"+outTime); +// try { +// String processFullName = SpringbootJjwtApplication.TC_DWG_TOOL2; +// outPdfFile = new File(pdfFileName); +// outPdfFile2 = new File(newfileName); +//// String cmd = String.format("cmd.exe /c start %s %s", +//// processFullName, +//// dwgFileName); +//// logger.info("cmd=>"+cmd); +// String cmd = String.format("%s %s", +// processFullName, +// dwgFileName); +// logger.info("cmd=>"+cmd); +// try { +// execCmd(cmd, outTime); +// }catch (IOException e2){ +// logger.info(e2.getMessage()); +// } catch (TimeoutException e){ +// Process proc = Runtime.getRuntime().exec(SpringbootJjwtApplication.BAT_PATH); +// Thread.sleep(120000); +// try { +// execCmd(cmd, outTime); +// }catch (IOException e5){ +// logger.info(e5.getMessage()); +// }catch (TimeoutException e4){ +// e4.printStackTrace(); +// } +// JSONObject object = new JSONObject(); +// JSONArray array = new JSONArray(); +// String[] admin_mails = SpringbootJjwtApplication.TC_ADMIN_MAIL.split(";"); +// for(String admin_mail:admin_mails) { +// array.add(admin_mail); +// } +// object.put("to", array); +// object.put("subject", "服务器的中望可能卡死,请查看"); +// object.put("content", "对象:"+revisionString); +// String server_url = SpringbootJjwtApplication.TC_FMSURL.replace(":4544","")+":9293/server/sendmail"; +// OkHttpClient client = new OkHttpClient(); +// RequestBody requestBody = RequestBody.create(JSON,object.toString()); +// Request request = new Request.Builder().url(server_url).post(requestBody).build(); +// try { +// Response response = client.newCall(request).execute(); +// String responseString = response.body().string(); +// logger.info(responseString); +// } catch (IOException e3) { +// e3.printStackTrace(); +// } +// e.printStackTrace(); +// } +//// Process proc = Runtime.getRuntime().exec(cmd); +//// String line; +//// try { +//// int i=0; +//// BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream())); +//// while((line=br.readLine()) != null) { +//// System.out.println(line); +//// Thread.sleep(1000); +//// i++; +//// if(i>outTime){ +//// logger.info("超时"); +//// break; +//// } +//// //p.waitFor(); +//// } +//// }catch (IOException e2){ +//// System.out.println(e2.getMessage()); +//// } +//// if(!proc.waitFor(outTime, TimeUnit.SECONDS)){ +//// logger.info("超时"); +//// } +// logger.info("调用程序结束"); +// int tempIndex = 0; +// while(!outPdfFile.exists()){ +// tempIndex ++; +// Thread.sleep(1000); +// if(tempIndex > 15){ +// break; +// } +// } +// if(outPdfFile.exists()){ +// int breakTime = 0; +// boolean isBreakTime = false; +// while (!outPdfFile.renameTo(outPdfFile2)){ +// logger.info("被占用"); +// breakTime ++; +// Thread.sleep(1000); +// if(breakTime > 15){ +// isBreakTime = true; +// break; +// } +// } +// if(!isBreakTime){ +// outPdfFile = outPdfFile2; +// } +// } +// } catch (Exception ex) { +// logger.info("调用出错:",ex); +// } +// if(outPdfFile.exists()){ +// logger.info("app生成PDF"); +// }else{ +// logger.info("app生成PDF失败"); +// } +// return outPdfFile; +// } + + private File assignPDF(File sourcePdfFile,String pdffilename,HashMap signInfos,String departmentid){ + logger.info("输出的pdf路径:"+pdffilename); + File outPdfFile = new File(pdffilename); + try { + if (PDF_ASSIGN_CONFIG != null) { + //读取pdf配置文件,为dwg转出的pdf文件签字 + InputStream inputStream = PDF_ASSIGN_CONFIG.getInputStream(); + PdfList pdfList = PDFUtil.getConfigList(inputStream,PdfList.class); + inputStream.close(); + PDFUtil.signoffToPdf(signInfos,departmentid,pdfList,sourcePdfFile,outPdfFile); + if(sourcePdfFile.exists()) { + try { + FileUtils.forceDelete(sourcePdfFile); + } catch (Exception ex) { + logger.info("删除源文件失败:", ex); + } + } + } else { + logger.info("加载PDF配置失败"); + } + }catch (Exception ex){ + ex.printStackTrace(); + logger.info("PDF签字失败:",ex); + } + return outPdfFile; + } + + + /** + * 下载数据集文件 + * @param dataset + * @param extList + * @return + */ + private File downloadFileFromDataset(Dataset dataset,ServerSignoffEntry signoffEntry,String revisonString,String strdatasetName){ + File outfile = null; + try { + String fmsurl = SpringbootJjwtApplication.TC_FMSURL; + // String fmsurl = env.getProperty("teamcenter."+signoffEntry.getFmsid()+"_fmsurl"); + logger.info("卷链接: "+fmsurl); + DataManagementService dmService = DataManagementService.getService(connection); + FileManagementUtility fmu = new FileManagementUtility(connection, + null, + new String[]{fmsurl}, + new String[]{fmsurl}, + SpringbootJjwtApplication.TC_FCCCACH); + + ModelObject[] objects = {dataset}; + dmService.refreshObjects2(objects,false); + dmService.getProperties(objects, new String[]{"ref_list","object_name"}); + objects = dataset.get_ref_list(); + dmService.refreshObjects2(objects,false); + dmService.getProperties(objects, new String[]{"original_file_name"}); + if(fmu == null){ + logger.info("连接fms服务失败"); + return null; + } + GetFileResponse getFileResponse = fmu.getFiles(objects); + File[] fileinfovec = getFileResponse.getFiles(); + if(fileinfovec == null){ + logger.info(String.format("对版本对象[%s]数据集对象[%s]获取数据集文件出现异常",revisonString,strdatasetName)); + return null; + } + String datasetName = dataset.get_object_name().replace(" ",""); + String fileName = null; + for(int i = 0;i signInfoMap = signoffEntry.getSigninfos(); + StringBuffer stringBuffer = new StringBuffer(); + for(Map.Entry entry:signInfoMap.entrySet()){ + stringBuffer.append(entry.getKey()); + stringBuffer.append("="); + System.out.println("内容:"+entry.getValue()); + if(entry.getKey().indexOf("人") != -1 || entry.getKey().indexOf("UserName")!=-1 || entry.getKey().indexOf("员")!=-1){ + String[] values = entry.getValue().split(","); + for(int j=0;j1){ + userName = SpringbootJjwtApplication.PICPATH+values2[1]+SpringbootJjwtApplication.PICEXT; + File file = new File(userName); + if (file.exists()) { + stringBuffer.append(userName); + }else { + stringBuffer.append(values2[0]); + } + }else { + stringBuffer.append(values2[0]); + } + } +// String[] values = entry.getValue().split("#:#"); +// String userName = ""; +// if(values.length>1){ +// userName = SpringbootJjwtApplication.PICPATH+values[1]+SpringbootJjwtApplication.PICEXT; +// File file = new File(userName); +// if (file.exists()) { +// stringBuffer.append(userName); +// }else { +// System.out.println("用户:"+values[0]); +// stringBuffer.append(values[0]); +// } +// }else { +// stringBuffer.append(values[0]); +// } +// String userName = value.substring(value.lastIndexOf("\\")+1, value.lastIndexOf(".")); +// if(!"".equals(userName)) { +// File file = new File(entry.getValue()); +// if (!file.exists()) { +// System.out.println("名字:" + userName); +// stringBuffer.append(userName); +// } else { +// stringBuffer.append(entry.getValue()); +// } +// } + }else { + stringBuffer.append(entry.getValue()); + } + stringBuffer.append("|"); + } + try { + File newlog = new File(signoffEntry.getTcsigninfofilename()); + logger.info("中间文件路径:"+newlog.getAbsolutePath()); + if(!newlog.isFile()){ + newlog.createNewFile(); + } + if(signoffEntry.isIssignpdf()) { + BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(newlog), "GBK")); + bw.write(stringBuffer.toString()); + bw.close(); + } + }catch (Exception e) { + e.printStackTrace(); + } + + } + +// /** +// * dwg转pdf服务 +// * @param dwgtopdfEntry +// * @return +// */ +// public Object dwgtopdfTeamcenterDwg(ServerDwgtopdfEntry dwgtopdfEntry){ +// logger.info("DWG转PDF消费者收到消息 : " + dwgtopdfEntry.toString()); +// JSONObject jsonObject = new JSONObject(); +// if(connection2==null){ +// logger.info("当前会话为空,重新登录"); +// LoginSoa login = new LoginSoa(); +// connection2 = login.loginSoa(); +// if (connection2 == null) { +// logger.info("登录失败,不再登录"); +// return null; +// } +// }else { +// SessionService sessionService = SessionService.getService(connection2); +// Map stateMap = null; +// try { +// stateMap = connection2.getClientSessionState(); +// if(stateMap!=null){ +// for(Map.Entry entry:stateMap.entrySet()){ +// logger.info(entry.getKey()+" 值:"+entry.getValue()); +// } +// }else{ +// sessionService.logout(); +// logger.info("获取会话信息为空,重新登录"); +// LoginSoa login = new LoginSoa(); +// connection2 = login.loginSoa(); +// if(connection2==null){ +// logger.info("登录失败,不再登录"); +// return null; +// } +// } +// }catch (Exception e){ +// logger.info("异常:",e); +// try { +// sessionService.logout(); +// }catch (Exception e2){ +// logger.info("登出错误:",e2); +// } +// logger.info("获取会话信息出错,重新登录"); +// LoginSoa login = new LoginSoa(); +// connection2 = login.loginSoa(); +// if(connection2==null){ +// logger.info("登录失败,不再登录"); +// return null; +// } +// } +// } +// logger.info("开启旁路"); +// TCSoaUserService userService = new TCSoaUserService(); +// ExecutorService executor = Executors.newSingleThreadExecutor(); +// FutureTask future= new FutureTask(new Callable() { +// @Override +// public String call() throws Exception { +// userService.openByPass(connection2); +// return "0"; +// } +// }); +// executor.execute(future); +// String result=""; +// try { +// result = future.get(120,TimeUnit.SECONDS); +// }catch (InterruptedException e){ +// logger.info("开启旁路中断"); +// future.cancel(true); +// }catch (ExecutionException e) { +// logger.info("开启旁路异常",e); +// future.cancel(true); +// }catch (TimeoutException e) { +// logger.info("开启旁路超时"); +// future.cancel(true); +// } +// try { +// executor.shutdown(); +// }catch (Exception e){ +// logger.info("关闭线程失败"); +// } +// if("0".equals(result)){ +// logger.info("开启旁路完成"); +// }else { +// logger.info("开始重新登录"); +// try { +// SessionService sessionService = SessionService.getService(connection2); +// sessionService.logout(); +// }catch (Exception e2){ +// logger.info("错误:",e2); +// } +// LoginSoa login = new LoginSoa(); +// connection2 = login.loginSoa(); +// if(connection2==null){ +// logger.info("登录失败,不再登录"); +// return null; +// } +// try { +// logger.info("重新开启旁路"); +// userService.openByPass(connection2); +// }catch (Exception e2){ +// logger.info("重新开启失败,错误:",e2); +// return null; +// } +// } +// try { +// String[] revUIDs = dwgtopdfEntry.getTccomponentuid(); +// String[] datasetUIDs = dwgtopdfEntry.getTcdatasetuid(); +// String[] pdfUIDs = dwgtopdfEntry.getPdfuid(); +// //获取tc中的操作数据服务 +// DataManagementService dmService = DataManagementService.getService(connection2); +// MessageEntry messageEntry = new MessageEntry(); +// //将uid转换为对象 +// for(int revLength=0; revLength 1) { +// revision = (ItemRevision) resultDate.getPlainObject(0); +// dataset = (Dataset) resultDate.getPlainObject(1); +// } +// resultDate = dmService.loadObjects(new String[]{dwgtopdfEntry.getTaskpuid()}); +// if (resultDate.sizeOfPlainObjects() > 0) { +// task = (EPMTask) resultDate.getPlainObject(0); +// } +// messageEntry.setItemPuid(revUID); +// messageEntry.setDatasetPuid(datasetUID); +// if (dataset == null || revision == null) { +// messageEntry.setStage("获取版本或数据集失败"); +// messageMapper.updateMessage(messageEntry); +// logger.info(String.format("没有找到版本对象[%s]或者数据集对象[%s]",revUID,datasetUID)); +// jsonObject.put("status",-1); +// jsonObject.put("errormessage",String.format("没有找到版本对象[%s]或者数据集对象[%s]",revUID,datasetUID)); +// dmService.unloadObjects(new ModelObject[]{dataset,revision,task}); +// dmService.refreshObjects2(new ModelObject[]{dataset,revision,task},false); +// continue; +// } +// logger.info("开始加载数据"); +// logger.info("加载的对象【"+revUID+"】数据集【"+datasetUID+"】pdf对象【"+pdfpuid+"】"); +// +// ModelObject[] datasets = new ModelObject[]{dataset}; +// dmService.refreshObjects2(datasets,false); +// dmService.getProperties(datasets,new String[]{"object_type","object_name"}); +// String datasetType = dataset.get_object_type(); +// String datasetName = dataset.get_object_name(); +// ModelObject[] itemRevs = new ModelObject[]{revision}; +// dmService.refreshObjects2(itemRevs,false); +// dmService.getProperties(itemRevs,new String[]{"object_string"}); +// String revisionString = revision.get_object_string(); +// +// logger.info("加载的对象名【"+revisionString+"】数据集名【"+datasetName+"】"); +// +// messageEntry.setStage("正在转PDF"); +// messageMapper.updateMessage(messageEntry); +// logger.info("类型:"+datasetType); +// if(datasetType.equals(dwgtopdfEntry.getDwgtype())){ +// File outFile = downloadFileFromDataset2(dataset,dwgtopdfEntry,revisionString,datasetName); +// if(outFile == null || !outFile.exists()){ +// logger.info(String.format("对版本对象[%s]数据集对象[%s]进行签名,没有找到需要签名的文件",revisionString,datasetName)); +// dmService.unloadObjects(new ModelObject[]{dataset,revision,task}); +// dmService.refreshObjects2(new ModelObject[]{dataset,revision,task},false); +// jsonObject.put("status",-1); +// messageEntry.setStage("下载文件失败"); +// messageMapper.updateMessage(messageEntry); +// continue; +// } +// logger.info("开始调用中望转PDF"); +// File tempFile = assignDWG(outFile,revisionString); +// logger.info("中望转PDF结束"); +// if(!tempFile.exists()){ +// logger.info(String.format("对版本对象[%s]数据集对象[%s]转换PDF失败,",revisionString,datasetName)); +// dmService.unloadObjects(new ModelObject[]{dataset,revision,task}); +// dmService.refreshObjects2(new ModelObject[]{dataset,revision,task},false); +// jsonObject.put("status",-1); +// messageEntry.setStage("转换PDF失败"); +// messageMapper.updateMessage(messageEntry); +// continue; +// } +// logger.info("第一次转换文件长度:"+tempFile.length()); +// //如果生成的pdf文件过小则表示失败,则采用新模式生成 +// if(tempFile.exists() && tempFile.length() < ITeamcenterServiceImpl.PDF_FILE_MIN_LEN){ +// logger.info("dwg生成文件过小,重写生成"); +// boolean deleteSuccess = false; +// int deleteIndex = 1; +// while(!deleteSuccess){ +// try{ +// FileUtils.forceDelete(tempFile); +// deleteSuccess = true; +// logger.info("删除无效pdf成功"); +// }catch (Exception ex) { +// logger.info("未释放,删除失败:" + ex.getMessage()); +// deleteSuccess = false; +// } +// if(deleteIndex>15){ +// break; +// }else { +// Thread.sleep(1000); +// } +// deleteIndex++; +// } +// tempFile = assignDWGApp(outFile,revisionString); +// logger.info("第二次的文件长度:"+tempFile.length()); +// }else if(!PDFUtil.isopenok(tempFile)){ +// logger.info("dwg转pdf,pdf损坏,重新转"); +// boolean deleteSuccess = false; +// int deleteIndex = 1; +// while(!deleteSuccess){ +// try{ +// FileUtils.forceDelete(tempFile); +// deleteSuccess = true; +// logger.info("删除无效pdf成功"); +// }catch (Exception ex){ +// logger.info("未释放,重新删除:"+ex.getMessage()); +// deleteSuccess = false; +// } +// if(deleteIndex>15){ +// break; +// }else { +// Thread.sleep(1000); +// } +// deleteIndex++; +// } +// tempFile = assignDWGApp(outFile,revisionString); +// logger.info("新的文件长度:"+tempFile.length()); +// } +// if(!tempFile.exists()){ +// logger.info(String.format("对版本对象[%s]数据集对象[%s]转换PDF失败,",revisionString,datasetName)); +// dmService.unloadObjects(new ModelObject[]{dataset,revision,task}); +// dmService.refreshObjects2(new ModelObject[]{dataset,revision,task},false); +// jsonObject.put("status",-1); +// messageEntry.setStage("转换PDF失败"); +// messageMapper.updateMessage(messageEntry); +// continue; +// } +// String originalfilename = dwgtopdfEntry.getTcoriginalfilename().substring(0,dwgtopdfEntry.getTcoriginalfilename().lastIndexOf(".")); +// String fileFullPath = String.format("%s/%s%s",SpringbootJjwtApplication.TC_FCCCACH,originalfilename,".pdf"); +// logger.info("上传文件路径:"+fileFullPath); +// File uploadFile = null; +// if(dwgtopdfEntry.getSigninfos()!=null){ +// if(dwgtopdfEntry.getSigninfos().size()>0){ +// logger.info("存在签审信息,给dwg签字"); +// uploadFile = assignPDF(tempFile,fileFullPath,dwgtopdfEntry.getSigninfos(),dwgtopdfEntry.getTcdepartmentid()); +// }else { +// uploadFile = new File(fileFullPath); +// FileUtils.copyFile(tempFile,uploadFile); +// } +// }else { +// uploadFile = new File(fileFullPath); +// FileUtils.copyFile(tempFile,uploadFile); +// } +// String pdfuid_in_db = messageMapper.findPdfUid(revUID,datasetUID,dwgtopdfEntry.getTaskpuid()); +// logger.info("数据库pdf的puid:"+pdfuid_in_db); +// if(pdfuid_in_db!=null && !"".equals(pdfuid_in_db)){ +// if(!(pdfpuid!= null && !"nopdf".equals(pdfpuid))) { +// logger.info("数据库中已有pdf的puid,不需要再创建,puid为:" + pdfuid_in_db); +// pdfpuid = pdfuid_in_db; +// } +// } +// int finditem = 0; +// finditem = messageMapper.findItem(datasetUID); +// if(finditem>0){ +// boolean isSuccessUpload = false; +// isSuccessUpload = uploadPdfToTc(revision,datasetName,task,pdfpuid,revisionString,dwgtopdfEntry,messageEntry,uploadFile); +// if(isSuccessUpload){ +// messageEntry.setStage("转换PDF完成"); +// messageMapper.updateMessage(messageEntry); +// }else { +// messageEntry.setStage("转换PDF失败"); +// messageMapper.updateMessage(messageEntry); +// } +// }else { +// messageEntry.setStage("数据集被删除"); +// messageMapper.updateMessage(messageEntry); +// logger.info("要转PDF的数据集被删除"); +// } +// //释放资源 +// dmService.unloadObjects(new ModelObject[]{dataset,revision,task}); +// dmService.refreshObjects2(new ModelObject[]{dataset,revision,task},false); +// jsonObject.put("status",1); +// try { +// if(tempFile.exists()){ +// FileUtils.forceDelete(tempFile); +// } +// } catch (Exception ex) { +// logger.info("未释放,删除失败2:"+ex.getMessage()); +// } +// try { +// FileUtils.forceDelete(uploadFile); +// }catch (Exception ex){ +// logger.info("未释放,删除失败3:"+ex.getMessage()); +// } +// try { +// FileUtils.forceDelete(outFile); +// }catch (Exception ex){ +// logger.info("未释放,删除失败4:"+ex.getMessage()); +// } +// }else { +// logger.info("数据集类型"+datasetType+"不符合"); +// jsonObject.put("status",-1); +// } +// } +// }catch (Exception exception){ +// logger.info("错误:",exception); +// exception.printStackTrace(); +// jsonObject.put("status",-1); +// return jsonObject; +// }finally { +// logger.info("关闭旁路"); +// userService.closeByPass(connection2); +// // SessionService sessionService = SessionService.getService(AppXSession.getConnection()); +//// tcSession.logout(); +//// AppXSession.getConnection().release(); +//// tcSession = null; +//// tcUser = null; +// } +// return jsonObject; +// } + + + + + public File execAssignProcess(File sourceFile,ServerSignoffEntry signoffEntry,MessageEntry messageEntry,String revisionString,String datasetName,String datasetType){ + File pdfFile = null; + System.out.println("源文件:"+sourceFile.getAbsolutePath()); + //是PDF签名,采用PDF签名处理的逻辑 + if(signoffEntry.isIsoriginalfilepdf()){ + //签名PDF + pdfFile = assignPDF(sourceFile,signoffEntry.getTcpdffilename(),signoffEntry.getSigninfos(),signoffEntry.getTcdepartmentid()); + return pdfFile; + } + + String fileName = sourceFile.getName().toLowerCase(); + logger.info("非dwg文件转PDF的源文件:"+fileName); + String processFullName = null; + if(fileName.endsWith(".xls") || fileName.endsWith(".xlsx")){ + processFullName = SpringbootJjwtApplication.TC_EXCEL_TOOL; + }else if(fileName.endsWith(".doc") || fileName.endsWith(".docx")){ + processFullName = SpringbootJjwtApplication.TC_WORD_TOOL; + } + if(processFullName == null){ + logger.info("调用的程序名不存在"); + return null; + } + logger.info("调用的程序名:"+processFullName); + BufferedReader bufferedReader = null; + try { + // 执行命令返回执行的子进程对象 +// String[] cmd = new String[]{ +// "cmd.exe /c start "+ processFullName, +// signoffEntry.getTcoriginalfilename(), +// signoffEntry.getTcsigninfofilename(), +// signoffEntry.getTcpdffilename() +// }; + + String originalfilename = signoffEntry.getTcoriginalfilename(); + String pdfname = ""; + + if(datasetName.contains(".")){ + String[] split = datasetName.split("\\."); + pdfname = SpringbootJjwtApplication.TC_FCCCACH+"//"+split[0]+".pdf"; + + }else{ + pdfname = SpringbootJjwtApplication.TC_FCCCACH+"//"+datasetName+".pdf"; + + } + + + //pdfFile = new File(pdfname);//不转pdf,要原来的文件签字 + pdfFile = new File(pdfname); + String cmd = String.format("cmd.exe /c start %s %s %s %s", + processFullName, + signoffEntry.getTcoriginalfilename(), + signoffEntry.getTcsigninfofilename(), + pdfname); + logger.info("命令:"+cmd); + Process proc = Runtime.getRuntime().exec(cmd); + String line; + try { + int i=0; + bufferedReader = new BufferedReader(new InputStreamReader(proc.getInputStream())); + while((line=bufferedReader.readLine()) != null) { + System.out.println(line); + Thread.sleep(1000); + i++; + if(i>180){ + logger.info("超时"); + break; + } + //p.waitFor(); + } + }catch (IOException e2){ + System.out.println(e2.getMessage()); + } + logger.info("调用程序结束"); + int tempIndex = 0; + while(!pdfFile.exists()){ + tempIndex ++; + Thread.sleep(1000); + if(tempIndex > 120){ + break; + } + } +// while(!pdfFile.exists()) { +// tempIndex++; +// Thread.sleep(1000); +// if (tempIndex > 60) { +// break; +// } +// System.out.println(String.format("文件:%s不存在", pdfname)); +// } + // 获取子进程的错误流,并打印 +// bufferedReader = new BufferedReader(new InputStreamReader(proc.getErrorStream())); +// String line = null; +// while ((line = bufferedReader.readLine()) != null) { +// System.out.println(line); +// } + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (bufferedReader != null) { + try { + bufferedReader.close(); + } catch (Exception ex) { + } + } + } + if(pdfFile.exists()){ + logger.info("生成PDF"); + }else{ + logger.info("生成PDF失败"); + } + return pdfFile; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/LoginSoa.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/LoginSoa.java new file mode 100644 index 0000000..6a657ee --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/LoginSoa.java @@ -0,0 +1,161 @@ +package com.pjb.springbootjjwt.control; + +import com.pjb.springbootjjwt.SpringbootJjwtApplication; +import com.teamcenter.clientx.AppXSession; +import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; +import com.teamcenter.services.loose.core.SessionService; +import com.teamcenter.services.strong.core.DataManagementService; +import com.teamcenter.services.strong.core._2006_03.Session; +import com.teamcenter.services.strong.query.SavedQueryService; +import com.teamcenter.services.strong.query._2006_03.SavedQuery.ExecuteSavedQueryResponse; +import com.teamcenter.services.strong.query._2006_03.SavedQuery.GetSavedQueriesResponse; +import com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryInput; +import com.teamcenter.soa.client.Connection; +import com.teamcenter.soa.client.model.ModelObject; +import com.teamcenter.soa.client.model.strong.*; +import com.teamcenter.soa.exceptions.NotLoadedException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.UUID; + +@Component +public class LoginSoa { + + @Autowired + private Environment env; // 注入envs + private static final Logger logger = LoggerFactory.getLogger(LoginSoa.class); + + private static LoginSoa loginSoa; + + @PostConstruct + public void init(){ + loginSoa = this; + loginSoa.env = this.env; + } + public Connection loginSoa(){ + System.out.println("TC_URL"+SpringbootJjwtApplication.TC_URL); + System.out.println("TC_USER"+SpringbootJjwtApplication.TC_USER); + System.out.println("TC_PWD"+SpringbootJjwtApplication.TC_PWD); + //AppXSession tcSession = new AppXSession("http://192.168.1.182:7001/tc"); + AppXSession tcSession = new AppXSession(SpringbootJjwtApplication.TC_URL); + User tcUser; +// GroupMember tcGroupMember=null; +// String Loacl_Department_Id = loginSoa.env.getProperty("teamcenter.localdepartmentid"); +// logger.info("本地:"+Loacl_Department_Id); +// String groupName = loginSoa.env.getProperty("teamcenter."+Loacl_Department_Id+"_group"); +// String role = loginSoa.env.getProperty("teamcenter."+Loacl_Department_Id+"_role"); +// logger.info("登录组:"+groupName+" 角色:"+role); + Session.LoginResponse out = null; + try { + out = tcSession.login(SpringbootJjwtApplication.TC_USER, SpringbootJjwtApplication.TC_PWD,"","", UUID.randomUUID().toString()); + } catch (Exception e) { + logger.info("登录失败"); + logger.info("异常:",e); + tcSession.logout(); + return null; + } + tcUser = out.user; + Connection connection = tcSession.getConnection(); + if (tcUser == null || connection==null) { + logger.info("登录失败2"); + tcSession.logout(); + return null; + } +// ModelObject[] groupMembers; +// try { +// groupMembers = querysProjects(tcSession, "__EINT_group_members", new String[] { +// "Group","Role","User" }, new String[] {groupName,role,SpringbootJjwtApplication.TC_USER}); +// if(groupMembers!=null && groupMembers.length>0) { +// tcGroupMember = (GroupMember) groupMembers[0]; +// }else { +// logger.info("未找到对应组"); +// tcSession.logout(); +// tcSession.getConnection().release(); +// return null; +// } +// } catch (ServiceException e1) { +// logger.info("查询异常:",e1); +// tcSession.logout(); +// return null; +// } +// DataManagementService dmService = DataManagementService.getService(connection); +// ModelObject[] groupMember = new ModelObject[]{tcGroupMember}; +// dmService.getProperties(groupMember,new String[]{"the_group"}); +// Group group = null; +// try { +// group = (Group) tcGroupMember.get_the_group(); +// } catch (NotLoadedException e) { +// e.printStackTrace(); +// logger.info("异常1:",e); +// return null; +// } +// ModelObject[] groups = new ModelObject[]{group}; +// dmService.getProperties(groups,new String[]{"volume"}); +// ImanVolume volume = null; +// try { +// volume = group.get_volume(); +// } catch (NotLoadedException e) { +// e.printStackTrace(); +// logger.info("异常2:",e); +// return null; +// } +// SessionService sessionService = SessionService.getService(connection); +// try { +// sessionService.setSessionGroupMember(tcGroupMember); +// } catch (ServiceException e) { +// e.printStackTrace(); +// logger.info("异常3:",e); +// tcSession.logout(); +// return null; +// } +// com.teamcenter.services.loose.core._2007_12.Session.StateNameValue var3 = new com.teamcenter.services.loose.core._2007_12.Session.StateNameValue(); +// var3.name = "volume"; +// var3.value = volume.getUid(); +// com.teamcenter.services.loose.core._2007_12.Session.StateNameValue[] var4 = new com.teamcenter.services.loose.core._2007_12.Session.StateNameValue[]{var3}; +// sessionService.setUserSessionState(var4); + return connection; + } + public static ModelObject[] querysProjects(AppXSession session, String queryName,String[] attrname, String[] attrvalue) throws ServiceException { + ModelObject[] item = (ModelObject[]) null; + ImanQuery query = null; + SavedQueryService queryService = SavedQueryService.getService(session.getConnection()); + GetSavedQueriesResponse savedQueries = queryService.getSavedQueries(); + for (int i = 0; i < savedQueries.queries.length; i++) { + if (!savedQueries.queries[i].name.equals(queryName)) + continue; + query = savedQueries.queries[i].query; + break; + } + if (query == null) { + System.out.println("There is not an " + queryName + " query."); + return null; + } + try { + System.out.println("There is an " + queryName + " query."); + int len = attrname.length; + SavedQueryInput[] savedQueryInput = new SavedQueryInput[1]; + savedQueryInput[0] = new SavedQueryInput(); + savedQueryInput[0].query = query; + savedQueryInput[0].limitList = new ModelObject[0]; + savedQueryInput[0].values = new String[len]; + savedQueryInput[0].entries = new String[len]; + for (int i = 0; i < len; i++) { + System.out.println("attrname--------------"+attrname[i]); + System.out.println("attrvalue-------------"+attrvalue[i]); + savedQueryInput[0].values[i] = attrvalue[i]; + savedQueryInput[0].entries[i] = attrname[i]; + } + ExecuteSavedQueryResponse foun = queryService.executeSavedQuery(query, attrname, attrvalue, 0); + item = foun.objects; + } catch (Exception e) { + e.printStackTrace(); + } + return item; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/ProcessWorker.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/ProcessWorker.java new file mode 100644 index 0000000..2ac0871 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/ProcessWorker.java @@ -0,0 +1,31 @@ +package com.pjb.springbootjjwt.control; + +import java.io.InputStreamReader; + +public class ProcessWorker extends Thread{ + + private Process process; + private volatile int exitCode = -99; + private volatile boolean completed = false; + + public ProcessWorker(Process process) { + this.process = process; + } + @Override + public void run() { + try (InputStreamReader reader = new InputStreamReader( + process.getInputStream(), "gbk")){ + exitCode = process.waitFor(); + completed = true; + } catch (Exception e) { + Thread.currentThread().interrupt(); + } + } + + public int getExitCode() { + return exitCode; + } + public boolean isCompleted() { + return completed; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/StartListener.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/StartListener.java new file mode 100644 index 0000000..4d8382c --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/StartListener.java @@ -0,0 +1,24 @@ +package com.pjb.springbootjjwt.control; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + +@Component +@Service +@Order(value = 1) +public class StartListener implements ApplicationRunner { + private static final Logger logger = LoggerFactory.getLogger(StartListener.class); + @Override + public void run(ApplicationArguments args) throws Exception { + logger.info("开启服务"); +// FindPDFError findPDFError = new FindPDFError(); +// findPDFError.finderror(); + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/StopListerner.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/StopListerner.java new file mode 100644 index 0000000..30a381b --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/control/StopListerner.java @@ -0,0 +1,16 @@ +package com.pjb.springbootjjwt.control; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextClosedEvent; +import org.springframework.stereotype.Component; + +@Component +public class StopListerner implements ApplicationListener { + private static final Logger logger = LoggerFactory.getLogger(StopListerner.class); + @Override + public void onApplicationEvent(ContextClosedEvent contextClosedEvent) { + logger.info("关闭服务"); + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/MessageEntry.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/MessageEntry.java new file mode 100644 index 0000000..661431c --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/MessageEntry.java @@ -0,0 +1,83 @@ +package com.pjb.springbootjjwt.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@NoArgsConstructor +public class MessageEntry { + String itemPuid; + String datasetPuid; + String pdfPuid; + String stage; + String tcstatus; + + public String getItemPuid() { + return itemPuid; + } + + public void setItemPuid(String itemPuid) { + this.itemPuid = itemPuid; + } + + public String getDatasetPuid() { + return datasetPuid; + } + + public void setDatasetPuid(String datasetPuid) { + this.datasetPuid = datasetPuid; + } + + public String getPdfPuid() { + return pdfPuid; + } + + public void setPdfPuid(String pdfPuid) { + this.pdfPuid = pdfPuid; + } + + public String getStage() { + return stage; + } + + public void setStage(String stage) { + this.stage = stage; + } + + public String getTcstatus() { + return tcstatus; + } + + public void setTcstatus(String tcstatus) { + this.tcstatus = tcstatus; + } + + public String getTaskpuid() { + return taskpuid; + } + + public void setTaskpuid(String taskpuid) { + this.taskpuid = taskpuid; + } + + public String getSigninfos() { + return signinfos; + } + + public void setSigninfos(String signinfos) { + this.signinfos = signinfos; + } + + public String getTcrelation() { + return tcrelation; + } + + public void setTcrelation(String tcrelation) { + this.tcrelation = tcrelation; + } + + String taskpuid; + String signinfos; + String tcrelation; +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerDwgtopdfEntry.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerDwgtopdfEntry.java new file mode 100644 index 0000000..59726fe --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerDwgtopdfEntry.java @@ -0,0 +1,27 @@ +package com.pjb.springbootjjwt.entity; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.HashMap; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ServerDwgtopdfEntry implements Serializable { + String[] tccomponentuid; + String[] tcdatasetuid; + String[] pdfuid; + String tccomponentrelation; + String dwgtype; + String dwgreferencename; + String tcoriginalfilename; + String tcdepartmentid; + String fmsid; + String taskpuid; + String tcstatus; + HashMap signinfos; +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerMailEntry.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerMailEntry.java new file mode 100644 index 0000000..5891ae8 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerMailEntry.java @@ -0,0 +1,18 @@ +package com.pjb.springbootjjwt.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ServerMailEntry { + String nickname; + String from; + String[] to; + String[] cc; + String subject; + String title; + String content; +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerSignoffEntry.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerSignoffEntry.java new file mode 100644 index 0000000..3eb8ebf --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/ServerSignoffEntry.java @@ -0,0 +1,42 @@ +package com.pjb.springbootjjwt.entity; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.HashMap; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ServerSignoffEntry implements Serializable { + /**是否签名PDF,如果不是PDF则转换成PDF后进行签名*/ + boolean issignpdf = true; + boolean isoriginalfilepdf = false; + boolean isoriginalfiledwg = false; + boolean istranslatepdf = false; + /**基地代号*/ + String tcdepartmentid; + /**tc中的数据集UID*/ + String tcdatasetuid ; + /**tc中的对象UID*/ + String tccomponentuid; + String tccomponentrelation; + String pdfuid; + /**tc中的签名后文件下挂到对象的关系*/ + String tcpdfrelation; + String tcoriginalname; + String tcoriginalext; + String tcoriginalfilename; + String tcpdffilename; + String tcsigninfofilename; + String dwgtype; + //pdf发布状态 + String tcstatus; + String taskpuid; + HashMap signinfos; + + +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/User.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/User.java new file mode 100644 index 0000000..a265963 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/entity/User.java @@ -0,0 +1,15 @@ +package com.pjb.springbootjjwt.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class User { + String app_secret; + String username; + String password; +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/interceptor/AuthenticationInterceptor.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/interceptor/AuthenticationInterceptor.java new file mode 100644 index 0000000..62691ec --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/interceptor/AuthenticationInterceptor.java @@ -0,0 +1,82 @@ +package com.pjb.springbootjjwt.interceptor; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTDecodeException; +import com.auth0.jwt.exceptions.JWTVerificationException; +import com.pjb.springbootjjwt.annotation.PassToken; +import com.pjb.springbootjjwt.annotation.UserLoginToken; +import com.pjb.springbootjjwt.entity.User; +import com.pjb.springbootjjwt.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; + + + +public class AuthenticationInterceptor implements HandlerInterceptor { + @Autowired + UserService userService; + @Override + public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception { + String token = httpServletRequest.getHeader("access_token");// 从 http 请求头中取出 token + // 如果不是映射到方法直接通过 + if(!(object instanceof HandlerMethod)){ + return true; + } + HandlerMethod handlerMethod=(HandlerMethod)object; + Method method=handlerMethod.getMethod(); + //检查是否有passtoken注释,有则跳过认证 + if (method.isAnnotationPresent(PassToken.class)) { + PassToken passToken = method.getAnnotation(PassToken.class); + if (passToken.required()) { + return true; + } + } + //检查有没有需要用户权限的注解 + if (method.isAnnotationPresent(UserLoginToken.class)) { + UserLoginToken userLoginToken = method.getAnnotation(UserLoginToken.class); + if (userLoginToken.required()) { + // 执行认证 + if (token == null) { + throw new RuntimeException("无token,请重新登录"); + } + // 获取 token 中的 user id + String userId; + try { + userId = JWT.decode(token).getAudience().get(0); + } catch (JWTDecodeException j) { + throw new RuntimeException("token验证失败"); + } + User user = userService.findUserById(userId); + if (user == null) { + throw new RuntimeException("用户不存在,请重新登录"); + } + // 验证 token + JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(user.getPassword())).build(); + try { + jwtVerifier.verify(token); + } catch (JWTVerificationException e) { + throw new RuntimeException("token验证失败"); + } + return true; + } + } + return true; + } + + @Override + public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception { + + } + @Override + public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { + + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/interceptor/GloablExceptionHandler.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/interceptor/GloablExceptionHandler.java new file mode 100644 index 0000000..73e29a1 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/interceptor/GloablExceptionHandler.java @@ -0,0 +1,22 @@ +package com.pjb.springbootjjwt.interceptor; + +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + + +@ControllerAdvice +public class GloablExceptionHandler { + @ResponseBody + @ExceptionHandler(Exception.class) + public Object handleException(Exception e) { + String msg = e.getMessage(); + if (msg == null || msg.equals("")) { + msg = "服务器出错"; + } + JSONObject jsonObject = new JSONObject(); + jsonObject.put("message", msg); + return jsonObject; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/lisener/MQ_TCSendmailReceiver.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/lisener/MQ_TCSendmailReceiver.java new file mode 100644 index 0000000..d92d5aa --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/lisener/MQ_TCSendmailReceiver.java @@ -0,0 +1,16 @@ +//package com.pjb.springbootjjwt.lisener; +// +//import org.springframework.amqp.rabbit.annotation.RabbitHandler; +//import org.springframework.amqp.rabbit.annotation.RabbitListener; +//import org.springframework.stereotype.Component; +// +//import java.util.Map; +// +//@Component +//@RabbitListener(queues = "SendmailMQ") +//public class MQ_TCSendmailReceiver { +// @RabbitHandler +// public void process(Map message) { +// System.out.println("发送电子邮件消费者收到消息 : " + message.toString()); +// } +//} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/lisener/MQ_TCSignoffReveiver.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/lisener/MQ_TCSignoffReveiver.java new file mode 100644 index 0000000..e57d695 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/lisener/MQ_TCSignoffReveiver.java @@ -0,0 +1,30 @@ +package com.pjb.springbootjjwt.lisener; + +import com.pjb.springbootjjwt.control.ITeamcenterServiceImpl; +import com.pjb.springbootjjwt.entity.ServerSignoffEntry; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +@RabbitListener(queues = "SignoffMQ") +public class MQ_TCSignoffReveiver { + @Autowired + ITeamcenterServiceImpl teamcenterService; + + @RabbitHandler + public void process(Map message) { + + + + Object messageData = message.get("messageData"); + if(messageData ==null || !(messageData instanceof ServerSignoffEntry)){ + return; + } + ServerSignoffEntry signoffEntry = (ServerSignoffEntry) messageData; + Object resultObject = teamcenterService.signoffTeamcenterDataset(signoffEntry); + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/mapper/MessageEntryMapper.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/mapper/MessageEntryMapper.java new file mode 100644 index 0000000..3299b4f --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/mapper/MessageEntryMapper.java @@ -0,0 +1,20 @@ +package com.pjb.springbootjjwt.mapper; + +import com.pjb.springbootjjwt.entity.MessageEntry; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Mapper +@Repository +public interface MessageEntryMapper { + int updatePDFPuid(MessageEntry messageEntry); + int updateMessage(MessageEntry messageEntry); + List selectByDepartmentId(@Param("DEPARMENTID") String deparmentId); + int findCount(@Param("PRIMARYPUID")String primarypuid,@Param("SECONDARYPUID")String secondarypuid); + String findPdfUid(@Param("ITEMPUID")String itempuid,@Param("DATASETPUID")String datasetpuid,@Param("TASKPUID")String taskpuid); + int findItem(@Param("ITEMPUID")String itempuid); +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/mapper/UserMapper.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/mapper/UserMapper.java new file mode 100644 index 0000000..9085e52 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/mapper/UserMapper.java @@ -0,0 +1,16 @@ +package com.pjb.springbootjjwt.mapper; + +import com.pjb.springbootjjwt.entity.User; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface UserMapper { + User findByUsername(@Param("USERNAME") String username); + + User findByUsernameAndId(@Param("USERNAME") String username, @Param("APP_SECRET") String Id); + + User findUserById(@Param("APP_SECRET") String Id); +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PDFUtil.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PDFUtil.java new file mode 100644 index 0000000..c3c8796 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PDFUtil.java @@ -0,0 +1,303 @@ +package com.pjb.springbootjjwt.pdfbean; + +import com.itextpdf.text.BaseColor; +import com.itextpdf.text.DocumentException; +import com.itextpdf.text.Image; +import com.itextpdf.text.Rectangle; +import com.itextpdf.text.pdf.*; +import com.pjb.springbootjjwt.SpringbootJjwtApplication; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import java.io.*; +import java.util.*; + +public class PDFUtil { + public static boolean isopenok(File file){ + + InputStream inputStreamPdf = null; + try { + inputStreamPdf = new FileInputStream(file); + } catch (FileNotFoundException e) { + System.out.println("文件不存在"); + return false; + } + + try { + PdfReader reader = new PdfReader(inputStreamPdf, "PDF".getBytes()); + reader.close(); + } catch (Exception e) { + System.out.println("打开失败"); + return false; + }finally { + try { + inputStreamPdf.close(); + }catch(Exception ex1){ + ex1.printStackTrace(); + } + } + return true; + } + public static PdfList getConfigList(InputStream inputStream,Class classLoad){ + PdfList object = null; + try { + JAXBContext context = JAXBContext.newInstance(new Class[]{classLoad}); + Unmarshaller unmarshaller = context.createUnmarshaller(); + object = (PdfList)unmarshaller.unmarshal(inputStream); + }catch (Exception exception){ + exception.printStackTrace(); + } + return object; + } + + public static Float[] getSize(Rectangle rectangle) + { + Float[] sizef = new Float[2]; + float toleft = rectangle.getLeft(); + float tobottom = rectangle.getBottom(); + float toright = rectangle.getRight(); + float totop = rectangle.getTop(); + int rotation = rectangle.getRotation(); + sizef[0] = Float.valueOf(toright - toleft); + sizef[1] = Float.valueOf(totop - tobottom); + +// if (sizef[0].floatValue() < sizef[1].floatValue()) +// { +// float cha = sizef[0].floatValue(); +// sizef[0] = sizef[1]; +// sizef[1] = Float.valueOf(cha); +// } + System.out.println("Left=" + toleft + "|Right=" + toright + "|Top=" + + totop + "|Bottom=" + tobottom + "|RD=" + + rotation); + System.out.println("W=" + sizef[0]); + System.out.println("H=" + sizef[1]); + return sizef; + } + + public static void signoffToPdf(HashMap signInfos,String departmentid,PdfList configList, File sourceFile, File outPdfFile) throws IOException, DocumentException { + InputStream inputStreamPdf = null; + try { + if (configList == null) { + System.out.println("pdf配置为空"); + return; + } + List infoBeanList = new ArrayList<>(); + for (Map.Entry entry : signInfos.entrySet()) { + SignoffInfoBean signBean = new SignoffInfoBean(); + signBean.set_Name(entry.getKey()); + String[] values = entry.getValue().split(","); + StringBuffer userValue= new StringBuffer(); + for(int j=0;j1){ + String userName = SpringbootJjwtApplication.PICPATH+values2[1]+SpringbootJjwtApplication.PICEXT; + File file = new File(userName); + if (file.exists()) { + userValue.append(userName); + }else { + userValue.append(values2[0]); + } + }else { + userValue.append(values2[0]); + } + } + signBean.get_infos().add(userValue.toString()); + signBean.get_infonames().add(values[0]); + infoBeanList.add(signBean); + } + int indexTemp = 0; + while (!sourceFile.exists()) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + indexTemp++; + if (indexTemp > 5) { + break; + } + } + if (!sourceFile.exists()) { + return; + } + inputStreamPdf = new FileInputStream(sourceFile); + System.out.println("IN PDF=>" + sourceFile.getAbsolutePath()); + PdfReader reader = new PdfReader(inputStreamPdf, "PDF".getBytes()); + PdfStamper stamp = new PdfStamper(reader, new FileOutputStream( + outPdfFile)); + BaseFont base = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", + BaseFont.NOT_EMBEDDED); + PdfContentByte content = null; + // 水印图片 + Image img = null; + int pageSize = reader.getNumberOfPages();// 获取输入文件的页数 + if (pageSize < 1) { + System.out.println("PDF页数小于0,退出PDF签名"); + return; + } + PdfDictionary pd = null; + for (int index = 1; index <= pageSize; index++) { + //int index = 1; + //for (int index = 1; index <= 1; index++) { + Rectangle rectangle = reader.getPageSizeWithRotation(index); + boolean isSignoff = false; + Float[] fposition = getSize(rectangle); + float pdfW = fposition[0], pdfH = fposition[1]; + System.out.println(String.format("pdfW=%f,pdfH%f", pdfW, pdfH)); + for (PdfBean pdfBean : configList.getPartList()) { + if (!(pdfW >= pdfBean.getiW() + && pdfW <= pdfBean.getmW() + && pdfH >= pdfBean.getiH() + && pdfH <= pdfBean.getmH())) { + System.out.println(pdfBean.getName() + "不匹配"); + continue; + } + if(!(departmentid.equals(pdfBean.getBase()))){ + System.out.println(pdfBean.getBase() + "基地不匹配"); + continue; + } + isSignoff = true; + System.out.println(pdfBean.getName() + "匹配"); + if (pdfBean.getIsT()) { + pd = reader.getPageN(index); + pd.put(PdfName.ROTATE, new PdfNumber(pdfBean.getRD())); // + // 顺时针旋转90° + } + + //进行电子签名 + //for (SignoffInfoBean siBean : infoBeanList) { + for (SignoffInfoBean siBean : infoBeanList) { + for (PdfPoint point : pdfBean.getPointList()) { + if (!siBean.get_Name().equals(point.getKey())) { + continue; + } + for (int k = 0; k < siBean.get_infos().size(); k++) { + String value = siBean.get_infos().get(k); + if (point.getIsImage()) { + File imageFile = new File(value); + if (!imageFile.exists()) { + // String userName = value.substring(value.lastIndexOf("\\")+1, value.lastIndexOf(".")); + String userName = siBean.get_infonames().get(k); + System.out.println("签名:" + userName); + content = stamp.getOverContent(index); + // 开始 + content.beginText(); + // 设置颜色 + content.setColorFill(BaseColor.BLACK); + // 设置字体及字号 + if(pdfBean.getFontSize()!=null){ + content.setFontAndSize(base, pdfBean.getFontSize()); + }else { + content.setFontAndSize(base, 7f); + } + content.setTextMatrix(pdfW - point.getX() + k * 35, + point.getY() + 2f); + content.showText(userName); + content.endText(); + continue; + } + img = Image.getInstance(value);// 获取图片实例 + // System.out.println("比例" + pdfBean.getSize()); + img.scaleAbsolute(35 * pdfBean.getSize(), + 20 * pdfBean.getSize());// 缩放图片 + img.setAbsolutePosition(pdfW - point.getX() + k * 35 + * pdfBean.getSize(), point.getY());// 设置水印左下角的坐 + System.out.println(String.format("%f,%f", point.getX(), point.getY())); + PdfContentByte under = stamp.getOverContent(index);// stamp.getUnderContent(i); + PdfGState gs = new PdfGState(); + gs.setFillOpacity(1.0f);// 设置透明度为0.2 + under.setGState(gs); + under.addImage(img); + } else { + content = stamp.getOverContent(index); + // 开始 + content.beginText(); + // 设置颜色 + content.setColorFill(BaseColor.BLACK); + // 设置字体及字号 + if(pdfBean.getFontSize()!=null){ + content.setFontAndSize(base, pdfBean.getFontSize()); + }else { + content.setFontAndSize(base, 7f); + } + + content.setTextMatrix(pdfW - point.getX() + k * 35, + point.getY()); + content.showText(value); + content.endText(); + } + } + } + } + } +// if (!isSignoff) { +// PdfBean pdfBean = configList.getPartList().get( +// configList.getPartList().size() - 1); +// for (SignoffInfoBean siBean : infoBeanList) { +// for (PdfPoint point : pdfBean.getPointList()) { +// if (!siBean.get_Name().equals(point.getKey())) { +// continue; +// } +// for (int k = 0; k < siBean.get_infos().size(); k++) { +// String value = siBean.get_infos().get(k); +// if (point.getIsImage()) { +// File imageFile = new File(value); +// if (!imageFile.exists()) { +// continue; +// } +// img = Image.getInstance(value);// 获取图片实例 +// img.scaleAbsolute(35 * pdfBean.getSize(), +// 20 * pdfBean.getSize());// 缩放图片 +// img.setAbsolutePosition(point.getX() + k * 35 +// * pdfBean.getSize(), point.getY());// 设置水印左下角的坐标 +// // 向PDF输出文件中插入水印 +// // if (pdfBean.getIsT()) { +// // pd = reader.getPageN(i); +// // pd.put(PdfName.ROTATE, new PdfNumber( +// // pdfBean.getRD())); // 顺时针旋转90° +// // // img.setRotationDegrees(pdfBean.getRD());// +// // // 旋转 +// // } +// PdfContentByte under = stamp.getOverContent(index);// stamp.getUnderContent(i); +// PdfGState gs = new PdfGState(); +// gs.setFillOpacity(1.0f);// 设置透明度为0.2 +// under.setGState(gs); +// under.addImage(img); +// } else { +// content = stamp.getOverContent(index); +// // 开始 +// content.beginText(); +// // 设置颜色 +// content.setColorFill(BaseColor.GRAY); +// // 设置字体及字号 +// content.setFontAndSize(base, 10f); +// content.setTextMatrix(point.getX() + k * 35, +// point.getY());// x,y +// content.showText(value); +// content.endText(); +// } +// } +// } +// } +// } + } + stamp.close(); + reader.close();// 关闭 + }catch(Exception ex){ + ex.printStackTrace(); + }finally { + if(inputStreamPdf!=null){ + try { + inputStreamPdf.close(); + }catch(Exception ex1){ + ex1.printStackTrace(); + } + } + } + } + +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfBean.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfBean.java new file mode 100644 index 0000000..0da82a5 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfBean.java @@ -0,0 +1,172 @@ +package com.pjb.springbootjjwt.pdfbean; + +import java.util.List; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; + +public class PdfBean +{ + private String Name; + private Float Size; + private Float iH; + private Float iW; + private Float mH; + private Float mW; + private Boolean isT; + private Boolean isM; + private Float RD; + private String Base; + private Float FontSize; + private List pointList; + + public PdfBean() {} + + public PdfBean(String Name,String Base, Float Size,Float FontSize, Float iH, Float iW, Float mH, Float mW, List pointList) + { + this.Size = Size; + this.FontSize = FontSize; + this.Base = Base; + this.Name = Name; + this.iH = iH; + this.iW = iW; + this.mH = mH; + this.mW = mW; + this.pointList = pointList; + } + + @XmlAttribute(name="rd") + public Float getRD() + { + return this.RD; + } + + public void setRD(Float rD) + { + this.RD = rD; + } + + @XmlAttribute(name="isM") + public Boolean getIsM() + { + return this.isM; + } + + public void setIsM(Boolean isM) + { + this.isM = isM; + } + + @XmlAttribute(name="isT") + public Boolean getIsT() + { + return this.isT; + } + + public void setIsT(Boolean isT) + { + this.isT = isT; + } + + @XmlAttribute(name="Size") + public Float getSize() + { + return this.Size; + } + + public void setSize(Float size) + { + this.Size = size; + } + + @XmlAttribute(name="Name") + public String getName() + { + return this.Name; + } + + public void setName(String name) + { + this.Name = name; + } + + @XmlAttribute(name="iH") + public Float getiH() + { + return this.iH; + } + + public void setiH(Float iH) + { + this.iH = iH; + } + + @XmlAttribute(name="iW") + public Float getiW() + { + return this.iW; + } + + public void setiW(Float iW) + { + this.iW = iW; + } + + @XmlAttribute(name="mH") + public Float getmH() + { + return this.mH; + } + + public void setmH(Float mH) + { + this.mH = mH; + } + + @XmlAttribute(name="mW") + public Float getmW() + { + return this.mW; + } + + public void setmW(Float mW) + { + this.mW = mW; + } + + @XmlAttribute(name="Base") + public String getBase() + { + return this.Base; + } + + public void setBase(String base) { this.Base = base; } + + @XmlAttribute(name="FontSize") + public Float getFontSize() + { + return this.FontSize; + } + + public void setFontSize(Float FontSize) + { + this.FontSize = FontSize; + } + + @XmlElement(name="point") + public List getPointList() + { + return this.pointList; + } + + public void setPointList(List pointList) + { + this.pointList = pointList; + } + + public String toString() + { + return + + "PdfBean [Name=" + this.Name + ", Base=" + this.Base + ", Size=" + this.Size + ", FontSize=" + this.FontSize + ", iH=" + this.iH + ", iW=" + this.iW + ", mH=" + this.mH + ", mW=" + this.mW + ", pointList=" + this.pointList + "]"; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfList.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfList.java new file mode 100644 index 0000000..639b207 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfList.java @@ -0,0 +1,29 @@ +package com.pjb.springbootjjwt.pdfbean; + +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name="pdfs") +public class PdfList +{ + private List partList; + + public PdfList() {} + + public PdfList(List partList) + { + this.partList = partList; + } + + @XmlElement(name="pdf") + public List getPartList() + { + return this.partList; + } + + public void setPartList(List partList) + { + this.partList = partList; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfPoint.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfPoint.java new file mode 100644 index 0000000..1ca280f --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/PdfPoint.java @@ -0,0 +1,65 @@ +package com.pjb.springbootjjwt.pdfbean; + +import javax.xml.bind.annotation.XmlAttribute; + +public class PdfPoint +{ + private String key; + private Boolean isImage; + private Float x; + private Float y; + + public PdfPoint() {} + + public PdfPoint(String key, Boolean isImage, Float x, Float y) + { + this.key = key; + this.isImage = isImage; + this.x = x; + this.y = y; + } + + @XmlAttribute(name="isImage") + public Boolean getIsImage() + { + return this.isImage; + } + + public void setIsImage(Boolean isImage) + { + this.isImage = isImage; + } + + @XmlAttribute(name="Key") + public String getKey() + { + return this.key; + } + + public void setKey(String key) + { + this.key = key; + } + + @XmlAttribute(name="X") + public Float getX() + { + return this.x; + } + + public void setX(Float x) + { + this.x = x; + } + + @XmlAttribute(name="Y") + public Float getY() + { + return this.y; + } + + public void setY(Float y) + { + this.y = y; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/SignoffInfoBean.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/SignoffInfoBean.java new file mode 100644 index 0000000..9dcae0d --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/pdfbean/SignoffInfoBean.java @@ -0,0 +1,47 @@ +package com.pjb.springbootjjwt.pdfbean; + +import java.util.ArrayList; +import java.util.List; + +public class SignoffInfoBean +{ + private String _Name; + private List _infos; + private List _infoNames; + + public String get_Name() + { + return this._Name; + } + + public void set_Name(String _Name) + { + this._Name = _Name; + } + + public List get_infos() + { + if (this._infos == null) { + this._infos = new ArrayList(); + } + return this._infos; + } + + public void set_infos(List _infos) + { + this._infos = _infos; + } + + public List get_infonames() + { + if (this._infoNames == null) { + this._infoNames = new ArrayList(); + } + return this._infoNames; + } + + public void set_infonames(List _infoNames) + { + this._infoNames = _infoNames; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/DirectRabbitConfig.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/DirectRabbitConfig.java new file mode 100644 index 0000000..e175cd7 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/DirectRabbitConfig.java @@ -0,0 +1,52 @@ +package com.pjb.springbootjjwt.service; + +import org.springframework.amqp.core.Binding; +import org.springframework.amqp.core.BindingBuilder; +import org.springframework.amqp.core.DirectExchange; +import org.springframework.amqp.core.Queue; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class DirectRabbitConfig { + + //队列 起名:TestDirectQueue + @Bean + public Queue SuporSendmailQueue() { + // durable:是否持久化,默认是false,持久化队列:会被存储在磁盘上,当消息代理重启时仍然存在,暂存队列:当前连接有效 + // exclusive:默认也是false,只能被当前创建的连接使用,而且当连接关闭后队列即被删除。此参考优先级高于durable + // autoDelete:是否自动删除,当没有生产者或者消费者使用此队列,该队列会自动删除。 + // return new Queue("TestDirectQueue",true,false,false); + //一般设置一下队列的持久化就好,其余两个就是默认false + return new Queue("SendmailMQ",true); + } + + @Bean + public Queue SuporSignoffQueue(){ + return new Queue("SignoffMQ",true); + } + + + //Direct交换机 起名:TestDirectExchange + @Bean + DirectExchange SuporSendmailQueueExchange() { + // return new DirectExchange("TestDirectExchange",true,true); + return new DirectExchange("SuporSendmailQueueExchange",true,false); + } + + @Bean + DirectExchange SuporSignoffQueueExchange() { + // return new DirectExchange("TestDirectExchange",true,true); + return new DirectExchange("SuporSignoffQueueExchange",true,false); + } + //绑定 将队列和交换机绑定, 并设置用于匹配键:TestDirectRouting + @Bean + Binding bindingSendmailDirect() { + return BindingBuilder.bind(SuporSendmailQueue()).to(SuporSendmailQueueExchange()).with("SuporSendmailQueueRouting"); + } + @Bean + Binding bindingSignoffDirect() { + return BindingBuilder.bind(SuporSignoffQueue()).to(SuporSignoffQueueExchange()).with("SuporSignoffQueueRouting"); + } + +} \ No newline at end of file diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/IMailService.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/IMailService.java new file mode 100644 index 0000000..e43e06f --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/IMailService.java @@ -0,0 +1,34 @@ +package com.pjb.springbootjjwt.service; + + +import javax.mail.MessagingException; + +public interface IMailService { + + /** + * 发送文本邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + */ + void sendSimpleMail(String to, String subject, String content); + + /** + * 发送HTML邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + */ + public void sendHtmlMail(String nickName,String[] to,String[] cc, String subject, String content) throws MessagingException, Exception; + + + + /** + * 发送带附件的邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + * @param filePath 附件 + */ + public void sendAttachmentsMail(String to, String subject, String content, String filePath); +} \ No newline at end of file diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/TokenService.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/TokenService.java new file mode 100644 index 0000000..3a6316d --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/TokenService.java @@ -0,0 +1,18 @@ +package com.pjb.springbootjjwt.service; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.pjb.springbootjjwt.entity.User; +import org.springframework.stereotype.Service; + + + +@Service("TokenService") +public class TokenService { + public String getToken(User user) { + String token=""; + token = JWT.create().withAudience(user.getApp_secret())// 将 user id 保存到 token 里面 + .sign(Algorithm.HMAC256(user.getPassword()));// 以 password 作为 token 的密钥 + return token; + } +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/UserService.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/UserService.java new file mode 100644 index 0000000..4896e91 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/service/UserService.java @@ -0,0 +1,26 @@ +package com.pjb.springbootjjwt.service; + +import com.pjb.springbootjjwt.entity.User; +import com.pjb.springbootjjwt.mapper.UserMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service("UserService") +public class UserService { + @Autowired + UserMapper userMapper; + + public User findByUsername(User user) { + return userMapper.findByUsername(user.getUsername()); + } + + public User findByUsernameAndId(User user) { + return userMapper.findByUsernameAndId(user.getUsername(), user.getApp_secret()); + } + + public User findUserById(String userId) { + return userMapper.findUserById(userId); + } + +} diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/ICCTUserService.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/ICCTUserService.java new file mode 100644 index 0000000..64e2452 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/ICCTUserService.java @@ -0,0 +1,60 @@ +package com.pjb.springbootjjwt.tcuserservice; + + +import com.teamcenter.clientx.AppXSession; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; +import com.teamcenter.services.internal.loose.core.ICTService; +import com.teamcenter.services.internal.loose.core._2011_06.ICT.Arg; +import com.teamcenter.services.internal.loose.core._2011_06.ICT.InvokeICTMethodResponse; +import com.teamcenter.soa.client.Connection; + +public class ICCTUserService { + private ICTService m_service; +// public ICCTUserService() { +// m_service = ICTService.getService( AppXSession.getConnection() ); +// } + + public ICCTUserService(Connection connection) { + m_service = ICTService.getService( connection ); + } + public void getMethodParameters(String methodName, longSeqValue_uHolder argumentTypeList, IntHolder returnParameterType){ + Arg[] args_ = new Arg[1]; + + args_[0] = TcUtility.createArg(methodName); + InvokeICTMethodResponse response = null; + try { + response = m_service.invokeICTMethod("ICCTUserService", "getMethodParameters", args_); + } catch (ServiceException e) { + e.printStackTrace(); + //LogHelper.Error(ICCTUserService.class, "调用 ICCTUserService,getMethodParameters错误",e); + return; + } +// if( TCSoaUtil.checkServicedataHaveError(response.serviceData)) +// { +// return; +// } + argumentTypeList.value = TcUtility.queryArg(response.output[0], argumentTypeList.value); + returnParameterType.value = TcUtility.queryArg(response.output[1], returnParameterType.value); + } + + public void callMethod(String methodName, stringSeqValue_u marshalledArguments, StringHolder returnValue) { + Arg[] args_ = new Arg[2]; + args_[0] = TcUtility.createArg(methodName); + args_[1] = TcUtility.createArg(marshalledArguments); + InvokeICTMethodResponse response = null; + try { + response = m_service.invokeICTMethod("ICCTUserService", "callMethod", args_); + } catch (ServiceException e) { + //LogHelper.Error(ICCTUserService.class, "调用 ICCTUserService,callMethod错误",e); + e.printStackTrace(); + } + if( response.serviceData.sizeOfPartialErrors() > 0) + { + return; + } + returnValue.value = TcUtility.queryArgStringUnion(response.output[0], returnValue.value); + } + +} + + diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/IntHolder.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/IntHolder.java new file mode 100644 index 0000000..cfa0c72 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/IntHolder.java @@ -0,0 +1,14 @@ +package com.pjb.springbootjjwt.tcuserservice; +public class IntHolder { + public int value = 0; + + + public IntHolder() { + } + + public IntHolder(int value) { + this.value = value; + } + +} + diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/StringHolder.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/StringHolder.java new file mode 100644 index 0000000..17aa338 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/StringHolder.java @@ -0,0 +1,16 @@ +package com.pjb.springbootjjwt.tcuserservice; +public class StringHolder { + public String value = null; + + + public StringHolder() { + } + + public StringHolder(String value) { + this.value = value; + } + +} + + + diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/TCSoaUserService.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/TCSoaUserService.java new file mode 100644 index 0000000..16c51f0 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/TCSoaUserService.java @@ -0,0 +1,104 @@ +package com.pjb.springbootjjwt.tcuserservice; + +import com.teamcenter.soa.client.Connection; + +public class TCSoaUserService +{ + + private final String BYPASS_METHOD = "ITK_server_bypass"; + + /** + * 开超级权限 + * @return + */ + public String openByPass(Connection connection){ + return callUserSerivce(connection,BYPASS_METHOD,new Object[]{"true"}); + } + + /** + * 关闭超级权限 + * @return + */ + public String closeByPass(Connection connection){ + return callUserSerivce(connection,BYPASS_METHOD,new Object[]{"false"}); + } + + /** + * 调用UserService服务 + * @param methodName 服务名称 + * @param marshalledArguments 参数 + * @return + */ + public String callUserSerivce(Connection connection,String methodName, Object[] marshalledArguments) + { + ICCTUserService userService = new ICCTUserService(connection); + longSeqValue_uHolder holder1 = new longSeqValue_uHolder(); + IntHolder localIntHolder = new IntHolder(); + userService.getMethodParameters(methodName, holder1, localIntHolder); + int[] localObject1 = new int[0]; + if (holder1.value.is_seqValue()) + { + localObject1 = holder1.value.seqValue(); + } + String[] values = new String[marshalledArguments.length]; + values = marshallArguments(localObject1, marshalledArguments); + stringSeqValue_u localObject2 = new stringSeqValue_u(); + localObject2.seqValue(values); + StringHolder localObject3 = new StringHolder(); + userService.callMethod(methodName,localObject2,localObject3); + return localObject3.value; + } + + + private String[] marshallArguments(int[] paramArrayOfInt, Object[] paramArrayOfObject) + { + int i = paramArrayOfObject.length; + String[] arrayOfString = new String[i]; + + for (int j = 0; j < i; j++) { + if (isArrayType(paramArrayOfInt[j])) { + //arrayOfString[j] = marshallArrayValue(paramArrayOfInt[j], paramArrayOfObject[j]); + } else { + arrayOfString[j] = marshallValue(paramArrayOfInt[j], paramArrayOfObject[j]); + } + } + return arrayOfString; + } + + + + private String marshallValue(int paramInt, Object paramObject) + { + String localObject1 = ""; + switch (paramInt) + { + + case 5: + + int localInteger = (int)paramObject; + localObject1 = localInteger +""; + break; + + + case 8: + + String str1 = (String)paramObject; + localObject1 = str1; + break; + + default: + break; + } + return localObject1; + } + + + private boolean isArrayType(int paramInt) + { + boolean isok = false; + if (paramInt > 100) { + isok = true; + } + return isok; + } +} \ No newline at end of file diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/TcUtility.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/TcUtility.java new file mode 100644 index 0000000..9c9fbe5 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/TcUtility.java @@ -0,0 +1,191 @@ +package com.pjb.springbootjjwt.tcuserservice; + +import com.teamcenter.services.internal.loose.core._2011_06.ICT.Arg; +import com.teamcenter.services.internal.loose.core._2011_06.ICT.Array; +import com.teamcenter.services.internal.loose.core._2011_06.ICT.Entry; +import com.teamcenter.services.internal.loose.core._2011_06.ICT.Structure; + +public class TcUtility + { + public static Arg createArg(String argValue) + { + Arg arg = new Arg(); + arg.val = argValue; + return arg; + } + + + public Entry createEntry() + { + Entry arg = new Entry(); + arg.structure = new Structure[1]; + arg.structure[0] = new Structure(); + + return arg; + } + public static longSeqValue_u queryArg(Arg arg, longSeqValue_u argValue) + { + if (argValue == null) { + argValue = new longSeqValue_u(); + } + argValue.__default(); + if (arg.structure == null || arg.structure[0] == null) { + return null; + } + if (arg.structure[0].args == null) { + return argValue; + } + String dicVal = "0"; + if (argValue.discriminator()) { + dicVal = "1"; + } + if (arg.structure[0].args[0].val.equals(dicVal)) + { + return argValue; + } + if (arg.structure[0].args[0].val.equalsIgnoreCase("TRUE")) + { + argValue.seqValue(TcUtility.queryArg(arg.structure[0].args[1], argValue.seqValue())); + } + else + { + argValue.seqValue(new int[0]); + } + return argValue; + } + public static int[] queryArg(Arg arg, int[] argValue) + { + if (arg.array == null || arg.array.length == 0 || arg.array[0] == null) { + return null; + } + if (arg.array[0].entries == null) { + return null; + } + argValue = new int[arg.array[0].entries.length]; + for (int ii = 0; ii < arg.array[0].entries.length; ii++) + { + argValue[ii] = (int)TcUtility.queryEntry(arg.array[0].entries[ii], argValue[ii]); + } + return argValue; + } + public static int[] queryEntry(Entry arg, int[] argValue) + { + if (arg.array == null || arg.array.length == 0 || arg.array[0] == null) { + return null; + } + if (arg.array[0].entries == null) { + return null; + } + argValue = new int[arg.array[0].entries.length]; + for (int ii = 0; ii < arg.array[0].entries.length; ii++) + { + argValue[ii] = (int)TcUtility.queryEntry(arg.array[0].entries[ii], argValue[ii]); + } + return argValue; + } + public static int queryEntry(Entry arg, int argValue) + { + return Integer.parseInt(arg.val); + } + public static int queryArg(Arg arg, int argValue) + { + return Integer.parseInt(arg.val); + } + public static Arg createArg(stringSeqValue_u[] argValue) + { + Arg arg = new Arg(); + arg.array = new Array[1]; + arg.array[0] = new Array(); + arg.array[0].entries = new Entry[argValue.length]; + for (int ii = 0; ii < argValue.length; ii++) + { + arg.array[0].entries[ii] = TcUtility.createEntry(argValue[ii]); + } + return arg; + } + + public static Entry createEntry(stringSeqValue_u argValue) + { + Entry arg = new Entry(); + String discValue = Boolean.toString(argValue.discriminator()); + arg.structure = new Structure[1]; + arg.structure[0] = new Structure(); + if (discValue.equalsIgnoreCase("TRUE")) + { + arg.structure[0].args = new Arg[2]; + } + else + { + arg.structure[0].args = new Arg[1]; + } + arg.structure[0].args[0] = new Arg(); + arg.structure[0].args[0].val = discValue; + + //process union members + if (discValue.equalsIgnoreCase("TRUE")) + { + arg.structure[0].args[1] = TcUtility.createArg(argValue.seqValue()); + } + return arg; + } + + public static Arg createArg(String[] argValue) + { + Arg arg = new Arg(); + arg.array = new Array[1]; + arg.array[0] = new Array(); + arg.array[0].entries = new Entry[argValue.length]; + for (int ii = 0; ii < argValue.length; ii++) + { + arg.array[0].entries[ii] = TcUtility.createEntry(argValue[ii]); + } + return arg; + } + public static Entry createEntry(String argValue) + { + Entry arg = new Entry(); + arg.val = argValue; + return arg; + } + + public static Arg createArg(stringSeqValue_u argValue) + { + Arg arg = new Arg(); + String discValue =Boolean.toString( argValue.discriminator()); + arg.structure = new Structure[1]; + arg.structure[0] = new Structure(); + + if (discValue.equalsIgnoreCase("TRUE")) + { + + arg.structure[0].args = new Arg[2]; + } + else + { + arg.structure[0].args = new Arg[1]; + } + arg.structure[0].args[0] = new Arg(); + arg.structure[0].args[0].val = discValue; + + + //process union members + if (discValue.equalsIgnoreCase("TRUE")) + { + + + arg.structure[0].args[1] = TcUtility.createArg(argValue.seqValue()); + } + return arg; + } + public static String queryArgStringUnion(Arg arg, String argValue) + { + argValue = null; + if (arg.structure != null && arg.structure[0] != null && arg.structure[0].args != null && arg.structure[0].args[0].val.equalsIgnoreCase("TRUE")) + { + argValue = arg.structure[0].args[1].val; + } + return argValue; + } + } + + \ No newline at end of file diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/longSeqValue_u.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/longSeqValue_u.java new file mode 100644 index 0000000..fd5f48e --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/longSeqValue_u.java @@ -0,0 +1,35 @@ +package com.pjb.springbootjjwt.tcuserservice; +public class longSeqValue_u { + private boolean __discriminator; + + private Object __value; + + + public longSeqValue_u() { + __default(); + } + + public boolean discriminator() { + return __discriminator; + } + + public void __default() { + this.__discriminator = false; + this.__value = null; + } + + public int[] seqValue() { + return (int[])__value; + } + + public void seqValue(int[] value) { + this.__discriminator = true; + this.__value = value; + } + + public boolean is_seqValue() { + return __discriminator; + } + +} + diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/longSeqValue_uHolder.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/longSeqValue_uHolder.java new file mode 100644 index 0000000..a4e64d9 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/longSeqValue_uHolder.java @@ -0,0 +1,14 @@ +package com.pjb.springbootjjwt.tcuserservice; +public class longSeqValue_uHolder { + public longSeqValue_u value; + + + public longSeqValue_uHolder() { + } + + public longSeqValue_uHolder(longSeqValue_u value) { + this.value = value; + } + +} + diff --git a/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/stringSeqValue_u.java b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/stringSeqValue_u.java new file mode 100644 index 0000000..a8f97c8 --- /dev/null +++ b/rabbit_server/src/main/java/com/pjb/springbootjjwt/tcuserservice/stringSeqValue_u.java @@ -0,0 +1,35 @@ +package com.pjb.springbootjjwt.tcuserservice; +public class stringSeqValue_u { + private boolean __discriminator; + + private Object __value; + + + public stringSeqValue_u() { + __default(); + } + + public boolean discriminator() { + return __discriminator; + } + + public void __default() { + this.__discriminator = false; + this.__value = null; + } + + public String[] seqValue() { + return (String[])__value; + } + + public void seqValue(String[] value) { + this.__discriminator = true; + this.__value = value; + } + + public boolean is_seqValue() { + return __discriminator; + } + +} + diff --git a/rabbit_server/src/main/java/com/teamcenter/clientx/AppXCredentialManager.java b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXCredentialManager.java new file mode 100644 index 0000000..10d7082 --- /dev/null +++ b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXCredentialManager.java @@ -0,0 +1,132 @@ +//================================================== +// +// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. +// +//================================================== + +package com.teamcenter.clientx; + +import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException; +import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException; +import com.teamcenter.soa.client.CredentialManager; +import com.teamcenter.soa.exceptions.CanceledOperationException; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; + +/** + * The CredentialManager is used by the Teamcenter Services framework to get the + * user's credentials when challenged by the server. This can occur after a period + * of inactivity and the server has timed-out the user's session, at which time + * the client application will need to re-authenticate. The framework will + * call one of the getCredentials methods (depending on circumstances) and will + * send the SessionService.login service request. Upon successful completion of + * the login service request. The last service request (one that caused the challenge) + * will be resent. + *

+ * The framework will also call the setUserPassword setGroupRole methods when ever + * these credentials change, thus allowing this implementation of the CredentialManager + * to cache these values so prompting of the user is not required for re-authentication. + */ +public class AppXCredentialManager implements CredentialManager { + + private String name = null; + private String password = null; + private String group = ""; // default group + private String role = ""; // default role + private String discriminator = "SoaAppX"; // always connect same user + // to same instance of server + + /** + * Return the type of credentials this implementation provides, + * standard (user/password) or Single-Sign-On. In this case + * Standard credentials are returned. + * + * @see CredentialManager#getCredentialType() + */ + public int getCredentialType() { + return CredentialManager.CLIENT_CREDENTIAL_TYPE_STD; + } + + /** + * Prompt's the user for credentials. + * This method will only be called by the framework when a login attempt has + * failed. + * + * @see CredentialManager#getCredentials(InvalidCredentialsException) + */ + public String[] getCredentials(InvalidCredentialsException e) + throws CanceledOperationException { + System.out.println(e.getMessage()); + return promptForCredentials(); + } + + /** + * Return the cached credentials. + * This method will be called when a service request is sent without a valid + * session ( session has expired on the server). + * + * @see CredentialManager#getCredentials(InvalidUserException) + */ + public String[] getCredentials(InvalidUserException e) + throws CanceledOperationException { + // Have not logged in yet, should not happen but just in case + if (name == null) return promptForCredentials(); + + // Return cached credentials + String[] tokens = {name, password, group, role, discriminator}; + return tokens; + } + + /** + * Cache the group and role + * This is called after the SessionService.setSessionGroupMember service + * operation is called. + * + * @see CredentialManager#setGroupRole(String, + * String) + */ + public void setGroupRole(String group, String role) { + this.group = group; + this.role = role; + } + + /** + * Cache the User and Password + * This is called after the SessionService.login service operation is called. + * + * @see CredentialManager#setUserPassword(String, + * String, String) + */ + public void setUserPassword(String user, String password, String discriminator) { + this.name = user; + this.password = password; + this.discriminator = discriminator; + } + + + public String[] promptForCredentials() + throws CanceledOperationException { + try { + LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in)); + System.out.println("Please enter user credentials (return to quit):"); + System.out.print("User Name: "); + name = reader.readLine(); + + if (name.length() == 0) + throw new CanceledOperationException(""); + + System.out.print("Password: "); + password = reader.readLine(); + } catch (IOException e) { + String message = "Failed to get the name and password.\n" + e.getMessage(); + System.out.println(message); + throw new CanceledOperationException(message); + } + + String[] tokens = {name, password, group, role, discriminator}; + return tokens; + } + +} diff --git a/rabbit_server/src/main/java/com/teamcenter/clientx/AppXExceptionHandler.java b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXExceptionHandler.java new file mode 100644 index 0000000..6dcfe13 --- /dev/null +++ b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXExceptionHandler.java @@ -0,0 +1,90 @@ +//================================================== +// +// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. +// +//================================================== + +package com.teamcenter.clientx; + +import com.teamcenter.schemas.soa._2006_03.exceptions.ConnectionException; +import com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException; +import com.teamcenter.schemas.soa._2006_03.exceptions.ProtocolException; +import com.teamcenter.soa.client.ExceptionHandler; +import com.teamcenter.soa.exceptions.CanceledOperationException; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; + +/** + * Implementation of the ExceptionHandler. For ConnectionExceptions (server + * temporarily down .etc) prompts the user to retry the last request. For other + * exceptions convert to a RunTime exception. + */ +public class AppXExceptionHandler implements ExceptionHandler { + + /* + * (non-Javadoc) + * + * @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException) + */ + public void handleException(InternalServerException ise) { + System.out.println(); + System.out.println("*****"); + System.out + .println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(InternalServerException)."); + + LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in)); + + if (ise instanceof ConnectionException) { + // ConnectionException are typically due to a network error (server + // down .etc) and can be recovered from (the last request can be sent again, + // after the problem is corrected). + System.out.print("\nThe server returned an connection error.\n" + ise.getMessage() + + "\nDo you wish to retry the last service request?[y/n]"); + } else if (ise instanceof ProtocolException) { + // ProtocolException are typically due to programming errors + // (content of HTTP + // request is incorrect). These are generally can not be + // recovered from. + System.out.print("\nThe server returned an protocol error.\n" + ise.getMessage() + + "\nThis is most likely the result of a programming error." + + "\nDo you wish to retry the last service request?[y/n]"); + } else { + System.out.println("\nThe server returned an internal server error.\n" + + ise.getMessage() + + "\nThis is most likely the result of a programming error." + + "\nA RuntimeException will be thrown."); + throw new RuntimeException(ise.getMessage()); + } + + try { + String retry = reader.readLine(); + // If yes, return to the calling SOA client framework, where the + // last service request will be resent. + if (retry.equalsIgnoreCase("y") || retry.equalsIgnoreCase("yes")) return; + + throw new RuntimeException("The user has opted not to retry the last request"); + } catch (IOException e) { + System.err.println("Failed to read user response.\nA RuntimeException will be thrown."); + throw new RuntimeException(e.getMessage()); + } + } + + /* + * (non-Javadoc) + * + * @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.soa.exceptions.CanceledOperationException) + */ + public void handleException(CanceledOperationException coe) { + System.out.println(); + System.out.println("*****"); + System.out.println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(CanceledOperationException)."); + + // Expecting this from the login tests with bad credentials, and the + // AnyUserCredentials class not + // prompting for different credentials + throw new RuntimeException(coe); + } + +} diff --git a/rabbit_server/src/main/java/com/teamcenter/clientx/AppXModelEventListener.java b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXModelEventListener.java new file mode 100644 index 0000000..42cbd13 --- /dev/null +++ b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXModelEventListener.java @@ -0,0 +1,56 @@ +//================================================== +// +// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. +// +//================================================== + +package com.teamcenter.clientx; + + +import com.teamcenter.soa.client.model.ModelEventListener; +import com.teamcenter.soa.client.model.ModelObject; +import com.teamcenter.soa.exceptions.NotLoadedException; + +/** + * Implementation of the ChangeListener. Print out all objects that have been updated. + */ +public class AppXModelEventListener extends ModelEventListener { + + @Override + public void localObjectChange(ModelObject[] objects) { + + if (objects.length == 0) return; + System.out.println(); + System.out.println("Modified Objects handled in com.teamcenter.clientx.AppXUpdateObjectListener.modelObjectChange"); + System.out.println("The following objects have been updated in the client data model:"); + for (int i = 0; i < objects.length; i++) { + String uid = objects[i].getUid(); + String type = objects[i].getTypeObject().getName(); + String name = ""; + if (objects[i].getTypeObject().isInstanceOf("WorkspaceObject")) { + ModelObject wo = objects[i]; + try { + name = wo.getPropertyObject("object_string").getStringValue(); + } catch (NotLoadedException e) { + } // just ignore + } + System.out.println(" " + uid + " " + type + " " + name); + } + } + + @Override + public void localObjectDelete(String[] uids) { + + if (uids.length == 0) + return; + + System.out.println(); + System.out.println("Deleted Objects handled in com.teamcenter.clientx.AppXDeletedObjectListener.modelObjectDelete"); + System.out.println("The following objects have been deleted from the server and removed from the client data model:"); + for (int i = 0; i < uids.length; i++) { + System.out.println(" " + uids[i]); + } + + } + +} diff --git a/rabbit_server/src/main/java/com/teamcenter/clientx/AppXPartialErrorListener.java b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXPartialErrorListener.java new file mode 100644 index 0000000..0039a95 --- /dev/null +++ b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXPartialErrorListener.java @@ -0,0 +1,53 @@ +//================================================== +// +// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. +// +//================================================== + + +package com.teamcenter.clientx; + +import com.teamcenter.soa.client.model.ErrorStack; +import com.teamcenter.soa.client.model.ErrorValue; +import com.teamcenter.soa.client.model.PartialErrorListener; + +/** + * Implementation of the PartialErrorListener. Print out any partial errors + * returned. + */ +public class AppXPartialErrorListener implements PartialErrorListener { + + @Override + public void handlePartialError(ErrorStack[] stacks) { + if (stacks.length == 0) return; + + System.out.println(); + System.out.println("*****"); + System.out.println("Partial Errors caught in com.teamcenter.clientx.AppXPartialErrorListener."); + + + for (int i = 0; i < stacks.length; i++) { + ErrorValue[] errors = stacks[i].getErrorValues(); + System.out.print("Partial Error for "); + + // The different service implementation may optionally associate + // an ModelObject, client ID, or nothing, with each partial error + if (stacks[i].hasAssociatedObject()) { + System.out.println("object " + stacks[i].getAssociatedObject().getUid()); + } else if (stacks[i].hasClientId()) { + System.out.println("client id " + stacks[i].getClientId()); + } else if (stacks[i].hasClientIndex()) { + System.out.println("client index " + stacks[i].getClientIndex()); + } + + + // Each Partial Error will have one or more contributing error messages + for (int j = 0; j < errors.length; j++) { + System.out.println(" Code: " + errors[j].getCode() + "\tSeverity: " + + errors[j].getLevel() + "\t" + errors[j].getMessage()); + } + } + + } + +} diff --git a/rabbit_server/src/main/java/com/teamcenter/clientx/AppXRequestListener.java b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXRequestListener.java new file mode 100644 index 0000000..23d33d7 --- /dev/null +++ b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXRequestListener.java @@ -0,0 +1,32 @@ +//================================================== +// +// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. +// +//================================================== + +package com.teamcenter.clientx; + +import com.teamcenter.soa.client.RequestListener; + +/** + * This implementation of the RequestListener, logs each service request + * to the console. + */ +public class AppXRequestListener implements RequestListener { + + /** + * Called before each request is sent to the server. + */ + public void serviceRequest(final Info info) { + // will log the service name when done + } + + /** + * Called after each response from the server. + * Log the service operation to the console. + */ + public void serviceResponse(final Info info) { + System.out.println(info.id + ": " + info.service + "." + info.operation); + } + +} diff --git a/rabbit_server/src/main/java/com/teamcenter/clientx/AppXSession.java b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXSession.java new file mode 100644 index 0000000..1702481 --- /dev/null +++ b/rabbit_server/src/main/java/com/teamcenter/clientx/AppXSession.java @@ -0,0 +1,182 @@ +//================================================== +// +// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. +// +//================================================== + +package com.teamcenter.clientx; + +import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; +import com.teamcenter.services.strong.core.DataManagementService; +import com.teamcenter.services.strong.core.SessionService; +import com.teamcenter.services.strong.core._2006_03.Session.LoginResponse; +import com.teamcenter.soa.SoaConstants; +import com.teamcenter.soa.client.Connection; +import com.teamcenter.soa.client.model.ModelObject; +import com.teamcenter.soa.client.model.strong.User; +import com.teamcenter.soa.client.model.strong.WorkspaceObject; +import com.teamcenter.soa.exceptions.CanceledOperationException; +import com.teamcenter.soa.exceptions.NotLoadedException; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.List; +import java.util.Locale; +import java.util.Vector; + + +public class AppXSession { + /** + * Single instance of the Connection object that is shared throughout + * the application. This Connection object is needed whenever a Service + * stub is instantiated. + */ + private Connection connection; + + /** + * The credentialManager is used both by the Session class and the Teamcenter + * Services Framework to get user credentials. + */ + private static AppXCredentialManager credentialManager; + + /** + * Create an instance of the Session with a connection to the specified + * server. + *

+ * Add implementations of the ExceptionHandler, PartialErrorListener, + * ChangeListener, and DeleteListeners. + * + * @param host Address of the host to connect to, http://serverName:port/tc + */ + public AppXSession(String host) { + // Create an instance of the CredentialManager, this is used + // by the SOA Framework to get the user's credentials when + // challenged by the server (session timeout on the web tier). + credentialManager = new AppXCredentialManager(); + + String protocol = null; + String envNameTccs = null; + System.out.println("登录链接: " + host); + if (host.startsWith("http")) { + + protocol = SoaConstants.HTTP; + } else if (host.startsWith("tccs")) { + protocol = SoaConstants.TCCS; + host = host.trim(); + int envNameStart = host.indexOf('/') + 2; + envNameTccs = host.substring(envNameStart); + host = ""; + } else { + protocol = SoaConstants.IIOP; + } + + + // Create the Connection object, no contact is made with the server + // until a service request is made + connection = new Connection(host, credentialManager, SoaConstants.REST, protocol); + + if (protocol == SoaConstants.TCCS) { + connection.setOption(Connection.TCCS_ENV_NAME, envNameTccs); + } + + + // Add an ExceptionHandler to the Connection, this will handle any + // InternalServerException, communication errors, XML marshaling errors + // .etc + connection.setExceptionHandler(new AppXExceptionHandler()); + + // While the above ExceptionHandler is required, all of the following + // Listeners are optional. Client application can add as many or as few Listeners + // of each type that they want. + + // Add a Partial Error Listener, this will be notified when ever a + // a service returns partial errors. + connection.getModelManager().addPartialErrorListener(new AppXPartialErrorListener()); + + // Add a Change and Delete Listener, this will be notified when ever a + // a service returns model objects that have been updated or deleted. + connection.getModelManager().addModelEventListener(new AppXModelEventListener()); + + + // Add a Request Listener, this will be notified before and after each + // service request is sent to the server. + Connection.addRequestListener(new AppXRequestListener()); + + } + + /** + * Get the single Connection object for the application + * + * @return connection + */ + public Connection getConnection() { + return connection; + } + + public LoginResponse login(String userName, String pwd,String group,String role,String sessionDiscriminator) throws InvalidCredentialsException { + // Get the service stub + SessionService sessionService = SessionService.getService(connection); + + // ***************************** + // Execute the service operation + // ***************************** + //"username", "password", "group", "role", "locale", "sessionDiscriminator" + LoginResponse out = sessionService.login(userName, pwd, group, role, "", sessionDiscriminator); + return out; + } + + /** + * Login to the Teamcenter Server + */ + public User login() { + // Get the service stub + SessionService sessionService = SessionService.getService(connection); + + try { + // Prompt for credentials until they are right, or until user + // cancels + String[] credentials = credentialManager.promptForCredentials(); + while (true) { + try { + + // ***************************** + // Execute the service operation + // ***************************** + LoginResponse out = sessionService.login(credentials[0], credentials[1], + credentials[2], credentials[3], "", credentials[4]); + + return out.user; + } catch (InvalidCredentialsException e) { + credentials = credentialManager.getCredentials(e); + } + } + } + // User canceled the operation, don't need to tell him again + catch (CanceledOperationException e) { + } + + // Exit the application + System.exit(0); + return null; + } + + /** + * Terminate the session with the Teamcenter Server + */ + public void logout() { + // Get the service stub + SessionService sessionService = SessionService.getService(connection); + try { + + // ***************************** + // Execute the service operation + // ***************************** + + sessionService.logout(); + } catch (ServiceException e) { + } + } + + +} diff --git a/rabbit_server/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/rabbit_server/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000..0af6036 --- /dev/null +++ b/rabbit_server/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,29 @@ +{ + "properties": [ + { + "name": "teamcenter.url", + "type": "java.lang.String", + "description": "Description for teamcenter.url." + }, + { + "name": "teamcenter.user", + "type": "java.lang.String", + "description": "Description for teamcenter.user." + }, + { + "name": "teamcenter.pwd", + "type": "java.lang.String", + "description": "Description for teamcenter.pwd." + }, + { + "name": "teamcenter.fmsurl", + "type": "java.lang.String", + "description": "Description for teamcenter.fmsurl." + }, + { + "name": "teamcenter.fcccash", + "type": "java.lang.String", + "description": "Description for teamcenter.fcccash." + } + ] +} \ No newline at end of file diff --git a/rabbit_server/src/main/resources/application.properties b/rabbit_server/src/main/resources/application.properties new file mode 100644 index 0000000..cffda2e --- /dev/null +++ b/rabbit_server/src/main/resources/application.properties @@ -0,0 +1,26 @@ +debug=false +management.endpoints.web.exposure.include=* +management.endpoint.shutdown.enabled=true +mybatis.config-location=classpath:mybatis.xml +mybatis.mapper-locations=classpath:com/pjb/springbootjjwt/mapper/*.xml +server.port=9294 +spring.application.name=ConnorServer +spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver +spring.datasource.url=jdbc:sqlserver://192.168.1.182:1433;DatabaseName=TC13 +spring.datasource.username=infodba +spring.datasource.password=infodba +spring.rabbitmq.host=localhost +spring.rabbitmq.port=5672 +spring.rabbitmq.username=admin +spring.rabbitmq.password=admin +spring.rabbitmq.virtual-host=LDPLMTEST2 +teamcenter.url=http://192.168.1.182:7001/tc +teamcenter.user=admin +teamcenter.pwd=admin +teamcenter.fmsurl=http://LDPLMTEST2:4544 +teamcenter.fcccash=D:/new_tcserver/FMS_CACHE +teamcenter.excel_tool=D:/new_tcserver/SCRIPT_DIR/SubstMacros-MSExcel.wsf +teamcenter.word_tool=D:/new_tcserver/SCRIPT_DIR/SubstMacros-MSWord.wsf +teamcenter.picpath=D:\\PICTURE\\ +teamcenter.picext=.png +spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER \ No newline at end of file diff --git a/rabbit_server/src/main/resources/com/pjb/springbootjjwt/mapper/MessageEntryMapper.xml b/rabbit_server/src/main/resources/com/pjb/springbootjjwt/mapper/MessageEntryMapper.xml new file mode 100644 index 0000000..fa0fc72 --- /dev/null +++ b/rabbit_server/src/main/resources/com/pjb/springbootjjwt/mapper/MessageEntryMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + update CONNOR_PDFMESSAGE + + PDFPUID=#{pdfPuid},STAGE=#{stage} + + where ITEMPUID=#{itemPuid} and DATASETPUID=#{datasetPuid} + + + + update CONNOR_PDFMESSAGE + + STAGE=#{stage} + + where ITEMPUID=#{itemPuid} and DATASETPUID=#{datasetPuid} + + + + \ No newline at end of file diff --git a/rabbit_server/src/main/resources/com/pjb/springbootjjwt/mapper/UserMapper.xml b/rabbit_server/src/main/resources/com/pjb/springbootjjwt/mapper/UserMapper.xml new file mode 100644 index 0000000..5ecf868 --- /dev/null +++ b/rabbit_server/src/main/resources/com/pjb/springbootjjwt/mapper/UserMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/rabbit_server/src/main/resources/logback-spring.xml b/rabbit_server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..7a556b0 --- /dev/null +++ b/rabbit_server/src/main/resources/logback-spring.xml @@ -0,0 +1,193 @@ + + + + + + + logback + + + + + + + + + + + + + + + + + info + + + ${CONSOLE_LOG_PATTERN} + + GBK + + + + + + + + ${log.path}/web_debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/web-debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/web_info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/web-info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/web_warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/web-warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/web_error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/web-error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rabbit_server/src/main/resources/mybatis.xml b/rabbit_server/src/main/resources/mybatis.xml new file mode 100644 index 0000000..8637727 --- /dev/null +++ b/rabbit_server/src/main/resources/mybatis.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/rabbit_server/src/main/resources/signpdfconfig.json b/rabbit_server/src/main/resources/signpdfconfig.json new file mode 100644 index 0000000..8554320 --- /dev/null +++ b/rabbit_server/src/main/resources/signpdfconfig.json @@ -0,0 +1,26 @@ +[ + {"departmentid":"wuhan", + "isleft": true, + "pdfsizes": [ + { + "sizename": "A4", + "wmin": 123, + "wmax": 200, + "hmin": 123, + "hmax": 124, + "poisions":[ + { + "property": "设计", + "xposition": 12, + "yposition": 25 + }, + { + "property": "审核", + "xposition": 12, + "yposition": 25 + } + ] + } + ] + } +] \ No newline at end of file diff --git a/rabbit_server/src/main/resources/signpdfconfig.xml b/rabbit_server/src/main/resources/signpdfconfig.xml new file mode 100644 index 0000000..5e894cf --- /dev/null +++ b/rabbit_server/src/main/resources/signpdfconfig.xml @@ -0,0 +1,473 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rabbit_server/src/test/java/com/pjb/springbootjjwt/SpringbootJjwtApplicationTests.java b/rabbit_server/src/test/java/com/pjb/springbootjjwt/SpringbootJjwtApplicationTests.java new file mode 100644 index 0000000..03af970 --- /dev/null +++ b/rabbit_server/src/test/java/com/pjb/springbootjjwt/SpringbootJjwtApplicationTests.java @@ -0,0 +1,16 @@ +//package com.pjb.springbootjjwt; +// +//import org.junit.Test; +//import org.junit.runner.RunWith; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.test.context.junit4.SpringRunner; +// +//@RunWith(SpringRunner.class) +//@SpringBootTest +//public class SpringbootJjwtApplicationTests { +// +// @Test +// public void contextLoads() { +// } +// +//}