diff --git a/inetsrv/uddi/source/.vs/uddi/FileContentIndex/aa481a07-098d-4c1e-bdf0-bf4fde428522.vsidx b/inetsrv/uddi/source/.vs/uddi/FileContentIndex/aa481a07-098d-4c1e-bdf0-bf4fde428522.vsidx new file mode 100644 index 0000000..a2e72f6 Binary files /dev/null and b/inetsrv/uddi/source/.vs/uddi/FileContentIndex/aa481a07-098d-4c1e-bdf0-bf4fde428522.vsidx differ diff --git a/inetsrv/uddi/source/.vs/uddi/v18/.suo b/inetsrv/uddi/source/.vs/uddi/v18/.suo new file mode 100644 index 0000000..3053b3b Binary files /dev/null and b/inetsrv/uddi/source/.vs/uddi/v18/.suo differ diff --git a/inetsrv/uddi/source/.vs/uddi/v18/Browse.VC.db b/inetsrv/uddi/source/.vs/uddi/v18/Browse.VC.db new file mode 100644 index 0000000..cd794b2 Binary files /dev/null and b/inetsrv/uddi/source/.vs/uddi/v18/Browse.VC.db differ diff --git a/inetsrv/uddi/source/.vs/uddi/v18/DocumentLayout.json b/inetsrv/uddi/source/.vs/uddi/v18/DocumentLayout.json new file mode 100644 index 0000000..d909639 --- /dev/null +++ b/inetsrv/uddi/source/.vs/uddi/v18/DocumentLayout.json @@ -0,0 +1,12 @@ +{ + "Version": 1, + "WorkspaceRootPath": "D:\\OpenXP\\inetsrv\\uddi\\source\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [] + } + ] +} \ No newline at end of file diff --git a/inetsrv/uddi/source/.vs/uddi/v18/Solution.VC.db b/inetsrv/uddi/source/.vs/uddi/v18/Solution.VC.db new file mode 100644 index 0000000..bd59a39 Binary files /dev/null and b/inetsrv/uddi/source/.vs/uddi/v18/Solution.VC.db differ diff --git a/inetsrv/uddi/source/Backup/uddi.sln b/inetsrv/uddi/source/Backup/uddi.sln new file mode 100644 index 0000000..f888a37 --- /dev/null +++ b/inetsrv/uddi/source/Backup/uddi.sln @@ -0,0 +1,128 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "api\api.csproj", "{11742B5A-F929-4DA7-8378-F82AB3B69491}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "core", "core\core.csproj", "{C792705F-C4F9-41F7-AE03-B9C87FAD9151}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "filter", "filter\filter.vcproj", "{70731D7E-08C5-4555-9707-71665BFC642A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "web", "web\web.csproj", "{BF191EA0-B0CF-4502-A290-A183AC71998F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "operator", "operator\operator.csproj", "{D6075C1E-793D-4AAC-8E9F-D6765A013C9E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmc", "mmc\mmc.vcproj", "{CA6FA2C8-BD59-49BE-947D-A85C64CA2033}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "replicate", "replicate\replicate.csproj", "{864978F9-A5AA-4F39-BA06-CC2A66949D33}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "addwebreference", "addwebreference\addwebreference.csproj", "{D8191F63-66E7-4D6D-A718-815A76F8D799}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xp", "xp\xp.vcproj", "{35D639CF-608C-4810-95A3-4895185E6A54}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + ConfigName.2 = Unicode Debug + ConfigName.3 = Unicode Release + ConfigName.4 = Unicode Release MinSize + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.0 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {11742B5A-F929-4DA7-8378-F82AB3B69491}.1 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.ActiveCfg = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.Build.0 = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Debug.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Debug.Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release.Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release MinSize.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release MinSize.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.ActiveCfg = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.Build.0 = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Debug.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Debug.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release MinSize.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release MinSize.Build.0 = Release|.NET + {70731D7E-08C5-4555-9707-71665BFC642A}.Debug.ActiveCfg = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Debug.Build.0 = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Release.ActiveCfg = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Release.Build.0 = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Debug.Build.0 = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release.ActiveCfg = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release.Build.0 = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release MinSize.ActiveCfg = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release MinSize.Build.0 = Unicode Release|Win32 + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Debug.ActiveCfg = Debug|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Debug.Build.0 = Debug|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Release.ActiveCfg = Release|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Release.Build.0 = Release|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Debug.ActiveCfg = Debug|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Debug.Build.0 = Debug|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Release.ActiveCfg = Release|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Release.Build.0 = Release|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Release MinSize.ActiveCfg = Release|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Release MinSize.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug.ActiveCfg = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug.Build.0 = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Debug.ActiveCfg = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Debug.Build.0 = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release MinSize.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release MinSize.Build.0 = Release|.NET + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Debug.ActiveCfg = Debug|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Debug.Build.0 = Debug|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Release.ActiveCfg = Release|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Release.Build.0 = Release|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Unicode Debug.ActiveCfg = Debug|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Unicode Debug.Build.0 = Debug|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Unicode Release.ActiveCfg = Release|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Unicode Release.Build.0 = Release|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Unicode Release MinSize.ActiveCfg = Release|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Unicode Release MinSize.Build.0 = Release|Win32 + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Debug.ActiveCfg = Debug|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Debug.Build.0 = Debug|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Release.ActiveCfg = Release|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Release.Build.0 = Release|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Debug.ActiveCfg = Debug|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Debug.Build.0 = Debug|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Release.ActiveCfg = Release|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Release.Build.0 = Release|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Release MinSize.ActiveCfg = Release|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Release MinSize.Build.0 = Release|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Debug.ActiveCfg = Debug|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Debug.Build.0 = Debug|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Release.ActiveCfg = Release|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Release.Build.0 = Release|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Debug.ActiveCfg = Debug|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Debug.Build.0 = Debug|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Release.ActiveCfg = Release|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Release.Build.0 = Release|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Release MinSize.ActiveCfg = Release|.NET + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Release MinSize.Build.0 = Release|.NET + {35D639CF-608C-4810-95A3-4895185E6A54}.Debug.ActiveCfg = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Debug.Build.0 = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Release.ActiveCfg = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Release.Build.0 = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Debug.ActiveCfg = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Debug.Build.0 = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release.ActiveCfg = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release.Build.0 = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release MinSize.ActiveCfg = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release MinSize.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/inetsrv/uddi/source/UpgradeLog.htm b/inetsrv/uddi/source/UpgradeLog.htm new file mode 100644 index 0000000..5ea6b0a --- /dev/null +++ b/inetsrv/uddi/source/UpgradeLog.htm @@ -0,0 +1,339 @@ + + + + Migration Report +

+ Migration Report - uddi

Overview

ProjectPathErrorsWarningsMessages
mmcmmc\mmc.vcproj0125
filterfilter\filter.vcproj0105
xpxp\xp.vcproj0105
Solutionuddi.sln012
addwebreferenceaddwebreference\addwebreference.csproj000
apiapi\api.csproj000
corecore\core.csproj000
operatoroperator\operator.csproj000
replicatereplicate\replicate.csproj000
webweb\web.csproj000

Solution and projects

mmc

Message
mmc\mmc.vcproj: + Due to the requirement that Visual C++ projects produce an embedded (by default) Windows SxS manifest, manifest files in the project are now automatically built with the Manifest Tool. You may need to change your build in order for it to work correctly. For instance, it is recommended that the dependency information contained in any manifest files be converted to "#pragma comment(linker,"<insert dependency here>")" in a header file that is included from your source code. If your project already embeds a manifest in the RT_MANIFEST resource section through a resource (.rc) file, the line may need to be commented out before the project will build correctly.
mmc\mmc.vcproj: + Due to a conformance change in the C++ compiler, code change may be required before your project will build without errors. Previous versions of the C++ compiler allowed specification of member function pointers by member function name (e.g. MemberFunctionName). The C++ standard requires a fully qualified name with the use of the address-of operator (e.g. &ClassName::MemberFunctionName). If your project contains forms or controls used in the Windows Forms Designer, you may have to change code in InitializeComponent because the designer generated code used the non-conformant syntax in delegate construction (used in event handlers).
mmc\mmc.vcproj: + This application has been updated to include settings related to the User Account Control (UAC) feature of Windows Vista. By default, when run on Windows Vista with UAC enabled, this application is marked to run with the same privileges as the process that launched it. This marking also disables the application from running with virtualization. You can change UAC related settings from the Property Pages of the project.
mmc\mmc.vcproj: + Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.
mmc\mmc.vcproj: + VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.
mmc\mmc.vcproj: + Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.
mmc\mmc.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\mmc\Debug\mmc.dll') does not match the Librarian's OutputFile property value 'Debug\mmc.dll' ('D:\OpenXP\inetsrv\uddi\source\Debug\mmc.dll') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).
mmc\mmc.vcproj: + MSB8012: $(TargetName) ('mmc') does not match the Linker's OutputFile property value 'Debug\uddi.mmc.dll' ('uddi.mmc') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetName) property value matches the value specified in %(Link.OutputFile).
mmc\mmc.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\mmc\Debug\mmc.dll') does not match the Linker's OutputFile property value 'Debug\uddi.mmc.dll' ('D:\OpenXP\inetsrv\uddi\source\Debug\uddi.mmc.dll') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).
mmc\mmc.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\mmc\Release\mmc.dll') does not match the Librarian's OutputFile property value 'Release\mmc.dll' ('D:\OpenXP\inetsrv\uddi\source\Release\mmc.dll') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).
mmc\mmc.vcproj: + MSB8012: $(TargetName) ('mmc') does not match the Linker's OutputFile property value 'Release\uddi.mmc.dll' ('uddi.mmc') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetName) property value matches the value specified in %(Link.OutputFile).
mmc\mmc.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\mmc\Release\mmc.dll') does not match the Linker's OutputFile property value 'Release\uddi.mmc.dll' ('D:\OpenXP\inetsrv\uddi\source\Release\uddi.mmc.dll') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).
+ Show 5 additional messages +
mmc\mmc.vcproj: + Converting project file 'D:\OpenXP\inetsrv\uddi\source\mmc\mmc.vcproj'.
mmc\mmc.vcproj: + Visual C++ now provides improved safety in its C and C++ Libraries. This includes new and improved functions, additional checking and validation, and internal design changes. These libraries are turned on by default. You may see some warnings about unsafe functions or parameters when you build your project. The warnings will generally suggest an alternative safer coding style or function. It is advised that you correct these warnings, in order to make your code more safe. Full details can be found in the documentation by searching for 'Security Enhancements in the CRT' and for 'Checked Iterators'.
mmc\mmc.vcproj: + The C/C++ compiler default settings have been modified to be more compliant with ISO Standard C++. Included in those changes are enforcing Standard C++ for loop scoping and supporting wchar_t as a native type. These changes may cause existing code to no longer compile without changes to the code or the compiler options with which it is built.
mmc\mmc.vcproj: + Web deployment to the local IIS server is no longer supported. The Web Deployment build tool has been removed from your project settings.
mmc\mmc.vcproj: + Done converting to new project file 'D:\OpenXP\inetsrv\uddi\source\mmc\mmc.vcxproj'.
+ Hide 5 additional messages +

filter

Message
filter\filter.vcproj: + Due to the requirement that Visual C++ projects produce an embedded (by default) Windows SxS manifest, manifest files in the project are now automatically built with the Manifest Tool. You may need to change your build in order for it to work correctly. For instance, it is recommended that the dependency information contained in any manifest files be converted to "#pragma comment(linker,"<insert dependency here>")" in a header file that is included from your source code. If your project already embeds a manifest in the RT_MANIFEST resource section through a resource (.rc) file, the line may need to be commented out before the project will build correctly.
filter\filter.vcproj: + Due to a conformance change in the C++ compiler, code change may be required before your project will build without errors. Previous versions of the C++ compiler allowed specification of member function pointers by member function name (e.g. MemberFunctionName). The C++ standard requires a fully qualified name with the use of the address-of operator (e.g. &ClassName::MemberFunctionName). If your project contains forms or controls used in the Windows Forms Designer, you may have to change code in InitializeComponent because the designer generated code used the non-conformant syntax in delegate construction (used in event handlers).
filter\filter.vcproj: + This application has been updated to include settings related to the User Account Control (UAC) feature of Windows Vista. By default, when run on Windows Vista with UAC enabled, this application is marked to run with the same privileges as the process that launched it. This marking also disables the application from running with virtualization. You can change UAC related settings from the Property Pages of the project.
filter\filter.vcproj: + VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.
filter\filter.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\filter\debug\filter.dll') does not match the Librarian's OutputFile property value '.\debug\filter.dll' ('D:\OpenXP\inetsrv\uddi\source\debug\filter.dll') in project configuration 'Unicode Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).
filter\filter.vcproj: + MSB8012: $(TargetName) ('filter') does not match the Linker's OutputFile property value '.\debug\uddi.filter.dll' ('uddi.filter') in project configuration 'Unicode Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetName) property value matches the value specified in %(Link.OutputFile).
filter\filter.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\filter\debug\filter.dll') does not match the Linker's OutputFile property value '.\debug\uddi.filter.dll' ('D:\OpenXP\inetsrv\uddi\source\debug\uddi.filter.dll') in project configuration 'Unicode Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).
filter\filter.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\filter\release\filter.dll') does not match the Librarian's OutputFile property value '.\release\filter.dll' ('D:\OpenXP\inetsrv\uddi\source\release\filter.dll') in project configuration 'Unicode Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).
filter\filter.vcproj: + MSB8012: $(TargetName) ('filter') does not match the Linker's OutputFile property value '.\release\uddi.filter.dll' ('uddi.filter') in project configuration 'Unicode Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetName) property value matches the value specified in %(Link.OutputFile).
filter\filter.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\filter\release\filter.dll') does not match the Linker's OutputFile property value '.\release\uddi.filter.dll' ('D:\OpenXP\inetsrv\uddi\source\release\uddi.filter.dll') in project configuration 'Unicode Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).
+ Show 5 additional messages +
filter\filter.vcproj: + Converting project file 'D:\OpenXP\inetsrv\uddi\source\filter\filter.vcproj'.
filter\filter.vcproj: + Visual C++ now provides improved safety in its C and C++ Libraries. This includes new and improved functions, additional checking and validation, and internal design changes. These libraries are turned on by default. You may see some warnings about unsafe functions or parameters when you build your project. The warnings will generally suggest an alternative safer coding style or function. It is advised that you correct these warnings, in order to make your code more safe. Full details can be found in the documentation by searching for 'Security Enhancements in the CRT' and for 'Checked Iterators'.
filter\filter.vcproj: + The C/C++ compiler default settings have been modified to be more compliant with ISO Standard C++. Included in those changes are enforcing Standard C++ for loop scoping and supporting wchar_t as a native type. These changes may cause existing code to no longer compile without changes to the code or the compiler options with which it is built.
filter\filter.vcproj: + Web deployment to the local IIS server is no longer supported. The Web Deployment build tool has been removed from your project settings.
filter\filter.vcproj: + Done converting to new project file 'D:\OpenXP\inetsrv\uddi\source\filter\filter.vcxproj'.
+ Hide 5 additional messages +

xp

Message
xp\xp.vcproj: + Due to the requirement that Visual C++ projects produce an embedded (by default) Windows SxS manifest, manifest files in the project are now automatically built with the Manifest Tool. You may need to change your build in order for it to work correctly. For instance, it is recommended that the dependency information contained in any manifest files be converted to "#pragma comment(linker,"<insert dependency here>")" in a header file that is included from your source code. If your project already embeds a manifest in the RT_MANIFEST resource section through a resource (.rc) file, the line may need to be commented out before the project will build correctly.
xp\xp.vcproj: + Due to a conformance change in the C++ compiler, code change may be required before your project will build without errors. Previous versions of the C++ compiler allowed specification of member function pointers by member function name (e.g. MemberFunctionName). The C++ standard requires a fully qualified name with the use of the address-of operator (e.g. &ClassName::MemberFunctionName). If your project contains forms or controls used in the Windows Forms Designer, you may have to change code in InitializeComponent because the designer generated code used the non-conformant syntax in delegate construction (used in event handlers).
xp\xp.vcproj: + This application has been updated to include settings related to the User Account Control (UAC) feature of Windows Vista. By default, when run on Windows Vista with UAC enabled, this application is marked to run with the same privileges as the process that launched it. This marking also disables the application from running with virtualization. You can change UAC related settings from the Property Pages of the project.
xp\xp.vcproj: + Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.
xp\xp.vcproj: + VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.
xp\xp.vcproj: + Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.
xp\xp.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\xp\Debug\xp.dll') does not match the Librarian's OutputFile property value 'Debug\xp.dll' ('D:\OpenXP\inetsrv\uddi\source\Debug\xp.dll') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).
xp\xp.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\xp\Debug\xp.dll') does not match the Linker's OutputFile property value 'Debug\xp.dll' ('D:\OpenXP\inetsrv\uddi\source\Debug\xp.dll') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).
xp\xp.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\xp\Release\xp.dll') does not match the Librarian's OutputFile property value 'Release\xp.dll' ('D:\OpenXP\inetsrv\uddi\source\Release\xp.dll') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).
xp\xp.vcproj: + MSB8012: $(TargetPath) ('D:\OpenXP\inetsrv\uddi\source\xp\Release\xp.dll') does not match the Linker's OutputFile property value 'Release\xp.dll' ('D:\OpenXP\inetsrv\uddi\source\Release\xp.dll') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).
+ Show 5 additional messages +
xp\xp.vcproj: + Converting project file 'D:\OpenXP\inetsrv\uddi\source\xp\xp.vcproj'.
xp\xp.vcproj: + Visual C++ now provides improved safety in its C and C++ Libraries. This includes new and improved functions, additional checking and validation, and internal design changes. These libraries are turned on by default. You may see some warnings about unsafe functions or parameters when you build your project. The warnings will generally suggest an alternative safer coding style or function. It is advised that you correct these warnings, in order to make your code more safe. Full details can be found in the documentation by searching for 'Security Enhancements in the CRT' and for 'Checked Iterators'.
xp\xp.vcproj: + The C/C++ compiler default settings have been modified to be more compliant with ISO Standard C++. Included in those changes are enforcing Standard C++ for loop scoping and supporting wchar_t as a native type. These changes may cause existing code to no longer compile without changes to the code or the compiler options with which it is built.
xp\xp.vcproj: + Web deployment to the local IIS server is no longer supported. The Web Deployment build tool has been removed from your project settings.
xp\xp.vcproj: + Done converting to new project file 'D:\OpenXP\inetsrv\uddi\source\xp\xp.vcxproj'.
+ Hide 5 additional messages +

Solution

Message
uddi.sln: + Visual Studio needs to make non-functional changes to this project in order to enable the project to open in released versions of Visual Studio newer than Visual Studio 2010 SP1 without impacting project behavior.
+ Show 2 additional messages +
uddi.sln: + File successfully backed up as D:\OpenXP\inetsrv\uddi\source\Backup\uddi.sln
uddi.sln: + Solution migrated successfully
+ Hide 2 additional messages +

addwebreference

Message
addwebreference logged no messages. +

api

Message
api logged no messages. +

core

Message
core logged no messages. +

operator

Message
operator logged no messages. +

replicate

Message
replicate logged no messages. +

web

Message
web logged no messages. +
\ No newline at end of file diff --git a/inetsrv/uddi/source/addwebreference/addwebreference.cs b/inetsrv/uddi/source/addwebreference/addwebreference.cs new file mode 100644 index 0000000..fe19ca3 --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/addwebreference.cs @@ -0,0 +1,277 @@ +using System; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Data; +using System.Globalization; +using System.Collections.Specialized; + +using UDDI.Web; +using UDDI.API; +using UDDI.API.Service; +using UDDI.API.Business; + +namespace UDDI.VisualStudio +{ + /// + /// This class represents the default page that is displayed in the Add Web Reference + /// Dialog in Visual Studio .NET. This page will display the inital search options to + /// the user. + /// + public class AddWebReferencePage : Page + { + // + // These controls are bound to elements on our .aspx page. We do not need to instantiate + // these objects, ASP.NET will assign values to them for us. + // + protected UddiButton aspnet_searchByService; + protected UddiButton aspnet_searchByProvider; + protected UddiButton aspnet_searchFromBrowse; + protected UddiButton aspnet_cancelBrowse; + protected UddiTextBox aspnet_serviceName; + protected UddiTextBox aspnet_providerName; + protected Label aspnet_serviceErrorMessage; + protected Label aspnet_providerErrorMessage; + protected Label aspnet_noCategoriesMessage; + protected HelpLinkControl aspnet_helpLink; + protected HtmlGenericControl html_browseSearchButtons; + protected HtmlGenericControl html_searchButtons; + protected CategoryBrowserControl uddi_categoryBrowser; + + /// + /// Event handler for the aspnet_searchByService button click. + /// + /// Passed by ASP.NET, we don't use it. + /// Passed by ASP.NET, we don't use it. + public void SearchByService_Click( object sender, EventArgs args ) + { + // + // We are searching by service name. Make sure we have a name first. + // + string searchName = aspnet_serviceName.Text; + + if( null == searchName || searchName.Equals( string.Empty ) || searchName.Length == 0 ) + { + ShowErrorMessage( SearchType.SearchByService ); + } + else + { + string url = string.Format( "search.aspx?{0}={1}&{2}={3}", StateParamNames.SearchType, + (int)SearchType.SearchByService, + StateParamNames.SearchParams, + Server.UrlEncode( searchName ) ); + + Response.Redirect( url ); + } + } + + /// + /// Event handler for the aspnet_searchByProvider button click. + /// + /// Passed by ASP.NET, we don't use it. + /// Passed by ASP.NET, we don't use it. + public void SearchByProvider_Click( object sender, EventArgs args ) + { + // + // We are searching by business name. Make sure we have a name first. + // + string searchName = aspnet_providerName.Text; + if( null == searchName || searchName.Equals( string.Empty ) || searchName.Length == 0 ) + { + ShowErrorMessage( SearchType.SearchByProvider ); + } + else + { + string url = string.Format( "search.aspx?{0}={1}&{2}={3}", StateParamNames.SearchType, + (int)SearchType.SearchByProvider, + StateParamNames.SearchParams, + Server.UrlEncode( searchName ) ); + Response.Redirect( url ); + } + } + + private void SearchFromBrowse_Click( object sender, EventArgs args ) + { + string searchID = ( string ) ViewState[ StateParamNames.SearchID ]; + string url = string.Format( "search.aspx?{0}={1}&{2}={3}&{4}={5}", StateParamNames.SearchType, + (int)SearchType.SearchFromBrowse, + Server.UrlEncode( StateParamNames.TModelKey ), + Server.UrlEncode( uddi_categoryBrowser.TModelKey ), + StateParamNames.KeyValue, + Server.UrlEncode( uddi_categoryBrowser.KeyValue ) ); + Response.Redirect( url ); + } + + /// + /// Displays an error message to the user. + /// + /// The type of search determines what message to show. + private void ShowErrorMessage( SearchType searchType ) + { + switch( searchType ) + { + case SearchType.SearchByService: + { + aspnet_serviceErrorMessage.Text = Localization.GetString( "AWR_SEARCH_SERVICE_ERROR" ); + aspnet_serviceErrorMessage.Visible = true; + break; + } + case SearchType.SearchByProvider: + { + aspnet_providerErrorMessage.Text = Localization.GetString( "AWR_SEARCH_PROVIDER_ERROR" ); + aspnet_providerErrorMessage.Visible = true; + + break; + } + } + } + + protected void CancelBrowse_Click( object sender, EventArgs args ) + { + string searchID = ViewState[ StateParamNames.SearchID ] as string; + + if( null != searchID && searchID.Length > 0 ) + { + SessionCache.Discard( searchID ); + } + Response.Redirect( "default.aspx" ); + } + + protected override void OnLoad( EventArgs args ) + { + // + // Whenever we load this page, we want to make sure our session state is cleared out and that + // the default search options are visible. + Session.Clear(); + + // + // Reset the state of our search and browse buttons + // + html_searchButtons.Visible = true; + html_browseSearchButtons.Visible = false; + + // + // Set our help link based on the current culture. + // + // -- this control is not localizable, replacing with localizable version + //aspnet_helpLink.NavigateUrl = string.Format(@"javascript:OnNavigate('{0}/addwebreference/{1}/help.htm')", Request.ApplicationPath, CultureInfo.CurrentCulture.TwoLetterISOLanguageName ); + aspnet_helpLink.NavigateUrl = string.Format(@"javascript:OnNavigate('{0}/addwebreference/{1}/help.htm')", Request.ApplicationPath, Localization.GetCulture().LCID ); + + // We don't use the CacheObject, but the CategoryBrowser control won't work unless this object + // is properly instantiated. + // + CacheObject cacheObject; + + if( !this.IsPostBack ) + { + string searchID = Guid.NewGuid().ToString(); + ViewState[ StateParamNames.SearchID ] = searchID; + + cacheObject = new CacheObject(); + + cacheObject.FindBusiness = new FindBusiness(); + cacheObject.FindBusiness.CategoryBag = new KeyedReferenceCollection(); + cacheObject.FindBusiness.IdentifierBag = new KeyedReferenceCollection(); + cacheObject.FindBusiness.TModelBag = new StringCollection(); + + cacheObject.FindService = new FindService(); + cacheObject.FindService.CategoryBag = new KeyedReferenceCollection(); + cacheObject.FindService.TModelBag = new StringCollection(); + + cacheObject.FindTModel = new UDDI.API.ServiceType.FindTModel(); + cacheObject.FindTModel.CategoryBag = new KeyedReferenceCollection(); + cacheObject.FindTModel.IdentifierBag = new KeyedReferenceCollection(); + + SessionCache.Save( searchID, cacheObject ); + } + else + { + // + // Get our search ID + // + string searchID = ( string ) ViewState[ StateParamNames.SearchID ]; + + cacheObject = SessionCache.Get( searchID ); + + // + // We want to peek in the ASP.NET event pipeline to see if the CategoryBrowser has been invoked. If it + // has, then we want to hide the rest of the search page. The reason is that the CategoryBrowser control + // can't be redirected to another page, so we want to give the appearance that its on a dedicated page. + // + if( null != Request[ "__EVENTTARGET" ] && Request[ "__EVENTTARGET" ].Length > 0 ) + { + html_searchButtons.Visible = false; + html_browseSearchButtons.Visible = true; + } + } + + // + // A null cacheObject at this point is a fatal error because we can't initialize our CategoryBrowser + // without it. + // + if( null == cacheObject ) + { + Response.Redirect( "error.aspx" ); + } + + uddi_categoryBrowser.Initialize( new KeyedReferenceCollection(), cacheObject ); + uddi_categoryBrowser.ShowNoCategoriesMessage = false; + } + + /// + /// This is our last chance to manipulate the page. All we want to do is see if our category browser is going to + /// show any taxonomies. If it isn't, we'll output a message instead of an empty control. + /// + /// + protected override void OnPreRender( EventArgs args ) + { + // + // If we are not in a postback, and there are no taxonomies being shown, + // display a message + // + if( 0 == uddi_categoryBrowser.TaxonomyCount && !IsPostBack ) + { + aspnet_noCategoriesMessage.Text = Localization.GetString( "AWR_NO_CATEGORIES" ); + aspnet_noCategoriesMessage.Visible = true; + uddi_categoryBrowser.Visible = false; + } + + // + // Only enable our search button if we are looking at a categorization scheme that is + // valid for categorization. + // + string taxonomyID = uddi_categoryBrowser.TaxonomyID; + string tModelKey = uddi_categoryBrowser.TModelKey; + string keyValue = uddi_categoryBrowser.KeyValue; + + if( null != taxonomyID && taxonomyID.Length > 0 && + null != keyValue && keyValue.Length > 0 && + Taxonomy.IsValidForClassification( Convert.ToInt32( taxonomyID ), keyValue ) ) + { + aspnet_searchFromBrowse.Enabled = true; + } + else + { + aspnet_searchFromBrowse.Enabled = false; + } + + base.OnPreRender( args ); + } + + /// + /// Override OnInit to set up our event handlers + /// + /// Passed by ASP.NET, we dont' use it. + protected override void OnInit( EventArgs args ) + { + // + // Hook up our event handlers + // + aspnet_searchByService.Click += new EventHandler( SearchByService_Click ); + aspnet_searchByProvider.Click += new EventHandler( SearchByProvider_Click ); + aspnet_searchFromBrowse.Click += new EventHandler( SearchFromBrowse_Click ); + aspnet_cancelBrowse.Click += new EventHandler( CancelBrowse_Click ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/addwebreference/addwebreference.csproj b/inetsrv/uddi/source/addwebreference/addwebreference.csproj new file mode 100644 index 0000000..1ce4d7e --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/addwebreference.csproj @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/addwebreference/addwebreference.snk b/inetsrv/uddi/source/addwebreference/addwebreference.snk new file mode 100644 index 0000000..c49633a Binary files /dev/null and b/inetsrv/uddi/source/addwebreference/addwebreference.snk differ diff --git a/inetsrv/uddi/source/addwebreference/assemblyinfo.cs b/inetsrv/uddi/source/addwebreference/assemblyinfo.cs new file mode 100644 index 0000000..da1c13e --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("uddi.addwebreference.dll")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile( "" )] +[assembly: AssemblyKeyName("")] diff --git a/inetsrv/uddi/source/addwebreference/assemblyversioninfo.cs b/inetsrv/uddi/source/addwebreference/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/addwebreference/build.log b/inetsrv/uddi/source/addwebreference/build.log new file mode 100644 index 0000000..286b80a --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/build.log @@ -0,0 +1,26 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\addwebreference directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\addwebreference directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\addwebreference +Elapsed time [0:00:00.000] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.addwebreference D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.addwebreference not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\addwebreference directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.addwebreference D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.addwebreference not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.addwebreference.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\web\obj\I386\uddi.web.dll,..\api\obj\I386\uddi.api.dll addwebreference.cs paging.cs results.cs search.cs visualstudio.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\addwebreference\obj\i386\uddi.addwebreference.dll +1>binplace D:\OpenXP\inetsrv\uddi\source\addwebreference\obj\i386\uddi.addwebreference.dll +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:01.515] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/addwebreference/makefile b/inetsrv/uddi/source/addwebreference/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/addwebreference/makefile.inc b/inetsrv/uddi/source/addwebreference/makefile.inc new file mode 100644 index 0000000..47a253a --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/addwebreference/obj/_objects.mac b/inetsrv/uddi/source/addwebreference/obj/_objects.mac new file mode 100644 index 0000000..d7fd1ee --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/obj/_objects.mac @@ -0,0 +1,44 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\addwebreference.obj \ + $(_OBJ_DIR)\i386\paging.obj \ + $(_OBJ_DIR)\i386\results.obj \ + $(_OBJ_DIR)\i386\search.obj \ + $(_OBJ_DIR)\i386\visualstudio.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\addwebreference.obj \ + $(_OBJ_DIR)\ia64\paging.obj \ + $(_OBJ_DIR)\ia64\results.obj \ + $(_OBJ_DIR)\ia64\search.obj \ + $(_OBJ_DIR)\ia64\visualstudio.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\addwebreference.obj \ + $(_OBJ_DIR)\amd64\paging.obj \ + $(_OBJ_DIR)\amd64\results.obj \ + $(_OBJ_DIR)\amd64\search.obj \ + $(_OBJ_DIR)\amd64\visualstudio.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\addwebreference.obj \ + $(_OBJ_DIR)\arm\paging.obj \ + $(_OBJ_DIR)\arm\results.obj \ + $(_OBJ_DIR)\arm\search.obj \ + $(_OBJ_DIR)\arm\visualstudio.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/addwebreference/obj/i386/uddi.addwebreference.dll b/inetsrv/uddi/source/addwebreference/obj/i386/uddi.addwebreference.dll new file mode 100644 index 0000000..a76a784 Binary files /dev/null and b/inetsrv/uddi/source/addwebreference/obj/i386/uddi.addwebreference.dll differ diff --git a/inetsrv/uddi/source/addwebreference/obj/i386/uddi.addwebreference.pdb b/inetsrv/uddi/source/addwebreference/obj/i386/uddi.addwebreference.pdb new file mode 100644 index 0000000..93dae58 Binary files /dev/null and b/inetsrv/uddi/source/addwebreference/obj/i386/uddi.addwebreference.pdb differ diff --git a/inetsrv/uddi/source/addwebreference/paging.cs b/inetsrv/uddi/source/addwebreference/paging.cs new file mode 100644 index 0000000..0c3e9b4 --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/paging.cs @@ -0,0 +1,197 @@ +using System; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Data; +using System.Collections; +using System.Collections.Specialized; + +namespace UDDI.VisualStudio +{ + internal struct PageInfo + { + public PageInfo( bool showEllipses, bool isCurrentPage, int pageNumber ) + { + this.showEllipses = showEllipses; + this.isCurrentPage = isCurrentPage; + this.pageNumber = pageNumber; + } + + public bool showEllipses; + public bool isCurrentPage; + public int pageNumber; + } + + + internal class PagingRenderer + { + private ArrayList pageRange; + private int numResults; + private int currentPage; + private string parentUrl; + + public PagingRenderer( int numResults, int currentPage, string parentUrl ) + { + this.numResults = numResults; + this.currentPage = currentPage; + this.parentUrl = parentUrl; + + pageRange = new ArrayList(); + + // + // Get the number of pages of results we have + // + int numPages = ( int ) Math.Ceiling( ( double ) Decimal.Divide( ( Decimal )numResults, ( Decimal )Constants.NumResultsPerPage ) ); + + // + // Start our loop at the current page. Add the current page, the move forward adding pages. We will keep adding + // pages until we have added the number of pages specified by Constants.MaxPagesToShow or we run out of pages to add. + // If we have more pages to add after we reach Constants.MaxPagesToShow, we'll start working our way back from the current + // page. + // + int forwardIndex = 0; + int backIndex = currentPage - 1; + int numPagesAdded = 0; + + while( numPagesAdded < Constants.MaxPagesToShow && numPagesAdded < numPages) + { + if( currentPage + forwardIndex <= numPages ) + { + // + // The first page added will always be the current page + // + pageRange.Add( new PageInfo(false, forwardIndex == 0 , currentPage + forwardIndex ) ); + forwardIndex++; + } + else + { + pageRange.Insert( 0, new PageInfo( false, false, backIndex ) ); + backIndex--; + } + numPagesAdded++; + } + + if( pageRange.Count > 0 ) + { + PageInfo lastPage = ( PageInfo )pageRange[ pageRange.Count - 1]; + if( lastPage.pageNumber != numPages ) + { + pageRange.Add( new PageInfo( true, false, lastPage.pageNumber + 1 ) ); + } + + PageInfo firstPage = ( PageInfo )pageRange[ 0 ]; + if( firstPage.pageNumber != 1 ) + { + pageRange.Insert( 0, new PageInfo( true, false, firstPage.pageNumber - 1 ) ); + } + } + } + + /// + /// This method will render the row of page numbers that link to the pages of our request. This method assumes it is + /// being called in the context of a HTML table. It will add rows to that table. + /// + /// Writer to use to write out our HTML. + public void Render( HtmlTextWriter writer ) + { + writer.RenderBeginTag( HtmlTextWriterTag.Table ); + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + + foreach( PageInfo pageInfo in pageRange ) + { + if( true == pageInfo.showEllipses ) + { + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + RenderEllipses( pageInfo.pageNumber, writer ); + writer.RenderEndTag(); + } + else + { + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + + if( true == pageInfo.isCurrentPage ) + { + RenderCurrentPageLink( writer ); + } + else + { + RenderPageLink( pageInfo.pageNumber, writer ); + } + writer.RenderEndTag(); + } + } + + writer.RenderEndTag(); + writer.RenderEndTag(); + } + + /// + /// This method will render a previous or next ellipses in our row of page numbers. This is done so we can limit the number + /// of pages to show in that row. + /// + /// The page number to link the ellipses to. + /// Writer to use to write our HTML. + private void RenderEllipses( int pageNumber, HtmlTextWriter writer) + { + string pageLink = string.Format( "{0}?{1}={2}", parentUrl, StateParamNames.CurrentPage, pageNumber ); + + pageLink += GetKeyedRefData(); + + writer.AddAttribute( HtmlTextWriterAttribute.Href, pageLink ); + writer.RenderBeginTag( HtmlTextWriterTag.A ); + writer.Write( "..." ); + writer.RenderEndTag(); + } + + /// + /// This method will render a page number. + /// + /// Page number to render. + /// Writer to use to write our HTML. + private void RenderPageLink( int pageNumber, HtmlTextWriter writer ) + { + string pageLink = string.Format( "{0}?{1}={2}", parentUrl, StateParamNames.CurrentPage, pageNumber ); + + pageLink += GetKeyedRefData(); + + writer.AddAttribute( HtmlTextWriterAttribute.Class, "boldBlue" ); + writer.AddAttribute( HtmlTextWriterAttribute.Href, pageLink ); + writer.RenderBeginTag( HtmlTextWriterTag.A ); + writer.Write( pageNumber ); + writer.RenderEndTag(); + } + + /// + /// Renders the 'current' page. This page number will not be a link. + /// + /// Writer to use to write our HTML. + private void RenderCurrentPageLink( HtmlTextWriter writer ) + { + writer.AddAttribute( HtmlTextWriterAttribute.Class, "A.navbold" ); + writer.RenderBeginTag( HtmlTextWriterTag.Span ); + writer.Write( currentPage ); + writer.RenderEndTag(); + } + + private string GetKeyedRefData() + { + if( !Utility.StringEmpty( HttpContext.Current.Request[ StateParamNames.TModelKey ] ) ) + { + string urlext = "&{0}={1}&{2}={3}"; + return string.Format( + urlext, + StateParamNames.TModelKey, + HttpContext.Current.Request[ StateParamNames.TModelKey ], + StateParamNames.KeyValue, + HttpContext.Current.Request[ StateParamNames.KeyValue ] + ); + + } + else + { + return string.Empty; + } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/addwebreference/placefil.txt b/inetsrv/uddi/source/addwebreference/placefil.txt new file mode 100644 index 0000000..3c55c84 --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/placefil.txt @@ -0,0 +1 @@ +uddi.addwebreference.dll uddi\bin:uddi\webroot\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/addwebreference/results.cs b/inetsrv/uddi/source/addwebreference/results.cs new file mode 100644 index 0000000..adf8081 --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/results.cs @@ -0,0 +1,534 @@ +using System; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Data; +using System.Collections; +using System.Collections.Specialized; + +using UDDI.API; +using UDDI.API.ServiceType; +using UDDI.API.Binding; +using UDDI.API.Service; +using UDDI.API.Business; + +namespace UDDI.VisualStudio +{ + // + // Simple internal class to hold information about a Service. + // + internal class ServiceResultInfo + { + public string serviceName; + public string serviceKey; + } + + // + // Simple internal class to hold information about a Business. + // + internal class BusinessResultInfo + { + public string businessName; + public ArrayList serviceResultInfos; + + public BusinessResultInfo() + { + serviceResultInfos = new ArrayList(); + } + } + + /// + /// ResultsList is a ASP.NET control that will display the results of our search. + /// TODO this class does a lot of work, consider moving some of the rendering out into a separate classs + /// + public class ResultsList : UserControl + { + // + // This function is defined in search.aspx. + // + private static string EXPAND_JSCRIPT = "toggle(this, '{0}');"; + private static string PLUS_SRC = "../images/plus.gif"; + + private ArrayList results; + private int currentPage; + + /// + /// Use this function to populate a ResultsList instance with raw values from the database. + /// The results from the database must be returned in the following order: + /// + /// businessName + /// businessKey + /// serviceName + /// serviceKey + /// + /// ParseResults will use indexes to read these values from the SqlDataReaderAccessor so this + /// order must be maintained from the database. + /// + /// Reader returned from the database. + /// + public int ParseResults( SqlDataReaderAccessor values ) + { + results = new ArrayList(); + + string currentBusinessName = null; + string lastBusinessName = null; + BusinessResultInfo businessInfo = new BusinessResultInfo(); + + while( values.Read() ) + { + currentBusinessName = values.GetString( 0 ); + + ServiceResultInfo serviceInfo = new ServiceResultInfo(); + serviceInfo.serviceName = values.GetString( 2 ); + serviceInfo.serviceKey = values.GetString( 3 ); + + if (null != lastBusinessName && false == lastBusinessName.Equals( currentBusinessName ) ) + { + results.Add( businessInfo ); + businessInfo = new BusinessResultInfo(); + } + + businessInfo.businessName = currentBusinessName; + businessInfo.serviceResultInfos.Add( serviceInfo ); + + lastBusinessName = currentBusinessName; + } + + // + // Add our last one. + // + if( businessInfo.serviceResultInfos.Count > 0 ) + { + results.Add( businessInfo ); + } + + return results.Count; + } + + /// + /// Overridden from UserControl. This method will get called when its time to render our control. + /// + /// Passed in from ASP.NET, use it to write our HTML + protected override void Render( HtmlTextWriter writer ) + { + // + // Figure out our current page and number of results + // + try + { + currentPage = Int32.Parse( Request[ StateParamNames.CurrentPage ] ); + } + catch + { + currentPage = 1; + } + + RenderResults( writer ); + } + + /// + /// This method actually does the work of rendering our results. + /// + /// Passed from Render() + private void RenderResults( HtmlTextWriter writer ) + { + // + // TODO should this be in the PagingControl? + // + // + // Determine the start and end indexes of the results that we'll display. These values are based + // on the current page that we are displaying. + // + int startIndex; + int endIndex; + + GetStartIndex( out startIndex, out endIndex ); + + if( endIndex > results.Count ) + { + endIndex = results.Count; + } + + if( startIndex < endIndex ) + { + // + // Render everything in table. + // + writer.AddAttribute( HtmlTextWriterAttribute.Width, "95%" ); + writer.RenderBeginTag( HtmlTextWriterTag.Table ); + + // + // Render the range of results. + // + RenderRange( writer, startIndex, endIndex ); + + // + // Render our paging information + // + RenderPaging( writer ); + + writer.RenderEndTag(); // TABLE + } + } + + private void RenderPaging( HtmlTextWriter writer ) + { + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.AddAttribute( HtmlTextWriterAttribute.Class, "pagesCell" ); + writer.AddAttribute( HtmlTextWriterAttribute.Colspan, "3"); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + + PagingRenderer paging = new PagingRenderer( results.Count, currentPage , Request.Path); + paging.Render( writer ); + + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + } + + /// + /// Renders a range of businesses. + /// + /// Writer to use to write our HTML. + /// The beginning of our range of businesses to render. + /// The end of our range of businesses to render. + private void RenderRange( HtmlTextWriter writer, int startIndex, int endIndex ) + { + while( startIndex < endIndex ) + { + BusinessResultInfo businessResultInfo = ( BusinessResultInfo )results[startIndex]; + + // + // Render the business name. + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.AddAttribute( HtmlTextWriterAttribute.Colspan, "3" ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderBeginTag( HtmlTextWriterTag.B ); + writer.Write( Server.HtmlEncode( businessResultInfo.businessName ) ); + writer.RenderEndTag(); + writer.RenderEndTag(); + writer.RenderEndTag(); + + foreach( ServiceResultInfo serviceResultInfo in businessResultInfo.serviceResultInfos ) + { + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + + // + // Write a placeholder cell so we can indent each service info under its + // business name. + // + writer.AddAttribute( HtmlTextWriterAttribute.Class, "space_cell" ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.Write( " " ); + writer.RenderEndTag(); + + // + // Render the service. + // + RenderServiceInfo( serviceResultInfo, writer ); + + writer.RenderEndTag(); + } + + startIndex++; + } + } + + /// + /// This method renders an individual service. + /// + /// The service to render. + /// Writer to use to write our HTML. + private void RenderServiceInfo( ServiceResultInfo serviceInfo, HtmlTextWriter writer ) + { + // + // Render a plus/minus tag. We will use the service key of this service to name + // our hidden details panel. + // + writer.AddAttribute( HtmlTextWriterAttribute.Class, "expand_cell" ); + writer.AddAttribute( HtmlTextWriterAttribute.Align, "center" ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + RenderExpandTag( writer, serviceInfo.serviceKey ); + writer.RenderEndTag(); + + // + // Render the name of the service. Use the first name that is registered with the service. + // + writer.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.Write( Server.HtmlEncode( serviceInfo.serviceName ) ); + writer.RenderEndTag(); + writer.RenderEndTag(); + + // + // Render a details panel for the service that is initially hidden. + // + writer.AddAttribute( HtmlTextWriterAttribute.Id, serviceInfo.serviceKey ); + writer.AddAttribute( HtmlTextWriterAttribute.Style, "display:none" ); + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + + // + // Skip 2 cells + // + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderEndTag(); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderEndTag(); + + writer.AddAttribute( HtmlTextWriterAttribute.Id, serviceInfo.serviceKey + "_detailsPanel" ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + RenderServiceDetail( serviceInfo.serviceKey, writer ); + writer.RenderEndTag(); + } + + /// + /// Renders the +/- sign used to show or hide the details of a service. + /// + /// Writer to use to write our HTML. + /// The service key is used to uniquely identify this HTML component. We need to do this for the script + /// that is located in search.aspx. + /// + private void RenderExpandTag( HtmlTextWriter writer, string serviceKey) + { + string jscript = EXPAND_JSCRIPT.Replace( "{0}", serviceKey ); + writer.AddAttribute( HtmlTextWriterAttribute.Style, "cursor:hand" ); + writer.AddAttribute( HtmlTextWriterAttribute.Src, ResultsList.PLUS_SRC ); + writer.AddAttribute( HtmlTextWriterAttribute.Onclick, jscript ); + writer.RenderBeginTag( HtmlTextWriterTag.Img ); + writer.RenderEndTag(); + } + + private void RenderServiceDetail( string serviceKey, HtmlTextWriter writer ) + { + // + // Get details for this service + // + StringCollection serviceKeys = new StringCollection(); + serviceKeys.Add( serviceKey ); + + ServiceDetail serviceDetail = new ServiceDetail(); + serviceDetail.Get( serviceKeys ); + + // + // We will only get the first one + // + BusinessService businessService = serviceDetail.BusinessServices[ 0 ]; + + writer.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + writer.AddAttribute( HtmlTextWriterAttribute.Class, "serviceDetailOuterTable" ); + writer.RenderBeginTag( HtmlTextWriterTag.Table ); + + // + // Render the business descriptions if there is one + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderBeginTag( HtmlTextWriterTag.B ); + writer.Write( Localization.GetString( "AWR_SERVICE_DESCRIPTION" ) ); + writer.RenderEndTag(); // B + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + + foreach( Description description in businessService.Descriptions ) + { + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.Write( Server.HtmlEncode( description.Value ) ); + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + } + + // + // Render each binding in the service that has a WSDL file associated with it + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderBeginTag( HtmlTextWriterTag.B ); + writer.Write( Localization.GetString( "AWR_BINDINGS" ) ); + writer.RenderEndTag(); // B + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + + foreach( BindingTemplate bindingTemplate in businessService.BindingTemplates ) + { + // + // Render each binding in a row + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + + writer.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + writer.AddAttribute( HtmlTextWriterAttribute.Class, "accessPointTable" ); + writer.RenderBeginTag( HtmlTextWriterTag.Table ); + + // + // Render the access point + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderBeginTag( HtmlTextWriterTag.B ); + writer.Write( Localization.GetString( "AWR_ACCESS_POINT" ) ); + writer.RenderEndTag(); // B + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.Write( Server.HtmlEncode( bindingTemplate.AccessPoint.Value ) ); + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + + // + // Render the descriptions. + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderBeginTag( HtmlTextWriterTag.B ); + writer.Write( Localization.GetString( "AWR_DESCRIPTION" ) ); + writer.RenderEndTag(); // B + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + + foreach( Description description in bindingTemplate.Descriptions ) + { + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.Write( Server.HtmlEncode( description.Value ) ); + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + + // + // Render an empty row between descriptions + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderEndTag(); // Tr + writer.RenderEndTag(); // Td + } + + // + // Render the WSDL files. We are assuming that any overview doc urls are urls to WSDL files + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.RenderBeginTag( HtmlTextWriterTag.B ); + writer.Write( Localization.GetString( "AWR_ID" ) ); + writer.RenderEndTag(); // B + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + + int wsdlCount = 0; + + foreach( TModelInstanceInfo instanceInfo in bindingTemplate.TModelInstanceInfos ) + { + // + // Get the tModel related to this instance. + // + TModel tModel = new TModel( instanceInfo.TModelKey ); + + // + // We don't want any exceptions ruining the rest of our display + // + try + { + // + // Get details for this tModel. + // + tModel.Get(); + + bool isWsdlSpec = false; + foreach( KeyedReference keyedReference in tModel.CategoryBag ) + { + if( true == keyedReference.KeyValue.Equals( UDDI.Constants.UDDITypeTaxonomyWSDLSpecKeyValue ) && + true == keyedReference.TModelKey.ToLower().Equals( UDDI.Constants.UDDITypeTaxonomyTModelKey ) ) + { + isWsdlSpec = true; + break; + } + } + + // + // If this tModel has an overview doc, then consider that document as the link to the + // WSDL file. + // + if( true == isWsdlSpec && + null != tModel.OverviewDoc.OverviewURL && + tModel.OverviewDoc.OverviewURL.Length > 0 ) + { + // + // Render the WSDL link + // + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + + // + // Render the arrow image. + // + writer.AddAttribute( HtmlTextWriterAttribute.Src, "../images/orange_arrow_right.gif" ); + writer.RenderBeginTag( HtmlTextWriterTag.Img ); + writer.Write(" "); + writer.RenderEndTag(); // Img + + // + // Make the overview URL a hyper link + // + writer.AddAttribute( HtmlTextWriterAttribute.Href, tModel.OverviewDoc.OverviewURL ); + writer.RenderBeginTag( HtmlTextWriterTag.A ); + writer.Write( tModel.OverviewDoc.OverviewURL ); + writer.RenderEndTag(); // A + + // + // Render the first description if there is one + // + if( tModel.OverviewDoc.Descriptions.Count > 0 ) + { + writer.Write( " - " ); + writer.Write( tModel.OverviewDoc.Descriptions[0].Value ); + } + + wsdlCount++; + + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + } + } + catch + { + // + // Intentionally empty. + // + } + } + + // + // If there were no WSDL files registered, render a message saying so. + // + if( 0 == wsdlCount ) + { + writer.RenderBeginTag( HtmlTextWriterTag.Tr ); + writer.RenderBeginTag( HtmlTextWriterTag.Td ); + writer.Write( Localization.GetString( "AWR_NO_WSDLS" ) ); + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + } + + writer.RenderEndTag(); // TABLE + writer.RenderEndTag(); // Td + writer.RenderEndTag(); // Tr + } + writer.RenderEndTag(); // TABLE + } + + /// + /// Returns the start index of the result we are supposed to show, taking into account paging. + /// + /// The start index. + /// The 'raw' end index; that is not taking into account whether this value exceeds the number of pages we have. + private void GetStartIndex( out int startIndex, out int rawEndIndex ) + { + startIndex = ( currentPage - 1) * Constants.NumResultsPerPage; + rawEndIndex = startIndex + Constants.NumResultsPerPage; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/addwebreference/search.cs b/inetsrv/uddi/source/addwebreference/search.cs new file mode 100644 index 0000000..a84a8e4 --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/search.cs @@ -0,0 +1,323 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Collections; + +using UDDI.Web; +using UDDI.API; +using UDDI.API.Service; +using UDDI.API.Business; + +namespace UDDI.VisualStudio +{ + // + // Just a simple class to help us keep track of our results. + // + public class ResultsCache + { + public ResultsCache() + {} + + public ResultsCache( SearchType searchType, string searchParams ) + { + this.searchType = searchType; + this.searchParams = searchParams; + } + + public string searchParams; + public SearchType searchType; + public int numResults; + } + + public class SearchPage : Page + { + // + // These controls are bound to elements on our .aspx page. We do not need to instantiate + // these objects, ASP.NET will assign values to them for us. + // + protected HtmlGenericControl html_hasResultsLabel; + protected HtmlGenericControl html_noResultsLabel; + protected HtmlGenericControl html_searchResultsMsg; + protected HtmlGenericControl html_browseResultsMsg; + protected HtmlGenericControl html_hasResultsMsg; + protected ResultsList uddi_resultsList; + + // + // These values will be displayed in search.aspx using <%= tags + // + protected ResultsCache results; + + /// + /// Override OnLoad to do our initialization. + /// + /// Passed by ASP.NET, we don't use it. + protected override void OnLoad( EventArgs args ) + { + // + // See if we already have a cached search, if we do, we'll use it. We only cache search params, + // result count and the search type, we'll get values from our database all the time. + // + results = Session[ StateParamNames.Results ] as ResultsCache; + + // + // If we don't have search results, get them + // + if( null == results ) + { + // + // Instantiate our results cache + // + results = new ResultsCache(); + + // + // Run our query based on the search type and display the results + // + string temp = Request[ StateParamNames.SearchType ]; + if( null == temp || temp.Length == 0 ) + { + Response.Redirect( "error.aspx" ); + } + + results.searchType = ( SearchType ) Int32.Parse( temp ); + + if( results.searchType == SearchType.SearchByService || results.searchType == SearchType.SearchByProvider ) + { + results.searchParams = GetSearchParams(); + } + } + + // + // Search type determines what sproc to run. + // + SqlStoredProcedureAccessor searchCommand = new SqlStoredProcedureAccessor(); + switch( results.searchType ) + { + case SearchType.SearchByService: + { + searchCommand.ProcedureName = "VS_AWR_services_get"; + searchCommand.Parameters.Add( "@serviceName", SqlDbType.NVarChar, 450 ); + searchCommand.Parameters.SetString( "@serviceName", results.searchParams ); + + break; + } + case SearchType.SearchByProvider: + { + searchCommand.ProcedureName = "VS_AWR_businesses_get"; + searchCommand.Parameters.Add( "@businessName", SqlDbType.NVarChar, 450 ); + searchCommand.Parameters.SetString( "@businessName", results.searchParams ); + + break; + } + case SearchType.SearchFromBrowse: + { + searchCommand.ProcedureName = "VS_AWR_categorization_get"; + searchCommand.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + searchCommand.Parameters.Add( "@keyValue", SqlDbType.NVarChar, 255 ); + + searchCommand.Parameters.SetGuidFromString( "@tModelKey", GetTModelKey() ); + searchCommand.Parameters.SetString( "@keyValue", GetKeyValue() ); + + break; + } + } + + // + // Get the results that we are supposed to display. + // + SqlDataReaderAccessor resultsReader = searchCommand.ExecuteReader(); + results.numResults = uddi_resultsList.ParseResults( resultsReader ); + resultsReader.Close(); + + // + // Store our results in session state + // + Session[ StateParamNames.Results ] = results; + + DisplaySearchMessages( results.numResults ); + } + + private void DisplaySearchMessages(int numResults ) + { + // + // Depending on whether we have results or not, show or hide the panel that will show our results. + // + if( numResults > 0 ) + { + if( results.searchType == SearchType.SearchFromBrowse ) + { + html_browseResultsMsg.Visible = true; + html_searchResultsMsg.Visible = false; + } + else + { + html_browseResultsMsg.Visible = false; + html_searchResultsMsg.Visible = true; + } + + html_hasResultsLabel.Visible = true; + html_noResultsLabel.Visible = false; + } + else + { + html_hasResultsLabel.Visible = false; + html_noResultsLabel.Visible = true; + } + } + + private string GetKeyValue() + { + string keyValue = Request[ StateParamNames.KeyValue ]; + if( null == keyValue || keyValue.Length == 0 ) + { + return "%"; + } + + return Server.UrlDecode( keyValue ); + } + + private string GetTModelKey() + { + // + // Get the tModel key to search on + // + string tModelKey = Request[ StateParamNames.TModelKey ]; + if( null == tModelKey || tModelKey.Length == 0 ) + { + Response.Redirect( "error.aspx" ); + } + + return Server.UrlDecode( tModelKey ); + } + + private string GetSearchParams() + { + // + // Make sure we have search params + // + string searchParams = Request[ StateParamNames.SearchParams ]; + if( null == searchParams || searchParams.Length == 0 ) + { + Response.Redirect( "error.aspx" ); + } + + return searchParams; + } + } + ///********************************************************************************** + /// + /// Class to help manage help link localization. + /// + ///********************************************************************************** + public class HelpLinkControl : UserControl + { + + private string helpstring; + /// ***************************************************************************** + /// + /// Text for the Help Message. + /// + /// If a localization key is provided, then a the string will be set to the + /// Localized value. + /// + /// ***************************************************************************** + public string HelpString + { + get{ return helpstring; } + set + { + if( Localization.IsKey( (string)value ) ) + helpstring=Localization.GetString( Localization.StripMarkup( (string)value ) ); + else + helpstring=value; + } + } + + private string helplinktext; + /// ***************************************************************************** + /// + /// Text for the Link inside the help Message. + /// + /// If a localization key is provided, then a the string will be set to the + /// Localized value. + /// + /// ***************************************************************************** + public string HelpLinkText + { + get{ return helplinktext; } + set + { + if( Localization.IsKey( (string)value ) ) + helplinktext=Localization.GetString( Localization.StripMarkup( (string)value ) ); + else + helplinktext=value; + } + } + + private string navigateurl; + /// ***************************************************************************** + /// + /// Url that the HelpLink will navigate too. + /// + /// ***************************************************************************** + public string NavigateUrl + { + get{ return navigateurl; } + set{ navigateurl=value; } + } + + private string navigatetarget; + /// ***************************************************************************** + /// + /// Url Target of the Help Link + /// + /// ***************************************************************************** + public string NavigateTarget + { + get{ return navigatetarget; } + set{ navigatetarget=value; } + } + + private string cssclass; + public string CssClass + { + get{ return cssclass; } + set{ cssclass=value; } + } + + /// + /// method to write content to the Response Stream + /// + /// Stream to write output too. + protected override void Render( HtmlTextWriter output ) + { + UDDI.Diagnostics.Debug.Verify( null!=HelpLinkText,"UDDI_ERROR_FATALERROR_AWR_NULLHELPLINKTEXT" ); + UDDI.Diagnostics.Debug.Verify( null!=HelpString,"UDDI_ERROR_FATALERROR_AWR_NULLHELPSTRING" ); + + + string hyperlink = ""; + if( null!=NavigateUrl ) + { + //build the hyperlink. + hyperlink="{0}"; + + hyperlink = string.Format( hyperlink, HelpLinkText ); + } + + if( null!=CssClass ) //if a stylesheet class was provided add it to the stream to be rendered + output.AddAttribute( HtmlTextWriterAttribute.Class,CssClass ) ; + + output.RenderBeginTag( HtmlTextWriterTag.Span ); + + //format the help string with the hyperlink string. + output.Write( HelpString, ((""!=hyperlink)?hyperlink:HelpLinkText ) ); + + output.RenderEndTag(); + } + } + +} \ No newline at end of file diff --git a/inetsrv/uddi/source/addwebreference/sources b/inetsrv/uddi/source/addwebreference/sources new file mode 100644 index 0000000..6c85f9f --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/sources @@ -0,0 +1,23 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=uddi.addwebreference +TARGETPATH=obj +TARGETTYPE=DYNLINK +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES=system.dll, system.data.dll, system.web.dll, system.web.services.dll, system.xml.dll, ..\core\obj\*\uddi.core.dll, ..\web\obj\*\uddi.web.dll, ..\api\obj\*\uddi.api.dll + +SOURCES=\ + addwebreference.cs \ + paging.cs \ + results.cs \ + search.cs \ + visualstudio.cs \ + assemblyversioninfo.cs \ + assemblyinfo.cs + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/addwebreference/visualstudio.cs b/inetsrv/uddi/source/addwebreference/visualstudio.cs new file mode 100644 index 0000000..cbd57ba --- /dev/null +++ b/inetsrv/uddi/source/addwebreference/visualstudio.cs @@ -0,0 +1,43 @@ +using System; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using System.Data; +using System.Collections.Specialized; + +using UDDI.API; +using UDDI.API.Service; +using UDDI.API.Business; + +namespace UDDI.VisualStudio +{ + internal struct StateParamNames + { + public static string SearchID = "searchID"; + public static string SearchType = "searchType"; + public static string TModelKey = "tModelKey"; + public static string ServiceKey = "serviceKey"; + public static string SearchParams = "searchParams"; + public static string CacheObject = "cacheObject"; + public static string Results = "results"; + public static string CurrentPage = "currentPage"; + public static string KeyValue = "keyValue"; + } + + internal struct Constants + { + // + // Number of results to show per page + // + public static int NumResultsPerPage = 3; + public static int MaxPagesToShow = 5; + } + + public enum SearchType + { + SearchByService = 0, + SearchByProvider = 1, + SearchFromBrowse = 2, + } +} diff --git a/inetsrv/uddi/source/api/address.cs b/inetsrv/uddi/source/api/address.cs new file mode 100644 index 0000000..8a78b97 --- /dev/null +++ b/inetsrv/uddi/source/api/address.cs @@ -0,0 +1,612 @@ +/// ************************************************************************ +/// Microsoft UDDI version 2.0 +/// Copyright (c) 2000-2001 Microsoft Corporation +/// All Rights Reserved +/// ------------------------------------------------------------------------ +/// +/// +/// ************************************************************************ +/// + +using System; +using System.Data; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API.Business +{ + /// ******************************************************************** + /// public class Address + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class Address + { + // + // Attribute: useType + // + [XmlAttribute( "sortCode" )] + public string SortCode; + + // + // Attribute: useType + // + [XmlAttribute( "useType" )] + public string UseType; + + // + // Attribute: tModelKey + // + [XmlAttribute( "tModelKey" )] + public string TModelKey; + + // + // Element: addressLines + // + private AddressLineCollection addressLines; + + [XmlElement( "addressLine" )] + public AddressLineCollection AddressLines + { + get + { + if( null == addressLines ) + addressLines = new AddressLineCollection(); + + return addressLines; + } + + set { addressLines = value; } + } + + /// **************************************************************** + /// public Address [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public Address() + { + } + + /// **************************************************************** + /// public Address [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public Address( string sortCode, string useType, string tModelKey ) + { + this.SortCode = sortCode; + this.UseType = useType; + this.TModelKey = tModelKey; + } + + /// **************************************************************** + /// public Address [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public Address( string sortCode, string useType ) + : this( sortCode, useType, null ) + { + } + + internal void Validate() + { + Debug.Enter(); + + Utility.ValidateLength( ref UseType, "useType", UDDI.Constants.Lengths.UseType ); + Utility.ValidateLength( ref SortCode, "sortCode", UDDI.Constants.Lengths.SortCode ); + Utility.ValidateLength( ref TModelKey, "tModelKey", UDDI.Constants.Lengths.TModelKey ); + + // + // Verify that if the address is adorned with a tModelKey, each + // of the address lines specifies a key name and value. + // + if( null != TModelKey ) + { + if( Utility.StringEmpty( TModelKey ) ) + { + // + // trying to save a business with empty tModelKey attribute + // in the address element should return E_invalidKeyPassed + // + throw new UDDIException( + ErrorType.E_invalidKeyPassed, + "UDDI_ERROR_INVALIDKEYPASSED_ADDRESS_BLANKTMODELKEY" ); + } + else + { + foreach( AddressLine addressLine in AddressLines ) + { + if( Utility.StringEmpty( addressLine.KeyName ) || + Utility.StringEmpty( addressLine.KeyValue ) ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_ADDRESS_MISSINGKEYNAMEKEYVALUE" ); + } + } + + // + // call net_key_validate + // + SqlCommand cmd = new SqlCommand( "net_key_validate", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Parameters.Add( new SqlParameter( "@entityTypeID", SqlDbType.TinyInt ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@entityKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + // + // TODO: Need enumeration for the entityTypeID + // + paramacc.SetInt( "@entityTypeID", 0 ); + paramacc.SetGuidFromKey( "@entityKey", TModelKey ); + + cmd.ExecuteNonQuery(); + } + } + + AddressLines.Validate(); + + Debug.Leave(); + } + + public void Get( long addressID ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_address_addressLines_get"; + + sp.Parameters.Add( "@addressID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@addressID", addressID ); + + // + // Run the stored procedure + // + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + if( 1 == Context.ApiVersionMajor ) + { + while( reader.Read() ) + AddressLines.Add( reader.GetString( "addressLine" ) ); + } + else + { + while( reader.Read() ) + { + AddressLines.Add( + reader.GetString( "addressLine" ), + reader.GetString( "keyName" ), + reader.GetString( "keyValue" ) ); + } + } + } + finally + { + reader.Close(); + } + } + + public void Save( long contactID ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_contact_address_save"; + + sp.Parameters.Add( "@contactID", SqlDbType.BigInt ); + sp.Parameters.Add( "@sortCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.SortCode ); + sp.Parameters.Add( "@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@addressID", SqlDbType.BigInt, ParameterDirection.Output ); + + sp.Parameters.SetLong( "@contactID", contactID ); + sp.Parameters.SetString( "@sortCode", SortCode ); + sp.Parameters.SetString( "@useType", UseType ); + sp.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + + sp.ExecuteNonQuery(); + + long addressID = sp.Parameters.GetLong( "@addressID" ); + + // + // Call save on individual address line instances + // + AddressLines.Save( addressID ); + + Debug.Leave(); + } + } + + /// ******************************************************************** + /// public class AddressCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class AddressCollection : CollectionBase + { + internal void Validate() + { + // + // Walk collection and call Validate on individual address + // instances. + // + foreach( Address address in this ) + address.Validate(); + } + + public void Save( long contactID ) + { + // + // Walk collection and call save on individual address + // instances. + // + foreach( Address address in this ) + address.Save( contactID ); + } + + public void Get( long contactID ) + { + ArrayList addressIDs = new ArrayList(); + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_contact_addresses_get" ); + + sp.Parameters.Add( "@contactID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@contactID", contactID ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + addressIDs = Read( reader ); + } + finally + { + reader.Close(); + } + + Populate( addressIDs ); + +#if never + ArrayList addressIDs = new ArrayList(); + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_contact_addresses_get"; + + sp.Parameters.Add( "@contactID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@contactID", contactID ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + if( 1 == Context.ApiVersionMajor ) + { + while( reader.Read() ) + { + addressIDs.Add( reader.GetLong( "addressID" ) ); + Add( reader.GetString( "sortCode" ), reader.GetString( "useType" ) ); + } + } + else + { + while( reader.Read() ) + { + addressIDs.Add( reader.GetLong( "addressID" ) ); + Add( reader.GetString( "sortCode" ), reader.GetString( "useType" ), reader.GetKeyFromGuid( "tModelKey" ) ); + } + } + } + finally + { + reader.Close(); + } + + // + // Retrieve the addressLines for this address + // + int index = 0; + + foreach( Address address in this ) + { + address.Get( (long)addressIDs[ index ] ); + index ++; + } +#endif + } + + public ArrayList Read( SqlDataReaderAccessor reader ) + { + ArrayList addressIDs = new ArrayList(); + + if( 1 == Context.ApiVersionMajor ) + { + while( reader.Read() ) + { + addressIDs.Add( reader.GetLong( "addressID" ) ); + Add( reader.GetString( "sortCode" ), reader.GetString( "useType" ) ); + } + } + else + { + while( reader.Read() ) + { + addressIDs.Add( reader.GetLong( "addressID" ) ); + Add( reader.GetString( "sortCode" ), reader.GetString( "useType" ), reader.GetKeyFromGuid( "tModelKey" ) ); + } + } + + return addressIDs; + } + + public void Populate( ArrayList addressIDs ) + { + // + // Retrieve the addressLines for this address + // + int index = 0; + foreach( Address address in this ) + { + address.Get( (long)addressIDs[ index ] ); + index ++; + } + } + + public Address this[ int index ] + { + get + { return ( Address)List[index]; } + set + { List[ index ] = value; } + } + + public int Add( string sortCode, string useType ) + { + return List.Add( new Address( sortCode, useType ) ); + } + + public int Add( string sortCode, string useType, string tModelKey ) + { + return List.Add( new Address( sortCode, useType, tModelKey ) ); + } + + public int Add( Address value ) + { + return List.Add( value ); + } + + public void Insert( int index, Address value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Address value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Address value ) + { + return List.Contains( value ); + } + + public void Remove( Address value ) + { + List.Remove( value ); + } + + public void CopyTo( Address[] array, int index ) + { + List.CopyTo( array, index ); + } + } + + /// ******************************************************************** + /// public class AddressLine + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class AddressLine + { + // + // Attribute: keyName + // + [XmlAttribute( "keyName" )] + public string KeyName; + + // + // Attribute: keyValue + // + [XmlAttribute( "keyValue" )] + public string KeyValue; + + // + // InnerText + // + [XmlText] + public string Value; + + public AddressLine() + { + } + + public AddressLine( string addressLine ) + : this( addressLine, null, null ) + { + } + + public AddressLine( string addressLine, string keyName, string keyValue ) + { + this.Value = addressLine; + this.KeyName = keyName; + this.KeyValue = keyValue; + } + + internal void Validate() + { + Utility.ValidateLength( ref Value, "addressLine", UDDI.Constants.Lengths.AddressLine ); + Utility.ValidateLength( ref KeyName, "keyName", UDDI.Constants.Lengths.KeyName ); + Utility.ValidateLength( ref KeyValue, "keyValue", UDDI.Constants.Lengths.KeyValue ); + } + + public void Save( long addressID ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_address_addressLine_save"; + + sp.Parameters.Add( "@addressID", SqlDbType.BigInt ); + sp.Parameters.Add( "@addressLine", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine ); + sp.Parameters.Add( "@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName ); + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + + sp.Parameters.SetLong( "@addressID", addressID ); + sp.Parameters.SetString( "@addressLine", Value ); + sp.Parameters.SetString( "@keyName", KeyName ); + sp.Parameters.SetString( "@keyValue", KeyValue ); + + sp.ExecuteNonQuery(); + } + } + + /// ******************************************************************** + /// public class AddressLineCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class AddressLineCollection : CollectionBase + { + internal void Validate() + { + // + // Walk the collection and call Validate on each individual + // address line. + // + foreach( AddressLine addressLine in this ) + addressLine.Validate(); + } + + public void Save( long addressID ) + { + // + // Walk the collection and save each individual address + // line. + // + foreach( AddressLine addressLine in this ) + addressLine.Save( addressID ); + } + + public void Get( long addressID ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_address_addressLines_get"; + + sp.Parameters.Add( "@addressID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@addressID", addressID ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + Add( + reader.GetString( "addressLine" ), + reader.GetString( "keyName" ), + reader.GetString( "keyValue" ) ); + } + } + finally + { + reader.Close(); + } + } + + public AddressLine this[ int index ] + { + get + { return (AddressLine)List[index]; } + set + { List[ index ] = value; } + } + + public int Add( string addressLine, string keyName, string keyValue ) + { + return List.Add( new AddressLine( addressLine, keyName, keyValue ) ); + } + + public int Add( string addressLine ) + { + return List.Add( new AddressLine( addressLine ) ); + } + + public int Add( AddressLine addressLine ) + { + return List.Add( addressLine ); + } + + public void Insert( int index, AddressLine addressLine ) + { + List.Insert( index, addressLine ); + } + + public int IndexOf( AddressLine addressLine ) + { + return List.IndexOf( addressLine ); + } + + public bool Contains( AddressLine addressLine ) + { + return List.Contains( addressLine ); + } + + public void Remove( AddressLine addressLine ) + { + List.Remove( addressLine ); + } + + public void CopyTo( AddressLine[] array, int index ) + { + List.CopyTo( array, index ); + } + } +} diff --git a/inetsrv/uddi/source/api/api.csproj b/inetsrv/uddi/source/api/api.csproj new file mode 100644 index 0000000..75cf1e5 --- /dev/null +++ b/inetsrv/uddi/source/api/api.csproj @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/api/api.snk b/inetsrv/uddi/source/api/api.snk new file mode 100644 index 0000000..3f96201 Binary files /dev/null and b/inetsrv/uddi/source/api/api.snk differ diff --git a/inetsrv/uddi/source/api/assemblyinfo.cs b/inetsrv/uddi/source/api/assemblyinfo.cs new file mode 100644 index 0000000..863fb67 --- /dev/null +++ b/inetsrv/uddi/source/api/assemblyinfo.cs @@ -0,0 +1,31 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("uddi.api.dll")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// diff --git a/inetsrv/uddi/source/api/assemblyversioninfo.cs b/inetsrv/uddi/source/api/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/api/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/api/assertion.cs b/inetsrv/uddi/source/api/assertion.cs new file mode 100644 index 0000000..9bf75fc --- /dev/null +++ b/inetsrv/uddi/source/api/assertion.cs @@ -0,0 +1,1635 @@ +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Data; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI.Replication; +using UDDI; +using UDDI.API; +using UDDI.Diagnostics; + +namespace UDDI.API.Business +{ + /// ******************************************************************** + /// public class PublisherAssertion + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class PublisherAssertion + { + [XmlElement( "fromKey" )] + public string FromKey + { + get + { + return fromkey; + } + set + { + if( null == value ) + fromkey = null; + else + fromkey = value.Trim(); + } + } + string fromkey; + + [XmlElement( "toKey" )] + public string ToKey + { + get + { + return tokey; + } + set + { + if( null == value ) + tokey = null; + else + tokey = value.Trim(); + } + } + string tokey; + + + // + // Element: keyedReference + // + private KeyedReference keyedReference; + + [XmlElement( "keyedReference" )] + public KeyedReference KeyedReference + { + get + { + if( null == keyedReference ) + keyedReference = new KeyedReference(); + + return keyedReference; + } + + set { keyedReference = value; } + } + + /// **************************************************************** + /// public PublisherAssertion [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public PublisherAssertion() + { + } + + /// **************************************************************** + /// public PublisherAssertion [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public PublisherAssertion( PublisherAssertion assertion ) + { + this.FromKey = assertion.FromKey; + this.ToKey = assertion.ToKey; + this.KeyedReference = assertion.KeyedReference; + } + + /// **************************************************************** + /// public PublisherAssertion [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public PublisherAssertion( string fromKey, string toKey, KeyedReference keyedReference ) + { + this.FromKey = fromKey; + this.ToKey = toKey; + this.KeyedReference = keyedReference; + } + + /// **************************************************************** + /// public PublisherAssertion [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public PublisherAssertion( string fromKey, string toKey, string keyName, string keyValue, string tModelKey ) + { + this.FromKey = fromKey; + this.ToKey = toKey; + this.KeyedReference = new KeyedReference( keyName, keyValue, tModelKey ); + } + + public void Save() + { + Save( CompletionStatusType.Uninitialized ); + } + + public void Save( CompletionStatusType status ) + { + Debug.Enter(); + + Validate(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_assertion_save" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@fromKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@toKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName ); + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int, ParameterDirection.InputOutput ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@fromKey", FromKey ); + sp.Parameters.SetGuidFromString( "@toKey", ToKey ); + sp.Parameters.SetString( "@keyName", KeyedReference.KeyName ); + sp.Parameters.SetString( "@keyValue", KeyedReference.KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", KeyedReference.TModelKey ); + + if( CompletionStatusType.Uninitialized == status ) + sp.Parameters.SetNull( "@flag" ); + else + sp.Parameters.SetInt( "@flag", (int)status ); + + try + { + sp.ExecuteNonQuery(); + + int flag = sp.Parameters.GetInt( "@flag" ); + + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.Payload = new ChangeRecordPublisherAssertion( this, (CompletionStatusType)flag ); + changeRecord.Log(); + } + } + catch( SqlException sqlException ) + { + // + // As per IN 60, we have to silently ignore assertions that reference keys to businesses that no longer + // exist. + // + if( sqlException.Number - UDDI.Constants.ErrorTypeSQLOffset == ( int ) ErrorType.E_invalidKeyPassed && + Context.ContextType == ContextType.Replication ) + { + // + // Set our exception source + // + Context.ExceptionSource = ExceptionSource.PublisherAssertion; + } + else + { + Context.ExceptionSource = ExceptionSource.Other; + } + + // + // Re-throw the exception so replication can properly log it. + // + throw sqlException; + } + + Debug.Leave(); + } + + public void Delete() + { + Delete( CompletionStatusType.Uninitialized ); + } + + public void Delete( CompletionStatusType status ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_assertion_delete" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@fromKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@toKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName ); + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int, ParameterDirection.InputOutput ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@fromKey", FromKey ); + sp.Parameters.SetGuidFromString( "@toKey", ToKey ); + sp.Parameters.SetString( "@keyName", KeyedReference.KeyName ); + sp.Parameters.SetString( "@keyValue", KeyedReference.KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", KeyedReference.TModelKey ); + + if( CompletionStatusType.Uninitialized == status ) + sp.Parameters.SetNull( "@flag" ); + else + sp.Parameters.SetInt( "@flag", (int)status ); + + try + { + sp.ExecuteNonQuery(); + + int flag = sp.Parameters.GetInt( "@flag" ); + + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.Payload = new ChangeRecordDeleteAssertion( this, (CompletionStatusType)flag ); + changeRecord.Log(); + } + } + catch( SqlException sqlException ) + { + // + // As per IN 60, we have to silently ignore assertions that reference keys to businesses that no longer + // exist, or assertions that don't exist at all. + // + int exceptionNumber = sqlException.Number - UDDI.Constants.ErrorTypeSQLOffset; + if( ( exceptionNumber == ( int ) ErrorType.E_invalidKeyPassed || exceptionNumber == ( int ) ErrorType.E_assertionNotFound ) && + Context.ContextType == ContextType.Replication ) + { + // + // Set our exception source + // + Context.ExceptionSource = ExceptionSource.PublisherAssertion; + } + else + { + Context.ExceptionSource = ExceptionSource.Other; + } + + // + // Re-throw the exception so replication can properly log it. + // + throw sqlException; + } + Debug.Leave(); + } + + internal void Validate() + { + // + // Check to make sure publisher's limit allows save of this + // entity. If this is an update, we won't check since they + // are simply replacing an existing entity. We also won't + // check if the limit is 0, since this indicates unlimited + // publishing rights. + // + int limit = Context.User.AssertionLimit; + int count = Context.User.AssertionCount; + + if( 0 != limit && Utility.StringEmpty( FromKey ) ) + { + // + // Verify that the publisher has not exceeded their limit. + // + if( count >= limit ) + { + throw new UDDIException( + ErrorType.E_accountLimitExceeded, + "UDDI_ERROR_ACCOUNTLIMITEXCEEDED_ASSERTION", + limit, + count + ); + } + } + + KeyedReference.Validate( null, KeyedReferenceType.Assertion ); + } + } + + /// ******************************************************************** + /// public class PublisherAssertionCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class PublisherAssertionCollection : CollectionBase + { + public string Get() + { + string AuthorizedName; + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_assertions_get" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + Add( + reader.GetGuidString( "fromKey" ), + reader.GetGuidString( "toKey" ), + reader.GetGuidString( "keyName" ), + reader.GetGuidString( "keyValue" ), + reader.GetKeyFromGuid( "tModelKey" ) ); + } + } + finally + { + reader.Close(); + } + AuthorizedName = sp.Parameters.GetString( "@authorizedName" ); + return AuthorizedName; + } + + public void Delete() + { + Debug.Enter(); + + foreach( PublisherAssertion assertion in this ) + assertion.Delete(); + + Debug.Leave(); + } + + public void Save() + { + Debug.Enter(); + + Validate(); + + foreach( PublisherAssertion assertion in this ) + assertion.Save(); + + Debug.Leave(); + } + + internal void Validate() + { + foreach( PublisherAssertion assertion in this ) + assertion.Validate(); + } + + public PublisherAssertion this[ int index ] + { + get { return (PublisherAssertion)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new PublisherAssertion() ); + } + + public int Add( PublisherAssertion value ) + { + return List.Add( value ); + } + + public int Add( string fromKey, string toKey, KeyedReference keyedReference ) + { + return List.Add( new PublisherAssertion( fromKey, toKey, keyedReference ) ); + } + + public int Add( string fromKey, string toKey, string keyName, string keyValue, string tModelKey ) + { + return List.Add( new PublisherAssertion( fromKey, toKey, keyName, keyValue, tModelKey ) ); + } + + public void Insert( int index, PublisherAssertion value ) + { + List.Insert( index, value ); + } + + public int IndexOf( PublisherAssertion value ) + { + return List.IndexOf( value ); + } + + public bool Contains( PublisherAssertion value ) + { + return List.Contains( value ); + } + + public void Remove( PublisherAssertion value ) + { + List.Remove( value ); + } + + public void CopyTo( PublisherAssertion[] array, int index ) + { + List.CopyTo( array, index ); + } + } + + /// ******************************************************************** + /// public class PublisherAssertionDetail + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "publisherAssertions", Namespace=UDDI.API.Constants.Namespace )] + public class PublisherAssertionDetail + { + // + // Attribute: generic + // + private string generic = Constants.Version; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: operator + // + [XmlAttribute( "operator" )] + public string OperatorName = Config.GetString( "Operator" ); + + // + // Attribute: authorizedName + // + [XmlAttribute( "authorizedName" )] + public string AuthorizedName; + + // + // Element: publisherAssertion + // + private PublisherAssertionCollection publisherAssertions; + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + publisherAssertions = new PublisherAssertionCollection(); + + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + + public PublisherAssertionDetail() + { + } + + public void Get() + { + AuthorizedName = PublisherAssertions.Get(); + } + } + + /// ******************************************************************** + /// public class AssertionStatusReport + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "assertionStatusReport", Namespace=UDDI.API.Constants.Namespace )] + public class AssertionStatusReport + { + // + // Attribute: generic + // + private string generic = Constants.Version; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: operator + // + [XmlAttribute( "operator" )] + public string OperatorName = Config.GetString( "Operator" ); + + // + // Element: assertionStatusItem + // + private AssertionStatusItemCollection assertionStatusItems; + + [XmlElement( "assertionStatusItem" )] + public AssertionStatusItemCollection AssertionStatusItems + { + get + { + if( null == assertionStatusItems ) + assertionStatusItems = new AssertionStatusItemCollection(); + + return assertionStatusItems; + } + + set { assertionStatusItems = value; } + } + + public AssertionStatusReport() + { + } + + public void Get( CompletionStatusType completionStatus ) + { + AssertionStatusItems.Get( completionStatus ); + } + } + + /// ******************************************************************** + /// public class AssertionStatusItem + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class AssertionStatusItem + { + // + // Attribute: completionStatus + // + [XmlAttribute( "completionStatus" )] + public CompletionStatusType CompletionStatus; + + // + // Element: fromKey + // + [XmlElement( "fromKey" )] + public string FromKey; + + // + // Element: toKey + // + [XmlElement( "toKey" )] + public string ToKey; + + // + // Element: keyedReference + // + private KeyedReference keyedReference; + + [XmlElement( "keyedReference" )] + public KeyedReference KeyedReference + { + get { return keyedReference; } + set { keyedReference = value; } + } + + // + // Element: keysOwned + // + private KeysOwned keysOwned; + + [XmlElement( "keysOwned" )] + public KeysOwned KeysOwned + { + get + { + if( null == keysOwned ) + keysOwned = new KeysOwned(); + + return keysOwned; + } + + set { keysOwned = value; } + } + + public AssertionStatusItem() + { + } + + public AssertionStatusItem( CompletionStatusType completionStatus, string fromKey, string toKey, KeyedReference keyedReference, KeysOwned keysOwned ) + { + this.CompletionStatus = completionStatus; + this.FromKey = fromKey; + this.ToKey = toKey; + this.KeyedReference = keyedReference; + this.KeysOwned = keysOwned; + } + } + + /// ******************************************************************** + /// public class AssertionStatusItemCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class AssertionStatusItemCollection : CollectionBase + { + public void Get( CompletionStatusType completionStatus ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_assertionStatus_get" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + + if( CompletionStatusType.Uninitialized != completionStatus ) + { + // + // If the completion status was not specified get all + // of the assertions by not specifying a completionStatus value + // in the stored procedure. + // + sp.Parameters.Add( "@completionStatus", SqlDbType.Int ); + sp.Parameters.SetInt( "@completionStatus", (int)completionStatus ); + } + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + KeyedReference keyedReference = new KeyedReference( + reader.GetString( "keyName" ), + reader.GetString( "keyValue" ), + reader.GetKeyFromGuid( "tModelKey" ) ); + + CompletionStatusType status = + (CompletionStatusType)reader.GetInt( "flag" ); + + string fromKey = reader.GetGuidString( "fromKey" ); + string toKey = reader.GetGuidString( "toKey" ); + + int ownerFlag = reader.GetInt( "ownerFlag" ); + + KeysOwned keysOwned = new KeysOwned(); + + if( 0x02 == ( ownerFlag & 0x02 ) ) + keysOwned.FromKey = fromKey; + + if( 0x01 == ( ownerFlag & 0x01 ) ) + keysOwned.ToKey = toKey; + + this.Add( + new AssertionStatusItem( + status, + fromKey, + toKey, + keyedReference, + keysOwned ) ); + } + } + finally + { + reader.Close(); + } + } + + public AssertionStatusItem this[ int index ] + { + get { return (AssertionStatusItem)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new AssertionStatusItem() ); + } + + public int Add( AssertionStatusItem value ) + { + return List.Add( value ); + } + + public void Insert( int index, AssertionStatusItem value ) + { + List.Insert( index, value ); + } + + public int IndexOf( AssertionStatusItem value ) + { + return List.IndexOf( value ); + } + + public bool Contains( AssertionStatusItem value ) + { + return List.Contains( value ); + } + + public void Remove( AssertionStatusItem value ) + { + List.Remove( value ); + } + + public void CopyTo( AssertionStatusItem[] array, int index ) + { + List.CopyTo( array, index ); + } + } + + /// ******************************************************************** + /// public class KeysOwned + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class KeysOwned + { + // + // Element: fromKey + // + [XmlElement( "fromKey" )] + public string FromKey; + + // + // Element: toKey + // + [XmlElement( "toKey" )] + public string ToKey; + + public KeysOwned() + { + } + + public KeysOwned( string fromKey, string toKey ) + { + this.FromKey = fromKey; + this.ToKey = toKey; + } + } + + public enum DirectionType + { + [XmlEnum( "fromKey" )] + FromKey, + [XmlEnum( "toKey" )] + ToKey + } + + public class RelatedBusinessInfo + { + // + // Element: businessKey + // + [XmlElement( "businessKey" )] + public string BusinessKey; + + // + // Element: name + // + private NameCollection names; + + [XmlElement( "name" )] + public NameCollection Names + { + get + { + if( null == names ) + names = new NameCollection(); + + return names; + } + + set { names = value; } + } + + // + // Element: description + // + private DescriptionCollection descriptions; + + [XmlElement( "description" )] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // + // Element: sharedRelationships + // + + [XmlIgnore()] + public SharedRelationships SharedRelationshipsFrom = new SharedRelationships(); + + [XmlIgnore()] + public SharedRelationships SharedRelationshipsTo = new SharedRelationships(); + + [XmlElement( "sharedRelationships" )] + public string sharedRelationshipEmptyTag + { + get + { + if( 0 == SharedRelationshipsSerialize.Count ) + return ""; + else + return null; + } + } + + [XmlElement( "sharedRelationships" )] + public SharedRelationshipsCollection SharedRelationshipsSerialize + { + get + { + SharedRelationshipsCollection col = new SharedRelationshipsCollection(); + + if( !SharedRelationshipsFrom.IsEmpty() ) + col.Add( SharedRelationshipsFrom ); + + if( !SharedRelationshipsTo.IsEmpty() ) + col.Add( SharedRelationshipsTo ); + + return col; + } + set + { + foreach( SharedRelationships sr in value ) + { + switch( sr.Direction ) + { + case DirectionType.FromKey: + SharedRelationshipsFrom = sr; + break; + case DirectionType.ToKey: + SharedRelationshipsTo = sr; + break; + } + } + } + } + + public RelatedBusinessInfo() + { + } + + public RelatedBusinessInfo( string businessKey ) + { + this.BusinessKey = businessKey; + } + + public void Get( string otherKey ) + { + Names.Get( BusinessKey, EntityType.BusinessEntity ); + Descriptions.Get( BusinessKey, EntityType.BusinessEntity ); + + // + // Get the shared relationships. + // + SharedRelationshipsFrom.Direction = DirectionType.FromKey; + SharedRelationshipsFrom.Get( otherKey, BusinessKey ); + + SharedRelationshipsTo.Direction = DirectionType.ToKey; + SharedRelationshipsTo.Get( BusinessKey, otherKey ); + } + } + + public class RelatedBusinessInfoCollection : CollectionBase + { + public RelatedBusinessInfo this[ int index ] + { + get { return (RelatedBusinessInfo)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new RelatedBusinessInfo() ); + } + + public int Add( RelatedBusinessInfo relatedBusinessInfo ) + { + return List.Add( relatedBusinessInfo ); + } + + public int Add( string businessKey ) + { + return List.Add( new RelatedBusinessInfo( businessKey ) ); + } + + public void Insert( int index, RelatedBusinessInfo relatedBusinessInfo ) + { + List.Insert( index, relatedBusinessInfo ); + } + + public int IndexOf( RelatedBusinessInfo relatedBusinessInfo ) + { + return List.IndexOf( relatedBusinessInfo ); + } + + public bool Contains( RelatedBusinessInfo relatedBusinessInfo ) + { + return List.Contains( relatedBusinessInfo ); + } + + public void Remove( RelatedBusinessInfo relatedBusinessInfo ) + { + List.Remove( relatedBusinessInfo ); + } + + public void CopyTo( RelatedBusinessInfo[] array, int index ) + { + List.CopyTo( array, index ); + } + } + + public class SharedRelationshipsCollection : CollectionBase + { + public SharedRelationships this[ int index ] + { + get { return (SharedRelationships)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new SharedRelationships() ); + } + + public int Add( SharedRelationships SharedRelationships ) + { + return List.Add( SharedRelationships ); + } + + public int Add( string businessKey ) + { + return List.Add( new SharedRelationships() ); + } + + public void Insert( int index, SharedRelationships SharedRelationships ) + { + List.Insert( index, SharedRelationships ); + } + + public int IndexOf( SharedRelationships SharedRelationships ) + { + return List.IndexOf( SharedRelationships ); + } + + public bool Contains( SharedRelationships SharedRelationships ) + { + return List.Contains( SharedRelationships ); + } + + public void Remove( SharedRelationships SharedRelationships ) + { + List.Remove( SharedRelationships ); + } + + public void CopyTo( SharedRelationships[] array, int index ) + { + List.CopyTo( array, index ); + } + } + + public class SharedRelationships + { + // + // Attribute: direction + // + [XmlAttribute( "direction" )] + public DirectionType Direction; + + // + // Element: keyedReference + // + private KeyedReferenceCollection keyedReferences; + + [XmlIgnore] + public KeyedReferenceCollection KeyedReferences + { + get + { + if( null == keyedReferences ) + keyedReferences = new KeyedReferenceCollection(); + + return keyedReferences; + } + set { keyedReferences = value; } + } + + [XmlElement( "keyedReference" )] + public KeyedReferenceCollection KeyedReferencesSerialize + { + get + { + return keyedReferences; + } + set { keyedReferences = value; } + } + + public bool IsEmpty() + { + return (keyedReferences == null); + } + + public SharedRelationships() + { + } + + public void Get( string fromKey, string toKey ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_businessEntity_assertions_get"; + + sp.Parameters.Add( "@fromKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@toKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@completionStatus", SqlDbType.Int ); + + sp.Parameters.SetGuidFromString( "@fromKey", fromKey ); + sp.Parameters.SetGuidFromString( "@toKey", toKey ); + sp.Parameters.SetInt( "@completionStatus", (int)CompletionStatusType.Complete ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + KeyedReferences.Add( + reader.GetString( "keyName" ), + reader.GetString( "keyValue" ), + reader.GetKeyFromGuid( "tModelKey" ) ); + } + } + finally + { + reader.Close(); + } + } + } + + [XmlRoot( "relatedBusinessesList", Namespace=UDDI.API.Constants.Namespace )] + public class RelatedBusinessList + { + // + // Attribute: generic + // + [XmlAttribute( "generic" )] + public string Generic = Constants.Version; + + // + // Attribute: operator + // + [XmlAttribute( "operator" )] + public string OperatorName = Config.GetString( "Operator" ); + + // + // Attribute: truncated + // + [XmlAttribute( "truncated" )] + public Truncated Truncated; + + // + // Element: businessKey + // + [XmlElement( "businessKey" )] + public string BusinessKey; + + // + // Element: relatedBusinessInfos + // + private RelatedBusinessInfoCollection relatedBusinessInfos; + + [ XmlArray( "relatedBusinessInfos" ), XmlArrayItem( "relatedBusinessInfo" ) ] + public RelatedBusinessInfoCollection RelatedBusinessInfos + { + get + { + if( null == relatedBusinessInfos ) + relatedBusinessInfos = new RelatedBusinessInfoCollection(); + + return relatedBusinessInfos; + } + + set { relatedBusinessInfos = value; } + } + } + + /// ******************************************************************** + /// public class AddPublisherAssertions + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "add_publisherAssertions", Namespace=UDDI.API.Constants.Namespace )] + public class AddPublisherAssertions : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement( "authInfo" )] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: publisherAssertion + // + private PublisherAssertionCollection publisherAssertions; + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + publisherAssertions = new PublisherAssertionCollection(); + + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + + public AddPublisherAssertions() + { + } + + public void Save() + { + PublisherAssertions.Save(); + } + } + + /// ******************************************************************** + /// public class DeletePublisherAssertions + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "delete_publisherAssertions", Namespace=UDDI.API.Constants.Namespace )] + public class DeletePublisherAssertions : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement( "authInfo" )] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: publisherAssertion + // + private PublisherAssertionCollection publisherAssertions; + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + publisherAssertions = new PublisherAssertionCollection(); + + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + + public DeletePublisherAssertions() + { + } + + public void Delete() + { + PublisherAssertions.Delete(); + } + } + + /// ******************************************************************** + /// public class FindRelatedBusinesses + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "find_relatedBusinesses", Namespace=UDDI.API.Constants.Namespace )] + public class FindRelatedBusinesses : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: maxRows + // + private int maxRows = Config.GetInt( "Find.MaxRowsDefault" ); + + [XmlAttribute("maxRows")] + public int MaxRows + { + get + { + return maxRows; + } + + set + { + maxRows = Math.Min( Config.GetInt( "Find.MaxRowsDefault" ), value ); + } + } + + // + // Element: findQualifiers/findQualifier + // + private FindQualifierCollection findQualifiers; + + [XmlArray( "findQualifiers" ), XmlArrayItem( "findQualifier" )] + public FindQualifierCollection FindQualifiers + { + get + { + if( null == findQualifiers ) + findQualifiers = new FindQualifierCollection(); + + return findQualifiers; + } + + set { findQualifiers = value; } + } + + // + // Element: businessKey + // + [XmlElement( "businessKey" )] + public string BusinessKey; + + // + // Element: keyedReference + // + [XmlElement( "keyedReference" )] + public KeyedReference KeyedReference; + + /// **************************************************************** + /// public FindRelatedBusinesses [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public FindRelatedBusinesses() + { + } + + /// **************************************************************** + /// public Find + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public RelatedBusinessList Find() + { + if( MaxRows < 0 ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_FINDRELATEDBE_MAXROWSLESSTHANZERO" ); + } + + RelatedBusinessList relatedBusinessList = new RelatedBusinessList(); + + // + // Process each find constraint. + // + FindBuilder find = new FindBuilder( EntityType.BusinessEntity, FindQualifiers ); + + // + // If no search arguments are specified, return an empty result + // set. + // + + // + // Validate find parameters. + // + Utility.IsValidKey( EntityType.BusinessEntity, BusinessKey ); + + // TODO: Override may be better for these calls to KeyedReference.Validate because no parent key is used + + // + // TODO: This not an Assertion so we should not pass KeyedReferenceType.Assertion. + // + if( null != KeyedReference ) + KeyedReference.Validate( "", KeyedReferenceType.IdentifierBag ); + + try + { + // + // Read in the find results. + // + SqlDataReaderAccessor reader; + SqlStoredProcedureAccessor sp; + + sp = find.FindRelatedBusinesses( + BusinessKey, + KeyedReference, + MaxRows); + + reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + relatedBusinessList.RelatedBusinessInfos.Add( + reader.GetString( "entityKey" ) ); + } + } + finally + { + reader.Close(); + } + + if( sp.Parameters.GetBool( "@truncated" ) ) + relatedBusinessList.Truncated = Truncated.True; + else + relatedBusinessList.Truncated = Truncated.False; + + relatedBusinessList.BusinessKey = BusinessKey; + + foreach( RelatedBusinessInfo relatedBusinessInfo in relatedBusinessList.RelatedBusinessInfos ) + relatedBusinessInfo.Get( BusinessKey ); + } + catch( Exception ) + { + find.Abort(); + throw; + } + + return relatedBusinessList; + } + } + + /// ******************************************************************** + /// public class GetAssertionStatusReport + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "get_assertionStatusReport", Namespace=UDDI.API.Constants.Namespace )] + public class GetAssertionStatusReport : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement( "authInfo" )] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: completionStatus + // + private CompletionStatusType completionStatus; + + [XmlElement( "completionStatus" )] + public CompletionStatusType CompletionStatus + { + get { return completionStatus; } + set + { + try + { + completionStatus = value; + } + catch( ArgumentException ) + { + throw new UDDIException( + ErrorType.E_invalidCompletionStatus, + "UDDI_ERROR_INVALIDCOMPLETIONSTATUS_GETASSERTIONSTATUSREPORT" ); + } + } + } + + public GetAssertionStatusReport() + { + } + } + + /// ******************************************************************** + /// public class GetPublisherAssertions + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "get_publisherAssertions", Namespace=UDDI.API.Constants.Namespace )] + public class GetPublisherAssertions : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement( "authInfo" )] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + public GetPublisherAssertions() + { + } + } + + /// ******************************************************************** + /// public class SetPublisherAssertions + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "set_publisherAssertions", Namespace=UDDI.API.Constants.Namespace )] + public class SetPublisherAssertions : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute( "generic" )] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement( "authInfo" )] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: publisherAssertion + // + private PublisherAssertionCollection publisherAssertions; + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + publisherAssertions = new PublisherAssertionCollection(); + + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + + public SetPublisherAssertions() + { + } + + public PublisherAssertionDetail Set() + { + // + // Remove all existing assertions for the publisher. + // + PublisherAssertionCollection existing = new PublisherAssertionCollection(); + + // + // TODO: This Get() call is unecessary. A stored proc that accepts the PUID could do this easily. + // In a scenario where a large number of assertions are used, returning all the assertions could get expensive. + // + + // + // We need to save this to use it in the PublisherAssertionDetail return structure + // + string authorizedName = existing.Get(); + existing.Delete(); + + // + // Save each of the assertions specified by the set_publisherAssertions + // message. + // + PublisherAssertions.Save(); + + // + // Get a list of all the current assertions for this publisher. + // + PublisherAssertionDetail detail = new PublisherAssertionDetail(); + detail.AuthorizedName = authorizedName; + detail.PublisherAssertions = PublisherAssertions; + + return detail; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/api/authentication.cs b/inetsrv/uddi/source/api/authentication.cs new file mode 100644 index 0000000..0413fdd --- /dev/null +++ b/inetsrv/uddi/source/api/authentication.cs @@ -0,0 +1,1455 @@ +using System; +using System.IO; +using System.Net; +using System.Text; +using System.Xml; +using System.Xml.Serialization; +using System.Security.Principal; +using System.Security.Cryptography; +using System.Runtime.InteropServices; +using Microsoft.Win32; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API.Authentication +{ + /// ******************************************************************** + /// public DiscardAuthToken + /// -------------------------------------------------------------------- + /// + /// Represents a discard_authToken message. + /// + /// ******************************************************************** + /// + [XmlRootAttribute("discard_authToken", Namespace=UDDI.API.Constants.Namespace)] + public class DiscardAuthToken : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + [XmlElement("authInfo")] + public string AuthInfo = ""; + } + + /// ******************************************************************** + /// public GetAuthToken + /// -------------------------------------------------------------------- + /// + /// Represents a get_authToken message. + /// + /// ******************************************************************** + /// + [XmlRootAttribute("get_authToken", Namespace=UDDI.API.Constants.Namespace)] + public class GetAuthToken : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: userID + // + [XmlAttribute("userID")] + public string UserID = ""; + + // + // Attribute: cred + // + [XmlAttribute("cred")] + public string Cred = ""; + } + + /// ******************************************************************** + /// public AuthToken + /// -------------------------------------------------------------------- + /// + /// Represents an authToken. + /// + /// ******************************************************************** + /// + [XmlRootAttribute("authToken", Namespace=UDDI.API.Constants.Namespace)] + public class AuthToken + { + // + // Attribute: operator + // + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + // + // Attribute: generic + // + [XmlAttribute("generic")] + public string Generic = Constants.Version; + + // + // Element: authInfo + // + [XmlElement("authInfo")] + public string AuthInfo; + } + + public interface IAuthenticator + { + bool GetAuthenticationInfo( string userid, string password, out string ticket ); + bool Authenticate( string strTicket, int timeWindow ); + } + + public class WindowsAuthenticator : IAuthenticator + { + public bool GetAuthenticationInfo( string userid, string password, out string ticket ) + { + try + { + // + // Verify that a userid and password were not specifed + // + Debug.Verify( Utility.StringEmpty( userid ) && Utility.StringEmpty( password ), "UDDI_ERROR_FATALERROR_USERIDANDPASSINWINAUTH" ); + + // + // This form of authentication requires the impersonation of the caller + // on the current thread of activity. + // + + // + // The ticket will not be used for this form of authentication + // + ticket = ""; + + // + // Setup the user credentials so we can verify that the user is a publisher + // + IPrincipal principal = System.Threading.Thread.CurrentPrincipal; + Context.User.SetRole( principal ); + } + catch( Exception exception ) + { + // + // Log the real exception + // + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, exception.ToString() ); + + // + // Preserve the error number if it was a UDDIException; but DO NOT preserve the error + // message. We want the error message in the log, but not shown to the user for security + // reasons. + // + UDDIException uddiException = exception as UDDIException; + if( null != uddiException ) + { + throw new UDDIException( uddiException.Number, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + } + return true; + } + + public bool Authenticate( string strTicket, int timeWindow ) + { + try + { + // + // TODO: Verify strTicket is empty + // + + // + // No timeout check is possible for Windows Authentication + // + IPrincipal principal = System.Threading.Thread.CurrentPrincipal; + Context.User.SetRole( principal ); + } + catch( Exception exception ) + { + // + // Log the real exception + // + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, exception.ToString() ); + + // + // Preserve the error number if it was a UDDIException; but DO NOT preserve the error + // message. We want the error message in the log, but not shown to the user for security + // reasons. + // + UDDIException uddiException = exception as UDDIException; + if( null != uddiException ) + { + throw new UDDIException( uddiException.Number, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + } + return true; + } + } + + public class UDDIAuthenticator : IAuthenticator + { + const string ResetKeyDateFormat = "MM/dd/yyyy HH:mm:ss"; + + [DllImport("advapi32.dll", SetLastError=true)] + public static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword, + int dwLogonType, int dwLogonProvider, out int phToken); + + private string DomainFromUserID( string userid ) + { + return userid.Substring( 0, userid.IndexOf( '\\' ) ); + } + + private string BaseUserNameFromUserID( string userid ) + { + return userid.Substring( userid.IndexOf( '\\' ) + 1 ); + } + + public bool GetAuthenticationInfo( string userid, string password, out string ticket ) + { + try + { + Debug.VerifySetting( "Security.Key" ); + Debug.VerifySetting( "Security.IV" ); + + ticket = null; + + // + // TODO: Need to support UPN formed user names + // + + // + // TODO: Need to look at use of this call on Domain controllers + // + + // + // The user account must have Log On Locally permission on the local computer. + // This permission is granted to all users on workstations and servers, + // but only to administrators on domain controllers. + // + + // + // Check userid and password by logging in + // + int windowstoken; // The Windows NT user token. + string baseName = BaseUserNameFromUserID( userid ); + string domain = DomainFromUserID( userid ); + + bool loggedOn = LogonUser( baseName,// User name. + domain, // Domain name. + password, // Password. + 3, // Logon type = LOGON32_LOGON_NETWORK + 0, // Logon provider = LOGON32_PROVIDER_DEFAULT + out windowstoken ); // The user token for the specified user is returned here. + + if( !loggedOn ) + { + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, userid + " failed logon. Error code was " + Marshal.GetLastWin32Error().ToString() ); + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + + WindowsIdentity wi = new WindowsIdentity( new IntPtr( windowstoken ) ); + WindowsPrincipal principal = new WindowsPrincipal( wi ); + Context.User.SetRole( principal ); + + // + // Generate the ticket + // + MemoryStream strm = new MemoryStream(); + Context.User.Serialize( strm ); + + // + // Get a key and initialization vector. + // + byte[] key = null; + byte[] iv = null; + GetSecurityPair( out key, out iv ); + + // + // Encrypt the ticket information + // + MemoryStream strmEncrypted = new MemoryStream(); + EncryptData( strm, strmEncrypted, key, iv ); + ticket = Convert.ToBase64String( strmEncrypted.GetBuffer(), 0, (int) strmEncrypted.Length ); +#if DEBUG + Debug.Write( SeverityType.Info, CategoryType.Soap, "Ticket Out:----------\n" + ticket ); +#endif + } + catch( Exception exception ) + { + // + // Log the real exception + // + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, exception.ToString() ); + + // + // Preserve the error number if it was a UDDIException; but DO NOT preserve the error + // message. We want the error message in the log, but not shown to the user for security + // reasons. + // + UDDIException uddiException = exception as UDDIException; + if( null != uddiException ) + { + throw new UDDIException( uddiException.Number, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + } + + return true; + } + + public bool Authenticate( string strTicket, int timeWindow ) + { + try + { + Debug.VerifySetting( "Security.Key" ); + Debug.VerifySetting( "Security.IV" ); + Debug.Verify( null != strTicket && strTicket.Length > 0, "UDDI_ERROR_AUTHTOKENREQUIRED_NOTOKENPUBLISHATTEMPT", ErrorType.E_authTokenRequired ); +#if DEBUG + Debug.Write( SeverityType.Info, CategoryType.Soap, "Ticket In:----------\n" + strTicket ); +#endif + + // + // Get a key and initialization vector. + // + byte[] key = null; + byte[] iv = null; + GetSecurityPair( out key, out iv ); + + // + // If the ticket cannot be decoded or decrypted throw an E_authTokenRequired + // + MemoryStream strm = new MemoryStream(); + try + { + byte[] ticket = Convert.FromBase64String( strTicket ); + + // + // Decrypt the ticket into a stream + // + MemoryStream strmEncrypted = new MemoryStream( ticket ); + DecryptData( strmEncrypted, strm, key, iv ); + } + catch( Exception ) + { + throw new UDDIException( UDDI.ErrorType.E_authTokenRequired, "UDDI_ERROR_AUTHTOKENREQUIRED_INVALIDOREXPIRED" ); + } + + // + // Deserialize the stream into the user class + // and setup the context's user information + // + XmlSerializer serializer = XmlSerializerManager.GetSerializer( typeof( UserInfo ) ); + + Context.User = (UserInfo) serializer.Deserialize( strm ); + + // + // Check the age of the token + // + Context.User.CheckAge( timeWindow ); + } + catch( Exception exception ) + { + // + // Log the real exception + // + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, exception.ToString() ); + + // + // Preserve the error number if it was a UDDIException; but DO NOT preserve the error + // message. We want the error message in the log, but not shown to the user for security + // reasons. + // + UDDIException uddiException = exception as UDDIException; + if( null != uddiException ) + { + throw new UDDIException( uddiException.Number, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + } + + return true; + } + + // + // This method returns a security key and initialization vector to be used in decryption or encryption + // algorithms. If the key has timed out, a new one is created. This method was added as part of the changes needed to remove our dependency on SQLAgent. + // + private void GetSecurityPair( out byte[] key, out byte[] iv ) + { + // + // Make sure we have the settings that we need. + // + Debug.VerifySetting( "Security.KeyAutoReset" ); + Debug.VerifySetting( "Security.KeyLastResetDate" ); + Debug.VerifySetting( "Security.KeyTimeout" ); + Debug.VerifySetting( "Security.Key" ); + Debug.VerifySetting( "Security.IV" ); + + key = null; + iv = null; + + // + // If we aren't supposed to automatically generate keys, then we don't care if the key has expired, so + // just use the current values. + // + if( 1 == Config.GetInt( "Security.KeyAutoReset" ) ) + { + // + // Since we are allowed to generate keys, see if we need to. + // + + // + // Get the current date + // + DateTime current = DateTime.Now; + + // + // Get the last time the key was reset. + // + // DateTime lastReset = DateTime.Parse( Config.GetString( "Security.KeyLastResetDate" ) ); + + // + // 739955 - Make sure date is parsed in the same format it was written. + // + DateTime lastReset = UDDILastResetDate.Get(); + + // + // Get the timeout (days) + // + int timeOutDays = Config.GetInt( "Security.KeyTimeout" ); + + // + // Has the key expired? + // + DateTime expiration = lastReset.AddDays( timeOutDays ); + + if( current > expiration ) + { + try + { + // + // Generate new security information. + // + SymmetricAlgorithm sa = SymmetricAlgorithm.Create(); + + sa.GenerateKey(); + key = sa.Key; + + sa.GenerateIV(); + iv = sa.IV; + + // + // Store the new key, initialization vector, and current time. + // + + // + // 739955 - Make sure date is parsed in the same format it was written. + // + UDDILastResetDate.Set( current ); + Config.SetString( "Security.Key", Convert.ToBase64String( key ) ); + Config.SetString( "Security.IV", Convert.ToBase64String( iv ) ); + + // + // Make sure our current configuration is reading these values. TODO AddSetting is not + // public, so we have to Refresh, this is pretty expensive, but it should only happen + // once a week (by default). + // + Config.Refresh(); + } + catch( Exception exception ) + { + // + // Don't let any exceptions propogate here, we'll catch them + // and just throw a generic one. We don't want to reveal too much + // information if we don't have to. + // + key = null; + iv = null; + + // + // Log the real exception + // + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, exception.ToString() ); + + // + // Preserve the error number if it was a UDDIException; but DO NOT preserve the error + // message. We want the error message in the log, but not shown to the user for security + // reasons. + // + UDDIException uddiException = exception as UDDIException; + if( null != uddiException ) + { + throw new UDDIException( uddiException.Number, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + } + } + } + + // + // If we don't have a value for the pair at this point, use the original values. + // + if( key == null && iv == null ) + { + key = Convert.FromBase64String( Config.GetString( "Security.Key" ) ); + iv = Convert.FromBase64String( Config.GetString( "Security.IV" ) ); + } + } + + private static void EncryptData( Stream input, Stream output, byte[] key, byte[] iv ) + { + byte[] buffer = new byte[100]; + long bytesRead = 0; + long bytesTotal = input.Length; + + // + // Creates the default implementation, which is RijndaelManaged (AES). + // + SymmetricAlgorithm sa = SymmetricAlgorithm.Create(); + CryptoStream encodingStream = new CryptoStream( output, sa.CreateEncryptor( key, iv ), CryptoStreamMode.Write ); + + // + // Encrypt the bytes in the buffer in 100 bytes at a time + // + while( bytesRead < bytesTotal ) + { + int n = input.Read( buffer, 0, 100 ); + encodingStream.Write( buffer, 0, n ); + bytesRead = bytesRead + n; + } + + encodingStream.FlushFinalBlock(); + input.Position = 0; + output.Position = 0; + } + + private static void DecryptData( Stream input, Stream output, byte[] key, byte[] iv ) + { + byte[] buffer = new byte[100]; + long bytesRead = 0; + long bytesTotal = input.Length; + + // + // Creates the default implementation, which is RijndaelManaged. + // + SymmetricAlgorithm sa = SymmetricAlgorithm.Create(); + CryptoStream decodingStream = new CryptoStream( output, sa.CreateDecryptor( key, iv ), CryptoStreamMode.Write ); + + // + // Encrypt the bytes in the buffer in 100 bytes at a time + // + while( bytesRead < bytesTotal ) + { + int n = input.Read( buffer, 0, 100 ); + decodingStream.Write( buffer, 0, n ); + bytesRead = bytesRead + n; + } + + decodingStream.FlushFinalBlock(); + input.Position = 0; + output.Position = 0; + } + } + + public class PassportAuthenticator : IAuthenticator + { + public bool GetAuthenticationInfo( string userid, string password, out string ticket ) + { + try + { + // + // TODO: Should we generate and use our own ticket? + // + PassportAuthenticationHelper helper = new PassportAuthenticationHelper(); + ticket = helper.AuthenticateUser( userid, password, false ); + Context.User.SetPublisherRole( userid ); + } + catch( Exception exception ) + { + // + // Log the real exception + // + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, exception.ToString() ); + + // + // Preserve the error number if it was a UDDIException; but DO NOT preserve the error + // message. We want the error message in the log, but not shown to the user for security + // reasons. + // + UDDIException uddiException = exception as UDDIException; + if( null != uddiException ) + { + throw new UDDIException( uddiException.Number, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + } + + return true; + } + + public bool Authenticate( string strTicket, int timeWindow ) + { + try + { + PassportAuthenticationHelper helper = new PassportAuthenticationHelper(); + helper.ValidateAuthInfo( strTicket, timeWindow ); + + string userID; + string email; + helper.GetUserInfo( strTicket, out userID, out email ); + Context.User.SetPublisherRole( userID ); + Context.User.Email = email; + } + catch( Exception exception ) + { + // + // Log the real exception + // + Debug.Write( SeverityType.FailAudit, CategoryType.Authorization, exception.ToString() ); + + // + // Preserve the error number if it was a UDDIException; but DO NOT preserve the error + // message. We want the error message in the log, but not shown to the user for security + // reasons. + // + UDDIException uddiException = exception as UDDIException; + if( null != uddiException ) + { + throw new UDDIException( uddiException.Number, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_LOGINFAILED" ); + } + } + + return true; + } + } + + /// **************************************************************** + /// class PassportAuthenticationHelper + /// ---------------------------------------------------------------- + /// + /// Methods for authenticating users against the Passport + /// authentication site. + /// + /// **************************************************************** + /// + class PassportAuthenticationHelper + { + private const int PassportEmailValidated = 0x0001; + + // + // SECURITY: This interval should be configurable + // + private readonly TimeSpan refreshInterval = TimeSpan.FromDays( 1 ); + + private PassportLib.Manager passport = null; + private XmlDocument clientXml = null; + private int keyVersion = 0; + + /// **************************************************************** + /// public Authenticator [constructor] + /// ---------------------------------------------------------------- + /// + /// Constructs a new authentication object. + /// + /// **************************************************************** + /// + public PassportAuthenticationHelper() + { + Debug.Enter(); + + // + // Retrieve Passport key version. + // + RegistryKey key = Registry.LocalMachine.OpenSubKey( @"Software\Microsoft\Passport" ); + + try + { + keyVersion = Convert.ToInt32( key.GetValue( "CurrentKey", 1 ) ); + } + finally + { + key.Close(); + } + + // + // Create an instance of the Passport Manager for this object. + // + passport = new PassportLib.Manager(); + + // + // TODO: Need to centralize default values such as 100 for connection limit + // + + // + // Set the connection limit for the webclient. + // + ServicePointManager.DefaultConnectionLimit = + Config.GetInt( "Passport.ConnectionLimit", 100 ); + + Debug.Leave(); + } + + /// **************************************************************** + /// public AuthenticateUser + /// ---------------------------------------------------------------- + /// + /// Authenticates a user by sending the specified userId and + /// password to the appropriate Passport authentication site. + /// + /// ---------------------------------------------------------------- + /// + /// The full user id for the user to be verified. This must be + /// of the form user@domain. + /// + /// + /// + /// The password of the user to authenticate. + /// + /// + /// + /// Specifies whether the user should remain logged into the + /// site. + /// + /// ---------------------------------------------------------------- + /// + /// Returns an authorization token, if successful. + /// + /// ---------------------------------------------------------------- + /// + /// An authorization token is simply a concatenation of the + /// passport ticket and profile, separated by a semicolon. + /// + /// **************************************************************** + /// + public string AuthenticateUser( string userId, string password, bool savePassword ) + { + Debug.Enter(); + Debug.Verify( !Utility.StringEmpty( userId ), "UDDI_ERROR_FATALERROR_NULLUSERID" ); + Debug.Verify( !Utility.StringEmpty( password ), "UDDI_ERROR_FATALERROR_NULLPASSWORD" ); + Debug.VerifySetting( "Passport.SiteID" ); + Debug.VerifySetting( "Passport.ReturnURL" ); + + string domain = ""; + string authUrl = ""; + string authInfo = ""; + + try + { + // + // The authentication URL depends on the user's domain. First parse off the + // domain (i.e. user@domain) using the Passport manager. + // + try + { + domain = passport.DomainFromMemberName( userId ); + } + catch( Exception ) + { + Debug.OperatorMessage( + SeverityType.FailAudit, + CategoryType.Authorization, + OperatorMessageType.InvalidUserId, + "Invalid format for user ID. Must be in the form of user@domain: " + userId ); + + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_BADFORMAT" ); + } + + Debug.Write( + SeverityType.Info, + CategoryType.Authorization, + "Got domain=" + domain + " for user=" + userId ); + + // + // Lookup the URL we should use to authenticate users from this + // domain. + // + authUrl = GetLoginURL( domain ); + + Debug.Write( + SeverityType.Info, + CategoryType.Authorization, + "Obtained authorization URL=" + authUrl ); + + // + // Append the site id and return url to the authorization url. + // + authUrl += "?id=" + Config.GetInt( "Passport.SiteID" ).ToString() + + "&ru=" + Config.GetString( "Passport.ReturnURL" ) + "&kv=" + keyVersion.ToString(); + + // + // Create the login message. + // + string loginMessage = + "" + + "" + + "" + + "" + userId + "" + + "" + password + "" + + "" + ( true == savePassword ? "true" : "false" ) + "" + + "" + + ""; + + byte[] requestData = Encoding.ASCII.GetBytes( loginMessage ); + + // + // Prepare the web request. + // + WebRequest webRequest = WebRequest.Create( authUrl ); + + string proxy = Config.GetString( "Proxy", null ); + + if( !Utility.StringEmpty( proxy ) ) + webRequest.Proxy = new WebProxy( proxy, true ); + + webRequest.Method = "POST"; + webRequest.ContentType = "text/xml"; + webRequest.ContentLength = requestData.Length; + webRequest.Timeout = Config.GetInt( "Passport.Timeout", 30000 ); + + Stream stream; + + stream = webRequest.GetRequestStream(); + stream.Write( requestData, 0, requestData.Length ); + stream.Close(); + + // + // Post the data to the server. + // +#if DEBUG + Debug.Write( + SeverityType.Info, + CategoryType.Authorization, + "Posting XML login message: " + loginMessage ); +#endif + + // + // SECURITY: try/finally for managing the stream + // and webrequest in cases of failure + // + WebResponse webResponse = webRequest.GetResponse(); + stream = webResponse.GetResponseStream(); + + // + // Retrieve the response. + // + StreamReader reader = new StreamReader( stream ); + string response = reader.ReadToEnd(); + reader.Close(); + + stream.Close(); + webResponse.Close(); + + // + // Process the response. If the response data contains Success="true", + // then the user has been authenticated + // + if( "true" != Utility.ParseDelimitedToken( "Success=\"", "\"", response ) ) + { + // + // SECURITY: FailAudit this login failure + // + Debug.Write( + SeverityType.Info, + CategoryType.Authorization, + "Login failed for user " + userId + "; response did not include attribute Success=true.\r\n" + response ); + + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_FAILED" ); + } + + // + // Retrieve the associated ticket and profile. + // + string redirectUrl = Utility.ParseDelimitedToken( "", "", response ); + string ticket = Utility.ParseDelimitedToken( "&t=", "&p=", redirectUrl ); + string profile = Utility.ParseDelimitedToken( "&p=", null, redirectUrl ); + + if( null == ticket || null == profile ) + { + Debug.Write( + SeverityType.FailAudit, + CategoryType.Authorization, + "Login failed for user " + userId + "; response did not include Success=true.\r\n" + response ); + + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_FAILED" ); + } + + // + // Build the authInfo from the ticket and profile. + // + authInfo = ticket + ";" + profile; + + Debug.Write( + SeverityType.PassAudit, + CategoryType.Authorization, + "User " + userId + " authenticated.\r\nauthInfo=" + authInfo ); + + Debug.Leave(); + + return authInfo; + } + catch( UDDIException ) + { + throw; + } + catch( WebException e ) + { + // + // A web exception is thrown when the Passport server is + // unavailable or returns an error message. + // + string message = "Error authenticating user\r\n\r\n"; + + if( null != e.Response ) + { + StreamReader reader = new StreamReader( e.Response.GetResponseStream(), Encoding.UTF8 ); + string response = reader.ReadToEnd(); + reader.Close(); + + string errorCode = Utility.ParseDelimitedToken( "Error Code=\"", "\"", response ); + + // + // Check to make sure an error code was returned. If it was, + // we can provide a little more fidelity in our error + // reporting. + // + if( null != errorCode ) + message += "Passport error: " + ParsePassportErrorCode( errorCode ) + "\r\n\r\n"; + + message += "Response stream:\r\n" + response + "\r\n\r\n"; + } + else + { + message += "Passport error: unknown error communicating with Passport\r\n\r\n"; + } + + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Authorization, + OperatorMessageType.PassportSiteUnavailable, + message + e.ToString() ); + + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_AUTHENTICATIONFAILED" ); + } + catch( Exception e ) + { + // + // General exception handling. + // + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Authorization, + OperatorMessageType.PassportSiteUnavailable, + "Error authenticating user.\r\n\r\n" + e.ToString() ); + + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_AUTHENTICATIONFAILED" ); + } + } + + /// **************************************************************** + /// public ValidateAuthInfo + /// ---------------------------------------------------------------- + /// + /// Validates an authorization token. + /// + /// ---------------------------------------------------------------- + /// + /// The authorization token. + /// + /// + /// + /// Time in seconds since login after which an authorization + /// token is considered expired. + /// + /// **************************************************************** + /// + public void ValidateAuthInfo( string authInfo, int timeWindow ) + { + Debug.Enter(); + Debug.Verify( null != authInfo, "UDDI_ERROR_FATALERROR_NULLAUTHINFO" ); + + // + // Parse the ticket and profile from the authInfo string. + // + int separator = authInfo.IndexOf( ";" ); + + if( -1 == separator ) + { + Debug.OperatorMessage( + SeverityType.FailAudit, + CategoryType.Authorization, + OperatorMessageType.InvalidTicketFormat, + "Invalid ticket format: " + authInfo ); + + throw new UDDIException( + ErrorType.E_authTokenRequired, + "UDDI_ERROR_AUTHTOKENREQUIRED_INVALIDOREXPIRED" ); + } + + string ticket = authInfo.Substring( 0, separator ); + string profile = authInfo.Substring( separator + 1 ); + + // + // Attempt to authenticate the ticket and profile. + // + try + { + passport.OnStartPageManual( ticket, null, null, null, null, null ); + + if( false == passport.IsAuthenticated( timeWindow, false, false ) ) + { + Debug.Write( + SeverityType.Info, + CategoryType.Authorization, + "Authentication failed; ticket is invalid or has expired" ); + + throw new UDDIException( + ErrorType.E_authTokenExpired, + "UDDI_ERROR_AUTHTOKENREQUIRED_INVALIDOREXPIRED" ); + } + + Debug.Write( + SeverityType.PassAudit, + CategoryType.Authorization, + "Authentication successful" ); + + Debug.Leave(); + } + catch( UDDIException ) + { + throw; + } + catch( Exception e ) + { + Debug.Write( + SeverityType.Error, + CategoryType.Authorization, + "Authentication failed; " + e.Message ); + + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_AUTHENTICATIONFAILED" ); + } + } + + /// **************************************************************** + /// public GetUserInfo + /// ---------------------------------------------------------------- + /// + /// Gets the user information associated with a specified + /// authorization token. + /// + /// ---------------------------------------------------------------- + /// + /// The authorization token. + /// + /// + /// + /// [out] The member id for the user. This is different than + /// the user id which was used to login. + /// + /// + /// + /// [out] The user's preferred email address. + /// + /// **************************************************************** + /// + public void GetUserInfo( string authInfo, out string puid, out string userEmail ) + { + Debug.Enter(); + Debug.Verify( null != authInfo, "UDDI_ERROR_FATALERROR_NULLAUTHINFO" ); + + // + // Parse the ticket and profile from the authInfo string. + // + int separator = authInfo.IndexOf( ";" ); + + if( -1 == separator ) + { + Debug.OperatorMessage( + SeverityType.FailAudit, + CategoryType.Authorization, + OperatorMessageType.InvalidTicketFormat, + "Invalid ticket format: " + authInfo ); + + throw new UDDIException( + ErrorType.E_authTokenRequired, + "UDDI_ERROR_AUTHTOKENREQUIRED_INVALIDFORMAT" ); + } + + string ticket = authInfo.Substring( 0, separator ); + string profile = authInfo.Substring( separator + 1 ); + + // + // Get the user's preferred email. This could change over time + // since the user could change this on the Passport site, so + // we'll always get the most recent value from the user's profile. + // + userEmail = (string)GetPropertyFromProfile( ticket, profile, "PreferredEmail" ); + + // + // Get the user's PUID. Since the PUID is a 64-bit value, we'll need + // to build this from the low and high 32-bit values (Passport doesn't + // store it as a single 64-bit value). + // + /* + object idHigh = GetPropertyFromProfile( ticket, profile, "MemberIDHigh" ); + Debug.Verify( null != idHigh, "Unable to retrieve Passport member ID." ); + + object idLow = GetPropertyFromProfile( ticket, profile, "MemberIDLow" ); + Debug.Verify( null != idLow, "Unable to retrieve Passport member ID." ); + + puid = ((int)idHigh).ToString( "X8" ) + ((int)idLow).ToString( "X8" ); + */ + + // + // they now provide a single property to get the PUID + // + puid = passport.HexPUID; + + Debug.Leave(); + } + + /// **************************************************************** + /// private GetPropertyFromProfile + /// ---------------------------------------------------------------- + /// + /// Retrieves a property from the given user profile. + /// + /// ---------------------------------------------------------------- + /// + /// Ticket for the authenticated user. + /// + /// + /// + /// Profile for the authenticated user. + /// + /// + /// + /// The name of the property to retrieve. + /// + /// ---------------------------------------------------------------- + /// + /// The value of the property. + /// + /// **************************************************************** + /// + private object GetPropertyFromProfile( string ticket, string profile, string propertyName ) + { + Debug.Assert( null != ticket, "ticket cannot be null" ); + Debug.Assert( null != profile, "profile cannot be null" ); + Debug.Assert( null != propertyName, "propertyName cannot be null" ); + + object val = null; + + try + { + passport.OnStartPageManual( ticket, profile, null, null, null, null ); + val = passport[ propertyName ]; + + Debug.Write( + SeverityType.Info, + CategoryType.Authorization, + "Current Property: " + propertyName + "\r\n" + + "Current Value: " + ((null!=val)?val:"(null)" ) + "\r\n" + + "MemberIDHigh: " + passport[ "MemberIDHigh" ] + "\r\n" + + "MemberIDLow: " + passport[ "MemberIDLow" ] + "\r\n" + + "PreferredEmail: " + passport[ "PreferredEmail" ] + "\r\n" + + "ProfileVersion: " + passport[ "ProfileVersion" ] + "\r\n" + ); + + return val; + } + catch( Exception ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_ERRORRETRIEVINGPROFILEDATA", + propertyName + ); + } + } + + /// **************************************************************** + /// public GetLoginURL + /// ---------------------------------------------------------------- + /// + /// Retrieves the XML Login URL for the given domain. + /// + /// ---------------------------------------------------------------- + /// + /// The domain name. + /// + /// ---------------------------------------------------------------- + /// + /// The XML Login URL. + /// + /// **************************************************************** + /// + public string GetLoginURL( string domain ) + { + Debug.VerifySetting( "Passport.ClientXmlFile" ); + + string location = Config.GetString( "Passport.ClientXmlFile" ); + + // + // Make sure the Client.xml file exists and is loaded. + // + if( !File.Exists( location ) ) + { + UpdateClientXml(); + } + + // + // Check to see if it is time for a periodic refresh + // of the Client.xml file. + // + TimeSpan age = DateTime.Now.Subtract( File.GetLastWriteTime( location ) ); + + if( age >= refreshInterval ) + { + UpdateClientXml(); + } + + // + // If the Client.xml file is still not loaded, load it now. + // + if( null == clientXml ) + { + clientXml = new XmlDocument(); + clientXml.Load( location ); + } + + // + // Make sure the Client.xml hasn't expired. + // + DateTime validUntil = DateTime.Parse( clientXml.DocumentElement.Attributes.GetNamedItem( "ValidUntil" ).Value ); + + if( validUntil < DateTime.Now ) + UpdateClientXml(); + + // + // Retrieve the XMLLogin element text for the specified domain. + // + if( clientXml.HasChildNodes ) + { + XmlNode node = clientXml.SelectSingleNode( "//Domain[@Name=\"" + domain + "\"]/XMLLogin" ); + + if( null != node ) + return node.InnerText; + + // + // We couldn't find the specified domain, so ll try the default + // XML login URL. + // + node = clientXml.SelectSingleNode( "//Domain[@Name=\"default\"]/XMLLogin" ); + + if( null != node ) + return node.InnerText; + } + + // + // We were unable to find a login URL for the domain. + // + + Debug.OperatorMessage( + SeverityType.FailAudit, + CategoryType.Authorization, + OperatorMessageType.UnknownLoginURL, + "Could not find login URL for user from domain '" + domain + "'" ); + + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_ERRORAUTHENTICATINGINDOMAIN", + domain); + } + + /// **************************************************************** + /// public UpdateClientXml + /// ---------------------------------------------------------------- + /// + /// Retrieves a fresh copy of the Client.xml file from + /// Passport. + /// + /// **************************************************************** + /// + public void UpdateClientXml() + { + Debug.VerifySetting( "Passport.ClientXmlURL" ); + Debug.VerifySetting( "Passport.ClientXmlFile" ); + + string url = Config.GetString( "Passport.ClientXmlURL" ); + + try + { + WebRequest request = WebRequest.Create( url ); + + string proxy = Config.GetString( "Proxy", null ); + + if( !Utility.StringEmpty( proxy ) ) + request.Proxy = new WebProxy( proxy, true ); + + request.Timeout = Config.GetInt( "Passport.Timeout", 30000 ); + + WebResponse response = request.GetResponse(); + + try + { + clientXml = new XmlDocument(); + + clientXml.Load( response.GetResponseStream() ); + clientXml.Save( Config.GetString( "Passport.ClientXmlFile" ) ); + } + finally + { + response.Close(); + } + } + catch( Exception e ) + { + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Authorization, + OperatorMessageType.CannotRetrieveClientXml, + "Error retrieving Client.xml from '" + url + "'\n\nDetails:\n" + e.ToString() ); + + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_ERRORCOMMUNICATINGWITHPASSPORT" ); + } + } + + /// **************************************************************** + /// private ParsePassportErrorCode [static] + /// ---------------------------------------------------------------- + /// + /// Returns an appropriate message for the Passport error + /// code. + /// + /// ---------------------------------------------------------------- + /// + /// The error code returned by Passport. + /// + /// ---------------------------------------------------------------- + /// + /// The error message. + /// + /// **************************************************************** + /// + private static string ParsePassportErrorCode( string errorCode ) + { + // + // Check for a general network error. This indicates the service + // is unavailable. + // + if( 'n' == errorCode[0] ) + return "Service unavailable"; + + // + // Return an appropriate message for the error code. + // + switch( errorCode ) + { + case "e1": + return "Missing member name and password"; + + case "e2": + return "Missing member name"; + + case "e3": + return "Missing password"; + + case "e5a": + return "Incorrect password for given member name"; + + case "e5b": + return "Member name does not exist"; + + case "e5d": + return "Member name incomplete"; + + case "e8": + return "Missing Passport site ID (configuration error)"; + + case "e8a": + return "Missing Passport return URL (configuration error)"; + + case "e6": + goto case "e9"; + + case "e9": + return "Member has a KIDS Passport that does not have parental consent"; + + case "e10": + return "Password lockout. Several incorrect password attempted for member in a short time duration"; + + case "e11": + return "Member name or domain exceed 64 characters or password exceeded 16 characters"; + + case "e13": + return "General XML parsing or validation failure"; + + case "e13a": + return "Login sent to wrong domain authority (see referral tag)"; + + case "e14": + return "Malformed request (missing LoginRequest element)"; + + case "g1": + return "Malformed request (missing ClientInfo element)"; + + case "p1": + return "Invalid version attribute specified in ClientInfo element"; + + default: + return "Unknown Passport error code '" + errorCode + "'."; + } + } + } +} diff --git a/inetsrv/uddi/source/api/binding.cs b/inetsrv/uddi/source/api/binding.cs new file mode 100644 index 0000000..99f9ef1 --- /dev/null +++ b/inetsrv/uddi/source/api/binding.cs @@ -0,0 +1,1059 @@ +using System; +using System.Data; +using System.Collections; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; +using UDDI.Replication; +using UDDI.API.ServiceType; + +namespace UDDI.API.Binding +{ + /// **************************************************************** + /// class BindingTemplate + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + [XmlRootAttribute( "bindingTemplate", Namespace=UDDI.API.Constants.Namespace )] + public class BindingTemplate : EntityBase + { + // + // Attribute: bindingKey + // + [XmlAttribute("bindingKey")] + public string BindingKey = ""; + + // + // Attribute: serviceKey + // + [XmlAttribute("serviceKey")] + public string ServiceKey = ""; + + // + // Element: description + // + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // + // Element: accessPoint + // + private AccessPoint accessPoint; + + [XmlElement("accessPoint")] + public AccessPoint AccessPointSerialize + { + get + { + if( null != accessPoint && accessPoint.ShouldSerialize ) + return accessPoint; + + return null; + } + + set { accessPoint = value; } + } + + [XmlIgnore] + public AccessPoint AccessPoint + { + get + { + if( null == accessPoint ) + accessPoint = new AccessPoint(); + + return accessPoint; + } + } + + // + // Element: hostingRedirector + // + private HostingRedirector hostingRedirector; + + [XmlElement("hostingRedirector")] + public HostingRedirector HostingRedirectorSerialize + { + get + { + if( null != hostingRedirector && hostingRedirector.ShouldSerialize ) + return hostingRedirector; + + return null; + } + + set + { + hostingRedirector = value; + } + } + + [XmlIgnore] + public HostingRedirector HostingRedirector + { + get + { + if( null == hostingRedirector ) + hostingRedirector = new HostingRedirector(); + + return hostingRedirector; + } + } + + // + // Element: tModelInstanceDetails + // + private TModelInstanceInfoCollection tModelInstanceInfos; + + [ XmlArray( "tModelInstanceDetails" ), XmlArrayItem( "tModelInstanceInfo" ) ] + public TModelInstanceInfoCollection TModelInstanceInfos + { + get + { + if( null == tModelInstanceInfos ) + tModelInstanceInfos = new TModelInstanceInfoCollection(); + + return tModelInstanceInfos; + } + + set { tModelInstanceInfos = value; } + } + + [XmlIgnore] + public override UDDI.EntityType EntityType + { + get { return EntityType.BindingTemplate; } + } + + [XmlIgnore] + public override string EntityKey + { + get { return BindingKey; } + } + + /// **************************************************************** + /// public BindingTemplate [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public BindingTemplate() + { + } + + /// **************************************************************** + /// public BindingTemplate [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public BindingTemplate( string bindingKey ) + { + BindingKey = bindingKey; + } + + /// **************************************************************** + /// public Delete + /// ---------------------------------------------------------------- + /// + /// Removes the specified bindingTemplate from the database. + /// + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// The bindingKey must be set prior to execution of this call. + /// + /// **************************************************************** + /// + public override void Delete() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_bindingTemplate_delete" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@bindingKey", BindingKey ); + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + sp.ExecuteNonQuery(); + + // + // Save the change log entry. + // + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + changeRecord.Payload = new ChangeRecordDelete( EntityType.BindingTemplate, BindingKey ); + changeRecord.Log(); + } + } + + /// **************************************************************** + /// public Get + /// ---------------------------------------------------------------- + /// + /// Retrieves the bindingTemplate details from the database. + /// + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// The bindingKey must be set prior to execution of this call. + /// + /// **************************************************************** + /// + public override void Get() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_bindingTemplate_get_batch" ); + + sp.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + sp.Parameters.Add( "@URLTypeID", SqlDbType.TinyInt, ParameterDirection.Output ); + sp.Parameters.Add( "@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint, ParameterDirection.Output ); + sp.Parameters.Add( "@hostingRedirector", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@bindingKey", BindingKey ); + + SqlDataReaderAccessor reader = null; + ArrayList instanceIds = new ArrayList(); + + try + { + // + // net_bindingTemplate_get will return the objects contained in a business in the following order: + // + // - descriptions + // - tmodel instance infos + reader = sp.ExecuteReader(); + + // + // Read the descriptions + // + Descriptions.Read( reader ); + + // + // Read the tmodel instance infos + // + if( true == reader.NextResult() ) + { + instanceIds = TModelInstanceInfos.Read( reader ); + } + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } + + // + // These calls will make separate sproc calls, so we have to close our reader first. + // + TModelInstanceInfos.Populate( instanceIds ); + + // + // Get output parameters + // + ServiceKey = sp.Parameters.GetGuidString( "@serviceKey" ); + AccessPoint.URLType = (URLType)sp.Parameters.GetInt( "@URLTypeID" ); + AccessPoint.Value = sp.Parameters.GetString( "@accessPoint" ); + HostingRedirector.BindingKey = sp.Parameters.GetGuidString( "@hostingRedirector" ); + +#if never + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_bindingTemplate_get" ); + + sp.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + sp.Parameters.Add( "@URLTypeID", SqlDbType.TinyInt, ParameterDirection.Output ); + sp.Parameters.Add( "@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint, ParameterDirection.Output ); + sp.Parameters.Add( "@hostingRedirector", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@bindingKey", BindingKey ); + + sp.ExecuteNonQuery(); + + ServiceKey = sp.Parameters.GetGuidString( "@serviceKey" ); + AccessPoint.URLType = (URLType)sp.Parameters.GetInt( "@URLTypeID" ); + AccessPoint.Value = sp.Parameters.GetString( "@accessPoint" ); + HostingRedirector.BindingKey = sp.Parameters.GetGuidString( "@hostingRedirector" ); + + // + // Get all contained objects. + // + Descriptions.Get( BindingKey, EntityType.BindingTemplate ); + TModelInstanceInfos.Get( BindingKey ); +#endif + + QueryLog.Write( QueryType.Get, EntityType.BindingTemplate ); + } + + /// **************************************************************** + /// public InnerSave + /// ---------------------------------------------------------------- + /// + /// Stores the bindingTemplate details into the database. + /// + /// **************************************************************** + /// + internal void InnerSave( string serviceKey ) + { + if( 0 == ServiceKey.Length ) + ServiceKey = serviceKey; + else + Debug.Verify( 0 == String.Compare( ServiceKey, serviceKey, true ), "UDDI_ERROR_INVALIDKEYPASSED_BINDINGPROJECTION", ErrorType.E_invalidKeyPassed ); + + if( Utility.StringEmpty( BindingKey ) ) + { + // + // This is an insert so, generate a bindingkey + // + BindingKey = Guid.NewGuid().ToString(); + } + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_bindingTemplate_save" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@generic", SqlDbType.VarChar, UDDI.Constants.Lengths.generic ); + sp.Parameters.Add( "@URLTypeID", SqlDbType.TinyInt ); + sp.Parameters.Add( "@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint ); + sp.Parameters.Add( "@hostingRedirector", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@bindingKey", BindingKey ); + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + sp.Parameters.SetString( "@generic", Constants.Version ); + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + if( null != AccessPoint ) + { + sp.Parameters.SetShort( "@URLTypeID", (short)AccessPoint.URLType ); + sp.Parameters.SetString( "@accessPoint", AccessPoint.Value ); + } + + if( null != HostingRedirector ) + sp.Parameters.SetGuidFromString( "@hostingRedirector", HostingRedirector.BindingKey ); + + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + sp.ExecuteNonQuery(); + + // + // Save all contained objects. + // + Descriptions.Save( BindingKey, EntityType.BindingTemplate ); + TModelInstanceInfos.Save( BindingKey ); + } + + + /// **************************************************************** + /// internal Validate + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + internal void Validate() + { + // + // Check to make sure that either the hosting redirector or the accessPoint were specified + // + if( Utility.StringEmpty( AccessPoint.Value ) && Utility.StringEmpty( HostingRedirector.BindingKey ) ) + throw new UDDIException( ErrorType.E_fatalError,"UDDI_ERROR_FATALERROR_BINDING_APVALUEMISSING" ); + + // + // Check for a circular reference + // + if( 0 == String.Compare( BindingKey, HostingRedirector.BindingKey, true ) ) + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_BINDING_HRSELFREFERENCE" ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_bindingTemplate_validate" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@hostingRedirector", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@bindingKey", BindingKey ); + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + sp.Parameters.SetGuidFromString( "@hostingRedirector", HostingRedirector.BindingKey ); + if( Context.User.AllowPreassignedKeys ) + sp.Parameters.SetInt( "@flag", 1 ); + else + sp.Parameters.SetInt( "@flag", 0 ); + + sp.ExecuteNonQuery(); + + // + // Validate field length for AccessPoint.Value + // + Utility.ValidateLength( ref AccessPoint.Value, "accessPoint", UDDI.Constants.Lengths.AccessPoint ); + + Descriptions.Validate(); + TModelInstanceInfos.Validate(); + } + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// Stores the bindingTemplate details into the database, as a + /// child of the service specified by the key. + /// + /// **************************************************************** + /// + public override void Save() + { + Validate(); + InnerSave( this.ServiceKey ); + + // + // Save the change log entry. + // + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + changeRecord.Payload = new ChangeRecordNewData( this ); + changeRecord.Log(); + } + } + } + + /// ******************************************************************** + /// public class BindingTemplateCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class BindingTemplateCollection : CollectionBase + { + /// **************************************************************** + /// public Get + /// ---------------------------------------------------------------- + /// + /// Populates the collection with all binding templates related to + /// the specified service. + /// + /// ---------------------------------------------------------------- + /// + /// Key of the parent service. A Guid formatted as a string. + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// **************************************************************** + /// + public void Get( string serviceKey ) + { + // + // Get all the bindings associated with the specified service + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_businessService_bindingTemplates_get" ); + + cmd.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier, ParameterDirection.Input ); + cmd.Parameters.SetGuidFromString( "@serviceKey", serviceKey ); + + SqlDataReaderAccessor reader = cmd.ExecuteReader(); + try + { + Read( reader ); +#if never + // + // Get the keys of the services for this business ID + // + while( rdr.Read() ) + { + Add( rdr.GetGuid(0).ToString() ); + } +#endif + } + finally + { + reader.Close(); + } + + Populate(); +#if never + // + // Populate each binding + // + foreach( BindingTemplate bt in this ) + { + bt.Get(); + } +#endif + } + + public void Read( SqlDataReaderAccessor reader ) + { + // + // Get the keys of the services for this business ID + // + while( reader.Read() ) + { + Add( reader.GetGuidString(0) ); + } + } + + public void Populate() + { + // + // Populate each binding + // + foreach( BindingTemplate bt in this ) + { + bt.Get(); + } + } + + /// **************************************************************** + /// internal Validate + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + internal void Validate() + { + foreach( BindingTemplate bt in this ) + { + bt.Validate(); + } + } + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// Saves the contained binding templates. Relates them to + /// the service specified by the serviceKey argument. + /// + /// ---------------------------------------------------------------- + /// + /// Key of the parent service. A Guid formatted as a string. + /// + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// This method simply calls the Save() method on all contained + /// BindingTemplates. + /// + /// **************************************************************** + /// + public void Save( string serviceKey ) + { + foreach( BindingTemplate bt in this ) + { + bt.InnerSave( serviceKey ); + } + } + + public void Save() + { + foreach( BindingTemplate bt in this ) + { + bt.Save(); + } + } + + public BindingTemplate this[ int index ] + { + get + { return (BindingTemplate)List[index]; } + set + { List[index] = value; } + } + + public int Add( BindingTemplate value ) + { + return List.Add(value); + } + + public int Add( string bindingKey ) + { + return List.Add( new BindingTemplate( bindingKey ) ); + } + + public int Add() + { + return List.Add( new BindingTemplate() ); + } + + public void Insert(int index, BindingTemplate value) + { + List.Insert(index, value); + } + + public int IndexOf(BindingTemplate value) + { + return List.IndexOf(value); + } + + public bool Contains(BindingTemplate value) + { + return List.Contains(value); + } + + public void Remove(BindingTemplate value) + { + List.Remove(value); + } + + public void CopyTo( BindingTemplate[] array ) + { + foreach( BindingTemplate binding in array ) + Add( binding ); + } + + public BindingTemplate[] ToArray() + { + return (BindingTemplate[])InnerList.ToArray( typeof( BindingTemplate ) ); + } + } + + /// **************************************************************** + /// class AccessPoint + /// ---------------------------------------------------------------- + /// + /// An AccessPoint describes the URL where services are available. + /// + /// **************************************************************** + /// + public class AccessPoint + { + // ----[Attribute: URLType]----------------------------------------- + + [XmlAttribute("URLType")] + public URLType URLType; + + // ----[Element Text]----------------------------------------------- + + [XmlText] + public string Value; + + public AccessPoint() + { + URLType = UDDI.API.URLType.Http; + } + + public AccessPoint( string accessPointValue ) + { + Value = accessPointValue; + } + + [XmlIgnore] + public bool ShouldSerialize + { + get + { + if( null != Value ) + return true; + + return false; + } + } + } + + /// **************************************************************** + /// class HostingRedirector + /// ---------------------------------------------------------------- + /// + /// A HostingRedirector describes a service location using another + /// bindingTemplate. + /// + /// **************************************************************** + /// + public class HostingRedirector + { + // ----[Attribute: bindingKey]-------------------------------------------- + + [XmlAttribute("bindingKey")] + public string BindingKey; + + [XmlIgnore] + public bool ShouldSerialize + { + get + { + if( null != BindingKey ) + return true; + + return false; + } + } + } + + /// **************************************************************** + /// class DeleteBinding + /// ---------------------------------------------------------------- + /// + /// The DeleteBinding class contains data and methods associated + /// with the delete_binding message. It is typically populated + /// via deserialization by the .NET runtime as part of the + /// message processing interface. + /// + /// As part of the publisher API, this message implements + /// IAuthenticateable. This allows the enclosed authInfo to be + /// authorized prior to processing + /// + /// **************************************************************** + /// + [XmlRootAttribute( "delete_binding", Namespace=UDDI.API.Constants.Namespace )] + public class DeleteBinding : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: bindingKey + // + [XmlElement("bindingKey")] + public StringCollection BindingKeys; + + public DeleteBinding() + { + Generic = UDDI.API.Constants.Version; + } + + public void Delete() + { + foreach( string key in BindingKeys ) + { + BindingTemplate bt = new BindingTemplate( key ); + bt.Delete(); + } + } + } + + [XmlRootAttribute("find_binding", Namespace=UDDI.API.Constants.Namespace)] + public class FindBinding : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: maxRows + // + private int maxRows = -1; + + [XmlAttribute( "maxRows" ), DefaultValue( -1 )] + public int MaxRows + { + get { return maxRows; } + set + { + if( value < 0 ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_FINDBINDING_MAXROWSLESSTHANZERO" ); + } + + maxRows = value; + } + } + + // + // Attribute: serviceKey + // + [XmlAttribute("serviceKey")] + public string ServiceKey; + + // + // Element: findQualifiers/findQualifier + // + [XmlArray("findQualifiers"), XmlArrayItem("findQualifier")] + public FindQualifierCollection FindQualifiers; + + // + // Element: tModelBag/tModelKey + // + [XmlArray("tModelBag"), XmlArrayItem("tModelKey")] + public StringCollection TModelBag; + + public FindBinding() + { + Generic = UDDI.API.Constants.Version; + } + + public BindingDetail Find() + { + BindingDetail bindingDetail = new BindingDetail(); + + QueryLog.Write( QueryType.Find, EntityType.BindingTemplate ); + + // + // Validate find parameters. + // + Utility.IsValidKey( EntityType.BusinessService, ServiceKey ); + + // + // Process each find constraint. + // + FindBuilder find = new FindBuilder( EntityType.BindingTemplate, FindQualifiers, ServiceKey ); + + // + // If no search arguments are specified, return an empty result + // set. + // + if( Utility.CollectionEmpty( TModelBag ) ) + return bindingDetail; + + try + { + int rows = 1; + + // + // Find entities with matching parent key. + // + if( !Utility.StringEmpty( ServiceKey ) ) + rows = find.FindByParentKey( ServiceKey ); + + // + // Find entities with matching TModel bag items. + // + if( !Utility.CollectionEmpty( TModelBag ) ) + rows = find.FindByTModelBag( TModelBag ); + + // + // Process the find result set. + // + if( 0 == rows ) + { + // + // Cleanup any temporary tables. + // + find.Abort(); + } + else if( 0 == MaxRows ) + { + bindingDetail.Truncated = Truncated.True; + return bindingDetail; + } + else + { + // + // Read in the find results. + // + SqlDataReaderAccessor reader; + SqlStoredProcedureAccessor sp; + sp = find.RetrieveResults( MaxRows ); + + reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + bindingDetail.BindingTemplates.Add( reader.GetGuidString( "entityKey" ) ); + } + finally + { + reader.Close(); + } + + if( sp.Parameters.GetBool( "@truncated" ) ) + bindingDetail.Truncated = Truncated.True; + else + bindingDetail.Truncated = Truncated.False; + + foreach( BindingTemplate bindingTemplate in bindingDetail.BindingTemplates ) + bindingTemplate.Get(); + } + } + catch( Exception ) + { + find.Abort(); + throw; + } + + return bindingDetail; + } + } + + /// ******************************************************************** + /// public class GetBindingDetail + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "get_bindingDetail", Namespace=UDDI.API.Constants.Namespace )] + public class GetBindingDetail : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: bindingKey + // + [XmlElement("bindingKey")] + public StringCollection BindingKeys; + + public GetBindingDetail() + { + } + } + + /// ******************************************************************** + /// public class SaveBinding + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "save_binding", Namespace=UDDI.API.Constants.Namespace )] + public class SaveBinding : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: bindingTemplate + // + [XmlElement("bindingTemplate")] + public BindingTemplateCollection BindingTemplates; + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Save() + { + BindingTemplates.Save(); + } + } + + [XmlRoot("bindingDetail", Namespace=UDDI.API.Constants.Namespace)] + public class BindingDetail + { + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + [XmlAttribute("truncated")] + public Truncated Truncated; + + [XmlElement("bindingTemplate")] + public BindingTemplateCollection BindingTemplates = new BindingTemplateCollection(); + + public void Get( StringCollection bindingKeys ) + { + foreach( string key in bindingKeys ) + { + int n = BindingTemplates.Add( key ); + BindingTemplates[ n ].Get(); + } + } + } +} diff --git a/inetsrv/uddi/source/api/build.log b/inetsrv/uddi/source/api/build.log new file mode 100644 index 0000000..99df84d --- /dev/null +++ b/inetsrv/uddi/source/api/build.log @@ -0,0 +1,24 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\api directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\api directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\api +Elapsed time [0:00:00.016] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.api D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\api directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.api D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.api.dll /baseaddress:0x78400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\i386\uddi.core.dll,passportlib.dll address.cs assemblyinfo.cs assemblyversioninfo.cs assertion.cs authentication.cs binding.cs business.cs category.cs changerecord.cs contact.cs description.cs discoveryurl.cs email.cs extension.cs find.cs inquire.cs keyedreference.cs logs.cs messages.cs name.cs phone.cs publish.cs service.cs taxonomy.cs tmodel.cs types.cs serializer.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\api\obj\i386\uddi.api.dll +1>binplace D:\OpenXP\inetsrv\uddi\source\api\obj\i386\uddi.api.dll +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:01.750] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/api/business.cs b/inetsrv/uddi/source/api/business.cs new file mode 100644 index 0000000..c96ed66 --- /dev/null +++ b/inetsrv/uddi/source/api/business.cs @@ -0,0 +1,1533 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; +using UDDI.API; +using UDDI.Replication; +using UDDI.API.Service; +using UDDI.API.ServiceType; + +namespace UDDI.API.Business +{ + /// ******************************************************************** + /// class BusinessEntity + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute( "businessEntity", Namespace=UDDI.API.Constants.Namespace )] + public class BusinessEntity : EntityBase + { + // + // Attribute: businessKey + // + [XmlAttribute("businessKey")] + public string BusinessKey; + + // + // Attribute: operator + // + [XmlAttribute("operator")] + public string Operator; + + // + // Attribute: authorizedName + // + [XmlAttribute("authorizedName")] + public string AuthorizedName; + + // + // Element: discoveryURLs + // + [ XmlIgnore ] + public DiscoveryUrlCollection DiscoveryUrls = new DiscoveryUrlCollection(); + + [ XmlArray( "discoveryURLs" ), XmlArrayItem( "discoveryURL" ) ] + public DiscoveryUrl[] DiscoveryUrlsSerialize + { + get + { + if( Utility.CollectionEmpty( DiscoveryUrls ) ) + return null; + + return DiscoveryUrls.ToArray(); + } + + set + { + DiscoveryUrls.Clear(); + DiscoveryUrls.CopyTo( value ); + } + } + + // + // Element: name + // + private NameCollection names; + + [XmlElement("name")] + public NameCollection Names + { + get + { + if( null == names ) + names = new NameCollection(); + + return names; + } + + set { names = value; } + } + + // + // Element: description + // + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // + // Element: contacts + // + [ XmlIgnore ] + public ContactCollection Contacts = new ContactCollection(); + + [ XmlArray( "contacts" ), XmlArrayItem( "contact" ) ] + public Contact[] ContactsSerialize + { + get + { + if( Utility.CollectionEmpty( Contacts ) ) + return null; + + return Contacts.ToArray(); + } + + set + { + Contacts.Clear(); + Contacts.CopyTo( value ); + } + } + + // + // Element: businessServices + // + [ XmlIgnore ] + public BusinessServiceCollection BusinessServices = new BusinessServiceCollection(); + + [ XmlArray( "businessServices" ), XmlArrayItem( "businessService" ) ] + public BusinessService[] BusinessServicesSerialize + { + get + { + if( Utility.CollectionEmpty( BusinessServices ) ) + return null; + + return BusinessServices.ToArray(); + } + + set + { + BusinessServices.Clear(); + BusinessServices.CopyTo( value ); + } + } + + // + // Element: identifierBag + // + [ XmlIgnore ] + public KeyedReferenceCollection IdentifierBag = new KeyedReferenceCollection(); + + [ XmlArray( "identifierBag" ), XmlArrayItem( "keyedReference" ) ] + public KeyedReference[] IdentifierBagSerialize + { + get + { + if( Utility.CollectionEmpty( IdentifierBag ) ) + return null; + + return IdentifierBag.ToArray(); + } + + set + { + IdentifierBag.Clear(); + IdentifierBag.CopyTo( value ); + } + } + + // + // Element: categoryBag + // + [ XmlIgnore ] + public KeyedReferenceCollection CategoryBag = new KeyedReferenceCollection(); + + [ XmlArray( "categoryBag" ), XmlArrayItem( "keyedReference" ) ] + public KeyedReference[] CategoryBagSerialize + { + get + { + if( Utility.CollectionEmpty( CategoryBag ) ) + return null; + + return CategoryBag.ToArray(); + } + + set + { + CategoryBag.Clear(); + CategoryBag.CopyTo( value ); + } + } + + [XmlIgnore] + public override UDDI.EntityType EntityType + { + get { return EntityType.BusinessEntity; } + } + + [XmlIgnore] + public override string EntityKey + { + get { return BusinessKey; } + } + + /// **************************************************************** + /// public BusinessEntity [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public BusinessEntity() + { + } + + /// **************************************************************** + /// public BusinessEntity [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public BusinessEntity( string businessKey ) + { + BusinessKey = businessKey; + } + + /// **************************************************************** + /// public Delete + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public override void Delete() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_delete" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + sp.ExecuteNonQuery(); + + // + // Save the change log entry. + // + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.Payload = new ChangeRecordDelete( EntityType.BusinessEntity, BusinessKey ); + changeRecord.Log(); + } + + Debug.Leave(); + } + + /// **************************************************************** + /// internal Validate + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + internal void Validate() + { + Debug.Enter(); + + // + // Check to make sure publisher's limit allows save of this + // entity. If this is an update, we won't check since they are + // simply replacing an existing entity. We also won't check if + // the limit is 0, since this indicates unlimited publishing + // rights. + // + int limit = Context.User.BusinessLimit; + int count = Context.User.BusinessCount; + + if( Utility.StringEmpty( BusinessKey ) && 0 != limit ) + { + // + // Verify that the publisher has not exceeded their limit. + // + if( count >= limit ) + { + throw new UDDIException( ErrorType.E_accountLimitExceeded, "UDDI_ERROR_ACCOUNTLIMITEXCEEDED_BUSINESS", limit , count ); + } + } + + // + // Check to see if this is an update of an existing businessEntity. If + // it is, we'll need to perform further validation in the database. + // + if( !Utility.StringEmpty( BusinessKey ) ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_validate" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + if( Context.User.AllowPreassignedKeys ) + sp.Parameters.SetInt( "@flag", 1 ); + else + sp.Parameters.SetInt( "@flag", 0 ); + + + sp.ExecuteNonQuery(); + } + + // + // Validate the contained elements. + // + DiscoveryUrls.Validate(); + Names.Validate(); + Descriptions.Validate(); + Contacts.Validate(); + BusinessServices.Validate( BusinessKey ); + IdentifierBag.Validate( BusinessKey, KeyedReferenceType.IdentifierBag ); + CategoryBag.Validate( BusinessKey, KeyedReferenceType.CategoryBag); + + Debug.Leave(); + } + + /// ********************************************************************** + /// public Save + /// ---------------------------------------------------------------------- + /// + /// + /// ********************************************************************** + /// + public override void Save() + { + Debug.Enter(); + + // + // Validate the business entity. + // + Validate(); + + // + // Check to see if a business key was specified. If not, this is a new + // record and a business key will have to be generated. + // + if( Utility.StringEmpty( BusinessKey ) ) + BusinessKey = Guid.NewGuid().ToString(); + + // + // Save the entity to the database. + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_save" ); + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@generic", SqlDbType.VarChar, UDDI.Constants.Lengths.generic ); + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + sp.Parameters.Add( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.InputOutput ); + sp.Parameters.Add( "@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.Operator, ParameterDirection.InputOutput ); + + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetString( "@generic", Constants.Version ); + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + sp.Parameters.SetString( "@authorizedName", AuthorizedName ); + sp.Parameters.SetString( "@operatorName", this.Operator ); + + // + // We won't set the operatorName since this will be derived from the PUID + // + + sp.ExecuteNonQuery(); + + AuthorizedName = sp.Parameters.GetString( "@authorizedName" ); + Operator = sp.Parameters.GetString( "@operatorName" ); + + // + // Save all the contained objects. + // + DiscoveryUrls.Save( BusinessKey ); + + if( Operator == Config.GetString( "Operator" ) ) + { + // + // Only add the default discovery Url to this business + // If it was published at this site. + // + DiscoveryUrls.AddDefaultDiscoveryUrl( BusinessKey ); + } + + Names.Save( BusinessKey, EntityType.BusinessEntity ); + Descriptions.Save( BusinessKey, EntityType.BusinessEntity ); + Contacts.Save( BusinessKey ); + BusinessServices.Save( BusinessKey ); + IdentifierBag.Save( BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.IdentifierBag ); + CategoryBag.Save( BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.CategoryBag ); + + // + // Save the change log entry for replication + // + if( Context.LogChangeRecords ) + { + // + // If we used a V1 API message, make sure to add in language codes for the names. We will + // then take these names out after we save the change record. + // + if( 1 == Context.ApiVersionMajor ) + { + foreach( Name name in Names ) + { + name.IsoLangCode = Context.User.IsoLangCode; + } + } + + ChangeRecord changeRecord = new ChangeRecord(); + changeRecord.Payload = new ChangeRecordNewData( this ); + changeRecord.Log(); + + // + // Take out language names if we are using V1. + // + if( 1 == Context.ApiVersionMajor ) + { + foreach( Name name in Names ) + { + name.IsoLangCode = null; + } + } + } + + Debug.Leave(); + } + + /// **************************************************************** + /// public Get + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public override void Get() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_get_batch" ); + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output ); + sp.Parameters.Add( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + + SqlDataReaderAccessor reader = null; + ArrayList contactIds = new ArrayList(); + + try + { + // + // net_businessEntity_get will return the objects contained in a business in the following order: + // + // - descriptions + // - names + // - discoveryURLs + // - contacts + // - identifier bags + // - category bags + // - services + // + reader = sp.ExecuteReader(); + + // + // Read the descriptions + // + Descriptions.Read( reader ); + + // + // Read the names + // + if ( true == reader.NextResult() ) + { + Names.Read( reader ); + } + + // + // + // Read the discoveryURLs + // + if( true == reader.NextResult() ) + { + DiscoveryUrls.Read( reader ); + } + + // + // Read the contacts + // + if( true == reader.NextResult() ) + { + contactIds = Contacts.Read( reader ); + } + + // + // Read the identifier bags + // + if( true == reader.NextResult() ) + { + IdentifierBag.Read( reader ); + } + + // + // Read the category bags + // + if( true == reader.NextResult() ) + { + CategoryBag.Read( reader ); + } + + // + // Read the services + // + if( true == reader.NextResult() ) + { + BusinessServices.Read( reader ); + } + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } + + // + // These calls will make separate sproc calls, so we have to close our reader first. + // + BusinessServices.Populate(); + Contacts.Populate( contactIds ); + + // + // Get our output parameters. + // + Operator = sp.Parameters.GetString( "@operatorName" ); + AuthorizedName = sp.Parameters.GetString( "@authorizedName" ); + + // + // If this entity was published to this node than add the + // default discoveryURL. + // + if( Operator == Config.GetString( "Operator" ) ) + { + // + // Only add the default discovery Url to this business + // if it was published at this site. + // + DiscoveryUrls.AddDefaultDiscoveryUrl( BusinessKey ); + } + +#if never + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_get" ); + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output ); + sp.Parameters.Add( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + + sp.ExecuteNonQuery(); + + Operator = sp.Parameters.GetString( "@operatorName" ); + AuthorizedName = sp.Parameters.GetString( "@authorizedName" ); + + // + // Retrieve contained objects. + // + Descriptions.Get( BusinessKey, EntityType.BusinessEntity ); + Names.Get( BusinessKey, EntityType.BusinessEntity ); + DiscoveryUrls.Get( BusinessKey ); + + // + // If this entity was published to this node than add the + // default discoveryURL. + // + if( Operator == Config.GetString( "Operator" ) ) + { + // + // Only add the default discovery Url to this business + // if it was published at this site. + // + DiscoveryUrls.AddDefaultDiscoveryUrl( BusinessKey ); + } + + Contacts.Get( BusinessKey ); + BusinessServices.Get( BusinessKey ); + IdentifierBag.Get( BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.IdentifierBag ); + CategoryBag.Get( BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.CategoryBag ); +#endif + QueryLog.Write( QueryType.Get, EntityType.BusinessEntity ); + + Debug.Leave(); + } + } + + public class BusinessInfoCollection : CollectionBase + { + public void GetForCurrentPublisher() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_businessInfos_get" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + Add( reader.GetGuidString( "businessKey" ) ); + } + finally + { + reader.Close(); + } + + foreach( BusinessInfo businessInfo in this ) + businessInfo.Get( true ); + } + + public BusinessInfo this[ int index ] + { + get { return (BusinessInfo)List[index]; } + set { List[index] = value; } + } + + public int Add() + { + return List.Add( new BusinessInfo() ); + } + + public int Add( string businessKey ) + { + return List.Add( new BusinessInfo( businessKey ) ); + } + + public int Add( BusinessInfo businessInfo ) + { + return List.Add( businessInfo ); + } + + public void Insert( int index, BusinessInfo businessInfo ) + { + List.Insert( index, businessInfo ); + } + + public int IndexOf( BusinessInfo businessInfo ) + { + return List.IndexOf( businessInfo ); + } + + public bool Contains( BusinessInfo businessInfo ) + { + return List.Contains( businessInfo ); + } + + public void Remove( BusinessInfo businessInfo ) + { + List.Remove( businessInfo ); + } + + public void CopyTo( BusinessInfo[] array, int index ) + { + List.CopyTo( array, index ); + } + + public void Sort() + { + InnerList.Sort( new BusinessInfoComparer() ); + } + + internal class BusinessInfoComparer : IComparer + { + public int Compare( object x, object y ) + { + BusinessInfo entity1 = (BusinessInfo)x; + BusinessInfo entity2 = (BusinessInfo)y; + + return string.Compare( entity1.Names[ 0 ].Value, entity2.Names[ 0 ].Value, true ); + } + } + } + + public class BusinessEntityCollection : CollectionBase + { + public void Save() + { + foreach( BusinessEntity business in this ) + { + business.Save(); + } + } + + public BusinessEntity this[int index] + { + get { return (BusinessEntity)List[index]; } + set { List[index] = value; } + } + + public int Add() + { + + return List.Add( new BusinessEntity() ); + } + + public int Add( string businessKey ) + { + return List.Add( new BusinessEntity( businessKey ) ); + } + + public int Add( BusinessEntity value ) + { + return List.Add( value ); + } + + public void Insert( int index, BusinessEntity value ) + { + List.Insert( index, value ); + } + + public int IndexOf( BusinessEntity value ) + { + return List.IndexOf( value ); + } + + public bool Contains( BusinessEntity value ) + { + return List.Contains( value ); + } + + public void Remove( BusinessEntity value ) + { + List.Remove( value ); + } + + public void CopyTo( BusinessEntity[] array, int index ) + { + List.CopyTo( array, index ); + } + public void Sort() + { + InnerList.Sort( new BusinessEntityComparer() ); + } + + internal class BusinessEntityComparer : IComparer + { + public int Compare( object x, object y ) + { + BusinessEntity entity1 = (BusinessEntity)x; + BusinessEntity entity2 = (BusinessEntity)y; + + return string.Compare( entity1.Names[ 0 ].Value, entity2.Names[ 0 ].Value, true ); + } + } + } + + public class BusinessEntityExtCollection : CollectionBase + { + public BusinessEntityExt this[ int index ] + { + get { return ( BusinessEntityExt)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new BusinessEntityExt() ); + } + + public int Add( BusinessEntityExt value ) + { + return List.Add( value ); + } + + public int Add( string businessKey ) + { + return List.Add( new BusinessEntityExt( businessKey ) ); + } + + public void Insert( int index, BusinessEntityExt value ) + { + List.Insert( index, value ); + } + + public int IndexOf( BusinessEntityExt value ) + { + return List.IndexOf( value ); + } + + public bool Contains( BusinessEntityExt value ) + { + return List.Contains( value ); + } + + public void Remove( BusinessEntityExt value ) + { + List.Remove( value ); + } + + public void CopyTo( BusinessEntityExt[] array, int index ) + { + List.CopyTo( array, index ); + } + } + + public class BusinessEntityExt + { + public BusinessEntityExt() + { + } + + public BusinessEntityExt( string businessKey ) + { + BusinessEntity = new BusinessEntity( businessKey ); + } + + public void Get() + { + BusinessEntity.Get(); + } + + [XmlElement("businessEntity")] + public BusinessEntity BusinessEntity; + } + + public class BusinessInfo + { + // + // Attribute: businessKey + // + [XmlAttribute("businessKey")] + public string BusinessKey; + + // + // Element: name + // + [XmlElement("name")] + public NameCollection Names = new NameCollection(); + + // + // Element: description + // + [XmlElement("description")] + public DescriptionCollection Descriptions = new DescriptionCollection(); + + // + // Element: serviceInfos + // + private ServiceInfoCollection serviceInfos; + + [ XmlArray( "serviceInfos" ), XmlArrayItem( "serviceInfo" ) ] + public ServiceInfoCollection ServiceInfos + { + get + { + if( null == serviceInfos ) + serviceInfos = new ServiceInfoCollection(); + + return serviceInfos; + } + + set { serviceInfos = value; } + } + + public BusinessInfo() + { + } + + public BusinessInfo( string businessKey ) + { + BusinessKey = businessKey; + } + + public void Get( bool getServiceInfos ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessInfo_get_batch" ); + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@getServiceInfos", SqlDbType.Bit ); + + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + sp.Parameters.SetBool( "@getServiceInfos", getServiceInfos ); + + SqlDataReaderAccessor reader = null; + ArrayList contactIds = new ArrayList(); + bool readServiceInfos = false; + + try + { + // + // net_businessInfo_get_batch will return the objects contained in a business in the following order: + // + // - descriptions + // - names + // - serviceInfos (if specified) + reader = sp.ExecuteReader(); + + // + // Read the descriptions + // + Descriptions.Read( reader ); + + // + // Read the names + // + if ( true == reader.NextResult() ) + { + Names.Read( reader ); + } + + // + // Read the service infos, maybe + // + if( true == getServiceInfos ) + { + if ( true == reader.NextResult() ) + { + ServiceInfos.Read( reader ); + readServiceInfos = true; + } + } + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } + + if( true == getServiceInfos && true == readServiceInfos ) + { + ServiceInfos.Populate(); + } +#if never + Names.Get( BusinessKey, EntityType.BusinessEntity ); + Descriptions.Get( BusinessKey, EntityType.BusinessEntity ); + + if( getServiceInfos ) + ServiceInfos.Get( BusinessKey ); +#endif + } + } + + /// **************************************************************** + /// class DeleteBusiness + /// ---------------------------------------------------------------- + /// + /// The DeleteBusiness class contains data and methods + /// associated with the delete_business message. It is typically + /// populated via deserialization by the .NET runtime as part of + /// the message processing interface. + /// + /// As part of the publisher API, this message implements + /// IAuthenticateable. This allows the enclosed authInfo to be + /// authorized prior to processing + /// + /// **************************************************************** + /// + [XmlRootAttribute( "delete_business", Namespace=UDDI.API.Constants.Namespace )] + public class DeleteBusiness : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: businessKey + // + [XmlElement("businessKey")] + public StringCollection BusinessKeys; + + public DeleteBusiness() + { + Generic = UDDI.API.Constants.Version; + } + + public void Delete() + { + foreach( string key in BusinessKeys ) + { + BusinessEntity be = new BusinessEntity( key ); + be.Delete(); + } + } + } + + /// ******************************************************************** + /// public class FindBusiness + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute("find_business", Namespace=UDDI.API.Constants.Namespace)] + public class FindBusiness : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: maxRows + // + private int maxRows = -1; + + [XmlAttribute( "maxRows" ), DefaultValue( -1 )] + public int MaxRows + { + get { return maxRows; } + set + { + if( value < 0 ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_FINDBE_MAXROWSLESSTHANZERO" ); + } + + maxRows = value; + } + } + + // + // Element: findQualifiers/findQualifier + // + [XmlArray( "findQualifiers" ), XmlArrayItem( "findQualifier" )] + public FindQualifierCollection FindQualifiers = new FindQualifierCollection(); + + // + // Element: name + // + [XmlElement( "name" )] + public NameCollection Names = new NameCollection(); + + // + // Element: identifierBag/keyedReference + // + [XmlArray( "identifierBag" ), XmlArrayItem( "keyedReference" ) ] + public KeyedReferenceCollection IdentifierBag; + + // + // Element: categoryBag/keyedReference + // + [XmlArray( "categoryBag" ), XmlArrayItem( "keyedReference" )] + public KeyedReferenceCollection CategoryBag; + + // + // Element: tModelBag/tModelKey + // + [XmlArray( "tModelBag" ), XmlArrayItem( "tModelKey" )] + public StringCollection TModelBag; + + // + // Element: discoveryURLs/discoveryURL + // + [XmlArray( "discoveryURLs" ), XmlArrayItem( "discoveryURL" )] + public DiscoveryUrlCollection DiscoveryUrls; + + public BusinessList Find() + { + BusinessList businessList = new BusinessList(); + + QueryLog.Write( QueryType.Find, EntityType.BusinessEntity ); + + // + // Process each find constraint. + // + FindBuilder find = new FindBuilder( EntityType.BusinessEntity, FindQualifiers ); + + // + // If no search arguments are specified, return an empty result + // set. + // + if( Utility.CollectionEmpty( Names ) && + Utility.CollectionEmpty( DiscoveryUrls ) && + Utility.CollectionEmpty( IdentifierBag ) && + Utility.CollectionEmpty( CategoryBag ) && + Utility.CollectionEmpty( TModelBag ) ) + return businessList; + + // + // Validate find parameters. + // + + if( !Utility.CollectionEmpty( Names ) ) + { + Names.ValidateForFind(); + } + else + { + Debug.Verify( !find.CaseSensitiveMatch && !find.ExactNameMatch, + "UDDI_ERROR_UNSUPPORTED_FINDBE_NAMEFQNONAMES", ErrorType.E_unsupported ); + } + + + // + // TODO: Override may be better for these calls to KeyedReference.Validate because no parent key is used + // + if( !Utility.CollectionEmpty( IdentifierBag ) ) + IdentifierBag.Validate( "", KeyedReferenceType.IdentifierBag ); + + if( !Utility.CollectionEmpty( CategoryBag ) ) + CategoryBag.Validate( "", KeyedReferenceType.CategoryBag ); + + try + { + int rows = 1; + + // + // Find entities with matching identifier bag items. + // + if( !Utility.CollectionEmpty( IdentifierBag ) ) + rows = find.FindByKeyedReferences( KeyedReferenceType.IdentifierBag, IdentifierBag ); + + // + // Find entities with matching category bag items. + // + if( rows > 0 && !Utility.CollectionEmpty( CategoryBag ) ) + rows = find.FindByKeyedReferences( KeyedReferenceType.CategoryBag, CategoryBag ); + + // + // Find entities with matching TModel bag items. + // + if( rows > 0 && !Utility.CollectionEmpty( TModelBag ) ) + rows = find.FindByTModelBag( TModelBag ); + + // + // Find entities with matching discovery URLs + // + if( rows > 0 && !Utility.CollectionEmpty( DiscoveryUrls ) ) + rows = find.FindByDiscoveryUrls( DiscoveryUrls ); + + // + // Find entities with matching names + // + if( rows > 0 && !Utility.CollectionEmpty( Names ) ) + rows = find.FindByNames( Names ); + + // + // Process the find result set. + // + if( 0 == rows ) + { + // + // Cleanup any temporary tables. + // + find.Abort(); + } // TODO: review + else if( 0 == MaxRows ) + { + businessList.Truncated = Truncated.True; + return businessList; + } + else + { + // + // Read in the find results. + // + SqlDataReaderAccessor reader; + SqlStoredProcedureAccessor sp; + sp = find.RetrieveResults( MaxRows); +// +// TODO: return reader, not the whole SPA +// + reader = sp.ExecuteReader(); + + try + { + if( find.ServiceSubset ) + { + // + // For a service subset search, we limit the result set + // to those services that matched the category bag + // search criteria. + // + BusinessInfo businessInfo = null; + string prevKey = null; + + while( reader.Read() ) + { + string businessKey = reader.GetString( "entityKey" ); + + if( prevKey != businessKey ) + { + businessInfo = new BusinessInfo( businessKey ); + businessList.BusinessInfos.Add( businessInfo ); + } + + businessInfo.ServiceInfos.Add( + reader.GetString( "subEntityKey" ), + businessKey ); + + prevKey = businessKey; + } + } + else + { + // + // For non-service subset searches, we will simply + // return a list of businesses with all services. + // + while( reader.Read() ) + businessList.BusinessInfos.Add( reader.GetString( "entityKey" ) ); + } + } + finally + { + reader.Close(); + } + + if( sp.Parameters.GetBool( "@truncated" ) ) + businessList.Truncated = Truncated.True; + else + businessList.Truncated = Truncated.False; + + // + // Get the actual business info and service info data. For + // a service subset, we'll grab just those services that we + // populated. For all other searches, we'll get all service + // infos. + // + if( find.ServiceSubset ) + { + foreach( BusinessInfo businessInfo in businessList.BusinessInfos ) + { + businessInfo.Get( false ); + + foreach( ServiceInfo serviceInfo in businessInfo.ServiceInfos ) + serviceInfo.Get(); + } + } + else + { + foreach( BusinessInfo businessInfo in businessList.BusinessInfos ) + businessInfo.Get( true ); + } + } + } + catch( Exception ) + { + find.Abort(); + throw; + } + + return businessList; + } + } + + /// ******************************************************************** + /// public class GetBusinessDetail + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute( "get_businessDetail", Namespace=UDDI.API.Constants.Namespace )] + public class GetBusinessDetail : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: businessKey + // + [XmlElement("businessKey")] + public StringCollection BusinessKeys; + + public GetBusinessDetail() + { + Generic = UDDI.API.Constants.Version; + } + } + + [XmlRootAttribute("businessDetail", Namespace=UDDI.API.Constants.Namespace)] + public class BusinessDetail + { + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + [XmlAttribute("truncated")] + public Truncated Truncated; + + [XmlElement("businessEntity")] + public BusinessEntityCollection BusinessEntities = new BusinessEntityCollection(); + + public void Get( StringCollection businessKeys ) + { + int n = 0; + foreach( string key in businessKeys ) + { + n = BusinessEntities.Add( key ); + BusinessEntities[ n ].Get(); + } + } + } + + /// ******************************************************************** + /// public class SaveBusiness + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute( "save_business", Namespace=UDDI.API.Constants.Namespace )] + public class SaveBusiness : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: businessEntity + // + [XmlElement("businessEntity")] + public BusinessEntityCollection BusinessEntities; + + // + // Element: uploadRegister + // + [XmlElement("uploadRegister")] + public StringCollection UploadRegisters; + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Save() + { + // + // This is outside of replication so any attempt to specify + // an upload register URL will force an E_unsupported response + // + if( 0 != UploadRegisters.Count ) + throw new UDDIException( ErrorType.E_unsupported, "UDDI_ERROR_UNSUPPORTED_UPLOADREGISTER" ); + + BusinessEntities.Save(); + } + } + + /// ******************************************************************** + /// public class GetBusinessDetailExt + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute( "get_businessDetailExt", Namespace=UDDI.API.Constants.Namespace )] + public class GetBusinessDetailExt : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: businessKey + // + [XmlElement("businessKey")] + public StringCollection BusinessKeys; + + public GetBusinessDetailExt() + { + } + } + + [XmlRootAttribute("businessDetailExt", Namespace=UDDI.API.Constants.Namespace)] + public class BusinessDetailExt + { + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + [XmlAttribute("truncated")] + public Truncated Truncated; + + [XmlElement("businessEntityExt")] + public BusinessEntityExtCollection BusinessEntityExts = new BusinessEntityExtCollection(); + + public void Get( StringCollection businessKeys ) + { + int n = 0; + foreach( string key in businessKeys ) + { + n = BusinessEntityExts.Add( key ); + BusinessEntityExts[ n ].Get(); + } + } + } + + [XmlRootAttribute("businessList", Namespace=UDDI.API.Constants.Namespace)] + public class BusinessList + { + // + // Attribute: generic + // + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + // + // Attribute: operator + // + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + // + // Attribute: truncated + // + [XmlAttribute("truncated")] + public Truncated Truncated; + + // + // Element: businessInfos + // + private BusinessInfoCollection businessInfos; + + [ XmlArray( "businessInfos" ), XmlArrayItem( "businessInfo" ) ] + public BusinessInfoCollection BusinessInfos + { + get + { + if( null == businessInfos ) + businessInfos = new BusinessInfoCollection(); + + return businessInfos; + } + + set { businessInfos = value; } + } + } +} diff --git a/inetsrv/uddi/source/api/category.cs b/inetsrv/uddi/source/api/category.cs new file mode 100644 index 0000000..fc6e101 --- /dev/null +++ b/inetsrv/uddi/source/api/category.cs @@ -0,0 +1,938 @@ +using System; +using System.Web; +using System.Data; +using System.IO; +using System.Xml; +using System.Xml.Schema; +using System.Collections; +using System.Web.Services; +using System.Data.SqlClient; +using System.Xml.Serialization; +using System.Web.Services.Protocols; + +using UDDI; +using UDDI.API; +using UDDI.Diagnostics; +using UDDI.API.Binding; +using UDDI.API.Service; +using UDDI.API.Business; +using UDDI.API.ServiceType; + + +namespace UDDI.API.Extensions +{ + public class Constants + { + public const string Namespace = "urn:uddi-microsoft-com:api_v2_extensions"; + } + + [XmlRoot( "resources", Namespace=UDDI.API.Extensions.Constants.Namespace )] + public class Resources + { + [XmlElement( "tModelDetail", Namespace=UDDI.API.Constants.Namespace )] + public TModelDetail TModelDetail; + + [XmlArray( "categorizationSchemes" ), XmlArrayItem( "categorizationScheme" )] + public CategorizationSchemeCollection CategorizationSchemes = new CategorizationSchemeCollection(); + + [XmlElement( "businessDetail", Namespace=UDDI.API.Constants.Namespace )] + public BusinessDetail BusinessDetail; + + [XmlElement( "serviceDetail", Namespace=UDDI.API.Constants.Namespace )] + public ServiceDetail ServiceDetail; + + [XmlElement( "bindingDetail", Namespace=UDDI.API.Constants.Namespace )] + public BindingDetail BindingDetail; + + public Resources() + { + } + + public static void Validate( Stream strm ) + { + Debug.VerifySetting( "InstallRoot" ); + + string installRoot = Config.GetString( "InstallRoot" ); + + string apiSchema = installRoot + "uddi_v2.xsd"; + string resourceSchema = installRoot + "extensions.xsd"; + + Debug.Verify( File.Exists( apiSchema ), "TUDDI_ERROR_FATALERROR_UDDISCHEMANOTFOUND" ); + Debug.Verify( File.Exists( resourceSchema ), "UDDI_ERROR_FATALERROR_UDDIRESOURCESCHEMANOTFOUND" ); + + XmlSchemaCollection xsc = new XmlSchemaCollection(); + + xsc.Add( UDDI.API.Constants.Namespace, apiSchema ); + xsc.Add( UDDI.API.Extensions.Constants.Namespace, resourceSchema ); + + // + // Rewind stream (to be safe) and validate + // + strm.Seek( 0, SeekOrigin.Begin ); + + // + // Construct a validating reader to verify the document is kosher + // + XmlTextReader reader = new XmlTextReader( strm ); + XmlValidatingReader vreader = new XmlValidatingReader( reader ); + vreader.Schemas.Add( xsc ); + while( vreader.Read()){} + + // + // Rewind stream again, so someone else can use it + // + strm.Seek( 0, SeekOrigin.Begin ); + + } + + public void Save() + { + UDDI.Diagnostics.Debug.Enter(); + + if( null != TModelDetail ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing tModels..." ); + foreach( TModel tm in TModelDetail.TModels ) + { + tm.AuthorizedName = null; + tm.Save(); + } + } + + if( null != CategorizationSchemes ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing Categorization schemes..." ); + foreach( CategorizationScheme cs in CategorizationSchemes ) + { + cs.Save(); + } + } + + if( null != BusinessDetail ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing Providers..." ); + foreach( BusinessEntity be in BusinessDetail.BusinessEntities ) + { + be.AuthorizedName = null; + be.Save(); + } + } + + if( null != ServiceDetail ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing Services..." ); + foreach( BusinessService bs in ServiceDetail.BusinessServices ) + { + bs.Save(); + } + } + + if( null != BindingDetail ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing bindings..." ); + foreach( BindingTemplate bind in BindingDetail.BindingTemplates ) + { + bind.Save(); + } + } + } + } + + [SoapDocumentService( ParameterStyle=SoapParameterStyle.Bare, RoutingStyle=SoapServiceRoutingStyle.RequestElement )] + [WebService( Namespace=UDDI.API.Extensions.Constants.Namespace )] + public class CategoryMessages + { + public CategoryMessages(){} + + [WebMethod, SoapDocumentMethod( Action="\"\"", RequestElementName="get_relatedCategories" )] + [UDDIExtension( messageType="get_relatedCategories" )] + public CategoryList GetRelatedCategories( GetRelatedCategories message ) + { + Debug.Enter(); + CategoryList list = null; + + try + { + list = message.Get(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + + return list; + } + } + + [XmlType( Namespace=UDDI.API.Extensions.Constants.Namespace )] + [XmlRoot( "get_relatedCategories", Namespace=UDDI.API.Extensions.Constants.Namespace )] + public class GetRelatedCategories + { + public GetRelatedCategories(){} + + [XmlIgnore] + public CategoryCollection Categories = new CategoryCollection(); + + [XmlElement( "category" )] + public Category[] CategoriesSerialize + { + get + { + return Categories.ToArray(); + } + set + { + Categories.CopyTo( value ); + } + } + + public CategoryList Get() + { + // + // For each category retrieve + // the request stuff ( root, children, parents ) + // + CategoryList list = new CategoryList(); + foreach( Category cat in Categories ) + { + CategoryInfo info = new CategoryInfo( cat.TModelKey, cat.KeyValue ); + info.Get( cat.RelationshipQualifiers ); + + list.CategoryInfos.Add( info ); + } + + return list; + } + } + + public class CategorizationScheme + { + // + // TODO: Must tModel element must be optional with tModelKey element + // + + private int CategorizationSchemeFlag = 1; + + [XmlAttribute( "checked" )] + public XmlBoolType Checked + { + get { return ( 1 == CategorizationSchemeFlag ) ? XmlBoolType.True : XmlBoolType.False; } + set + { + if( XmlBoolType.True == value ) + CategorizationSchemeFlag = 1; + else + CategorizationSchemeFlag = 0;//changed from 2 to 0 to correctly implement bit flags + } + } + + [XmlElement( "tModel", Namespace=UDDI.API.Constants.Namespace )] + public TModel TModel = null; + + [XmlElement( "tModelKey" )] + public string TModelKey + { + get + { + return tModelKey; + } + set + { + if( null == value ) + tModelKey = null; + else + tModelKey = value.Trim(); + } + } + private string tModelKey = ""; + + [XmlElement( "categoryValue" )] + public CategoryValueCollection CategoryValues + { + get + { + if( null == categoryvalues ) + categoryvalues = new CategoryValueCollection(); + + return categoryvalues; + } + + set + { + categoryvalues = value; + } + } + private CategoryValueCollection categoryvalues; + + public CategorizationScheme(){} + + public void Delete() + { + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "net_taxonomy_delete", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetGuidFromKey( "@tModelKey", tModelKey ); + + cmd.ExecuteNonQuery(); + + Debug.Leave(); + } + + public void Save() + { + string tmodelkey; + + Debug.Enter(); + + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing categorization scheme..." ); + + if( null != TModel ) + { + TModel.AuthorizedName = null; + TModel.Save(); + } + else + { + TModel = new TModel( TModelKey ); + TModel.Get(); + } + + // + // If the TModel Provided is categorized with 'Browsing Intended' + // Set the flag (0x0002) + // + //if( TModel.CategoryBag.Contains( new KeyedReference( "Browsing Intended","1","uuid:BE37F93E-87B4-4982-BF6D-992A8E44EDAB" ) ) ) + foreach( KeyedReference kr in TModel.CategoryBag ) + { + if( kr.KeyValue=="1" && kr.TModelKey.ToUpper()=="UUID:BE37F93E-87B4-4982-BF6D-992A8E44EDAB" ) + CategorizationSchemeFlag = CategorizationSchemeFlag | 0x0002; + } + + // + // Store the TModelKey + // + tmodelkey = TModel.TModelKey; + + // + // Save the categorization scheme + // + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_taxonomy_save"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + sp.Parameters.Add( "@taxonomyID", SqlDbType.BigInt, ParameterDirection.InputOutput ); + + sp.Parameters.SetGuidFromKey( "@tModelKey", tmodelkey ); + sp.Parameters.SetInt( "@flag", CategorizationSchemeFlag ); + + sp.ExecuteNonQuery(); + + int taxonomyID = sp.Parameters.GetInt( "@taxonomyID" ); + + // + // Save the category values + // + + foreach( CategoryValue cv in CategoryValues ) + { + cv.Save( tmodelkey ); + } + + Debug.Leave(); + } + + public void Get() + { + Debug.Enter(); + + // + // Retrieve the taxonomy + // + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_taxonomy_get" ); + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int, ParameterDirection.InputOutput ); + + sp.Parameters.SetGuidFromKey( "@tModelKey", tModelKey ); + sp.Parameters.SetNull( "@flag" ); + + sp.ExecuteScalar(); + + // + // Set the flag value + // + + CategorizationSchemeFlag = sp.Parameters.GetInt( "@flag" ); + + // + // Retrieve the taxonomy values + // + + CategoryValues.Clear(); + + SqlStoredProcedureAccessor sp2 = new SqlStoredProcedureAccessor( "net_taxonomyValues_get" ); + sp2.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp2.Parameters.SetGuidFromKey( "@tModelKey", tModelKey ); + SqlDataReaderAccessor reader = sp2.ExecuteReader(); + + try + { + while( reader.Read() ) + { + CategoryValues.Add( reader.GetString( "keyName" ), reader.GetString( "keyValue" ), reader.GetString( "parentKeyValue"), ( ( reader.GetInt( "valid" ) == 1 ) ? true : false ) ); + } + } + finally + { + reader.Close(); + } + + Debug.Leave(); + } + } + + public enum ValidForCategorization + { + [XmlEnumAttribute( "false" )] + False = 0, + [XmlEnumAttribute( "true" )] + True = 1, + } + + public class CategorizationSchemeCollection : CollectionBase + { + public CategorizationSchemeCollection() + { + } + public void Save() + { + Debug.Enter(); + + foreach( CategorizationScheme tax in this ) + { + tax.Save(); + } + + Debug.Leave(); + } + + public CategorizationScheme this[int index] + { + get { return (CategorizationScheme)List[index]; } + set { List[index] = value; } + } + + public int Add(CategorizationScheme value) + { + return List.Add(value); + } + + public void Insert(int index, CategorizationScheme value) + { + List.Insert(index, value); + } + + public int IndexOf( CategorizationScheme value ) + { + return List.IndexOf( value ); + } + + public bool Contains( CategorizationScheme value ) + { + return List.Contains( value ); + } + + public void Remove( CategorizationScheme value ) + { + List.Remove( value ); + } + + public void CopyTo(CategorizationScheme[] array, int index) + { + List.CopyTo( array, index ); + } + + public void CopyTo( CategorizationScheme[] array ) + { + foreach( CategorizationScheme tax in array ) + Add( tax ); + } + + public CategorizationScheme[] ToArray() + { + return (CategorizationScheme[]) InnerList.ToArray( typeof( CategorizationScheme ) ); + } + } + + public class Category + { + [XmlElement( "relationshipQualifier" )] + public RelationshipQualifier[] RelationshipQualifiers; + + [XmlAttribute( "tModelKey" )] + public string TModelKey; + + [XmlAttribute( "keyValue" )] + public string KeyValue; + } + + public enum RelationshipQualifier + { + root = 1, parent = 2, child = 3 + } + + [XmlRoot( "categoryList", Namespace=UDDI.API.Extensions.Constants.Namespace )] + public class CategoryList + { + [XmlAttribute( "truncated" )] + public bool Truncated = false; + + [XmlAttribute( "operator" )] + public string Operator = Config.GetString( "Operator" ); + + [XmlIgnore] + public CategoryInfoCollection CategoryInfos = new CategoryInfoCollection(); + + [XmlElement( "categoryInfo" )] + public CategoryInfo[] CategoryInfosSerialize + { + get + { + return CategoryInfos.ToArray(); + } + set + { + CategoryInfos.CopyTo( value ); + } + } + + public CategoryList(){} + } + + public class CategoryInfo : CategoryValue + { + const int KeyValueIndex = 0; + const int ParentKeyValueIndex = 1; + const int KeyNameIndex = 2; + const int IsValidIndex = 3; + + // -- 0 - Root information requested + // -- 1 - Child information requested + // -- 2 - Parent information requested + // -- 3 - Current information requested + + public enum RelationType : int + { + Root = 0, + Child = 1, + Parent = 2, + Current = 3 + } + + [XmlArray( "rootRelationship" ), XmlArrayItem( "categoryValue" )] + public CategoryValueCollection Roots = null; + + [XmlArray( "parentRelationship" ), XmlArrayItem( "categoryValue" )] + public CategoryValueCollection Parents = null; + + [XmlArray( "childRelationship" ), XmlArrayItem( "categoryValue" )] + public CategoryValueCollection Children = null; + + public CategoryInfo( string tmodelkey, string keyvalue ) + : base( tmodelkey, keyvalue ) + { + } + + public SqlDataReader GetValues( RelationType relation ) + { + SqlCommand cmd = new SqlCommand( "net_taxonomyValue_get", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Add parameters and set values + // + SqlParameterAccessor populator = new SqlParameterAccessor( cmd.Parameters ); + + cmd.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + cmd.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + cmd.Parameters.Add( "@relation", SqlDbType.Int ); + + populator.SetGuidFromKey( "@tModelKey", TModelKey ); + populator.SetString( "@keyValue", KeyValue ); + populator.SetInt( "@relation", (int) relation ); + + return cmd.ExecuteReader(); + } + + public void Get( RelationshipQualifier[] relations ) + { + if( null != KeyValue ) + { + // + // The request can ask for Root stuff with just the TModelKey + // + SqlDataReader rdr = GetValues( RelationType.Current ); + + try + { + SqlDataReaderAccessor dracc = new SqlDataReaderAccessor( rdr ); + + if( rdr.Read() ) + { + this.KeyName = dracc.GetString( KeyNameIndex ); + this.IsValid = ( 1 == dracc.GetInt( IsValidIndex ) ); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_invalidValue, "UDDI_ERROR_INVALIDVALUE_VALUENOTFOUND" ); + } + } + finally + { + rdr.Close(); + } + } + + if( null != relations ) + { + foreach( RelationshipQualifier rq in relations ) + { + switch( rq ) + { + case RelationshipQualifier.root: + GetRoots(); + break; + + case RelationshipQualifier.child: + GetChildren(); + break; + + case RelationshipQualifier.parent: + GetParents(); + break; + } + } + } + } + + public void GetRoots() + { + Roots = new CategoryValueCollection(); + SqlDataReader rdr = GetValues( RelationType.Root ); + + try + { + SqlDataReaderAccessor dracc = new SqlDataReaderAccessor( rdr ); + + while( rdr.Read() ) + { + Roots.Add( dracc.GetString( KeyNameIndex ), + dracc.GetString( KeyValueIndex ), + dracc.GetString( ParentKeyValueIndex ), + ( 1 == dracc.GetInt( IsValidIndex ) ) ); + } + } + finally + { + rdr.Close(); + } + } + + public void GetChildren() + { + Children = new CategoryValueCollection(); + SqlDataReader rdr = GetValues( RelationType.Child ); + + try + { + SqlDataReaderAccessor dracc = new SqlDataReaderAccessor( rdr ); + + while( rdr.Read() ) + { + Children.Add( dracc.GetString( KeyNameIndex ), + dracc.GetString( KeyValueIndex ), + dracc.GetString( ParentKeyValueIndex ), + ( 1 == dracc.GetInt( IsValidIndex ) ) ); + } + } + finally + { + rdr.Close(); + } + } + + public void GetParents() + { + Parents = new CategoryValueCollection(); + SqlDataReader rdr = GetValues( RelationType.Parent ); + + try + { + SqlDataReaderAccessor dracc = new SqlDataReaderAccessor( rdr ); + + while( rdr.Read() ) + { + Parents.Add( dracc.GetString( KeyNameIndex ), + dracc.GetString( KeyValueIndex ), + dracc.GetString( ParentKeyValueIndex ), + ( 1 == dracc.GetInt( IsValidIndex ) ) ); + } + } + finally + { + rdr.Close(); + } + } + + public CategoryInfo(){} + } + + [XmlInclude( typeof( CategoryInfo ) )] + public class CategoryValue + { + [XmlAttribute( "tModelKey" )] + public string TModelKey = null; + + [XmlAttribute( "keyName" )] + public string KeyName = null; + + [XmlAttribute( "keyValue" )] + public string KeyValue = null; + + [XmlAttribute( "parentKeyValue" )] + public string ParentKeyValue = null; + + [XmlAttribute( "isValid" )] + public bool IsValid = false; + + public CategoryValue() + { + } + + public CategoryValue( string tmodelkey, string keyvalue ) + { + TModelKey = tmodelkey; + KeyValue = keyvalue; + } + + public CategoryValue( string keyname, string keyvalue, string parent, bool isvalid ) + { + KeyName = keyname; + KeyValue = keyvalue; + ParentKeyValue = parent; + IsValid = isvalid; + } + + public void Save( string TModelKey ) + { + Debug.Enter(); + + if( !Utility.StringEmpty( ParentKeyValue ) ) + Debug.Verify( KeyValue != ParentKeyValue, "UDDI_ERROR_FATALERROR_PARENTKEYEQUALSVALUE", ErrorType.E_fatalError ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_taxonomyValue_save" ); + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@parentKeyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName ); + sp.Parameters.Add( "@valid", SqlDbType.Bit ); + + sp.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + sp.Parameters.SetString( "@keyValue", KeyValue ); + sp.Parameters.SetString( "@parentKeyValue", ParentKeyValue ); + sp.Parameters.SetString( "@keyName", KeyName ); + sp.Parameters.SetBool( "@valid" , IsValid ); + + sp.ExecuteNonQuery(); + + Debug.Leave(); + } + } + + public class CategoryValueCollection : CollectionBase + { + public CategoryValueCollection() + { + } + + public CategoryValue this[int index] + { + get + { return (CategoryValue)List[index]; } + set + { List[index] = value; } + } + public int Add( string keyname, string keyvalue, string parent, bool isvalid ) + { + return List.Add( new CategoryValue( keyname, keyvalue, parent, isvalid ) ); + } + + public int Add(CategoryValue value) + { + return List.Add(value); + } + + public void Insert(int index, CategoryValue value) + { + List.Insert(index, value); + } + + public int IndexOf( CategoryValue value ) + { + return List.IndexOf( value ); + } + + public bool Contains( CategoryValue value ) + { + return List.Contains( value ); + } + + public void Remove( CategoryValue value ) + { + List.Remove( value ); + } + + public void CopyTo(CategoryValue[] array, int index) + { + List.CopyTo( array, index ); + } + + public void CopyTo( CategoryValue[] array ) + { + foreach( CategoryValue tax in array ) + Add( tax ); + } + + public CategoryValue[] ToArray() + { + return (CategoryValue[]) InnerList.ToArray( typeof( CategoryValue ) ); + } + } + + public class CategoryCollection : CollectionBase + { + public CategoryCollection() + { + } + + public Category this[int index] + { + get { return (Category)List[index]; } + set { List[index] = value; } + } + + public int Add(Category value) + { + return List.Add(value); + } + + public void Insert(int index, Category value) + { + List.Insert(index, value); + } + + public int IndexOf( Category value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Category value ) + { + return List.Contains( value ); + } + + public void Remove( Category value ) + { + List.Remove( value ); + } + + public void CopyTo(Category[] array, int index) + { + List.CopyTo( array, index ); + } + + public void CopyTo( Category[] array ) + { + foreach( Category tax in array ) + Add( tax ); + } + + public Category[] ToArray() + { + return (Category[]) InnerList.ToArray( typeof( Category ) ); + } + } + + public class CategoryInfoCollection : CollectionBase + { + public CategoryInfoCollection() + { + } + + public CategoryInfo this[int index] + { + get + { return (CategoryInfo)List[index]; } + set + { List[index] = value; } + } + + public int Add(CategoryInfo value) + { + return List.Add(value); + } + + public void Insert(int index, CategoryInfo value) + { + List.Insert(index, value); + } + + public int IndexOf( CategoryInfo value ) + { + return List.IndexOf( value ); + } + + public bool Contains( CategoryInfo value ) + { + return List.Contains( value ); + } + + public void Remove( CategoryInfo value ) + { + List.Remove( value ); + } + + public void CopyTo(CategoryInfo[] array, int index) + { + List.CopyTo( array, index ); + } + + public void CopyTo( CategoryInfo[] array ) + { + foreach( CategoryInfo tax in array ) + Add( tax ); + } + + public CategoryInfo[] ToArray() + { + return (CategoryInfo[]) InnerList.ToArray( typeof( CategoryInfo ) ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/api/changerecord.cs b/inetsrv/uddi/source/api/changerecord.cs new file mode 100644 index 0000000..0f01ee8 --- /dev/null +++ b/inetsrv/uddi/source/api/changerecord.cs @@ -0,0 +1,963 @@ +using System; +using System.Collections; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.Serialization; + +using UDDI; +using UDDI.API; +using UDDI.API.Binding; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Replication +{ + public abstract class ChangeRecordBase + { + public abstract UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType { get; } + public abstract void Process( long LSN ); + } + + [ XmlRoot( "changeRecord", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecord + { + // + // Attribute: acknowledgementRequested + // + [ XmlAttribute( "acknowledgementRequested" ) ] + public bool AcknowledgementRequested = false; + + // + // Element: changeID + // + private ChangeRecordVector changeID; + + [ XmlElement( "changeID" ) ] + public ChangeRecordVector ChangeID + { + get + { + if( null == changeID ) + changeID = new ChangeRecordVector(); + + return changeID; + } + + set { changeID = value; } + } + + // + // Element: changeRecordAcknowledgement | + // changeRecordCorrection | + // changeRecordCustodyTransfer | + // changeRecordDelete | + // changeRecordDeleteAssertion | + // changeRecordHide | + // changeRecordNewData | + // changeRecordNull | + // changeRecordPublisherAssertion | + // changeRecordSetAssertions + // + private ChangeRecordBase payload; + + [ XmlElement( "changeRecordAcknowledgement", typeof( ChangeRecordAcknowledgement ) ) ] + [ XmlElement( "changeRecordCorrection", typeof( ChangeRecordCorrection ) ) ] + [ XmlElement( "changeRecordCustodyTransfer", typeof( ChangeRecordCustodyTransfer ) ) ] + [ XmlElement( "changeRecordDelete", typeof( ChangeRecordDelete ) ) ] + [ XmlElement( "changeRecordDeleteAssertion", typeof( ChangeRecordDeleteAssertion ) ) ] + [ XmlElement( "changeRecordHide", typeof( ChangeRecordHide ) ) ] + [ XmlElement( "changeRecordNewData", typeof( ChangeRecordNewData ) ) ] + [ XmlElement( "changeRecordNull", typeof( ChangeRecordNull ) ) ] + [ XmlElement( "changeRecordPublisherAssertion", typeof( ChangeRecordPublisherAssertion ) ) ] + [ XmlElement( "changeRecordSetAssertions", typeof( ChangeRecordSetAssertions ) ) ] + public ChangeRecordBase Payload + { + get { return payload; } + set { payload = value; } + } + + public ChangeRecord() + { + ChangeID.NodeID = null; + ChangeID.OriginatingUSN = 0; + Payload = null; + } + + public ChangeRecord( ChangeRecordBase payload ) + { + ChangeID.NodeID = null; + ChangeID.OriginatingUSN = 0; + Payload = payload; + } + + public ChangeRecord( ChangeRecordVector changeID, ChangeRecordBase payload ) + { + ChangeID = changeID; + Payload = payload; + } + + /// **************************************************************** + /// public Process + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Process() + { + // + // Add the change record to our change log as a foreign change. + // + long LSN = Log(); + + // + // Process the change record payload. + // + Payload.Process( LSN ); + + // + // If an acknowledgement was requested, generate a + // acknowledgement change record. + // + if( AcknowledgementRequested ) + { + // + // Save the log entry as our local system account, not the + // current user. + // + string puid = Context.User.ID; + Context.User.ID = null; + + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.Payload = new ChangeRecordAcknowledgement( ChangeID ); + changeRecord.Log(); + + Context.User.ID = puid; + } + } + + public long Log() + { + string changeData; + + // + // Serialize the change data. + // + Type type = Payload.GetType(); + + //XmlSerializer serializer = new XmlSerializer( type ); + XmlSerializer serializer = XmlSerializerManager.GetSerializer( type ); + XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(); + UTF8EncodedStringWriter stringWriter = new UTF8EncodedStringWriter(); + + try + { + namespaces.Add( "", "urn:uddi-org:repl" ); + + serializer.Serialize( stringWriter, Payload, namespaces ); + changeData = stringWriter.ToString(); + } + finally + { + stringWriter.Close(); + } + + // + // Store the record in the change log. + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_changeRecord_save" ); + + sp.Parameters.Add( "@USN", SqlDbType.BigInt ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@delegatePUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@entityKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@entityTypeID", SqlDbType.TinyInt ); + sp.Parameters.Add( "@changeTypeID", SqlDbType.TinyInt ); + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@contextTypeID", SqlDbType.TinyInt ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + sp.Parameters.Add( "@changeData", SqlDbType.NText ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + sp.Parameters.Add( "@seqNo", SqlDbType.BigInt, ParameterDirection.Output ); + + if( Utility.StringEmpty( ChangeID.NodeID ) || + 0 == String.Compare( Config.GetString( "OperatorKey" ), ChangeID.NodeID, true ) ) + { + sp.Parameters.SetNull( "@USN" ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetString( "@delegatePUID", Context.User.ImpersonatorID ); + sp.Parameters.SetNull( "@operatorKey" ); + } + else + { + sp.Parameters.SetLong( "@USN", changeID.OriginatingUSN ); + sp.Parameters.SetNull( "@PUID" ); + sp.Parameters.SetNull( "@delegatePUID" ); + sp.Parameters.SetGuidFromString( "@operatorKey", changeID.NodeID ); + } + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetInt( "@flag", AcknowledgementRequested ? 0x1 : 0x0 ); + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + sp.Parameters.SetShort( "@contextTypeID", (short)Context.ContextType ); + sp.Parameters.SetShort( "@changeTypeID", (short)Payload.ChangeRecordPayloadType ); + + if( Payload is ChangeRecordNewData ) + { + ChangeRecordNewData payload = (ChangeRecordNewData)Payload; + + sp.Parameters.SetShort( "@entityTypeID", (short)payload.EntityType ); + + if( EntityType.TModel == payload.EntityType ) + sp.Parameters.SetGuidFromKey( "@entityKey", payload.Entity.EntityKey ); + else + sp.Parameters.SetGuidFromString( "@entityKey", payload.Entity.EntityKey ); + } + else if( Payload is ChangeRecordDelete ) + { + ChangeRecordDelete payload = (ChangeRecordDelete)Payload; + + sp.Parameters.SetShort( "@entityTypeID", (short)payload.EntityType ); + + if( EntityType.TModel == payload.EntityType ) + sp.Parameters.SetGuidFromKey( "@entityKey", payload.EntityKey ); + else + sp.Parameters.SetGuidFromString( "@entityKey", payload.EntityKey ); + } + else if( Payload is ChangeRecordHide ) + { + sp.Parameters.SetShort( "@entityTypeID", (short)EntityType.TModel ); + sp.Parameters.SetGuidFromKey( "@entityKey", ((ChangeRecordHide)Payload).TModelKey ); + } + else + { + sp.Parameters.SetNull( "@entityTypeID" ); + sp.Parameters.SetNull( "@entityKey" ); + } + + sp.Parameters.SetString( "@changeData", changeData ); + + sp.ExecuteNonQuery(); + + return sp.Parameters.GetLong( "@seqNo" ); + } + + public override string ToString() + { + // XmlSerializer serializer = new XmlSerializer( GetType() ); + XmlSerializer serializer = XmlSerializerManager.GetSerializer( GetType() ); + UTF8EncodedStringWriter stringWriter = new UTF8EncodedStringWriter (); + + try + { + serializer.Serialize( stringWriter, this ); + return stringWriter.ToString(); + } + finally + { + stringWriter.Close(); + } + } + } + + [ XmlRoot( "changeRecordAcknowledgement", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordAcknowledgement : ChangeRecordBase + { + // + // Element: acknowledgedChange + // + [ XmlElement( "acknowledgedChange" ) ] + public ChangeRecordVector AcknowledgedChange; + + public ChangeRecordAcknowledgement() + { + } + + public ChangeRecordAcknowledgement( ChangeRecordVector acknowledgedChange ) + { + this.AcknowledgedChange = acknowledgedChange; + } + + public override void Process( long LSN ) + { + } + + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordAcknowledgement; } + } + } + + [ XmlRoot( "changeRecordCorrection", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordCorrection : ChangeRecordBase + { + // + // Element: changeRecord + // + [ XmlElement( "changeRecord" ) ] + public ChangeRecord ChangeRecord; + + public override void Process( long LSN ) + { + // + // Annotate the change record in our database with this + // correction's LSN. The correction's payload will be + // used as the updated data on future get_changeRecords + // requests. + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_changeRecord_update"; + + sp.Parameters.Add( "@seqNo", SqlDbType.BigInt ); + sp.Parameters.Add( "@USN", SqlDbType.BigInt ); + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@newSeqNo", SqlDbType.BigInt ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + + if( true == ChangeRecord.ChangeID.NodeID.ToLower().Equals( Config.GetString( "OperatorKey" ).ToLower() ) ) + { + // + // We are correcting a local change + // + sp.Parameters.SetLong( "@seqNo", ChangeRecord.ChangeID.OriginatingUSN ); + sp.Parameters.SetNull( "@USN" ); + } + else + { + // + // We are correcting a foreign change + // + sp.Parameters.SetLong( "@USN", ChangeRecord.ChangeID.OriginatingUSN ); + sp.Parameters.SetNull( "@seqNo" ); + } + + sp.Parameters.SetGuidFromString( "@operatorKey", ChangeRecord.ChangeID.NodeID ); + sp.Parameters.SetLong( "@newSeqNo", LSN ); + + sp.ExecuteNonQuery(); + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordCorrection; } + } + } + + [ XmlRoot( "changeRecordCustodyTransfer", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordCustodyTransfer : ChangeRecordBase + { + public override void Process( long LSN ) + { + + } + + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordCustodyTransfer; } + } + } + + [ XmlRoot( "changeRecordDelete", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordDelete : ChangeRecordBase + { + private string entityKey; + private EntityBase entity; + + // + // Element: businessKey + // + [ XmlElement( "businessKey", Namespace=UDDI.API.Constants.Namespace ) ] + public string BusinessKey + { + get + { + if( entity is BusinessEntity ) + return entityKey; + + return null; + } + + set + { + Debug.Verify( Utility.StringEmpty( entityKey ), "UDDI_ERROR_FATALERROR_DELETE_MULTIPLEKEYS" ); + + entity = new BusinessEntity( value ); + entityKey = value; + } + } + + // + // Element: serviceKey + // + [ XmlElement( "serviceKey", Namespace=UDDI.API.Constants.Namespace ) ] + public string ServiceKey + { + get + { + if( entity is BusinessService ) + return entityKey; + + return null; + } + + set + { + Debug.Verify( Utility.StringEmpty( entityKey ), "UDDI_ERROR_FATALERROR_DELETE_MULTIPLEKEYS" ); + + entity = new BusinessService( value ); + entityKey = value; + } + } + + // + // Element: bindingKey + // + [ XmlElement( "bindingKey", Namespace=UDDI.API.Constants.Namespace ) ] + public string BindingKey + { + get + { + if( entity is BindingTemplate ) + return entityKey; + + return null; + } + + set + { + Debug.Verify( Utility.StringEmpty( entityKey ), "UDDI_ERROR_FATALERROR_DELETE_MULTIPLEKEYS" ); + + entity = new BindingTemplate( value ); + entityKey = value; + } + } + + // + // Element: tModelKey + // + [ XmlElement( "tModelKey", Namespace=UDDI.API.Constants.Namespace ) ] + public string TModelKey + { + get + { + if( entity is TModel ) + return entityKey; + + return null; + } + + set + { + Debug.Verify( Utility.StringEmpty( entityKey ), "UDDI_ERROR_FATALERROR_DELETE_MULTIPLEKEYS" ); + + // TODO: since tModels should normally not be deleted (they + // should be hidden), put a warning in the event log. + + entity = new TModel( value ); + entityKey = value; + } + } + + [ XmlIgnore ] + public UDDI.EntityType EntityType + { + get { return entity.EntityType; } + } + + [ XmlIgnore ] + public string EntityKey + { + get { return entityKey; } + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordDelete; } + } + + public ChangeRecordDelete() + { + } + + public ChangeRecordDelete( EntityType entityType, string entityKey ) + { + this.entityKey = entityKey; + + switch( entityType ) + { + case EntityType.BusinessEntity: + this.entity = new BusinessEntity( entityKey ); + break; + + case EntityType.BusinessService: + this.entity = new BusinessService( entityKey ); + break; + + case EntityType.BindingTemplate: + this.entity = new BindingTemplate( entityKey ); + break; + + case EntityType.TModel: + this.entity = new TModel( entityKey ); + break; + } + } + + public override void Process( long LSN ) + { + // + // Process a change record delete by deleting the entity. + // + entity.Delete(); + } + } + + [ XmlRoot( "changeRecordDeleteAssertion", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordDeleteAssertion : ChangeRecordBase + { + [ XmlElement( "publisherAssertion", Namespace=UDDI.API.Constants.Namespace ) ] + public PublisherAssertion Assertion; + + [ XmlElement( "fromBusinessCheck" ) ] + public bool FromBusinessCheck; + + [ XmlElement( "toBusinessCheck" ) ] + public bool ToBusinessCheck; + + public override void Process( long LSN ) + { + // + // Process a change record delete assertion by deleting the assertion. + // + if( !FromBusinessCheck && !ToBusinessCheck ) + { + Debug.OperatorMessage( SeverityType.Warning, + CategoryType.Replication, + OperatorMessageType.None, + "FromBusinessCheck and ToBusinessCheck cannot both be false in a ChangeRecordDeleteAssertion message" ); + } + else + { + CompletionStatusType status; + + status = (CompletionStatusType) + ( ( FromBusinessCheck ? 0x02 : 0x00 ) | + ( ToBusinessCheck ? 0x01 : 0x00 ) ); + + Assertion.Delete( status ); + } + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordDeleteAssertion; } + } + + public ChangeRecordDeleteAssertion() + { + } + + public ChangeRecordDeleteAssertion( PublisherAssertion assertion, CompletionStatusType completion ) + { + Assertion = assertion; + + FromBusinessCheck = ( 0x02 == ( (int)completion & 0x02 ) ); + ToBusinessCheck = ( 0x01 == ( (int)completion & 0x01 ) ); + } + } + + [ XmlRoot( "changeRecordHide", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordHide : ChangeRecordBase + { + [ XmlElement( "tModelKey", Namespace=UDDI.API.Constants.Namespace ) ] + public string TModelKey; + + public override void Process( long LSN ) + { + // + // Process change record hide by deleting the specified tModel. + // + TModel tModel = new TModel( TModelKey ); + tModel.Hide(); + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordHide; } + } + + public ChangeRecordHide() + { + } + + public ChangeRecordHide( string tModelKey ) + { + TModelKey = tModelKey; + } + } + + [ XmlRoot( "changeRecordNewData", Namespace="urn:uddi-org:repl" ) ] + [ XmlInclude( typeof( BusinessEntity ) ) ] + [ XmlInclude( typeof( BusinessService ) ) ] + [ XmlInclude( typeof( BindingTemplate ) ) ] + [ XmlInclude( typeof( TModel ) ) ] + public class ChangeRecordNewData : ChangeRecordBase + { + // + // Element: businessEntity | + // businessService | + // bindingTemplate | + // tModel + // + [ XmlElement( "businessEntity", typeof( BusinessEntity ), Namespace=UDDI.API.Constants.Namespace ) ] + [ XmlElement( "businessService", typeof( BusinessService ), Namespace=UDDI.API.Constants.Namespace ) ] + [ XmlElement( "bindingTemplate", typeof( BindingTemplate ), Namespace=UDDI.API.Constants.Namespace ) ] + [ XmlElement( "tModel", typeof( TModel ), Namespace=UDDI.API.Constants.Namespace ) ] + public EntityBase Entity; + + public ChangeRecordNewData() + { + } + + public ChangeRecordNewData( EntityBase entity ) + { + this.Entity = entity; + } + + [ XmlIgnore ] + public UDDI.EntityType EntityType + { + get { return Entity.EntityType; } + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordNewData; } + } + + /// **************************************************************** + /// public Process + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public override void Process( long LSN ) + { + // + // We process a new data change record by saving the entity to + // the registry. + // + Entity.Save(); + } + } + + [ XmlRoot( "changeRecordNull", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordNull : ChangeRecordBase + { + public override void Process( long LSN ) + { + // + // Nothing to do for a null change record. + // + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordNull; } + } + } + + [ XmlRoot( "changeRecordPublisherAssertion", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordPublisherAssertion : ChangeRecordBase + { + [ XmlElement( "publisherAssertion", Namespace=UDDI.API.Constants.Namespace ) ] + public PublisherAssertion Assertion; + + [ XmlElement( "fromBusinessCheck" ) ] + public bool FromBusinessCheck; + + [ XmlElement( "toBusinessCheck" ) ] + public bool ToBusinessCheck; + + public override void Process( long LSN ) + { + // + // Process a change record assertion by saving the assertion. + // + + if( !FromBusinessCheck && !ToBusinessCheck ) + { + Debug.OperatorMessage( SeverityType.Warning, + CategoryType.Replication, + OperatorMessageType.None, + "FromBusinessCheck and ToBusinessCheck cannot both be false in a ChangeRecordPublisherAssertion message" ); + } + else + { + CompletionStatusType status; + + status = (CompletionStatusType) + ( ( FromBusinessCheck ? 0x02 : 0x00 ) | + ( ToBusinessCheck ? 0x01 : 0x00 ) ); + + + Assertion.Save( status ); + } + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordPublisherAssertion; } + } + + public ChangeRecordPublisherAssertion() + { + } + + public ChangeRecordPublisherAssertion( PublisherAssertion assertion, CompletionStatusType status ) + { + Assertion = assertion; + + FromBusinessCheck = ( 0x02 == ( (int)status & 0x02 ) ); + ToBusinessCheck = ( 0x01 == ( (int)status & 0x01 ) ); + } + } + + [ XmlRoot( "changeRecordSetAssertions", Namespace="urn:uddi-org:repl" ) ] + public class ChangeRecordSetAssertions : ChangeRecordBase + { + [ XmlElement( "changeRecordPublisherAssertion" ) ] + public ChangeRecordPublisherAssertionCollection Assertions; + + public override void Process( long LSN ) + { + foreach( ChangeRecordPublisherAssertion assertion in Assertions ) + assertion.Process( LSN ); + } + + [ XmlIgnore ] + public override UDDI.API.ChangeRecordPayloadType ChangeRecordPayloadType + { + get { return ChangeRecordPayloadType.ChangeRecordSetAssertions; } + } + } + + public class ChangeRecordCollection : CollectionBase + { + public ChangeRecord this[ int index ] + { + get{ return (ChangeRecord)List[ index ]; } + set{ List[ index ] = value; } + } + + public int Add( ChangeRecord changeRecord ) + { + return List.Add( changeRecord ); + } + + public int Add() + { + return List.Add( new ChangeRecord() ); + } + + public void Insert( int index, ChangeRecord changeRecord ) + { + List.Insert( index, changeRecord ); + } + + public int IndexOf( ChangeRecord changeRecord ) + { + return List.IndexOf( changeRecord ); + } + public bool Contains( ChangeRecord changeRecord ) + { + return List.Contains( changeRecord ); + } + public void Remove( ChangeRecord changeRecord ) + { + List.Remove( changeRecord ); + } + public void CopyTo( ChangeRecord[ ] array, int index ) + { + InnerList.CopyTo( array, index ); + } + } + + // + // TODO: Consider renaming this class, the ChangeRecord... convention has become a bit confusing. + // Are things prefixed with "ChangeRecord" change records or is this just a prefix for + // association of these classes into a collective group. + // + // Consider the use of a namespace, maybe turning the semantic into + // ChangeRecord.Correction + // ChangeRecord.NewData + // and maybe event ChangeRecord.Vector, which is a little better than current. + // + // The spec uses the terms HighWaterMark and HightWaterMarkVector + // I think these might be better choices. + // + + public class ChangeRecordVector + { + // + // Element: nodeID + // + [ XmlElement( "nodeID" ) ] + public string NodeID; + + // + // Element: originatingUSN + // + [ XmlElement( "originatingUSN" ) ] + public long OriginatingUSN; + + public ChangeRecordVector() + { + } + + public ChangeRecordVector( string nodeID, long originatingUSN ) + { + this.NodeID = nodeID; + this.OriginatingUSN = originatingUSN; + } + } + + public class ChangeRecordVectorCollection : CollectionBase + { + public ChangeRecordVector this[ int index ] + { + get{ return (ChangeRecordVector)List[ index ]; } + set{ List[ index ] = value; } + } + + public int Add() + { + return List.Add( new ChangeRecordVector() ); + } + + public int Add( ChangeRecordVector vector ) + { + return List.Add( vector ); + } + + public int Add( string nodeID, long originatingUSN ) + { + return List.Add( new ChangeRecordVector( nodeID, originatingUSN ) ); + } + + public void Insert( int index, ChangeRecordVector vector ) + { + List.Insert( index, vector ); + } + + public int IndexOf( ChangeRecordVector vector ) + { + return List.IndexOf( vector ); + } + + public bool Contains( ChangeRecordVector vector ) + { + return List.Contains( vector ); + } + + public void Remove( ChangeRecordVector vector ) + { + List.Remove( vector ); + } + + public void CopyTo( ChangeRecordVector[ ] array, int index ) + { + InnerList.CopyTo( array, index ); + } + + public bool IsProcessed( ChangeRecordVector changeID ) + { + // + // TODO: Consider. If you find Node id and OriginatingUSNs are not equal return false + // avoiding checking the rest of the list + // + foreach( ChangeRecordVector vector in this ) + { + if( 0 == String.Compare( changeID.NodeID, vector.NodeID, true ) && + changeID.OriginatingUSN <= vector.OriginatingUSN ) + return true; + } + + return false; + } + + public void MarkAsProcessed( ChangeRecordVector changeID ) + { + foreach( ChangeRecordVector vector in this ) + { + if( 0 == String.Compare( changeID.NodeID, vector.NodeID, true ) ) + { + vector.OriginatingUSN = changeID.OriginatingUSN; + return; + } + } + + this.Add( changeID ); + } + } + + public class ChangeRecordPublisherAssertionCollection : CollectionBase + { + public ChangeRecordPublisherAssertion this[ int index ] + { + get{ return (ChangeRecordPublisherAssertion)List[ index ]; } + set{ List[ index ] = value; } + } + + public int Add() + { + return List.Add( new ChangeRecordPublisherAssertion() ); + } + + public int Add( ChangeRecordPublisherAssertion changeRecord ) + { + return List.Add( changeRecord ); + } + + public void Insert( int index, ChangeRecordPublisherAssertion changeRecord ) + { + List.Insert( index, changeRecord ); + } + + public int IndexOf( ChangeRecordPublisherAssertion changeRecord ) + { + return List.IndexOf( changeRecord ); + } + + public bool Contains( ChangeRecordPublisherAssertion changeRecord ) + { + return List.Contains( changeRecord ); + } + + public void Remove( ChangeRecordPublisherAssertion changeRecord ) + { + List.Remove( changeRecord ); + } + + public void CopyTo( ChangeRecordPublisherAssertion[ ] array, int index ) + { + InnerList.CopyTo( array, index ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/api/contact.cs b/inetsrv/uddi/source/api/contact.cs new file mode 100644 index 0000000..24b433b --- /dev/null +++ b/inetsrv/uddi/source/api/contact.cs @@ -0,0 +1,475 @@ +using System; +using System.Data; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API.Business +{ + public class Contact + { + // + // Attribute: useType + // + [ XmlAttribute( "useType" ) ] + public string UseType; + + // + // Element: description + // + private DescriptionCollection descriptions; + + [ XmlElement( "description" ) ] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // + // Element: personName + // + [ XmlElement( "personName" ) ] + public string PersonName + { + get{ return personName; } + set{ personName = value; } + } + private string personName; + + // + // Element: phone + // + private PhoneCollection phones; + + [ XmlElement( "phone" ) ] + public PhoneCollection Phones + { + get + { + if( null == phones ) + phones = new PhoneCollection(); + + return phones; + } + + set { phones = value; } + } + + // + // Element: email + // + private EmailCollection emails; + + [ XmlElement( "email" ) ] + public EmailCollection Emails + { + get + { + if( null == emails ) + emails = new EmailCollection(); + + return emails; + } + + set { emails = value; } + } + + // + // Element: address + // + private AddressCollection addresses; + + [ XmlElement( "address" ) ] + public AddressCollection Addresses + { + get + { + if( null == addresses ) + addresses = new AddressCollection(); + + return addresses; + } + + set { addresses = value; } + } + + public Contact() + { + } + + public Contact( string personName, string useType ) + { + PersonName = personName; + UseType = useType; + } + + internal void Validate() + { + Debug.Enter(); + + Utility.ValidateLength( ref UseType, "useType", UDDI.Constants.Lengths.UseType ); + Utility.ValidateLength( ref personName, "personName", UDDI.Constants.Lengths.PersonName ); + + Descriptions.Validate(); + Emails.Validate(); + Phones.Validate(); + Addresses.Validate(); + + Debug.Leave(); + } + + public void Save( string businessKey ) + { + // + // Create a command object to invoke the stored procedure + // + SqlCommand cmd = new SqlCommand( "net_businessEntity_contact_save", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Parameters + // + cmd.Parameters.Add( new SqlParameter( "@businessKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@personName", SqlDbType.NVarChar, UDDI.Constants.Lengths.PersonName ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@contactID", SqlDbType.BigInt ) ).Direction = ParameterDirection.Output; + + // + // Set parameter values and execute query + // + SqlParameterAccessor parmacc = new SqlParameterAccessor( cmd.Parameters ); + parmacc.SetGuidFromString( "@businessKey", businessKey ); + parmacc.SetString( "@personName", PersonName ); + parmacc.SetString( "@useType", UseType ); + + cmd.ExecuteScalar(); + + // + // Move out parameters into local variables + // + long ContactID = parmacc.GetLong( "@contactID" ); + + // + // Save sub-objects + // + Descriptions.Save( ContactID, EntityType.Contact ); + Phones.Save( ContactID ); + Emails.Save( ContactID ); + Addresses.Save( ContactID ); + } + + public void Get( int contactId ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_contact_get_batch" ); + + sp.Parameters.Add( "@contactId", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@contactId", contactId ); + + SqlDataReaderAccessor reader = null; + ArrayList addressIDs = new ArrayList(); + + try + { + // + // net_businessEntity_contact_get_batch will return the objects contained in a business in the following order: + // + // - descriptions + // - phones + // - emails + // - addresses + reader = sp.ExecuteReader(); + + // + // Read the descriptions + // + Descriptions.Read( reader ); + + // + // Read the phones + // + if ( true == reader.NextResult() ) + { + Phones.Read( reader ); + } + + // + // Read the emails + // + if ( true == reader.NextResult() ) + { + Emails.Read( reader ); + } + + // + // Read the addresses + // + if ( true == reader.NextResult() ) + { + addressIDs = Addresses.Read( reader ); + } + } + finally + { + if( reader != null ) + { + reader.Close(); + } + } + + // + // These calls will make separate sproc calls, so we have to close our reader first. + // + Addresses.Populate( addressIDs ); + +#if never + // + // Call get method on sub-objects personName and UseType + // should have been populate by contacts.get() method; + // + Descriptions.Get( contactId, EntityType.Contact ); + Phones.Get( contactId ); + Emails.Get( contactId ); + Addresses.Get( contactId ); +#endif + } + } + + public class ContactCollection : CollectionBase + { + internal void Validate() + { + foreach( Contact c in this ) + { + c.Validate(); + } + } + + public void Save( string businessKey ) + { + // + // Walk collection and call save on individual contact instances + // + foreach( Contact c in this ) + { + c.Save( businessKey ); + } + } + + public void Get( string businessKey ) + { + // + // Create a command object to invoke the stored procedure net_get_contacts + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_businessEntity_contacts_get" ); + + // + // Input parameters + // + cmd.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier, ParameterDirection.Input ); + cmd.Parameters.SetGuidFromString( "@businessKey", businessKey ); + + // + // Run the stored procedure + // + SqlDataReaderAccessor reader = cmd.ExecuteReader(); + ArrayList contactIds = null; + try + { + contactIds = Read( reader ); + } + finally + { + reader.Close(); + } + + Populate( contactIds ); +#if never + const int ContactIdIndex = 0; + const int UseTypeIndex = 1; + const int PersonNameIndex = 2; + ArrayList contactIds = new ArrayList(); + + // + // Create a command object to invoke the stored procedure net_get_contacts + // + SqlCommand cmd = new SqlCommand( "net_businessEntity_contacts_get", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Input parameters + // + cmd.Parameters.Add( new SqlParameter( "@businessKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + // + // Set parameter values + // + SqlParameterAccessor populator = new SqlParameterAccessor( cmd.Parameters ); + populator.SetGuidFromString( "@businessKey", businessKey ); + + // + // Run the stored procedure + // + SqlDataReader rdr = cmd.ExecuteReader(); + try + { + SqlDataReaderAccessor dracc = new SqlDataReaderAccessor( rdr ); + + // + // The contacts will be contained in the result set + // + while( rdr.Read() ) + { + // + // construct a new contact from the data in this row, fully populate contact and add to collection + // + Add( new Contact( dracc.GetString( PersonNameIndex ), dracc.GetString( UseTypeIndex ) ) ); + contactIds.Add( dracc.GetInt( ContactIdIndex ) ); + } + } + finally + { + rdr.Close(); + } + + int i = 0; + foreach( Contact contact in this ) + { + contact.Get( (int) contactIds[ i++ ] ); + } +#endif + } + + public ArrayList Read( SqlDataReaderAccessor reader ) + { + const int ContactIdIndex = 0; + const int UseTypeIndex = 1; + const int PersonNameIndex = 2; + ArrayList contactIds = new ArrayList(); + + // + // The contacts will be contained in the result set + // + while( reader.Read() ) + { + // + // construct a new contact from the data in this row, fully populate contact and add to collection + // + contactIds.Add( reader.GetInt( ContactIdIndex ) ); + Add( new Contact( reader.GetString( PersonNameIndex ), reader.GetString( UseTypeIndex ) ) ); + } + + return contactIds; + } + + public void Populate( ArrayList contactIds ) + { + int i = 0; + foreach( Contact contact in this ) + { + contact.Get( (int) contactIds[ i++ ] ); + } + } + + public Contact this[ int index ] + { + get { return ( Contact)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new Contact() ); + } + + public int Add( string personName ) + { + return List.Add( new Contact( personName, null ) ); + } + + public int Add( string personName, string useType ) + { + return List.Add( new Contact( personName, useType ) ); + } + + public int Add( Contact value ) + { + return List.Add( value ); + } + + public void Insert( int index, Contact value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Contact value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Contact value ) + { + return List.Contains( value ); + } + + public void Remove( Contact value ) + { + List.Remove( value ); + } + + public void CopyTo( Contact[] array ) + { + foreach( Contact contact in array ) + Add( contact ); + } + + public Contact[] ToArray() + { + return (Contact[])InnerList.ToArray( typeof( Contact ) ); + } + + public void Sort() + { + InnerList.Sort( new ContactComparer() ); + } + + internal class ContactComparer : IComparer + { + public int Compare( object x, object y ) + { + Contact entity1 = (Contact)x; + Contact entity2 = (Contact)y; + + + // + // Check for null PersonName. + // + if( null==entity1.PersonName && null==entity2.PersonName ) + return 0; + + else if( null==entity1.PersonName ) + return -1; + + else if( null==entity2.PersonName ) + return 1; + + else + return string.Compare( entity1.PersonName, entity2.PersonName, true ); + + } + } + } +} diff --git a/inetsrv/uddi/source/api/description.cs b/inetsrv/uddi/source/api/description.cs new file mode 100644 index 0000000..c62eb50 --- /dev/null +++ b/inetsrv/uddi/source/api/description.cs @@ -0,0 +1,465 @@ +using System; +using System.Data; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API +{ + public class Description + { + // + // Attribute: xml:lang + // + private string isoLangCode; + + [XmlAttribute("xml:lang")] + public string IsoLangCode + { + get { return isoLangCode; } + set { isoLangCode = value; } + } + + // + // Text + // + [XmlText] + public string Value; + + public Description() + { + } + + // + // 741019 - use the UDDI site language if one is not specified. + // + public Description( string description ) : this( Config.GetString( "Setup.WebServer.ProductLanguage", "en" ) , description ) + { + } + + public Description( string isoLangCode, string description ) + { + IsoLangCode = isoLangCode; + Value = description; + } + + public void Save( long parentID, EntityType parentType ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.Contact: + sp.ProcedureName = "net_contact_description_save"; + + sp.Parameters.Add( "@contactID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@contactID", parentID ); + + break; + + case EntityType.TModelInstanceInfo: + sp.ProcedureName = "net_bindingTemplate_tModelInstanceInfo_description_save"; + + sp.Parameters.Add( "@instanceID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@instanceID", parentID ); + + break; + + case EntityType.InstanceDetail: + sp.ProcedureName = "net_bindingTemplate_instanceDetails_description_save"; + + sp.Parameters.Add( "@instanceID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@instanceID", parentID ); + + break; + + case EntityType.InstanceDetailOverviewDoc: + sp.ProcedureName = "net_bindingTemplate_instanceDetails_overviewDoc_description_save"; + + sp.Parameters.Add( "@instanceID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@instanceID", parentID ); + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_DESCRPTION_INVALIDPARENTTYPE" , parentType.ToString() ); + } + + sp.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode ); + sp.Parameters.Add( "@description", SqlDbType.NVarChar, UDDI.Constants.Lengths.Description ); + + sp.Parameters.SetString( "@isoLangCode", IsoLangCode ); + sp.Parameters.SetString( "@description", Value ); + + sp.ExecuteNonQuery(); + + Debug.Leave(); + } + + public void Save( string parentKey, EntityType parentType ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.BusinessEntity: + sp.ProcedureName = "net_businessEntity_description_save"; + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", parentKey ); + + break; + + case EntityType.BusinessService: + sp.ProcedureName = "net_businessService_description_save"; + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@serviceKey", parentKey ); + + break; + + case EntityType.BindingTemplate: + sp.ProcedureName = "net_bindingTemplate_description_save"; + + sp.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@bindingKey", parentKey ); + + break; + + case EntityType.TModel: + sp.ProcedureName = "net_tModel_description_save"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKey", parentKey ); + + break; + + case EntityType.TModelOverviewDoc: + sp.ProcedureName = "net_tModel_overviewDoc_description_save"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKey", parentKey ); + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_DESCRPTION_INVALIDPARENTTYPE" , parentType.ToString() ); + } + + sp.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode ); + sp.Parameters.Add( "@description", SqlDbType.NVarChar, UDDI.Constants.Lengths.Description ); + + sp.Parameters.SetString( "@isoLangCode", IsoLangCode ); + sp.Parameters.SetString( "@description", Value ); + + sp.ExecuteNonQuery(); + + Debug.Leave(); + } + } + + public class DescriptionCollection : CollectionBase + { + public DescriptionCollection() + { + } + + public void Get( int parentID, EntityType parentType ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.Contact: + sp.ProcedureName = "net_contact_descriptions_get"; + + sp.Parameters.Add( "@contactID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@contactID", parentID ); + + break; + + case EntityType.TModelInstanceInfo: + sp.ProcedureName = "net_bindingTemplate_tModelInstanceInfo_descriptions_get"; + + sp.Parameters.Add( "@instanceID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@instanceID", parentID ); + + break; + + case EntityType.InstanceDetail: + sp.ProcedureName = "net_bindingTemplate_instanceDetails_descriptions_get"; + + sp.Parameters.Add( "@instanceID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@instanceID", parentID ); + + break; + + case EntityType.InstanceDetailOverviewDoc: + sp.ProcedureName = "net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get"; + + sp.Parameters.Add( "@instanceID", SqlDbType.BigInt ); + sp.Parameters.SetLong( "@instanceID", parentID ); + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_DESCRPTION_INVALIDPARENTTYPE" , parentType.ToString() ); + } + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + Read( reader ); +#if never + while( reader.Read() ) + { + Add( reader.GetString( "isoLangCode" ), + reader.GetString( "description" ) ); + } +#endif + } + finally + { + reader.Close(); + } + + Debug.Leave(); + } + + public void Get( string parentKey, EntityType parentType ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.BusinessEntity: + sp.ProcedureName = "net_businessEntity_descriptions_get"; + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", parentKey ); + + break; + + case EntityType.BusinessService: + sp.ProcedureName = "net_businessService_descriptions_get"; + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@serviceKey", parentKey ); + + break; + + case EntityType.BindingTemplate: + sp.ProcedureName = "net_bindingTemplate_descriptions_get"; + + sp.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@bindingKey", parentKey ); + + break; + + case EntityType.TModel: + sp.ProcedureName = "net_tModel_descriptions_get"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKey", parentKey ); + + break; + + case EntityType.TModelOverviewDoc: + sp.ProcedureName = "net_tModel_overviewDoc_descriptions_get"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKey", parentKey ); + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_DESCRPTION_INVALIDPARENTTYPE", parentType.ToString() ); + } + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + Read( reader ); +#if never + while( reader.Read() ) + { + Add( reader.GetString( "isoLangCode" ), + reader.GetString( "description" ) ); + } +#endif + } + finally + { + reader.Close(); + } + + Debug.Leave(); + } + + public void Read( SqlDataReaderAccessor reader ) + { + while( reader.Read() ) + { + Add( reader.GetString( "isoLangCode" ), + reader.GetString( "description" ) ); + } + } + + internal void Validate() + { + int maxLength = UDDI.Constants.Lengths.Description; + int count = this.Count; + bool languageAssigned = false; + + for( int i = 0; i < count; i ++ ) + { + // + // Validate the description string length. + // + Utility.ValidateLength( ref this[ i ].Value, "description", maxLength ); + + // + // Validate the language code. If one was not specified, + // we'll use the publisher's default language. + // + if( Utility.StringEmpty( this[ i ].IsoLangCode ) ) + { + // + // Only one description can have an unassigned language. + // + if( languageAssigned ) + { + throw new UDDIException( + ErrorType.E_languageError, + "UDDI_ERROR_LANGUAGEERROR_MULTIPLEBLANKLANG" ); + } + + languageAssigned = true; + + // + // Fix: Bug 2340 9/9/2002, creeves + // + + // if( i > 0 ) + // { + // throw new UDDIException( + // ErrorType.E_languageError, + // "Only the first description can have a blank or missing xml:lang attribute. All other descriptions must have a valid xml:lang attribute." ); + // } + + this[ i ].IsoLangCode = Context.User.IsoLangCode; + } + } + + // + // Fix: Bug 2397, 9/16/2002, a-kirkma + // + // Split loops and fill in default IsoLangCode first (if needed), + // then look for repeated languages + // + for( int i = 0; i < count; i ++ ) + { + // + // Check to make sure there is only one description + // per language. + // + string isoLangCode = this[ i ].IsoLangCode; + + Debug.Write( SeverityType.Info, CategoryType.Data, "Description[" + i + "]: " + this[ i ].Value + ", IsoLangCode: " + isoLangCode ); + + for( int j = i + 1; j < count; j ++ ) + { + if (false == Utility.StringEmpty(this[ j ].IsoLangCode) + && isoLangCode.ToLower() == this[ j ].IsoLangCode.ToLower() ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "Error: Description[" + j + "]: " + this[ j ].Value + ", IsoLangCode " + this[ j ].IsoLangCode + " matches IsoLangCode[" + i + "]: " + isoLangCode ); + + throw new UDDIException( + ErrorType.E_languageError, + "UDDI_ERROR_LANGUAGEERROR_MULTIPLESAMELANG",isoLangCode ); + } + } + } + } + + public void Save( long ID, EntityType parentType ) + { + Debug.Enter(); + + foreach( Description desc in this ) + desc.Save( ID, parentType ); + + Debug.Leave(); + } + + public void Save( string key, EntityType parentType ) + { + Debug.Enter(); + + foreach( Description desc in this ) + desc.Save( key, parentType ); + + Debug.Leave(); + } + + public Description this[int index] + { + get + { return (Description)List[index]; } + set + { List[index] = value; } + } + + public int Add(Description value) + { + return List.Add(value); + } + + public int Add(string value) + { + return List.Add( new Description(value) ); + } + + public int Add(string isoLangCode, string description) + { + return List.Add( new Description(isoLangCode, description) ); + } + + public void Insert(int index, Description value) + { + List.Insert(index, value); + } + + public int IndexOf(Description value) + { + return List.IndexOf(value); + } + + public bool Contains(Description value) + { + return List.Contains(value); + } + + public void Remove(Description value) + { + List.Remove(value); + } + + public void CopyTo(Description[] array, int index) + { + List.CopyTo(array, index); + } + } +} diff --git a/inetsrv/uddi/source/api/discoveryurl.cs b/inetsrv/uddi/source/api/discoveryurl.cs new file mode 100644 index 0000000..4212079 --- /dev/null +++ b/inetsrv/uddi/source/api/discoveryurl.cs @@ -0,0 +1,434 @@ +using System; +using System.Web; +using System.IO; +using System.Data; +using System.Text; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API.Business +{ + public class DiscoveryUrl + { + [XmlAttribute("useType")] + public string UseType; + + [XmlText] + public string Value; + + public DiscoveryUrl() + { + } + + public DiscoveryUrl( string url ) + { + this.Value = url; + this.UseType = ""; + } + + public DiscoveryUrl( string url, string useType ) + { + this.Value = url; + this.UseType = useType; + } + + internal void Validate() + { + if( null == UseType ) + UseType = ""; + + Utility.ValidateLength( ref UseType, "useType", UDDI.Constants.Lengths.UseType ); + Utility.ValidateLength( ref Value, "discoveryURL", UDDI.Constants.Lengths.DiscoveryURL ); + } + + public void Save( string businessKey ) + { + // + // Create a command object to invoke the stored procedure + // + SqlCommand cmd = new SqlCommand( "net_businessEntity_discoveryUrl_save", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Input parameters + // + cmd.Parameters.Add( new SqlParameter( "@businessKey", SqlDbType.UniqueIdentifier ) ); + cmd.Parameters.Add( new SqlParameter( "@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType ) ); + cmd.Parameters.Add( new SqlParameter( "@discoveryUrl", SqlDbType.NVarChar, UDDI.Constants.Lengths.DiscoveryURL ) ); + + // + // Set parameters + // + SqlParameterAccessor parmacc = new SqlParameterAccessor( cmd.Parameters ); + parmacc.SetGuidFromString( "@businessKey", businessKey ); + parmacc.SetString( "@useType", UseType ); + parmacc.SetString( "@discoveryUrl", Value ); + + // + // Execute save + // + cmd.ExecuteNonQuery(); + } + + public bool IsDefault( string businessKey ) + { + Debug.VerifySetting( "DefaultDiscoveryURL" ); + + string defaultDiscoveryUrl = Config.GetString( "DefaultDiscoveryURL" ) + businessKey; + + return ( null != UseType ) && + ( "businessentity" == UseType.ToLower() ) && + ( string.Compare( defaultDiscoveryUrl, Value, true ) == 0 ); + } + } + + public class DiscoveryUrlCollection : CollectionBase + { + public DiscoveryUrl this[int index] + { + get + { return (DiscoveryUrl)List[index]; } + set + { List[index] = value; } + } + + public void Get( string businessKey ) + { + // + // This procedure add the discoveryURLs that were persisted to the database + // this does not include the default discoveryURL, it is added by the the businessEntity.Get() + // method since it has the visibility of the operator name who owns the entity. + // + + // + // Create a command object to invoke the stored procedure + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_businessEntity_discoveryURLs_get" ); + + // + // Add parameters + // + cmd.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + cmd.Parameters.SetGuidFromString( "@businessKey", businessKey ); + + // + // Execute query + // + SqlDataReaderAccessor reader = cmd.ExecuteReader(); + try + { + Read( reader ); + } + finally + { + reader.Close(); + } + +#if never + // + // This procedure add the discoveryURLs that were persisted to the database + // this does not include the default discoveryURL, it is added by the the businessEntity.Get() + // method since it has the visibility of the operator name who owns the entity. + // + const int UseTypeIndex = 0; + const int UrlIndex = 1; + + // + // Create a command object to invoke the stored procedure + // + SqlCommand cmd = new SqlCommand( "net_businessEntity_discoveryURLs_get", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Add parameters + // + cmd.Parameters.Add( new SqlParameter( "@businessKey", SqlDbType.UniqueIdentifier ) ); + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + paramacc.SetGuidFromString( "@businessKey", businessKey ); + + // + // Execute query + // + SqlDataReader rdr = cmd.ExecuteReader(); + try + { + SqlDataReaderAccessor rdracc = new SqlDataReaderAccessor( rdr ); + + // + // The discoveryUrls will be contained in the result set + // + while( rdr.Read() ) + { + string useType = rdracc.GetString( UseTypeIndex ); + + if( null == useType ) + useType = ""; + + Add( rdracc.GetString( UrlIndex ), useType ); + } + } + finally + { + rdr.Close(); + } +#endif + } + + public void Read( SqlDataReaderAccessor reader ) + { + const int UseTypeIndex = 0; + const int UrlIndex = 1; + + // + // The discoveryUrls will be contained in the result set + // + while( reader.Read() ) + { + string useType = reader.GetString( UseTypeIndex ); + + if( null == useType ) + useType = ""; + + Add( reader.GetString( UrlIndex ), useType ); + } + } + + internal void Validate() + { + foreach( DiscoveryUrl discoveryUrl in this ) + { + discoveryUrl.Validate(); + } + } + + public void Save( string businessKey ) + { + // + // Keep a separate remove list. + // + DiscoveryUrlCollection duplicateUrls = null; + + foreach( DiscoveryUrl discoveryUrl in this ) + { + // + // If we are not doing replication, then we want to check to make sure that we don't persist the + // default discovery url. + // + if( ContextType.Replication != Context.ContextType ) + { + // + // Make sure we don't persist the default discoveryURL + // + if( !discoveryUrl.IsDefault( businessKey ) ) + { + discoveryUrl.Save( businessKey ); + } + else + { + if( null == duplicateUrls ) + { + duplicateUrls = new DiscoveryUrlCollection(); + } + + duplicateUrls.Add( discoveryUrl ); + } + } + else + { + discoveryUrl.Save( businessKey ); + } + } + + // + // Remove duplicates if we have any. + // + if( null != duplicateUrls ) + { + foreach( DiscoveryUrl duplicateUrl in duplicateUrls ) + { + this.Remove( duplicateUrl ); + } + } + } + + internal void AddDefaultDiscoveryUrl( string businessKey ) + { + Debug.VerifySetting( "DefaultDiscoveryURL" ); + + string defaultDiscoveryUrl = Config.GetString( "DefaultDiscoveryURL" ) + businessKey; + + // + // Check to see if the collection already contains the default + // discovery URL. If so, we don't need to add one. + // This check is needed since some of the legacy code used to + // permit the persistence of the default discovery URL. + // + foreach( DiscoveryUrl discoveryUrl in this ) + { + if( discoveryUrl.IsDefault( businessKey ) ) + return; + } + + Add( defaultDiscoveryUrl, "businessEntity" ); + } + + public int Add() + { + return List.Add( new DiscoveryUrl() ); + } + + public int Add( DiscoveryUrl value ) + { + return List.Add( value ); + } + + public int Add( string strUrl ) + { + return List.Add( new DiscoveryUrl( strUrl ) ); + } + + public int Add( string strUrl, string strUseType ) + { + return List.Add( new DiscoveryUrl( strUrl, strUseType ) ); + } + + public void Insert( int index, DiscoveryUrl value ) + { + List.Insert( index, value ); + } + + public int IndexOf( DiscoveryUrl value ) + { + return List.IndexOf( value ); + } + + public bool Contains( DiscoveryUrl value ) + { + return List.Contains( value ); + } + + public void Remove( DiscoveryUrl value ) + { + List.Remove(value); + } + + public void CopyTo( DiscoveryUrl[] array ) + { + foreach( DiscoveryUrl discoveryUrl in array ) + Add( discoveryUrl ); + } + + public DiscoveryUrl[] ToArray() + { + return (DiscoveryUrl[])InnerList.ToArray( typeof( DiscoveryUrl ) ); + } + } + + /// **************************************************************** + /// public class DiscoveryUrlHandler + /// ---------------------------------------------------------------- + /// + /// DiscoveryUrlHandler implements the IHttpHandler interface. + /// It is designed to retrieve businessEntity details for a businessKey + /// specified as part of the HTTP query string + /// e.g. http://uddi.microsoft.com/discovery?businessKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + /// + /// **************************************************************** + /// + public class DiscoveryUrlHandler : IHttpHandler + { + public void ProcessRequest( HttpContext ctx ) + { + try + { + // + // Verify the GET verb was used and that a query string is + // specified. + // + if( "GET" != ctx.Request.RequestType.ToUpper() ) + { + ctx.Response.AddHeader( "Allow", "GET" ); + ctx.Response.StatusCode = 405; // Method Not Allowed + + return; + } + + if( null == ctx.Request.QueryString[ "businessKey" ] ) + { + ctx.Response.StatusCode = 400; // Bad Request + ctx.Response.Write( "

400 Bad Request

Missing required argument 'businessKey'" ); + + return; + } + + // + // Attempt to retrieve the business entity. + // + ConnectionManager.Open( false, false ); + string businessKey = ctx.Request.QueryString[ "businessKey" ]; + BusinessEntity be = new BusinessEntity( businessKey ); + be.Get(); + + // + // Serialize the business Entity to the response stream + // using UTF-8 encoding + // + // XmlSerializer serializer = new XmlSerializer( be.GetType() ); + XmlSerializer serializer = XmlSerializerManager.GetSerializer( be.GetType() ); + + UTF8Encoding utf8 = new UTF8Encoding( false ); + StreamWriter sr = new StreamWriter( ctx.Response.OutputStream, utf8 ); + serializer.Serialize( sr, be ); + + ctx.Response.AddHeader( "Content-Type", "text/xml; charset=utf-8" ); + } + catch( FormatException e ) + { + // + // We get a FormatException when passed a bad GUID. + // + ctx.Response.StatusCode = 400; // Bad Request + ctx.Response.Write( "

400 Bad Request

" + e.Message ); + } + catch( SqlException e ) + { + // + // We get a SqlException when we could not get the data. + // + ctx.Response.StatusCode = 400; // Bad Request + ctx.Response.Write( "

400 Bad Request

" + e.Message ); + } + catch( UDDIException e ) + { + ctx.Response.StatusCode = 400; // Bad Request + ctx.Response.Write( "

400 Bad Request

" + e.Message ); + } + catch( Exception e ) + { + ctx.Response.StatusCode = 500; // Internal Server Error + ctx.Response.Write( "

500 Internal Server Error

" ); + + Debug.OperatorMessage( SeverityType.Error, CategoryType.None, OperatorMessageType.None, e.ToString() ); + } + finally + { + ConnectionManager.Close(); + } + } + + public bool IsReusable + { + get + { + return true; + } + } + } +} diff --git a/inetsrv/uddi/source/api/email.cs b/inetsrv/uddi/source/api/email.cs new file mode 100644 index 0000000..6974ea7 --- /dev/null +++ b/inetsrv/uddi/source/api/email.cs @@ -0,0 +1,183 @@ +using System; +using System.Data; +using System.Collections; +using System.Diagnostics; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; + +namespace UDDI.API.Business +{ + public class Email + { + [XmlAttribute("useType")] + public string UseType; + + [XmlText()] + public string Value; + + public Email() + { + } + + public Email( string email, string useType ) + { + Value = email; + UseType = useType; + } + + internal void Validate() + { + Utility.ValidateLength( ref UseType, "useType", UDDI.Constants.Lengths.UseType ); + Utility.ValidateLength( ref Value, "email", UDDI.Constants.Lengths.Email ); + } + + public void Save( long contactID ) + { + // + // Create a command object to invoke the stored procedure + // + SqlCommand cmd = new SqlCommand( "net_contact_email_save", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Input parameters + // + cmd.Parameters.Add( new SqlParameter( "@contactID", SqlDbType.BigInt ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType ) ).Direction = ParameterDirection.Input; + + // + // Set parameter values + // + SqlParameterAccessor parmacc = new SqlParameterAccessor( cmd.Parameters ); + parmacc.SetLong( "@contactID", contactID ); + parmacc.SetString( "@email", Value ); + parmacc.SetString( "@useType", UseType ); + + cmd.ExecuteNonQuery(); + } + } + + public class EmailCollection : CollectionBase + { + internal void Validate() + { + foreach( Email email in this) + { + email.Validate(); + } + } + + public void Save( long contactID ) + { + // + // Walk collection and call save on individual contact instances + // + foreach( Email email in this) + email.Save( contactID ); + } + + public void Get( long contactID ) + { + // + // Create a command object to invoke the stored procedure net_get_contacts + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_contact_emails_get" ); + + // + // Add parameters and set values + // + cmd.Parameters.Add( "@contactID", SqlDbType.BigInt, ParameterDirection.Input ); + cmd.Parameters.SetLong( "@contactID", contactID ); + + // + // Run the stored procedure + // + SqlDataReaderAccessor reader = cmd.ExecuteReader(); + try + { +#if never + while( reader.Read() ) + { + // + // Construct a new Email from the data in this row + // + this.Add( dracc.GetString( EmailIndex ), dracc.GetString( UseTypeIndex ) ); + } +#endif + } + finally + { + reader.Close(); + } + } + + public void Read( SqlDataReaderAccessor reader ) + { + const int UseTypeIndex = 0; + const int EmailIndex = 1; + + while( reader.Read() ) + { + // + // Construct a new Email from the data in this row + // + this.Add( reader.GetString( EmailIndex ), reader.GetString( UseTypeIndex ) ); + } + } + + public Email this[ int index ] + { + get { return (Email)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new Email() ); + } + + public int Add( Email emailObject ) + { + return List.Add( emailObject ); + } + + public int Add( string email ) + { + return ( Add( email, null ) ); + } + + public int Add( string email, string useType ) + { + return List.Add( new Email( email, useType ) ); + } + + public void Insert( int index, Email value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Email value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Email value ) + { + return List.Contains( value ); + } + + public void Remove( Email value ) + { + List.Remove( value ); + } + + public void CopyTo( Email[] array, int index ) + { + List.CopyTo( array, index ); + } + } +} diff --git a/inetsrv/uddi/source/api/extension.cs b/inetsrv/uddi/source/api/extension.cs new file mode 100644 index 0000000..c6a1166 --- /dev/null +++ b/inetsrv/uddi/source/api/extension.cs @@ -0,0 +1,915 @@ +using System; +using System.IO; +using System.Web; +using System.Data; +using System.Text; +using System.Xml; +using System.Data.SqlClient; +using System.Xml.Serialization; +using System.Security.Cryptography.X509Certificates; +using System.Security.Principal; +using System.Web.Services.Protocols; +using System.Web.Security; +using UDDI; +using UDDI.Diagnostics; +using UDDI.API.Authentication; + +namespace UDDI.API +{ + public class UDDIExtension : SoapExtension + { + Data data; + DateTime begin; + + private class Data + { + public bool log = true; + public bool https = false; + public bool validate = true; + public bool performance = true; + public bool authenticate = false; + public bool transaction = false; + public bool certificate = false; + public string messageType = ""; + + public Data( + bool log, + bool validate, + bool performance, + bool authenticate, + bool transaction, + bool https, + bool certificate, + string messageType ) + { + this.log = log; + this.https = https; + this.validate = validate; + this.performance = performance; + this.authenticate = authenticate; + this.transaction = transaction; + this.certificate = certificate; + this.messageType = messageType; + } + } + + static UDDIExtension() + { + Context.ContextType = ContextType.SOAP; + } + + private void CheckForHttps( SoapMessage message ) + { + Debug.Enter(); + + if( 1 == Config.GetInt( "Security.HTTPS", 1 ) ) + { + Debug.Write( SeverityType.Info, CategoryType.Soap, "URL: " + message.Url ); + Debug.Verify( message.Url.ToLower().StartsWith( "https" ), "UDDI_ERROR_FATALERROR_HTTPSREQUIREDFORPUBLISH" ); + } + else + { + Debug.Write( SeverityType.Warning, CategoryType.Soap, "HTTPS check is turned off. Content may be published without SSL. To turn this check on remove or modify the Security.HTTPS configuration setting" ); + } + + Debug.Leave(); + } + + private void CheckCertificate( SoapMessage message ) + { + HttpClientCertificate httpCert = HttpContext.Current.Request.ClientCertificate; + X509Certificate requestCert = new X509Certificate( httpCert.Certificate ); + + Debug.Verify( !Utility.StringEmpty( httpCert.Issuer ), "UDDI_ERROR_FATALERROR_CLIENTCERTREQUIRED" ); + Debug.Verify( !Utility.StringEmpty( httpCert.Subject ), "UDDI_ERROR_FATALERROR_CLIENTCERTREQUIRED" ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_operatorCert_get" ); + + sp.Parameters.Add( "@certSerialNo", SqlDbType.NVarChar, UDDI.Constants.Lengths.CertSerialNo ); + + sp.Parameters.SetString( "@certSerialNo", requestCert.GetSerialNumberString() ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + if( reader.Read() ) + { + Context.RemoteOperator = reader.GetGuidString( "operatorKey" ); + + byte[] operatorCertRaw = reader.GetBinary( "certificate" ); + byte[] requestCertRaw = httpCert.Certificate; + + Debug.Verify( + null != operatorCertRaw, + "UDDI_ERROR_FATALERROR_CLIENTCERTNOTSTORED", + ErrorType.E_fatalError, + Context.RemoteOperator ); + + if( operatorCertRaw.Length != requestCertRaw.Length ) + { + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_UNKOWNCERT" ); + } + + for( int i = 0; i < operatorCertRaw.Length; i ++ ) + { + if( operatorCertRaw[ i ] != requestCertRaw[ i ] ) + { + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_UNKOWNCERT" ); + } + } + + /* + * TODO: Check to see if this works instead + * + + X509Certificate operatorCert = new X509Certificate( operatorCertRaw ); + X509Certificate requestCert = new X509Certificate( requestCertRaw ); + + if( !requestCert.Equals( operatorCert ) ) + { + throw new UDDIException( + ErrorType.E_unknownUser, + "Unknown certificate" ); + } + */ + } + else + { + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_UNKOWNCERT" ); + } + } + finally + { + reader.Close(); + } + } + + private void Validate( SoapMessage message ) + { + Debug.Enter(); + + StreamReader srdr = new StreamReader( message.Stream, System.Text.Encoding.UTF8 ); +#if DEBUG + Debug.Write( SeverityType.Verbose, CategoryType.None, srdr.ReadToEnd() ); + message.Stream.Seek( 0,System.IO.SeekOrigin.Begin ); +#endif + // + // Validate incoming XML, ValidateStream will rewind stream when finished + // so I don't have to. + // + SchemaCollection.Validate( message.Stream ); + + Debug.Leave(); + } + + private void PublishMethodBegin( SoapMessage message ) + { + Debug.Enter(); + begin = DateTime.Now; + Debug.Leave(); + } + + private void PublishMethodEnd( SoapMessage message ) + { + Debug.Enter(); + + TimeSpan duration = DateTime.Now - begin; + Debug.Write( SeverityType.Info, CategoryType.Soap, "Message took " + duration.TotalMilliseconds.ToString() + " ms" ); + + Performance.PublishMessageData( data.messageType, duration ); + + Debug.Leave(); + } + + // + // What follows is the logic for selection of the authentication algorithm + // Enjoy boys and girls + // + // Bit 3 - Anonymous User + // Bit 2 - UDDI Authentication Mode + // Bit 1 - Windows Authentication Mode + // Bit 0 - Ticket Present + // | + // | Authentication Module Used + // 0000 X + // 0001 X + // 0010 Windows + // 0011 Exception ( UDDI authentication turned off ) + // 0100 UDDI ( will fail authentication due to invalid credentials ) + // 0101 UDDI + // 0110 Windows + // 0111 UDDI + // 1000 X + // 1001 X + // 1010 Exception UDDI authentication turned off + // 1011 Exception "" + // 1100 UDDI ( will fail authentication due to invalid credentials ) + // 1101 UDDI + // 1110 UDDI ( will fail authentication due to invalid credentials ) + // 1111 UDDI + // + // + // Reduction Work + // + // A - Anonymous User + // B - UDDI Authentication Mode + // C - Windows Authentication Mode + // D - Ticket Present + // + // Key + // e - throw exception invalid configuration + // x - invalid state + // w - windows authentication + // u - uddi authentication + // + // CD + // AB 00 01 11 10 + // 00 x x e w + // 01 u u u w + // 11 u u u u + // 10 x x e e + // + // if( !A && C && !D ) + // w - windows authentication + // else if( B ) + // u - uddi authentication + // else + // throw exception + // + + private void Authenticate( SoapMessage message ) + { + Debug.Enter(); + + IAuthenticateable authenticate = (IAuthenticateable) message.GetInParameterValue(0); + //WindowsIdentity identity = (WindowsIdentity)HttpContext.Current.User.Identity; + IIdentity identity = HttpContext.Current.User.Identity; + int mode = Config.GetInt( "Security.AuthenticationMode", (int) AuthenticationMode.Both ); + + if( mode == (int) AuthenticationMode.Passport ) + { + if( identity is PassportIdentity ) + { + string ticket = authenticate.AuthInfo.Trim(); + + // + // Authentication the user using the attached passport ticket + // + PassportAuthenticator pa = new PassportAuthenticator(); + pa.Authenticate( ticket, Config.GetInt( "Security.TimeOut", 60 ) ); + } + else + { + throw new UDDIException( ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_PASSPORTBADCONFIG" ) ; + } + Debug.Write( SeverityType.Info, CategoryType.Soap, "Authenticated user: using Passport based authentication Identity is " + identity.Name ); + + } + else if( !( (WindowsIdentity)identity ).IsAnonymous && + ( ( mode & (int) AuthenticationMode.Windows ) != 0 ) && + Utility.StringEmpty( authenticate.AuthInfo ) ) + { + /* 0X10 Case */ + // + // Authenticate the user using the currently impersonated credentials + // + WindowsAuthenticator wa = new WindowsAuthenticator(); + wa.Authenticate( authenticate.AuthInfo, Config.GetInt( "Security.TimeOut", 60 ) ); + + Debug.Write( SeverityType.Info, CategoryType.Soap, "Authenticated user: using Windows based authentication Identity is " + identity.Name ); + } + else if( ( mode & (int) AuthenticationMode.Uddi ) != 0 ) + { + /* X1XX Case for leftovers */ + // + // If windows authentication is turned off or the + Debug.Write( SeverityType.Info, CategoryType.Soap, "Anonymous user: using UDDI authentication" ); + + // + // Authenticate the user using the authToken + // + UDDIAuthenticator ua = new UDDIAuthenticator(); + ua.Authenticate( authenticate.AuthInfo, Config.GetInt( "Security.TimeOut", 60 ) ); + } + else + { + // + // Throw exception for the rest + // + throw new UDDIException( UDDI.ErrorType.E_unsupported, + "UDDI_ERROR_UNSUPPORTED_BADAUTHENTICATIONCONFIG" ); + } + + // + // Check to make sure the authenticated user has publisher credentials + // + Debug.Verify( Context.User.IsPublisher, + "UDDI_ERROR_FATALERROR_USERNOPUBLISHERCRED", + UDDI.ErrorType.E_fatalError, + Context.User.ID ); + + // + // The server can be configured for automatic registration of publishers with credentials + // + if( !Context.User.IsRegistered ) + { + if( 1 == Config.GetInt( "Security.AutoRegister", 0 ) ) + { + // + // Mark the user as verified. + // + Context.User.TrackPassport = false; + Context.User.Verified = true; + + Context.User.Register(); + } + else + { + throw new UDDIException( UDDI.ErrorType.E_unknownUser, + "UDDI_ERROR_UNKNOWNUSER_NOTREGISTERED" ); + } + } + + Context.User.Login(); +#if DEBUG + Debug.Write( SeverityType.Info, CategoryType.Soap, "Windows Identity is " + WindowsIdentity.GetCurrent().Name ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "Thread Identity is " + System.Threading.Thread.CurrentPrincipal.Identity.Name ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "HttpContext Identity is " + identity.Name ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "IsAdministrator = " + Context.User.IsAdministrator ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "IsCoordinator = " + Context.User.IsCoordinator ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "IsPublisher = " + Context.User.IsPublisher ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "IsUser = " + Context.User.IsUser ); +#endif + Debug.Leave(); + } + + + public override object GetInitializer( Type t ) + { + return null; + } + + public override object GetInitializer( LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute ) + { + UDDIExtensionAttribute attr = (UDDIExtensionAttribute) attribute; + return new Data( attr.log, attr.validate, attr.performance, attr.authenticate, attr.transaction, attr.https, attr.certificate, attr.messageType ); + } + + public override void Initialize( object initializer ) + { + data = (UDDIExtension.Data) initializer; + } + + public override void ProcessMessage(SoapMessage message) + { + Debug.Enter(); + +#if DEBUG + string info = "log: " + data.log.ToString() + + "; https: " + data.https.ToString() + + "; validate: " + data.validate.ToString() + + "; performance: " + data.performance.ToString() + + "; authenticate: " + data.authenticate.ToString() + + "; transaction: " + data.transaction.ToString() + + "; messageType: " + data.messageType; + + Debug.Write( SeverityType.Info, CategoryType.Soap, info ); +#endif + try + { + switch( message.Stage ) + { + // + // First Event + // + case SoapMessageStage.BeforeDeserialize: + // + // Initialize our context. + // + Context.Current.Initialize(); + + Config.CheckForUpdate(); + + // + // TODO: Since we are using DispositionReport.ThrowFinal() I don't think this is + // needed anymore. + // + + // + // Check to make sure the authenticated user has user credentials + // + Debug.Verify( "1" != HttpContext.Current.Request.ServerVariables[ "Exception" ], + "UDDI_ERROR_FATALERROR_VERSIONCHECKERROR", + UDDI.ErrorType.E_fatalError ); + + Debug.Write( SeverityType.Info, CategoryType.Soap, "URL: " + message.Url ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "SOAPAction: " + HttpContext.Current.Request.Headers[ "SOAPAction" ] ); + + string contentType = HttpContext.Current.Request.ContentType.ToLower(); + + bool validEncoding = ( contentType.IndexOf( "charset=\"utf-8\"" ) >= 0 ) || + ( contentType.IndexOf( "charset=utf-8" ) >= 0 ); + + Debug.Verify( validEncoding, "UDDI_ERROR_UNSUPPORTED_CONTENTTYPEHEADERMISSING", ErrorType.E_unsupported ); + + if( data.performance ) + PublishMethodBegin( message ); + + if( data.https ) + CheckForHttps( message ); + + // + // Validation has been moved into the other SOAP extension + // +// if( data.validate ) +// Validate( message ); + + break; + + // + // Second Event + // + case SoapMessageStage.AfterDeserialize: + + ConnectionManager.Open( data.transaction, data.transaction ); + + if( data.certificate ) + CheckCertificate( message ); + + if( data.authenticate ) + Authenticate( message ); + else if( 0 != ( Config.GetInt( "Security.AuthenticationMode", (int) AuthenticationMode.Both ) + & (int) AuthenticationMode.AuthenticatedRead ) ) + { + // + // Authenticated reads are turned on and this is a read request + // Make sure the caller is authenticated using Windows and is at least a user + // + WindowsIdentity identity = (WindowsIdentity) HttpContext.Current.User.Identity; + WindowsAuthenticator wa = new WindowsAuthenticator(); + wa.Authenticate( "", 0 /* not used */ ); + + Debug.Write( SeverityType.Info, CategoryType.Soap, "Authenticated user: using Windows based authentication Identity is " + identity.Name ); + + // + // Check to make sure the authenticated user has user credentials + // + Debug.Verify( Context.User.IsUser, + "UDDI_ERROR_FATALERROR_NOUSERCREDS", + UDDI.ErrorType.E_fatalError, + Context.User.ID ); + } + + break; + + // + // Third Event + // + case SoapMessageStage.BeforeSerialize: + break; + + // + // Last Event + // + case SoapMessageStage.AfterSerialize: + + // + // Cleanup the connection and commit the database activity + // + if( data.transaction && + ( null != (object) ConnectionManager.GetConnection() ) && + ( null != (object) ConnectionManager.GetTransaction() ) ) + { + if( null == (object) message.Exception ) + { + ConnectionManager.Commit(); + } + else + { + ConnectionManager.Abort(); + } + } + + ConnectionManager.Close(); + + try + { + if( data.performance ) + PublishMethodEnd( message ); + } + catch + { + Debug.OperatorMessage( + SeverityType.Warning, + CategoryType.None, + OperatorMessageType.UnableToPublishCounter, + "An error occurred while trying to publish a performance counter, the system will continue" ); + } + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_UNKNOWNEXTSTAGE" ); + } + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + } + + public override Stream ChainStream( Stream stream ) + { + return base.ChainStream( stream ); + } + } + + [AttributeUsage(AttributeTargets.Method, AllowMultiple=false)] + public class UDDIExtensionAttribute : SoapExtensionAttribute + { + private int priority; + + // + // The default constructor should be configured for the inquire API set + // + public UDDIExtensionAttribute() : this( true, true, true, false, false, false, false, "" ){} + public UDDIExtensionAttribute( + bool log, + bool validate, + bool performance, + bool authenticate, + bool transaction, + bool https, + bool certificate, + string messageType ) + { + this.log = log; + this.https = https; + this.validate = validate; + this.performance = performance; + this.authenticate = authenticate; + this.transaction = transaction; + this.certificate = certificate; + this.messageType = messageType; + } + + public override Type ExtensionType + { + get { return typeof(UDDIExtension); } + } + + public override int Priority + { + get { return priority; } + set { priority = value; } + } + + public bool log; + public bool https; + public bool validate; + public bool performance; + public bool authenticate; + public bool transaction; + public bool certificate; + public string messageType; + } + + /// ******************************************************************** + /// public class VersionSupportExtension + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class VersionSupportExtension : SoapExtension + { + Stream oldStream; + Stream newStream; + + public override object GetInitializer( LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute ) + { + return null; + } + + public override object GetInitializer( Type type ) + { + return null; + } + + public override void Initialize( object initializer ) + { + } + + public override void ProcessMessage(SoapMessage message) + { + try + { + switch( message.Stage ) + { + case SoapMessageStage.BeforeDeserialize: + // + // Check to see if the server has been manually stopped. + // + if( 0 == Config.GetInt( "Run", 1 ) ) + { + DispositionReport.ThrowFinal( new UDDIException( ErrorType.E_busy, "UDDI_ERROR_BUSY_SERVICENOTAVAILABLE" ) ); + + // + // DispositionReport.ThrowFinal will close the HTTP stream so there is no point going on in this method + // + return; + } + + try + { + // + // Validate against the UDDI schemas + // + SchemaCollection.Validate( oldStream ); + } + catch( Exception e ) + { + DispositionReport.ThrowFinal( new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_SCHEMAVALIDATIONFAILED", e.Message ) ); + + // + // DispositionReport.ThrowFinal will close the HTTP stream so there is no point going on in this method + // + return; + } + + // + // Make sure we only have 1 UDDI request in the SOAP body. This method will also set the versionMajor + // member. + // + CheckForSingleRequest( oldStream ); + + // + // If this is a v1 message, we'll first map it to the v2 + // namespace so that it can be processed by the new + // library. + // + if( 1 == Context.ApiVersionMajor || 2 == Context.ApiVersionMajor) + { + TextReader reader = new StreamReader( oldStream ); + TextWriter writer = new StreamWriter( newStream, new System.Text.UTF8Encoding( false ) ); + string xml = reader.ReadToEnd(); + + if( 1 == Context.ApiVersionMajor ) + { + xml = xml.Replace( "=\"urn:uddi-org:api\"", "=\"urn:uddi-org:api_v2\"" ); + xml = xml.Replace( "='urn:uddi-org:api'", "=\"urn:uddi-org:api_v2\"" ); + } + writer.Write( xml ); + writer.Flush(); + + newStream.Position = 0; + } + + break; + + case SoapMessageStage.AfterDeserialize: + // + // After the message is deserialized is the earliest place where we + // have access to our SOAP headers. + // + CheckSOAPHeaders( message ); + + // + // Now that the message has been deserialized, make + // sure that the generic and xmlns attributes agree. + // + IMessage obj = message.GetInParameterValue( 0 ) as IMessage; + if( null != obj ) + { + // + // We only need to do this if the deserialized object supports IMessage + // + string expected = Context.ApiVersionMajor + ".0"; + string actual = obj.Generic.Trim(); + + if( expected != actual ) + throw new UDDIException( ErrorType.E_unrecognizedVersion, "UDDI_ERROR_UNKNOWNVERSION_GENERICNAMESPACEMISMATCH" ); + } + + break; + + case SoapMessageStage.BeforeSerialize: + break; + + case SoapMessageStage.AfterSerialize: + + // + // There may have been exceptions thrown during serialization. + // + if( null != message.Exception && + ( null == message.Exception.Detail || + 0 == message.Exception.Detail.ChildNodes.Count ) ) + { + DispositionReport.ThrowFinal( new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_FAILEDDESERIALIZATION" ) ); + + // + // DispositionReport.ThrowFinal will close the HTTP stream so there is no point going on in this method + // + return; + } + + // + // If the original request was v1, then we'll need to + // remap the output to use the v1 namespace. + // + if( 1 == Context.ApiVersionMajor || 2 == Context.ApiVersionMajor ) + { + newStream.Position = 0; + + TextReader reader = new StreamReader( newStream ); + TextWriter writer = new StreamWriter( oldStream, new System.Text.UTF8Encoding( false ) ); + + string xml = reader.ReadToEnd(); + + // + // We don't have to use the same 'loose' replacement as we did on the incoming request + // because our response will be serialized such that the default namespace is our UDDI + // namespace. + // + + if( 1 == Context.ApiVersionMajor ) + { + xml = xml.Replace( "xmlns=\"urn:uddi-org:api_v2\"", "xmlns=\"urn:uddi-org:api\"" ); + xml = xml.Replace( "generic=\"2.0\"", "generic=\"1.0\"" ); + } + writer.Write( xml ); + writer.Flush(); + } + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_UNKNOWNEXTSTAGE" ); + } + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + } + + public override Stream ChainStream( Stream stream ) + { + oldStream = stream; + newStream = new MemoryStream(); + + return newStream; + } + + private void CheckSOAPHeaders( SoapMessage message ) + { + // We want to check the following: + // + // - no SOAP Actor attribute exists + // - no SOAP headers can have a must_understand attribute set to true + // + // Go through each header in our message + // + foreach( SoapHeader header in message.Headers ) + { + if( header.MustUnderstand ) + { + // + // No headers can have this attribute set. + // + DispositionReport.ThrowFinal( new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_SOAP_MUSTUNDERSTANDATT" ) ); + + return; + } + + if( header.Actor.Length > 0 ) + { + // + // Can't have a SOAP Actor attribute set, generate a SOAP fault with + // no detail element and a 'Client' fault code + // + DispositionReport.ThrowFinal( new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_SOAP_ACTORATT" ) ); + + return; + } + } + } + + // + // TODO: see if there is a way to better modularize this method and rename it. + // + private void CheckForSingleRequest( Stream stream ) + { + try + { + // + // Move to the start of our stream + // + stream.Position = 0; + XmlTextReader requestReader = new XmlTextReader( oldStream ); + requestReader.MoveToContent(); + + // + // TODO: should not hard-code SOAP names and namespaces + // + + // + // Move to the beginning of the SOAP envelope + // + requestReader.ReadStartElement( "Envelope", "http://schemas.xmlsoap.org/soap/envelope/" ); + + // + // Move to the SOAP body + // + while( !requestReader.IsStartElement( "Body", "http://schemas.xmlsoap.org/soap/envelope/" ) && !requestReader.EOF ) + { + requestReader.Skip(); + } + + // + // Advance the current node to the first child of Body. This is presumably the UDDI message + // + requestReader.ReadStartElement( "Body", "http://schemas.xmlsoap.org/soap/envelope/" ); + requestReader.MoveToContent(); + + // + // This element MUST have a UDDI namespace + // + string uddiNamespace = requestReader.LookupNamespace( requestReader.Prefix ); + + switch( uddiNamespace ) + { + case "urn:uddi-org:api": + { + Context.ApiVersionMajor = 1; + break; + } + case "urn:uddi-org:api_v2": + { + Context.ApiVersionMajor = 2; + break; + } + case "urn:uddi-microsoft-com:api_v2_extensions": + { + Context.ApiVersionMajor = 2; + break; + } + case "urn:uddi-org:repl": + { + Context.ApiVersionMajor = 2; + break; + } + default: + { + // + // This is a problem, we don't have a UDDI namespace. Throw an exception and get out of here. The + // exception will be caught in our outer catch and sent to our client using DispositionReport.ThrowFinal. + // + + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_MISSINGUDDINS" ); + } + } + + // + // Skip the children of this node + // + requestReader.Skip(); + requestReader.MoveToContent(); + + // + // Reset our stream so someone else can use it. + // + stream.Position = 0; + + // + // If we are not at the end of the Body tag, then we have multiple requests, we should reject the message. + // + if( false == requestReader.LocalName.Equals( "Body" ) ) + { + DispositionReport.ThrowFinal( new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_SOAP_MULTIPLEREQUEST" ) ); + } + } + catch( UDDIException uddiException ) + { + DispositionReport.ThrowFinal( uddiException ); + } + catch + { + // + // We'll get this exception if the message contains any invalid elements + // + DispositionReport.ThrowFinal( new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_SOAP_INVALIDELEMENT" ) ); + } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/api/find.cs b/inetsrv/uddi/source/api/find.cs new file mode 100644 index 0000000..91fb2cc --- /dev/null +++ b/inetsrv/uddi/source/api/find.cs @@ -0,0 +1,828 @@ +/// ************************************************************************ +/// Microsoft UDDI version 2.0 +/// Copyright (c) 2000-2001 Microsoft Corporation +/// All Rights Reserved +/// ------------------------------------------------------------------------ +/// +/// +/// ************************************************************************ +/// + +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections; +using System.Collections.Specialized; +using System.Text; +using UDDI; +using UDDI.Diagnostics; +using UDDI.API.Business; + +namespace UDDI.API +{ + /// ******************************************************************** + /// public class FindBuilder + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class FindBuilder + { + // + // Find entity type + // + private EntityType entityType; + private string entityName = null; + private string parentKey = null; + + // + // Find qualifiers + // + public bool ExactNameMatch = false; + public bool CaseSensitiveMatch = false; + public bool SortByNameAsc = false; + public bool SortByNameDesc = false; + public bool SortByDateAsc = false; + public bool SortByDateDesc = false; + public bool OrLikeKeys = false; + public bool OrAllKeys = false; + public bool CombineCategoryBags = false; + public bool ServiceSubset = false; + public bool AndAllKeys = false; + public bool Soundex = false; + + /// **************************************************************** + /// public FindBuilder [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// The type of entity to search for. + /// + /// + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public FindBuilder( EntityType entityType, FindQualifierCollection findQualifiers, string parentKey ) + : this( entityType, findQualifiers ) + { + this.parentKey = parentKey; + } + + /// **************************************************************** + /// public FindBuilder [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// The type of entity to search for. + /// + /// + /// + /// + /// **************************************************************** + /// + public FindBuilder( EntityType entityType, FindQualifierCollection findQualifiers ) + { + this.entityType = entityType; + this.entityName = Conversions.EntityNameFromID( entityType ); + + // + // Parse the find qualifiers. + // + if( null != findQualifiers ) + { + foreach( FindQualifier findQualifier in findQualifiers ) + { + // + // Need to trim whitespace + // + switch( findQualifier.Value.Trim() ) + { + case "exactNameMatch": + if( EntityType.BusinessEntity == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + ExactNameMatch = true; + break; + + case "caseSensitiveMatch": + if( EntityType.BusinessEntity == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + CaseSensitiveMatch = true; + break; + + case "sortByNameAsc": + if( EntityType.BusinessEntity == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + { + // + // sortByNameAsc and sortByNameDesc are mutually exclusive. + // + Debug.Verify( !SortByNameDesc, "UDDI_ERROR_UNSUPPORTED_NAMEASCANDDESC", ErrorType.E_unsupported ); + SortByNameAsc = true; + } + break; + + case "sortByNameDesc": + if( EntityType.BusinessEntity == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + { + // + // sortByNameAsc and sortByNameDesc are mutually exclusive. + // + Debug.Verify( !SortByNameAsc, "UDDI_ERROR_UNSUPPORTED_NAMEASCANDDESC", ErrorType.E_unsupported ); + + SortByNameDesc = true; + } + break; + + case "sortByDateAsc": + if( EntityType.BindingTemplate == entityType || + EntityType.BusinessEntity == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + { + // + // sortByDateAsc and sortByDateDesc are mutually exclusive. + // + Debug.Verify( !SortByDateDesc, "UDDI_ERROR_UNSUPPORTED_DATEASCANDDESC", ErrorType.E_unsupported ); + SortByDateAsc = true; + } + break; + + case "sortByDateDesc": + if( EntityType.BindingTemplate == entityType || + EntityType.BusinessEntity == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + { + // + // sortByDateAsc and sortByDateDesc are mutually exclusive. + // + Debug.Verify( !SortByDateAsc, "UDDI_ERROR_UNSUPPORTED_DATEASCANDDESC", ErrorType.E_unsupported ); + SortByDateDesc = true; + } + break; + + case "orLikeKeys": + if( EntityType.BusinessEntity == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + { + // + // orLikeKeys, orAllKeys, and andAllKeys are mutually exclusive. + // + Debug.Verify( !OrAllKeys && !AndAllKeys, "UDDI_ERROR_UNSUPPORTED_KEYSORAND", ErrorType.E_unsupported ); + OrLikeKeys = true; + } + break; + + case "orAllKeys": + if( EntityType.BusinessEntity == entityType || + EntityType.BindingTemplate == entityType || + EntityType.BusinessService == entityType || + EntityType.TModel == entityType ) + { + // + // orLikeKeys, orAllKeys, and andAllKeys are mutually exclusive. + // + Debug.Verify( !OrLikeKeys && !AndAllKeys, "UDDI_ERROR_UNSUPPORTED_KEYSORAND", ErrorType.E_unsupported ); + + OrAllKeys = true; + } + break; + + case "combineCategoryBags": + if( EntityType.BusinessEntity == entityType ) + { + CombineCategoryBags = true; + } + break; + + case "serviceSubset": + if( EntityType.BusinessEntity == entityType ) + { + ServiceSubset = true; + } + break; + + case "andAllKeys": + if( EntityType.BusinessEntity == entityType || + EntityType.TModel == entityType ) + { + // + // orLikeKeys, orAllKeys, and andAllKeys are mutually exclusive. + // + Debug.Verify( !OrLikeKeys && !OrAllKeys, "UDDI_ERROR_UNSUPPORTED_KEYSORAND", ErrorType.E_unsupported ); + + AndAllKeys = true; + } + break; + + default: + throw new UDDIException( + ErrorType.E_unsupported, + "UDDI_ERROR_UNSUPPORTED_FINDQUALIFIER", + findQualifier.Value ); + } + } + } + } + + /// **************************************************************** + /// private ScratchCommit + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private int ScratchCommit() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_find_scratch_commit" ); + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + sp.ExecuteNonQuery(); + + return sp.Parameters.GetInt( "@rows" ); + } + + /// **************************************************************** + /// public Abort + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Abort() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_find_cleanup" ); + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + sp.ExecuteNonQuery(); + } + + /// **************************************************************** + /// public RetrieveResults + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public SqlStoredProcedureAccessor RetrieveResults( int maxRows ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + if( ServiceSubset ) + sp.ProcedureName = "net_find_businessEntity_serviceSubset_commit"; + else + sp.ProcedureName = "net_find_" + entityName + "_commit"; + + if( entityName != "bindingTemplate" ) + { + sp.Parameters.Add( "@sortByNameAsc", SqlDbType.Bit ); + sp.Parameters.Add( "@sortByNameDesc", SqlDbType.Bit ); + } + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@sortByDateAsc", SqlDbType.Bit ); + sp.Parameters.Add( "@sortByDateDesc", SqlDbType.Bit ); + sp.Parameters.Add( "@maxRows", SqlDbType.Int ); + sp.Parameters.Add( "@truncated", SqlDbType.Bit, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + if( entityName != "bindingTemplate" ) + { + sp.Parameters.SetBool( "@sortByNameAsc", SortByNameAsc ); + sp.Parameters.SetBool( "@sortByNameDesc", SortByNameDesc ); + } + + sp.Parameters.SetBool( "@sortByDateAsc", SortByDateAsc ); + sp.Parameters.SetBool( "@sortByDateDesc", SortByDateDesc ); + + int defaultMaxRows = Config.GetInt( "Find.MaxRowsDefault" ); + + if( maxRows < 0 || maxRows > defaultMaxRows ) + maxRows = defaultMaxRows; + + sp.Parameters.SetInt( "@maxRows", maxRows ); + + return sp; + } + + /// **************************************************************** + /// public FindByName + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public int FindByName( string name ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_find_" + entityName + "_name"; + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp.Parameters.Add( "@exactNameMatch", SqlDbType.Bit ); + sp.Parameters.Add( "@caseSensitiveMatch", SqlDbType.Bit ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetBool( "@exactNameMatch", ExactNameMatch ); + sp.Parameters.SetBool( "@caseSensitiveMatch", CaseSensitiveMatch ); + sp.Parameters.SetString( "@name", LikeEncode( name ) ); + + sp.ExecuteNonQuery(); + + return ScratchCommit(); + } + + /// **************************************************************** + /// public FindByNames + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public int FindByNames( NameCollection names ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_find_" + entityName + "_name"; + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode ); + sp.Parameters.Add( "@exactNameMatch", SqlDbType.Bit ); + sp.Parameters.Add( "@caseSensitiveMatch", SqlDbType.Bit ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetBool( "@exactNameMatch", ExactNameMatch ); + sp.Parameters.SetBool( "@caseSensitiveMatch", CaseSensitiveMatch ); + + foreach( Name name in names ) + { + sp.Parameters.SetString( "@name", LikeEncode( name.Value ) ); + + if( Utility.StringEmpty( name.IsoLangCode ) ) + sp.Parameters.SetString( "@isoLangCode", "%" ); + else + sp.Parameters.SetString( "@isoLangCode", name.IsoLangCode ); + + sp.ExecuteNonQuery(); + } + + return ScratchCommit(); + } + + /// **************************************************************** + /// public FindByDiscoveryUrls + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public int FindByDiscoveryUrls( DiscoveryUrlCollection discoveryUrls ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_find_" + entityName + "_discoveryURL"; + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType ); + sp.Parameters.Add( "@discoveryURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.DiscoveryURL ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + int rows = 0; + + foreach( DiscoveryUrl discoveryUrl in discoveryUrls ) + { + sp.Parameters.SetString( "@useType", discoveryUrl.UseType ); + sp.Parameters.SetString( "@discoveryURL", discoveryUrl.Value ); + + sp.ExecuteNonQuery(); + + rows = sp.Parameters.GetInt( "@rows" ); + } + + return ScratchCommit(); + } + + /// **************************************************************** + /// public FindByTModelBag + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public int FindByTModelBag( StringCollection tModelBag ) + { + // + // First validate all the keys, this will make sure any invalid keys are 'caught' beforehand. + // + foreach( string tModelKey in tModelBag ) + { + Utility.IsValidKey( EntityType.TModel, tModelKey ); + } + + // + // Set up the stored procedure call and set common parameters. + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_find_" + entityName + "_tModelBag"; + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@orKeys", SqlDbType.Bit ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetBool( "@orKeys", OrAllKeys ); + + // + // Process each tModelKey. + // + foreach( string tModelKey in tModelBag ) + { + sp.Parameters.SetGuidFromKey( "@tModelKey", tModelKey ); + sp.ExecuteNonQuery(); + + // + // No point continuing if a query returns no results in AND operation. + // + if( false == this.OrAllKeys && + 0 == sp.Parameters.GetInt( "@rows" ) ) + { + break; + } + } + + return ScratchCommit(); + } + + /// **************************************************************** + /// public FindByKeyedReferences + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public int FindByKeyedReferences( KeyedReferenceType keyedReferenceType, KeyedReferenceCollection keyedReferences ) + { + int rows = 0; + + // + // Fix for Windows Bug #728622 + // OrAllKeys findQualifier was being modified for the scope of the entire find. + // This fix preserves the initial value of OrAllKeys so as not to affect subsequent method invocations in the same find. + // All subsequent references to OrAllKeys are replaced by OrAllKeysTemp in this method. + // + + bool OrAllKeysTemp = OrAllKeys; + + // + // Set up the stored procedure call and set common parameters. + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( keyedReferenceType ) + { + case KeyedReferenceType.CategoryBag: + if( CombineCategoryBags ) + sp.ProcedureName = "net_find_" + entityName + "_combineCategoryBags"; + else if( ServiceSubset ) + sp.ProcedureName = "net_find_" + entityName + "_serviceSubset"; + else + sp.ProcedureName = "net_find_" + entityName + "_categoryBag"; + + break; + + case KeyedReferenceType.IdentifierBag: + if (AndAllKeys == false) + { + // + // Fix for Windows Bug #728622 + // + +// OrAllKeys = true; // if OrLikeKeys has been specified, that will be overriden below + OrAllKeysTemp = true; + } + + sp.ProcedureName = "net_find_" + entityName + "_identifierBag"; + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_UNEXPECTEDKRTYPE",keyedReferenceType.ToString() ); + } + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName ); + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@orKeys", SqlDbType.Bit ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + // + // Determine whether we should be doing an 'orLikeKeys' search. + // + if( OrLikeKeys ) + { + // + // First group keyed references by tModelKey (basically + // grouping by taxonomy). This will allow us to easily + // process keyed references with the same taxonomy. In + // an orLikeKeys search, we will match on any of the + // keys for a given taxonomy (a logical OR operation). + // + ArrayList sortedList = new ArrayList(); + + foreach( KeyedReference keyedReference in keyedReferences ) + sortedList.Add( keyedReference ); + + sortedList.Sort( new TModelKeyComparer() ); + + // + // In an orLikeKeys search, we or all keys in the scratch + // table. + // + sp.Parameters.SetBool( "@orKeys", true ); + + // + // Process each group of keyed references. Each time + // we cross a group boundary (seen when the current + // tModelKey is different than the last one we processed), + // commit the data in the scratch table to the main results + // table (a logical AND operation with the result of other + // search constraints). + // + string prevKey = ((KeyedReference)sortedList[0]).TModelKey.ToLower(); + bool dirty = false; + + foreach( KeyedReference keyedReference in sortedList ) + { + Utility.IsValidKey( EntityType.TModel, keyedReference.TModelKey ); + + if( prevKey != keyedReference.TModelKey.ToLower() ) + { + // + // Logical AND scratch table results with main table. + // + rows = ScratchCommit(); + dirty = false; + + // + // If the main results list is now empty, we don't + // need to process any more constraints. + // + if( 0 == rows ) + return rows; + } + + sp.Parameters.SetString( "@keyName", keyedReference.KeyName ); + sp.Parameters.SetString( "@keyValue", keyedReference.KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", keyedReference.TModelKey ); + + sp.ExecuteNonQuery(); + + dirty = true; + prevKey = keyedReference.TModelKey.ToLower(); + } + + // + // If the scratch table contains results that haven't been + // processed, logical AND them with the main table. + // + if( dirty ) + rows = ScratchCommit(); + } + else + { + // + // Determine whether we should be performing a logical OR or + // AND on results from each keyed reference. + // + // + + // + // Fix for Windows Bug #728622 + // + +// sp.Parameters.SetBool( "@orKeys", OrAllKeys ); + sp.Parameters.SetBool( "@orKeys", OrAllKeysTemp ); + + // + // Process each keyed reference. + // + foreach( KeyedReference keyedReference in keyedReferences ) + { + sp.Parameters.SetString( "@keyName", keyedReference.KeyName ); + sp.Parameters.SetString( "@keyValue", keyedReference.KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", keyedReference.TModelKey ); + + sp.ExecuteNonQuery(); + int sprows = sp.Parameters.GetInt( "@rows" ); + + // + // No point continuing if a query returns no results in AND operation. + // + + // + // Fix for Windows Bug #728622 + // + +// if( false == this.OrAllKeys && 0 == sprows ) + if( false == OrAllKeysTemp && 0 == sprows ) + { + break; + } + } + + // + // Logical AND scratch table results with main table. + // + rows = ScratchCommit(); + } + + return rows; + } + + public int FindByParentKey( string parentKey ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( entityType ) + { + case EntityType.BusinessService: + sp.ProcedureName = "net_find_businessService_businessKey"; + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", parentKey ); + + break; + + case EntityType.BindingTemplate: + sp.ProcedureName = "net_find_bindingTemplate_serviceKey"; + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@serviceKey", parentKey ); + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_UNEXPECTEDENTITYTYPE", entityType.ToString() ); + } + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + sp.ExecuteNonQuery(); + + return sp.Parameters.GetInt( "@rows" ); + } + + public SqlStoredProcedureAccessor FindRelatedBusinesses( string businessKey, KeyedReference keyedReference, int maxRows) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_find_businessEntity_relatedBusinesses" ); + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName ); + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@sortByNameAsc", SqlDbType.Bit ); + sp.Parameters.Add( "@sortByNameDesc", SqlDbType.Bit ); + sp.Parameters.Add( "@sortByDateAsc", SqlDbType.Bit ); + sp.Parameters.Add( "@sortByDateDesc", SqlDbType.Bit ); + sp.Parameters.Add( "@maxRows", SqlDbType.Int ); + sp.Parameters.Add( "@truncated", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetGuidFromString( "@businessKey", businessKey ); + + if( null != keyedReference ) + { + sp.Parameters.SetString( "@keyName", keyedReference.KeyName ); + sp.Parameters.SetString( "@keyValue", keyedReference.KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", keyedReference.TModelKey ); + } + else + { + sp.Parameters.SetNull( "@keyName" ); + sp.Parameters.SetNull( "@keyValue" ); + sp.Parameters.SetNull( "@tModelKey" ); + } + + sp.Parameters.SetBool( "@sortByNameAsc", SortByNameAsc ); + sp.Parameters.SetBool( "@sortByNameDesc", SortByNameDesc ); + sp.Parameters.SetBool( "@sortByDateAsc", SortByDateAsc ); + sp.Parameters.SetBool( "@sortByDateDesc", SortByDateDesc ); + sp.Parameters.SetInt( "@maxRows", maxRows ); + + return sp; + } + + private class TModelKeyComparer : IComparer + { + public int Compare( object keyedReference1, object keyedReference2 ) + { + return String.Compare( + ((KeyedReference)keyedReference1).TModelKey.ToLower(), + ((KeyedReference)keyedReference2).TModelKey.ToLower() ); + } + } + + private string LikeEncode( string str ) + { + if( null == str ) + return null; + + StringBuilder builder = new StringBuilder( str.Length ); + + foreach( char ch in str ) + { + switch( ch ) + { + case '[': + builder.Append( "[ [ ]" ); + break; + + case ']': + builder.Append( "[ ] ]" ); + break; + + case '%': + // + // We'll always treat the % as a wildcard, so don't + // escape in the client string. + // + builder.Append( ch ); + break; + + case '_': + builder.Append( "[_]" ); + break; + + default: + builder.Append( ch ); + break; + } + } + + return builder.ToString(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/api/inquire.cs b/inetsrv/uddi/source/api/inquire.cs new file mode 100644 index 0000000..ca210e1 --- /dev/null +++ b/inetsrv/uddi/source/api/inquire.cs @@ -0,0 +1,350 @@ +using System; +using System.IO; +using System.Web; +using System.Xml; +using System.Data; +using System.Data.SqlClient; +using System.Collections; +using System.Web.Services; +using System.Xml.Serialization; +using System.Web.Services.Protocols; +using UDDI.API; +using UDDI; +using UDDI.Diagnostics; +using UDDI.API.Authentication; +using UDDI.API.Binding; +using UDDI.API.Service; +using UDDI.API.Business; +using UDDI.API.ServiceType; + +namespace UDDI.API +{ + /// **************************************************************** + /// class InquireMessages + /// ---------------------------------------------------------------- + /// + /// This is the web service class that contains the UDDI inquire + /// methods. + /// + /// **************************************************************** + /// + [SoapDocumentService( ParameterStyle=SoapParameterStyle.Bare, RoutingStyle=SoapServiceRoutingStyle.RequestElement )] + [WebService( Namespace=UDDI.API.Constants.Namespace )] + public class InquireMessages + { + /// **************************************************************** + /// public FindBinding + /// ---------------------------------------------------------------- + /// + /// Locates qualified bindingTemplates based on the criteria + /// specified in the message content. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the find_binding message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a list of bindingTemplates contained in a BindingDetail element. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="find_binding")] + [UDDIExtension(messageType="find_binding")] + public BindingDetail FindBinding( FindBinding fbind ) + { + Debug.Enter(); + BindingDetail bd = null; + + try + { + bd = fbind.Find(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return bd; + } + + /// **************************************************************** + /// public FindBusiness + /// ---------------------------------------------------------------- + /// + /// Locates qualified businessEntities based on the criteria + /// specified in the message content. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the find_business message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a list of businessInfo structures contained in a BusinessList. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="find_business")] + [UDDIExtension(messageType="find_business")] + //public BusinessList FindBusiness( FindBusiness fbus, [XmlAnyElement] XmlElement[] trash ) + public BusinessList FindBusiness( FindBusiness fbus ) + { + Debug.Enter(); + BusinessList bl = null; + + try + { + bl = fbus.Find(); + + // + // If this request came from a v1 message, filter out any service projections in our list of + // businesses + // + if( 1 == Context.ApiVersionMajor ) + { + foreach( BusinessInfo businessInfo in bl.BusinessInfos ) + { + businessInfo.ServiceInfos = FilterServiceProjections( businessInfo.ServiceInfos, businessInfo.BusinessKey ); + } + } + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return bl; + } + + /// **************************************************************** + /// public FindRelatedBusinesses + /// ---------------------------------------------------------------- + /// + /// Locates qualified businessEntities based on the criteria + /// specified in the message content. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the find_business message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a list of businessInfo structures contained in a BusinessList. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="find_relatedBusinesses")] + [UDDIExtension(messageType="find_relatedBusinesses")] + public RelatedBusinessList FindRelatedBusinesses( FindRelatedBusinesses frelbus ) + { + Debug.Enter(); + RelatedBusinessList rbl = null; + + try + { + rbl = frelbus.Find(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return rbl; + } + + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="find_service")] + [UDDIExtension(messageType="find_service")] + public ServiceList FindService( FindService fs ) + { + Debug.Enter(); + ServiceList sl = null; + + try + { + sl = fs.Find(); + + // + // Maybe we could filter service projections out earlier, but this seems to be the + // most readable place to do it. + // + if( 1 == Context.ApiVersionMajor ) + { + sl.ServiceInfos = FilterServiceProjections( sl.ServiceInfos, fs.BusinessKey ); + } + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return sl; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="find_tModel")] + [UDDIExtension(messageType="find_tModel")] + public TModelList FindTModel( UDDI.API.ServiceType.FindTModel ftm ) + { + Debug.Enter(); + TModelList tml = null; + + try + { + tml = ftm.Find(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + return tml; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="get_bindingDetail")] + [UDDIExtension(messageType="get_bindingDetail")] + public BindingDetail GetBindingDetail( GetBindingDetail gbd ) + { + Debug.Enter(); + BindingDetail bd = new BindingDetail(); + + try + { + bd.Get( gbd.BindingKeys ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return bd; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="get_businessDetail")] + [UDDIExtension(messageType="get_businessDetail")] + public BusinessDetail GetBusinessDetail( GetBusinessDetail gbd ) + { + Debug.Enter(); + + BusinessDetail bd = new BusinessDetail(); + + try + { + bd.Get( gbd.BusinessKeys ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return bd; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="get_businessDetailExt")] + [UDDIExtension(messageType="get_businessDetailExt")] + public BusinessDetailExt GetBusinessDetailExt( GetBusinessDetailExt gbde ) + { + Debug.Enter(); + BusinessDetailExt bde = new BusinessDetailExt(); + try + { + bde.Get( gbde.BusinessKeys ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return bde; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="get_serviceDetail")] + [UDDIExtension(messageType="get_serviceDetail")] + public ServiceDetail GetServiceDetail( GetServiceDetail gsd ) + { + Debug.Enter(); + ServiceDetail sd = new ServiceDetail(); + + try + { + sd.Get( gsd.ServiceKeys ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return sd; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="get_tModelDetail")] + [UDDIExtension(messageType="get_tModelDetail")] + public TModelDetail GetTModelDetail( GetTModelDetail gtmd ) + { + Debug.Enter(); + TModelDetail tmd = new TModelDetail(); + + try + { + tmd.Get( gtmd.TModelKeys ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return tmd; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="validate_categorization")] + [UDDIExtension(messageType="validate_categorization")] + public DispositionReport ValidateCategorization( ValidateCategorization vc ) + { + Debug.Enter(); + + try + { + vc.Validate(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return new DispositionReport(); + } + + private ServiceInfoCollection FilterServiceProjections( ServiceInfoCollection serviceInfos, string businessKey ) + { + // + // If we are given an empty businessKey, just return the original collection. Without a businessKey, there is + // no way to determine if these services are service projections or not. + // + if( null == businessKey || 0 == businessKey.Length ) + { + return serviceInfos; + } + + // + // Make a copy because manipulating the collection as you iterate over it is not a good idea. Accessing + // a collection by index and removing items is probably very slow. Since we don't know how this collection + // is implemented, making a copy and populating it is probably the safest thing to do from a performance standpoint. + // + ServiceInfoCollection filteredCollection = new ServiceInfoCollection(); + foreach( ServiceInfo serviceInfo in serviceInfos ) + { + // + // If these business keys are equal, it is not a service projection, so + // add it to our filtered list, otherwise, don't add it. + // + if( true == serviceInfo.BusinessKey.Equals( businessKey ) ) + { + filteredCollection.Add( serviceInfo ); + } + } + + return filteredCollection; + } + } +} diff --git a/inetsrv/uddi/source/api/keyedreference.cs b/inetsrv/uddi/source/api/keyedreference.cs new file mode 100644 index 0000000..960de4f --- /dev/null +++ b/inetsrv/uddi/source/api/keyedreference.cs @@ -0,0 +1,491 @@ +using System; +using System.Data; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API +{ + public class KeyedReference + { + [XmlAttribute("tModelKey")] + public string TModelKey + { + get + { + return tmodelkey; + } + set + { + if( null == value ) + tmodelkey = null; + else + tmodelkey = value.Trim().ToLower(); + } + } + string tmodelkey; + + [XmlAttribute("keyName")] + public string KeyName + { + get + { + return keyname; + } + set + { + if( null == value ) + keyname = null; + else + keyname = value.Trim(); + } + } + string keyname; + + [XmlAttribute("keyValue")] + public string KeyValue + { + get + { + return keyvalue; + } + set + { + if( null == value ) + keyvalue = null; + else + keyvalue = value.Trim(); + } + } + string keyvalue; + + public KeyedReference() + { + } + + public KeyedReference( string name, string value ) + { + KeyName = name; + KeyValue = value; + } + + public KeyedReference( string name, string value, string key ) + { + KeyName = name; + KeyValue = value; + TModelKey = key; + } + + public void ValidateLength() + { + } + + private void ValidateOwningBusiness( EntityType parentType, KeyedReferenceType keyedReferenceType ) + { + // + // IN87: 3. If a keyedReference contains the uddi-org:owningBusiness tModelKey, then + // the following conditions must be met: + // 1. The keyedReference's tModelKey is case insensitive equal to uuid:4064C064-6D14-4F35-8953-9652106476A9 + // 2. The keyedReference's keyValue contains a valid UUID + // 3. The keyedReference is contained within a categoryBag or identifierBag + // 4. The containing categoryBag or identifierBag is a child element of a tModel + // 5. The UUID (from condition 2) refers to an existing businessEntity + // 6. The businessEntity is owned (and published by) the same publisher that is publishing the tModel from (condition 4). + // + + // + // 1. The keyedReference's tModelKey is case insensitive equal to uuid:4064C064-6D14-4F35-8953-9652106476A9 + // + if( Context.ContextType != ContextType.Replication && + TModelKey.ToLower().Equals( UDDI.Constants.OwningBusinessTModelKey ) ) + { + // + // 3. The keyedReference is contained within a categoryBag or identifierBag + // + if( keyedReferenceType != KeyedReferenceType.CategoryBag && + keyedReferenceType != KeyedReferenceType.IdentifierBag ) + { + // + // Error + // + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_KROWNINGBE" ); + } + + // + // 4. The containing categoryBag or identifierBag is a child element of a tModel + // + if( EntityType.TModel != parentType ) + { + // + // Error + // + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_KROWNINGBETMODELCHILD" ); + } + + // + // 2. The keyedReference's keyValue contains a valid UUID + // 5. The UUID (from condition 2) refers to an existing businessEntity + // 6. The businessEntity is owned (and published by) the same publisher that is publishing the tModel from (condition 4). + // + try + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_validate" ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@businessKey", KeyValue ); + sp.Parameters.SetInt( "@flag", 0 ); + + sp.ExecuteNonQuery(); + } + catch + { + // + // Error + // + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_INVALIDEVALUEORPUBLISHER" ); + } + } + } + + internal void Validate( string parentKey, KeyedReferenceType keyedReferenceType ) + { + Debug.Enter(); + + // + // IN69: 4. When a keyedReference is saved within a categoryBag without specifying + // a tModelKey (that is no tModelKey attribute at all) the UDDI server MUST + // assume the urn:uddi-org:general_keywords tModelKey. The resulting response + // MUST add to the keyedReference the attribute + // tModelKey=”uuid:A035A07C-F362-44dd-8F95-E2B134BF43B4” (case does not matter). + // + if( KeyedReferenceType.CategoryBag == keyedReferenceType && Utility.StringEmpty( TModelKey ) ) + { + TModelKey = Config.GetString( "TModelKey.GeneralKeywords" ); + } + + // + // IN69: 3. A UDDI server MUST reject a save_xxx request with a keyedReferences + // in an identifierBag where no tModelKey attribute is specified. + // + if( KeyedReferenceType.IdentifierBag == keyedReferenceType && Utility.StringEmpty( TModelKey ) ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_IDBAG_MISSINGTMODELKEY" ); + } + + // + // IN69: 1. A UDDI server MUST reject a save_xxx request with a keyedReference + // with no keyName when the urn:uddi-org:general_keywords is involved + // + // #1718, make sure the comparison is not case sensitive. + // + if( Config.GetString( "TModelKey.GeneralKeywords" ).ToLower().Equals( TModelKey ) && null == keyname ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_GENERALKEYWORDS_BLANKNAME" ); + } + + // + // IN69: 2. A UDDI server MUST reject a save_xxx request with a + // keyedReference where only the keyValue is specified + // + if( Utility.StringEmpty( tmodelkey ) && Utility.StringEmpty( keyname ) ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_ASSERTION_MISSINGTMODELKEYORNAME" ); + } + + // + // Validate TModelKey, KeyName, and KeyValue length. + // + if( KeyedReferenceType.Assertion == keyedReferenceType ) + { + if( Utility.StringEmpty( tmodelkey ) || + null == keyname || + null == keyvalue ) + { + throw new UDDIException( + ErrorType.E_fatalError, + "UDDI_ERROR_FATALERROR_ASSERTION_MISSINGKEYNAMEORVALUE" ); + } + } + + Utility.ValidateLength( ref tmodelkey, "tModelKey", UDDI.Constants.Lengths.TModelKey ); + Utility.ValidateLength( ref keyname, "keyName", UDDI.Constants.Lengths.KeyName ); + Utility.ValidateLength( ref keyvalue, "keyValue", UDDI.Constants.Lengths.KeyValue ); + + Debug.VerifyKey( tmodelkey ); + + // + // TODO: We are skipping validation of this keyedreference here if the parent entity key is + // the same as the tModelKey for the identifer bag or category bag. Why??? + // + // Please insert a comment to describe why this is necessary + // + if( parentKey != TModelKey ) + { + // + // call net_keyedReference_validate + // + SqlCommand cmd = new SqlCommand( "net_keyedReference_validate", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@keyedRefType", SqlDbType.TinyInt ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetString( "@PUID", Context.User.ID ); + paramacc.SetShort( "@keyedRefType", (short)keyedReferenceType ); + paramacc.SetString( "@keyValue", KeyValue ); + paramacc.SetGuidFromKey( "@tModelKey", TModelKey ); + + cmd.ExecuteNonQuery(); + } + + Debug.Leave(); + } + + public void Save( string parentKey, EntityType parentType, KeyedReferenceType keyedReferenceType ) + { + Debug.Enter(); + + // + // IN 87 Need to validate that keyedReferences that contain the uddi-org:owningBusinessKey. We can't + // do this in validate because the parentKey won't be set if the parent is a new tmodel. + // + ValidateOwningBusiness( parentType, keyedReferenceType ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.BusinessEntity: + if( KeyedReferenceType.CategoryBag == keyedReferenceType ) + sp.ProcedureName = "net_businessEntity_categoryBag_save"; + else + sp.ProcedureName = "net_businessEntity_identifierBag_save"; + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", parentKey ); + + break; + + case EntityType.BusinessService: + Debug.Assert( + KeyedReferenceType.CategoryBag == keyedReferenceType, + "Unexpected keyed reference type '" + keyedReferenceType.ToString() + + "' for parent entity type '" + parentType.ToString() + "'" ); + + sp.ProcedureName = "net_businessService_categoryBag_save"; + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@serviceKey", parentKey ); + + break; + + case EntityType.TModel: + if( KeyedReferenceType.CategoryBag == keyedReferenceType ) + sp.ProcedureName = "net_tModel_categoryBag_save"; + else + sp.ProcedureName = "net_tModel_identifierBag_save"; + + sp.Parameters.Add( "@tModelKeyParent", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKeyParent", parentKey ); + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UNEXPECTED_PARENT_ENTITY_TYPE" , parentType.ToString() ); + } + + sp.Parameters.Add( "@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName ); + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetString( "@keyName", KeyName ); + sp.Parameters.SetString( "@keyValue", KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + + sp.ExecuteNonQuery(); + + Debug.Leave(); + } + } + + public class KeyedReferenceCollection : CollectionBase + { + public KeyedReferenceCollection() + { + } + + internal void Validate( string parentKey, KeyedReferenceType keyedReferenceType ) + { + foreach( KeyedReference keyRef in this ) + { + keyRef.Validate( parentKey, keyedReferenceType ); + } + } + + public void Save( string parentKey, EntityType parentType, KeyedReferenceType keyedReferenceType ) + { + foreach( KeyedReference keyRef in this ) + { + keyRef.Save( parentKey, parentType, keyedReferenceType ); + } + } + + public KeyedReference this[int index] + { + get { return (KeyedReference)List[index]; } + set { List[index] = value; } + } + + public int Add(KeyedReference value) + { + return List.Add(value); + } + + public int Add( string name, string value ) + { + return List.Add( new KeyedReference( name, value ) ); + } + + public int Add( string name, string value, string key ) + { + return List.Add( new KeyedReference( name, value, key ) ); + } + + public int Add() + { + return List.Add( new KeyedReference() ); + } + + public void Insert(int index, KeyedReference value) + { + List.Insert(index, value); + } + + public void Get( string parentKey, EntityType parentType, KeyedReferenceType keyedReferenceType ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.BusinessEntity: + if( KeyedReferenceType.CategoryBag == keyedReferenceType ) + sp.ProcedureName = "net_businessEntity_categoryBag_get"; + else + sp.ProcedureName = "net_businessEntity_identifierBag_get"; + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", parentKey ); + + break; + + case EntityType.BusinessService: + Debug.Assert( + KeyedReferenceType.CategoryBag == keyedReferenceType, + "Unexpected keyed reference type '" + keyedReferenceType.ToString() + + "' for parent entity type '" + parentType.ToString() + "'" ); + + sp.ProcedureName = "net_businessService_categoryBag_get"; + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@serviceKey", parentKey ); + + break; + + case EntityType.TModel: + if( KeyedReferenceType.CategoryBag == keyedReferenceType ) + sp.ProcedureName = "net_tModel_categoryBag_get"; + else + sp.ProcedureName = "net_tModel_identifierBag_get"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKey", parentKey ); + + break; + + default: + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UNEXPECTED_PARENT_ENTITY_TYPE" , parentType.ToString() ); + } + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + Read( reader ); +#if never + while( reader.Read() ) + { + Add( + reader.GetString( "keyName" ), + reader.GetString( "keyValue" ), + reader.GetKeyFromGuid( "tModelKey" ) ); + } +#endif + } + finally + { + reader.Close(); + } + + Debug.Leave(); + } + + public void Read( SqlDataReaderAccessor reader ) + { + while( reader.Read() ) + { + Add( reader.GetString( "keyName" ), + reader.GetString( "keyValue" ), + reader.GetKeyFromGuid( "tModelKey" ) ); + } + } + + public int IndexOf( KeyedReference value ) + { + return List.IndexOf( value ); + } + public bool Contains( KeyedReference value ) + { + return List.Contains( value ); + } + public void Remove( KeyedReference value ) + { + List.Remove( value ); + } + + public void CopyTo( KeyedReference[] array ) + { + foreach( KeyedReference keyedReference in array ) + Add( keyedReference ); + } + + public KeyedReference[] ToArray() + { + return (KeyedReference[])InnerList.ToArray( typeof( KeyedReference ) ); + } + } +} diff --git a/inetsrv/uddi/source/api/logs.cs b/inetsrv/uddi/source/api/logs.cs new file mode 100644 index 0000000..2369cdd --- /dev/null +++ b/inetsrv/uddi/source/api/logs.cs @@ -0,0 +1,47 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API +{ + public class QueryLog + { + public static void Write( QueryType queryType, EntityType entityType ) + { + // + // This can sometimes be an expensive call, so avoid it if possible. + // + if( 1 == Config.GetInt( "Audit.LogQueries", 0 ) ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_queryLog_save" ); + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + sp.Parameters.Add( "@contextTypeID", SqlDbType.TinyInt ); + sp.Parameters.Add( "@entityKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@queryTypeID", SqlDbType.TinyInt ); + sp.Parameters.Add( "@entityTypeID", SqlDbType.TinyInt ); + + // + // TODO: add the entityKey + // + sp.Parameters.SetGuidFromString( "@entityKey", "00000000-0000-0000-0000-000000000000" ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + sp.Parameters.SetShort( "@contextTypeID", (short)Context.ContextType ); + sp.Parameters.SetShort( "@queryTypeID", (short)queryType ); + sp.Parameters.SetShort( "@entityTypeID", (short)entityType ); + + sp.ExecuteNonQuery(); + } + } + } +} diff --git a/inetsrv/uddi/source/api/makefile b/inetsrv/uddi/source/api/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/api/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/api/makefile.inc b/inetsrv/uddi/source/api/makefile.inc new file mode 100644 index 0000000..47a253a --- /dev/null +++ b/inetsrv/uddi/source/api/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/api/messages.cs b/inetsrv/uddi/source/api/messages.cs new file mode 100644 index 0000000..61277ff --- /dev/null +++ b/inetsrv/uddi/source/api/messages.cs @@ -0,0 +1,415 @@ +using System; +using System.IO; +using System.Web; +using System.Data; +using System.Data.SqlClient; +using System.Text; +using System.Xml; +using System.Xml.Serialization; +using System.Collections; +using System.Web.Services.Protocols; +using UDDI; +using UDDI.Diagnostics; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI.API.Authentication; + +namespace UDDI.API +{ + /// + /// The Documentation class is an HTTP handler that will redirect (server-side) GET requests to our .ASMX files + /// to a help file. + /// + public class Documentation : IHttpHandler + { + public void ProcessRequest( HttpContext httpContext ) + { + + int cultureID = Localization.GetCulture().LCID; + string basepath = "/help/{0}/wsdlinfo.htm"; + + // + // Validate that the current UI Culture is supported. If not, revert to the default + // language. + // + string pathToHelp = GetFullFilePath( string.Format( basepath,cultureID ) ) ; + + if( !System.IO.File.Exists( httpContext.Server.MapPath( pathToHelp ) ) ) + { + try + { + cultureID = System.Globalization.CultureInfo.CreateSpecificCulture( Config.GetString( "Setup.WebServer.ProductLanguage", "en-US" ) ).LCID; + } + catch + { + cultureID = new System.Globalization.CultureInfo( Config.GetString( "Setup.WebServer.ProductLanguage", "en-US" ) ).LCID; + } + + pathToHelp = GetFullFilePath( string.Format( basepath,cultureID ) ); + } + + + // + // Do a server-side transfer to return the proper help file to the client. + // + httpContext.Server.Transfer( pathToHelp ); + } + private static string GetFullFilePath( string file ) + { + string url = ( ( "/"==HttpContext.Current.Request.ApplicationPath) ? "" : HttpContext.Current.Request.ApplicationPath ); + url += file ; + return url; + } + public bool IsReusable + { + get { return true; } + } + } + + [XmlRootAttribute("get_registeredInfo", Namespace=UDDI.API.Constants.Namespace)] + public class GetRegisteredInfo : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + } + + [XmlRootAttribute("dispositionReport", Namespace=UDDI.API.Constants.Namespace)] + public class DispositionReport + { + [XmlAttribute("generic")] + public string Generic + { + get + { + if( 0 == Context.ApiVersionMajor ) + return "2.0"; + + return Context.ApiVersionMajor.ToString() + ".0"; + } + + set { } + } + + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + [XmlAttribute("truncated")] + public string Truncated; + + [XmlElement("result")] + public ResultCollection Results = new ResultCollection(); + + public DispositionReport() : this( ErrorType.E_success, "" ) + { + } + + public DispositionReport( ErrorType err, string description ) + { + Results.Add( err, description ); + } + + public static void ThrowFinal( UDDIException e ) + { + if( 0 == Context.ApiVersionMajor ) + Context.ApiVersionMajor = 2; + + string versionedNamespace = ( Context.ApiVersionMajor == 1 ? "urn:uddi-org:api" : "urn:uddi-org:api_v2" ); + + HttpContext.Current.Response.StatusCode = 500; + HttpContext.Current.Response.ContentType = Config.GetString( "Soap.ContentType", @"text/xml; charset=""utf-8""" ); + HttpContext.Current.Response.ContentEncoding = Encoding.UTF8; + + XmlTextWriter soapFault = new XmlTextWriter( HttpContext.Current.Response.Output ); + soapFault.WriteStartDocument(); + soapFault.WriteStartElement( "soap", "Envelope", "http://schemas.xmlsoap.org/soap/envelope/" ); + soapFault.WriteStartElement( "soap", "Body", "http://schemas.xmlsoap.org/soap/envelope/" ); + soapFault.WriteStartElement( "soap", "Fault", "http://schemas.xmlsoap.org/soap/envelope/" ); + soapFault.WriteElementString( "soap:faultcode", "soap:Client" ); + soapFault.WriteElementString( "soap:faultstring", "" ); + soapFault.WriteStartElement( "soap:detail" ); + soapFault.WriteStartElement( "dispositionReport" ); + soapFault.WriteAttributeString( "generic", "", Context.ApiVersionMajor.ToString() + ".0" ); + soapFault.WriteAttributeString( "operator", "", Config.GetString( "Operator" ) ); + soapFault.WriteAttributeString( "xmlns", versionedNamespace ); + soapFault.WriteStartElement( "result" ); + soapFault.WriteAttributeString( "errno", "", ( ( int )e.Number ).ToString() ); + soapFault.WriteStartElement( "errInfo" ); + soapFault.WriteAttributeString( "errCode", "", e.Number.ToString() ); + soapFault.WriteString( UDDI.Utility.XmlEncode( e.Message ) ); + soapFault.WriteEndElement(); + soapFault.WriteEndElement(); + soapFault.WriteEndElement(); + soapFault.WriteEndElement(); + soapFault.WriteEndElement(); + soapFault.WriteEndElement(); + soapFault.WriteEndElement(); + soapFault.WriteEndDocument(); + + soapFault.Flush(); + + HttpContext.Current.Response.Flush(); + HttpContext.Current.Response.Close(); + HttpContext.Current.Response.End(); + } + + public static void Throw( Exception e ) + { + Debug.Enter(); + + // + // If this is a UDDI exception get the error number + // Otherwise map all other errors to E_fatalError + // + ErrorType et = ErrorType.E_fatalError; + string debugMessage = ""; + + if( e is UDDI.UDDIException ) + { + et = (ErrorType)( (UDDIException)e ).Number; + } + else if( e is System.Data.SqlClient.SqlException ) + { + // + // SECURITY: SqlException's include stored procedure names + // This information is flowing back to the client in the SOAPFault + // information. This information should be logged and not returned. + // + System.Data.SqlClient.SqlException se = (System.Data.SqlClient.SqlException)e; + + // + // Build a detailed message about the exception; this text is not sent back to the user. + // + debugMessage = "SQL Exception in " + se.Procedure + + " line " + se.LineNumber + + " [severity " + se.Class + + ", state " + se.State; + + debugMessage += ", server " + se.Server; + debugMessage += "]"; + + // + // Is this one of our custom error messages? If so, we'll masssage the + // error code into one of the UDDIException error types (custom errors + // are thrown as ErrorType + 50000). Otherwise, we'll simply use + // E_fatalError. + // + if( 16 == se.Class ) + et = (ErrorType)( se.Number - 50000 ); + else + { + // + // 739178 - See if this was a SQL deadlock issue. If it was, then return an E_serverBusy error + // instead. The 1205 number is a retrieved from sysmessages table in the masters database of + // SQL Server. See the SQL Books Online for more information about 1205. + // + if( 1205 == se.Number ) + { + // + // Change the 'e' variable to a new exception; need to do this since e.Message + // is read-only. Keep track of the original exception so we can log it. + // + Exception originalException = e; + e = new UDDIException( ErrorType.E_busy, "ERROR_BUSY" ); + et = ErrorType.E_busy; + + Debug.Write( SeverityType.Info, CategoryType.Data, "A deadlock exception has been converted to an E_busy exception. The original exception was:\r\n" + originalException.ToString() ); + } + else + { + et = ErrorType.E_fatalError; + } + } + } + + // + // Log this error message. + // + Debug.Write( SeverityType.Info, CategoryType.Data, "An exception occurred. Details Follow:\r\n" + e.ToString() + "\r\n\r\n" + debugMessage ); + + // + // if this is a V1.0 call, map any new V2.0 error codes to + // v1.0 error codes + // + if( 1 == Context.ApiVersionMajor ) + { + switch( et ) + { + case ErrorType.E_invalidValue: + case ErrorType.E_valueNotAllowed: + case ErrorType.E_invalidProjection: + case ErrorType.E_assertionNotFound: + case ErrorType.E_invalidCompletionStatus: + case ErrorType.E_messageTooLarge: + case ErrorType.E_transferAborted: + case ErrorType.E_publisherCancelled: + case ErrorType.E_requestDenied: + case ErrorType.E_secretUnknown: + et = ErrorType.E_fatalError; + break; + } + } + + // + // Construct a new instance of a disposition report + // + DispositionReport dr = new DispositionReport( et, e.Message ); + + // + // Serialize the disposition report to a stream and load into + // a DOM. + // + XmlDocument doc = new XmlDocument(); + + MemoryStream strm = new MemoryStream(); + + // XmlSerializer serializer = new XmlSerializer( typeof( DispositionReport ) ); + XmlSerializer serializer = XmlSerializerManager.GetSerializer( typeof( DispositionReport ) ); + + serializer.Serialize( strm, dr ); + strm.Position = 0; + + doc.Load( strm ); + + // + // Wrap the disposition report with a detail node. + // + XmlNode detail = doc.CreateNode( + XmlNodeType.Element, + SoapException.DetailElementName.Name, + SoapException.DetailElementName.Namespace ); + + detail.AppendChild( doc.FirstChild.NextSibling ); + + // + // Construct the SOAP exception using the dr XML + // as details and the received Exception as the inner exception. + // + + UDDIText uddiText = new UDDIText( "ERROR_FATAL_ERROR" ); + throw new UDDISoapException( uddiText.GetText(), + SoapException.ClientFaultCode, + "", + detail, + e); + } + } + + /// + /// Soap Exception Wrapper to help prevent StackTrace dumps in the XML output sent from the server. + /// + /// NOTE: ASP.NET will call Exception.ToString() to get the stack trace, so in Release/Free builds, + /// we only return an empty string, other wise we return the entire dump. + /// + public class UDDISoapException : SoapException + { + public UDDISoapException( string message, XmlQualifiedName name, string actor, XmlNode detail, Exception e ) : base( message, name, actor, detail, e ) + {} + public override string ToString() + { + +#if DEBUG + return base.ToString(); +#else + return ""; +#endif + + } + + } + + [XmlRootAttribute("registeredInfo", Namespace=UDDI.API.Constants.Namespace)] + public class RegisteredInfo + { + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + [XmlAttribute("truncated")] + public string Truncated; + + [ XmlArray( "businessInfos" ), XmlArrayItem( "businessInfo" ) ] + public BusinessInfoCollection BusinessInfos = new BusinessInfoCollection(); + + [ XmlArray( "tModelInfos" ), XmlArrayItem( "tModelInfo" ) ] + public TModelInfoCollection TModelInfos = new TModelInfoCollection(); + + public void Get() + { + BusinessInfos.GetForCurrentPublisher(); + TModelInfos.GetForCurrentPublisher(); + } + } + + [XmlRootAttribute("validate_categorization", Namespace=UDDI.API.Constants.Namespace)] + public class ValidateCategorization : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + [XmlElement("tModelKey")] + public string TModelKey = ""; + + [XmlElement("keyValue")] + public string KeyValue = ""; + + [XmlElement("businessEntity")] + public BusinessEntity BusinessEntity = new BusinessEntity(); + + [XmlElement("businessService")] + public BusinessService BusinessService = new BusinessService(); + + [XmlElement("tModel")] + public TModel TModel = new TModel(); + + internal void Validate() + { + SqlCommand cmd = new SqlCommand( "net_categoryBag_validate", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Parameters.Add( new SqlParameter( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetString( "@keyValue", KeyValue ); + paramacc.SetGuidFromKey( "@tModelKey", TModelKey ); + + cmd.ExecuteNonQuery(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/api/name.cs b/inetsrv/uddi/source/api/name.cs new file mode 100644 index 0000000..855de55 --- /dev/null +++ b/inetsrv/uddi/source/api/name.cs @@ -0,0 +1,344 @@ +using System; +using System.Data; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API +{ + public class Name + { + // + // Attribute: xml:lang + // + private string isoLangCode; + + [XmlAttribute( "xml:lang" )] + public string IsoLangCode + { + get { return isoLangCode; } + set { isoLangCode = value; } + } + + // + // Element: Value + // + [XmlText] + public string Value; + + public Name() + { + } + + // + // 741019 - use the UDDI site language if one is not specified. + // + public Name( string name ) : this( Config.GetString( "Setup.WebServer.ProductLanguage", "en" ), name ) + { + } + + public Name( string isoLangCode, string name ) + { + this.IsoLangCode = isoLangCode; + this.Value = name; + } + + public void Save( string parentKey, EntityType parentType ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.BusinessEntity: + sp.ProcedureName = "net_businessEntity_name_save"; + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", parentKey ); + + break; + + case EntityType.BusinessService: + sp.ProcedureName = "net_businessService_name_save"; + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@serviceKey", parentKey ); + + break; + + default: + //throw new UDDIException( ErrorType.E_fatalError, "Unexpected parent entity type '" + parentType.ToString() + "'" ); + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UNEXPECTED_PARENT_ENTITY_TYPE", parentType.ToString() ); + } + + sp.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + + sp.Parameters.SetString( "@isoLangCode", ( 1 == Context.ApiVersionMajor ? Context.User.IsoLangCode : IsoLangCode ) ); + sp.Parameters.SetString( "@name", Value ); + + sp.ExecuteNonQuery(); + + Debug.Leave(); + } + } + + /// ******************************************************************** + /// class NameCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class NameCollection : CollectionBase + { + public NameCollection() + { + } + + public void Get( string parentKey, EntityType parentType ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( parentType ) + { + case EntityType.BusinessEntity: + sp.ProcedureName = "net_businessEntity_names_get"; + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", parentKey ); + + break; + + case EntityType.BusinessService: + sp.ProcedureName = "net_businessService_names_get"; + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@serviceKey", parentKey ); + + break; + + default: + // throw new UDDIException( ErrorType.E_fatalError, "Unexpected parent entity type '" + parentType.ToString() + "'" ); + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UNEXPECTED_PARENT_ENTITY_TYPE", parentType.ToString() ); + } + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + Read( reader ); + } + finally + { + reader.Close(); + } + } + + public void Read( SqlDataReaderAccessor reader ) + { + if( 1 == Context.ApiVersionMajor ) + { + if( reader.Read() ) + Add( null, reader.GetString( "name" ) ); + } + else + { + while( reader.Read() ) + Add( reader.GetString( "isoLangCode" ), reader.GetString( "name" ) ); + } + } + + internal void ValidateForFind() + { + // + // For v1 messages, we need to throw an exception. But for v2, errata 3 + // says that we need to just truncate. + // + if( 1 == Context.ApiVersionMajor ) + { + foreach( Name name in this ) + { + if( null != name.Value && name.Value.Trim().Length > UDDI.Constants.Lengths.Name ) + { + // throw new UDDIException( ErrorType.E_nameTooLong, "A name specified in the search exceed the allowable length" ); + throw new UDDIException( ErrorType.E_nameTooLong, "UDDI_ERROR_NAME_TOO_LONG" ); + } + } + } + else + { + foreach( Name name in this ) + Utility.ValidateLength( ref name.Value, "name", UDDI.Constants.Lengths.Name ); + } + } + + internal void Validate() + { + int minLength = 1; + int maxLength = UDDI.Constants.Lengths.Name; + int count = this.Count; + + // + // We have to make sure we have a names since the schema has made optional to accomodate + // service projections. + // + if( 0 == count ) + { + //throw new UDDIException( ErrorType.E_fatalError, "Name is a required element." ); + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_NAME_IS_A_REQUIRED_ELEMENT" ); + } + + if( 1 == Context.ApiVersionMajor ) + { + // + // Validate the name string length. + // + Utility.ValidateLength( ref this[ 0 ].Value, "name", maxLength, minLength ); + return; + } + + for( int i = 0; i < count; i ++ ) + { + // + // The language code should be lower-case characters. + // + string isoLangCode = this[ i ].IsoLangCode; + + if( null != isoLangCode ) + this[ i ].IsoLangCode = isoLangCode.ToLower(); + } + + bool languageAssigned = false; + + for( int i = 0; i < count; i ++ ) + { + // + // Validate the name string length. + // + Utility.ValidateLength( ref this[ i ].Value, "name", maxLength, minLength ); + + // + // Validate the language code. If one was not specified, + // we'll use the publisher's default language. + // + if( Utility.StringEmpty( this[ i ].IsoLangCode ) ) + { + // + // Only one name can have an unassigned language. + // + if( languageAssigned ) + { + // throw new UDDIException( + // ErrorType.E_languageError, + //"More than one name was found to have an unassigned language" ); + throw new UDDIException( ErrorType.E_languageError, "UDDI_ERROR_MORE_THAN_ONE_NAME_UNASSIGNED" ); + } + + languageAssigned = true; + + // + // Fix: Bug 2340 9/9/2002, creeves + // + + // if( i > 0 ) + // { + // throw new UDDIException( + // ErrorType.E_languageError, + // "Only the first name can have a blank or missing xml:lang attribute. All other names must have a valid xml:lang attribute." ); + // } + + this[ i ].IsoLangCode = Context.User.IsoLangCode; + } + } + + // Split loops and fill in default IsoLangCode first (if needed), + // then look for repeated languages + // + for( int i = 0; i < count; i ++ ) + { + // + // Check to make sure there is only one name + // per language. + // + string isoLangCode = this[ i ].IsoLangCode; + + Debug.Write( SeverityType.Info, CategoryType.Data, "Name[" + i + "]: " + this[ i ].Value + ", IsoLangCode: " + isoLangCode ); + + for( int j = i + 1; j < count; j ++ ) + { + if( false == Utility.StringEmpty(this[ j ].IsoLangCode) + && isoLangCode.ToLower() == this[ j ].IsoLangCode.ToLower() ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "Error: Name[" + j + "]: " + this[ j ].Value + ", IsoLangCode " + this[ j ].IsoLangCode + " matches IsoLangCode[" + i + "]: " + isoLangCode ); + + //throw new UDDIException( + //ErrorType.E_languageError, + //"More than one name found for language '" + isoLangCode + "'" ); + + throw new UDDIException( ErrorType.E_languageError, "UDDI_ERROR_MORE_THAN_ONE_NAME_FOR_LANGUAGE", isoLangCode ); + } + } + } + } + + public void Save( string parentKey, EntityType parentType ) + { + Debug.Enter(); + + foreach( Name name in this ) + name.Save( parentKey, parentType ); + + Debug.Leave(); + } + + public Name this[ int index ] + { + get { return (Name)List[ index ]; } + set { List[ index ] = value; } + } + + public int Add( Name name ) + { + return List.Add( name ); + } + + public int Add( string name ) + { + return List.Add( new Name( name ) ); + } + + public int Add( string isoLangCode, string name ) + { + return List.Add( new Name( isoLangCode, name ) ); + } + + public void Insert( int index, Name name ) + { + List.Insert( index, name ); + } + + public int IndexOf( Name name ) + { + return List.IndexOf( name ); + } + + public bool Contains( Name name ) + { + return List.Contains( name ); + } + + public void Remove( Name name ) + { + List.Remove( name ); + } + + public void CopyTo( Name[] names, int index ) + { + List.CopyTo( names, index ); + } + } +} diff --git a/inetsrv/uddi/source/api/obj/_objects.mac b/inetsrv/uddi/source/api/obj/_objects.mac new file mode 100644 index 0000000..d08c51c --- /dev/null +++ b/inetsrv/uddi/source/api/obj/_objects.mac @@ -0,0 +1,124 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\address.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\assertion.obj \ + $(_OBJ_DIR)\i386\authentication.obj \ + $(_OBJ_DIR)\i386\binding.obj \ + $(_OBJ_DIR)\i386\business.obj \ + $(_OBJ_DIR)\i386\category.obj \ + $(_OBJ_DIR)\i386\changerecord.obj \ + $(_OBJ_DIR)\i386\contact.obj \ + $(_OBJ_DIR)\i386\description.obj \ + $(_OBJ_DIR)\i386\discoveryurl.obj \ + $(_OBJ_DIR)\i386\email.obj \ + $(_OBJ_DIR)\i386\extension.obj \ + $(_OBJ_DIR)\i386\find.obj \ + $(_OBJ_DIR)\i386\inquire.obj \ + $(_OBJ_DIR)\i386\keyedreference.obj \ + $(_OBJ_DIR)\i386\logs.obj \ + $(_OBJ_DIR)\i386\messages.obj \ + $(_OBJ_DIR)\i386\name.obj \ + $(_OBJ_DIR)\i386\phone.obj \ + $(_OBJ_DIR)\i386\publish.obj \ + $(_OBJ_DIR)\i386\service.obj \ + $(_OBJ_DIR)\i386\taxonomy.obj \ + $(_OBJ_DIR)\i386\tmodel.obj \ + $(_OBJ_DIR)\i386\types.obj \ + $(_OBJ_DIR)\i386\serializer.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\address.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\assertion.obj \ + $(_OBJ_DIR)\ia64\authentication.obj \ + $(_OBJ_DIR)\ia64\binding.obj \ + $(_OBJ_DIR)\ia64\business.obj \ + $(_OBJ_DIR)\ia64\category.obj \ + $(_OBJ_DIR)\ia64\changerecord.obj \ + $(_OBJ_DIR)\ia64\contact.obj \ + $(_OBJ_DIR)\ia64\description.obj \ + $(_OBJ_DIR)\ia64\discoveryurl.obj \ + $(_OBJ_DIR)\ia64\email.obj \ + $(_OBJ_DIR)\ia64\extension.obj \ + $(_OBJ_DIR)\ia64\find.obj \ + $(_OBJ_DIR)\ia64\inquire.obj \ + $(_OBJ_DIR)\ia64\keyedreference.obj \ + $(_OBJ_DIR)\ia64\logs.obj \ + $(_OBJ_DIR)\ia64\messages.obj \ + $(_OBJ_DIR)\ia64\name.obj \ + $(_OBJ_DIR)\ia64\phone.obj \ + $(_OBJ_DIR)\ia64\publish.obj \ + $(_OBJ_DIR)\ia64\service.obj \ + $(_OBJ_DIR)\ia64\taxonomy.obj \ + $(_OBJ_DIR)\ia64\tmodel.obj \ + $(_OBJ_DIR)\ia64\types.obj \ + $(_OBJ_DIR)\ia64\serializer.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\address.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\assertion.obj \ + $(_OBJ_DIR)\amd64\authentication.obj \ + $(_OBJ_DIR)\amd64\binding.obj \ + $(_OBJ_DIR)\amd64\business.obj \ + $(_OBJ_DIR)\amd64\category.obj \ + $(_OBJ_DIR)\amd64\changerecord.obj \ + $(_OBJ_DIR)\amd64\contact.obj \ + $(_OBJ_DIR)\amd64\description.obj \ + $(_OBJ_DIR)\amd64\discoveryurl.obj \ + $(_OBJ_DIR)\amd64\email.obj \ + $(_OBJ_DIR)\amd64\extension.obj \ + $(_OBJ_DIR)\amd64\find.obj \ + $(_OBJ_DIR)\amd64\inquire.obj \ + $(_OBJ_DIR)\amd64\keyedreference.obj \ + $(_OBJ_DIR)\amd64\logs.obj \ + $(_OBJ_DIR)\amd64\messages.obj \ + $(_OBJ_DIR)\amd64\name.obj \ + $(_OBJ_DIR)\amd64\phone.obj \ + $(_OBJ_DIR)\amd64\publish.obj \ + $(_OBJ_DIR)\amd64\service.obj \ + $(_OBJ_DIR)\amd64\taxonomy.obj \ + $(_OBJ_DIR)\amd64\tmodel.obj \ + $(_OBJ_DIR)\amd64\types.obj \ + $(_OBJ_DIR)\amd64\serializer.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\address.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\assertion.obj \ + $(_OBJ_DIR)\arm\authentication.obj \ + $(_OBJ_DIR)\arm\binding.obj \ + $(_OBJ_DIR)\arm\business.obj \ + $(_OBJ_DIR)\arm\category.obj \ + $(_OBJ_DIR)\arm\changerecord.obj \ + $(_OBJ_DIR)\arm\contact.obj \ + $(_OBJ_DIR)\arm\description.obj \ + $(_OBJ_DIR)\arm\discoveryurl.obj \ + $(_OBJ_DIR)\arm\email.obj \ + $(_OBJ_DIR)\arm\extension.obj \ + $(_OBJ_DIR)\arm\find.obj \ + $(_OBJ_DIR)\arm\inquire.obj \ + $(_OBJ_DIR)\arm\keyedreference.obj \ + $(_OBJ_DIR)\arm\logs.obj \ + $(_OBJ_DIR)\arm\messages.obj \ + $(_OBJ_DIR)\arm\name.obj \ + $(_OBJ_DIR)\arm\phone.obj \ + $(_OBJ_DIR)\arm\publish.obj \ + $(_OBJ_DIR)\arm\service.obj \ + $(_OBJ_DIR)\arm\taxonomy.obj \ + $(_OBJ_DIR)\arm\tmodel.obj \ + $(_OBJ_DIR)\arm\types.obj \ + $(_OBJ_DIR)\arm\serializer.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/api/obj/i386/coffbase.mac b/inetsrv/uddi/source/api/obj/i386/coffbase.mac new file mode 100644 index 0000000..99eb8b0 --- /dev/null +++ b/inetsrv/uddi/source/api/obj/i386/coffbase.mac @@ -0,0 +1,6 @@ +# +# Auto-generated COFFBASE from D:\OpenXP\Tools\coffbase.txt +# +# Module: uddi.api +# +MANAGED_COFFBASE=0x78400000 diff --git a/inetsrv/uddi/source/api/obj/i386/uddi.api.dll b/inetsrv/uddi/source/api/obj/i386/uddi.api.dll new file mode 100644 index 0000000..eed9ee3 Binary files /dev/null and b/inetsrv/uddi/source/api/obj/i386/uddi.api.dll differ diff --git a/inetsrv/uddi/source/api/obj/i386/uddi.api.pdb b/inetsrv/uddi/source/api/obj/i386/uddi.api.pdb new file mode 100644 index 0000000..3e63846 Binary files /dev/null and b/inetsrv/uddi/source/api/obj/i386/uddi.api.pdb differ diff --git a/inetsrv/uddi/source/api/passportlib.dll b/inetsrv/uddi/source/api/passportlib.dll new file mode 100644 index 0000000..73d72a2 Binary files /dev/null and b/inetsrv/uddi/source/api/passportlib.dll differ diff --git a/inetsrv/uddi/source/api/phone.cs b/inetsrv/uddi/source/api/phone.cs new file mode 100644 index 0000000..94156d0 --- /dev/null +++ b/inetsrv/uddi/source/api/phone.cs @@ -0,0 +1,184 @@ +using System; +using System.Data; +using System.Collections; +using System.Diagnostics; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI; + +namespace UDDI.API.Business +{ + public class Phone + { + [XmlAttribute("useType")] + public string UseType; + + [XmlText] + public string Value; + + public Phone() + { + } + + public Phone( string phone, string useType ) + { + Value = phone; + UseType = useType; + } + + internal void Validate() + { + Utility.ValidateLength( ref UseType, "useType", UDDI.Constants.Lengths.UseType ); + Utility.ValidateLength( ref Value, "phone", UDDI.Constants.Lengths.Phone ); + } + + public void Save( long contactID ) + { + // + // Create a command object to invoke the stored procedure + // + SqlCommand cmd = new SqlCommand( "net_contact_phone_save", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Input parameters + // + cmd.Parameters.Add( new SqlParameter( "@contactID", SqlDbType.BigInt ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@phone", SqlDbType.NVarChar, UDDI.Constants.Lengths.Phone ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType ) ).Direction = ParameterDirection.Input; + + // + // Set parameter values + // + SqlParameterAccessor parmacc = new SqlParameterAccessor( cmd.Parameters ); + parmacc.SetLong( "@contactID", contactID ); + parmacc.SetString( "@phone", Value ); + parmacc.SetString( "@useType", UseType ); + + cmd.ExecuteNonQuery(); + } + } + public class PhoneCollection : CollectionBase + { + internal void Validate() + { + foreach( Phone phone in this ) + { + phone.Validate(); + } + } + + public void Save( long contactID ) + { + // + // Walk collection and call save on individual contact instances + // + foreach( Phone phone in this ) + phone.Save( contactID ); + } + + public void Get( long contactID ) + { + // + // Create a command object to invoke the stored procedure net_get_contacts + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_contact_phones_get" ); + + // + // Add parameters and set values + // + cmd.Parameters.Add( "@contactID", SqlDbType.BigInt, ParameterDirection.Input ); + cmd.Parameters.SetLong( "@contactID", contactID ); + + // + // Run the stored procedure + // + SqlDataReaderAccessor reader = cmd.ExecuteReader(); + try + { + Read( reader ); +#if never + // + // Phones for this contact will be contained in the resultset + // + while( rdr.Read() ) + { + // + // construct a new contact from the data in this row, fully populate contact and add to collection + // + this.Add( dracc.GetString( PhoneIndex ), dracc.GetString( UseTypeIndex ) ); + } +#endif + } + finally + { + reader.Close(); + } + } + + public void Read( SqlDataReaderAccessor reader ) + { + const int UseTypeIndex = 0; + const int PhoneIndex = 1; + + // + // Phones for this contact will be contained in the resultset + // + while( reader.Read() ) + { + // + // construct a new contact from the data in this row, fully populate contact and add to collection + // + this.Add( reader.GetString( PhoneIndex ), reader.GetString( UseTypeIndex ) ); + } + } + + public Phone this[int index] + { + get { return ( Phone )List[ index]; } + set { List[ index ] = value; } + } + + public int Add( Phone phoneObject ) + { + return List.Add( phoneObject ); + } + + public int Add( string phone ) + { + return( Add( phone, null ) ); + } + + public int Add( string phone, string useType ) + { + return List.Add( new Phone( phone, useType ) ); + } + + public void Insert( int index, Phone value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Phone value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Phone value ) + { + return List.Contains( value ); + } + + public void Remove( Phone value ) + { + List.Remove( value ); + } + + public void CopyTo( Phone[] array, int index ) + { + List.CopyTo( array, index ); + } + } +} diff --git a/inetsrv/uddi/source/api/placefil.txt b/inetsrv/uddi/source/api/placefil.txt new file mode 100644 index 0000000..b77cfb8 --- /dev/null +++ b/inetsrv/uddi/source/api/placefil.txt @@ -0,0 +1 @@ +uddi.api.dll uddi\bin:uddi\webroot\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/api/publish.cs b/inetsrv/uddi/source/api/publish.cs new file mode 100644 index 0000000..551e6cb --- /dev/null +++ b/inetsrv/uddi/source/api/publish.cs @@ -0,0 +1,638 @@ +using System; +using System.IO; +using System.Web; +using System.Data; +using System.Data.SqlClient; +using System.Collections; +using System.Web.Services; +using System.Xml.Serialization; +using System.Security.Principal; +using System.Web.Security; +using System.Web.Services.Protocols; +using UDDI.API; +using UDDI; +using UDDI.Diagnostics; +using UDDI.API.Authentication; +using UDDI.API.Binding; +using UDDI.API.Service; +using UDDI.API.Business; +using UDDI.API.ServiceType; + +namespace UDDI.API +{ + /// **************************************************************** + /// class PublishMessages + /// ---------------------------------------------------------------- + /// + /// This is the web service class that contains the UDDI + /// publish methods. + /// + /// **************************************************************** + /// + [SoapDocumentService( ParameterStyle=SoapParameterStyle.Bare, RoutingStyle=SoapServiceRoutingStyle.RequestElement )] + [WebService( Namespace=UDDI.API.Constants.Namespace )] + public class PublishMessages + { + /// **************************************************************** + /// public AddPublisherAssertions + /// ---------------------------------------------------------------- + /// + /// Web method for adding publisher assertions. Users are + /// authenticated and the message is processed as part of a + /// transaction. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the add_publisherAssertions + /// message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a disposition report indicating success or failure. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod( Action = "\"\"", RequestElementName = "add_publisherAssertions" )] + [UDDIExtension( authenticate = true, transaction = true, https = true, messageType = "add_publisherAssertions" )] + public DispositionReport AddPublisherAssertions( AddPublisherAssertions message ) + { + Debug.Enter(); + + // + // Create a disposition report indicating success + // + DispositionReport report = new DispositionReport(); + + try + { + // + // Add the publisher assertions. + // + message.Save(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + + return report; + } + + /// **************************************************************** + /// public DeleteBinding + /// ---------------------------------------------------------------- + /// + /// Web method for removing a set of bindingTemplates from the UDDI registry. + /// Users are authenticated and the message is processed as part of a + /// transaction. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the delete_binding message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a dispositionReport indicating success or failure. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="delete_binding")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="delete_binding" )] + public DispositionReport DeleteBinding( DeleteBinding dbind ) + { + Debug.Enter(); + + // + // Create dispositionReport indicating success + // + DispositionReport dr = new DispositionReport(); + + try + { + // + // Delete the binding + // + dbind.Delete(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return dr; + } + + /// **************************************************************** + /// public DeleteBusiness + /// ---------------------------------------------------------------- + /// + /// Web method for removing a set of businessEntities from the UDDI registry. + /// Users are authenticated and the message is processed as part of a + /// transaction. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the delete_business message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a dispositionReport indicating success or failure. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="delete_business")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="delete_business" )] + public DispositionReport DeleteBusiness( DeleteBusiness dbus ) + { + Debug.Enter(); + + DispositionReport dr = new DispositionReport(); + try + { + // + // Delete the business + // + dbus.Delete(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return dr; + } + + /// **************************************************************** + /// public class DeletePublisherAssertions + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + [WebMethod] + [SoapDocumentMethod( Action = "\"\"", RequestElementName = "delete_publisherAssertions" )] + [UDDIExtension( authenticate = true, transaction = true, https = true, messageType = "delete_publisherAssertions" )] + public DispositionReport DeletePublisherAssertions( DeletePublisherAssertions message ) + { + Debug.Enter(); + + DispositionReport report = new DispositionReport(); + + try + { + message.Delete(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + + return report; + } + + /// **************************************************************** + /// public DeleteService + /// ---------------------------------------------------------------- + /// + /// Web method for removing a set of businessServices from the UDDI registry. + /// Users are authenticated and the message is processed as part of a + /// transaction. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the delete_service message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a dispositionReport indicating success or failure. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="delete_service")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="delete_service" )] + public DispositionReport DeleteService( DeleteService ds ) + { + Debug.Enter(); + DispositionReport dr = new DispositionReport(); + try + { + // + // Delete the service + // + ds.Delete(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return dr; + } + + /// **************************************************************** + /// public DeleteTModel + /// ---------------------------------------------------------------- + /// + /// Web method for removing a set of tModels from the UDDI registry. + /// Users are authenticated and the message is processed as part of a + /// transaction. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the delete_tModel message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a dispositionReport indicating success or failure. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="delete_tModel")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="delete_tModel" )] + public DispositionReport DeleteTModel( DeleteTModel dtm ) + { + Debug.Enter(); + DispositionReport dr = new DispositionReport(); + try + { + // + // Delete the tModel + // + dtm.Delete(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return dr; + } + + /// **************************************************************** + /// public DiscardAuthToken + /// ---------------------------------------------------------------- + /// + /// This optional message is used to deactivate an authentication token + /// that was obtained by a call to get_authToken. + /// + /// ---------------------------------------------------------------- + /// + /// A properly formed instance of the discard_authToken message. + /// + /// ---------------------------------------------------------------- + /// + /// Returns a dispositionReport indicating success or failure. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="discard_authToken")] + [UDDIExtension( https=true, messageType="discard_authToken" )] + public DispositionReport DiscardAuthToken( DiscardAuthToken dat ) + { + Debug.Enter(); + DispositionReport dr = new DispositionReport(); + + try + { + if( ( Config.GetInt( "Security.AuthenticationMode" ) == (int) AuthenticationMode.Passport ) ) + { + PassportAuthenticator authenticator = new PassportAuthenticator(); + authenticator.Authenticate( dat.AuthInfo, Config.GetInt( "Security.TimeOut" ) ); + + // + // Call to the database to update the user status to logged off. + // + SqlCommand cmd = new SqlCommand( "ADM_setPublisherStatus", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.Add( new SqlParameter( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@publisherStatus", SqlDbType.NVarChar, UDDI.Constants.Lengths.PublisherStatus ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + paramacc.SetString( "@PUID", Context.User.ID ); + paramacc.SetString( "@publisherStatus", "loggedOut"); + cmd.ExecuteNonQuery(); + } + + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return dr; + } + + [WebMethod] + [SoapDocumentMethod( Action = "\"\"", RequestElementName = "get_assertionStatusReport" )] + [UDDIExtension( authenticate = true, https = true, messageType = "get_assertionStatusReport" )] + public AssertionStatusReport GetAssertionStatusReport( GetAssertionStatusReport message ) + { + Debug.Enter(); + + AssertionStatusReport statusReport = new AssertionStatusReport(); + + try + { + statusReport.Get( message.CompletionStatus ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + + return statusReport; + } + + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="get_authToken")] + [UDDIExtension( https=true, messageType="get_authToken" )] + public AuthToken GetAuthToken( GetAuthToken gat ) + { + Debug.Enter(); + AuthToken at = new AuthToken(); + + try + { + // + // XX-SECURITY: Review the value here in the case where we use + // XX-this with a web.config with Authentication set to None or Passport + // + // + // NOW: We now Get a Generic Identity. If the AuthenticationMode is AuthenticationMode.Passport (8), + // we make sure the Identity is a PassportIdentity, then we authenticate. If AuthenticationMode + // is Not set to AuthenticationMode.Passport, then process it as a WindowsIdentity. + // + // + + IIdentity identity = HttpContext.Current.User.Identity; + + int mode = Config.GetInt( "Security.AuthenticationMode", (int) AuthenticationMode.Both ); + if( ( (int) AuthenticationMode.Passport ) == mode ) + { + if( identity is PassportIdentity ) + { + Debug.Write( SeverityType.Info, CategoryType.Soap, "Generating credentials for Passport based authentication Identity is " + gat.UserID ); + + PassportAuthenticator pa = new PassportAuthenticator(); + + // + // Get a Passport ticket for this user. + // + if( !pa.GetAuthenticationInfo( gat.UserID, gat.Cred, out at.AuthInfo ) ) + { + // throw new UDDIException( ErrorType.E_unknownUser, "User failed authentication." ) ; + throw new UDDIException( ErrorType.E_unknownUser, "USER_FAILED_AUTHENTICATION" ) ; + } + + // + // We need to extract the PUID from the ticket and put it into our Context.UserInfo.ID; a + // successfull call to Authenticate will do all of this. + // + if( !pa.Authenticate( at.AuthInfo, UDDI.Constants.Passport.TimeWindow ) ) + { + throw new UDDIException( ErrorType.E_unknownUser, "UDDI_ERROR_USER_FAILED_AUTHENTICATION" ) ; + } + + // + // Make sure this Passport user has registered with our UDDI site as a publisher. + // + if( !Context.User.IsVerified ) + { + // throw new UDDIException( ErrorType.E_unknownUser, "Not a valid publisher." ) ; + throw new UDDIException( ErrorType.E_unknownUser, "UDDI_ERROR_NOT_A_VALID_PUBLISHER" ) ; + } + } + else + { +#if never + throw new UDDIException( ErrorType.E_fatalError, + "CONFIGURATION ERROR: Passport Identity Expected. \r\n"+ + "You are currently running in Passport Authentication Mode. \r\n"+ + "Check your web.config for the entry and try again." ) ; +#endif + + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_PASSPORT_CONFIGURATION_ERROR" ); + } + } + + // + // SECURITY: Check to make sure the password is blank too + // + else if( !((WindowsIdentity)identity).IsAnonymous && + ( ( mode & (int) AuthenticationMode.Windows ) != 0 ) && + Utility.StringEmpty( gat.UserID ) ) + { + Debug.Write( SeverityType.Info, CategoryType.Soap, "Generating credentials for Windows based authentication Identity is " + identity.Name ); + WindowsAuthenticator wa = new WindowsAuthenticator(); + wa.GetAuthenticationInfo( gat.UserID, gat.Cred, out at.AuthInfo ); + } + else if( ( mode & (int) AuthenticationMode.Uddi ) != 0 ) + { + Debug.Write( SeverityType.Info, CategoryType.Soap, "Generating credentials for UDDI based authentication" ); + UDDIAuthenticator ua = new UDDIAuthenticator(); + ua.GetAuthenticationInfo( gat.UserID, gat.Cred, out at.AuthInfo ); + } + else + { + // throw new UDDIException( UDDI.ErrorType.E_unsupported, + //"The UDDI server is not configured to support the requested form of authentication." ); + throw new UDDIException( UDDI.ErrorType.E_unsupported, "UDDI_ERROR_AUTHENTICATION_CONFIGURATION_ERROR" ); + } + + Debug.Write( SeverityType.Info, CategoryType.Soap, "Windows Identity is " + WindowsIdentity.GetCurrent().Name ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "Thread Identity is " + System.Threading.Thread.CurrentPrincipal.Identity.Name ); + Debug.Write( SeverityType.Info, CategoryType.Soap, "HttpContext Identity is " + identity.Name ); + + // + // Check to make sure the authenticated user has publisher credentials + // +#if never + Debug.Verify( Context.User.IsPublisher, + "The user account " + Context.User.ID + " does not have publisher credentials", + UDDI.ErrorType.E_fatalError ); +#endif + + Debug.Verify( Context.User.IsPublisher, + "UDDI_ERROR_NO_PUBLISHER_CREDENTIALS", + UDDI.ErrorType.E_fatalError, + Context.User.ID ); + + Debug.Write( + SeverityType.Info, + CategoryType.Authorization, + "Authenticated user (userid = " + gat.UserID + " )" ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return at; + } + + /// **************************************************************** + /// public class GetPublisherAssertions + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + [WebMethod] + [SoapDocumentMethod( Action = "\"\"", RequestElementName = "get_publisherAssertions" )] + [UDDIExtension( authenticate = true, https = true, messageType = "get_publisherAssertions" )] + public PublisherAssertionDetail GetPublisherAssertions( GetPublisherAssertions message ) + { + Debug.Enter(); + + PublisherAssertionDetail detail = new PublisherAssertionDetail(); + + try + { + detail.Get(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + + return detail; + } + + /// **************************************************************** + /// public class GetRegisteredInfo + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod( Action="\"\"", RequestElementName="get_registeredInfo" )] + [UDDIExtension( authenticate=true, https=true, messageType="get_registeredInfo")] + public RegisteredInfo GetRegisteredInfo( GetRegisteredInfo gri ) + { + Debug.Enter(); + RegisteredInfo ri = new RegisteredInfo(); + + try + { + ri.Get(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return ri; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="save_binding")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="save_binding")] + public BindingDetail SaveBinding( SaveBinding sb ) + { + Debug.Enter(); + BindingDetail bd = new BindingDetail(); + + try + { + sb.Save(); + bd.BindingTemplates = sb.BindingTemplates; + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return bd; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="save_business")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="save_business" )] + public BusinessDetail SaveBusiness( SaveBusiness sb ) + { + Debug.Enter(); + BusinessDetail bd = new BusinessDetail(); + try + { + sb.Save(); + bd.BusinessEntities = sb.BusinessEntities; + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return bd; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="save_service")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="save_service" )] + public ServiceDetail SaveService( SaveService ss ) + { + Debug.Enter(); + ServiceDetail sd = new ServiceDetail(); + + try + { + ss.Save(); + sd.BusinessServices = ss.BusinessServices; + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return sd; + } + + [WebMethod, SoapDocumentMethod(Action="\"\"", RequestElementName="save_tModel")] + [UDDIExtension( authenticate=true, transaction=true, https=true, messageType="save_tModel" )] + public TModelDetail SaveTModel( UDDI.API.ServiceType.SaveTModel stm ) + { + Debug.Enter(); + TModelDetail tmd = new TModelDetail(); + try + { + stm.Save(); + tmd.TModels = stm.TModels; + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + return tmd; + } + + [WebMethod()] + [SoapDocumentMethod( Action = "\"\"", RequestElementName = "set_publisherAssertions" )] + [UDDIExtension( authenticate = true, transaction = true, https = true, messageType = "set_publisherAssertions" )] + public PublisherAssertionDetail SetPublisherAssertions( SetPublisherAssertions message ) + { + Debug.Enter(); + + PublisherAssertionDetail detail = new PublisherAssertionDetail(); + + try + { + detail = message.Set(); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + } + + Debug.Leave(); + + return detail; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/api/serializer.cs b/inetsrv/uddi/source/api/serializer.cs new file mode 100644 index 0000000..280a053 --- /dev/null +++ b/inetsrv/uddi/source/api/serializer.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections; +using System.Xml.Serialization; + +using UDDI.API.Business; +using UDDI.Replication; +using UDDI.Diagnostics; + +namespace UDDI +{ + // + // This class caches all of the serializers that our API and replication uses. + // + public class XmlSerializerManager + { + private static Hashtable serializers; + + static XmlSerializerManager() + { + // + // Pre-create all of our serializers + // + serializers = new Hashtable(); + + Type type = typeof( ChangeRecordAcknowledgement ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordCorrection ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordCustodyTransfer ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordDelete ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordDeleteAssertion ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordHide ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordNewData ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordNull ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordPublisherAssertion ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( ChangeRecordSetAssertions ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( BusinessEntity ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( UserInfo ); + serializers.Add( type, new XmlSerializer( type ) ) ; + + type = typeof( UDDI.API.DispositionReport ); + serializers.Add( type, new XmlSerializer( type ) ) ; + } + + static public XmlSerializer GetSerializer( Type type ) + { + XmlSerializer serializer = ( XmlSerializer )serializers[ type ]; + + if( null == serializer ) + { + Debug.Write( SeverityType.Warning, CategoryType.None, "No serializer for type: " + type.FullName ); + + serializer = new XmlSerializer( type ); + serializers[ type ] = serializer; + } + + return serializer; + } + } +} diff --git a/inetsrv/uddi/source/api/service.cs b/inetsrv/uddi/source/api/service.cs new file mode 100644 index 0000000..2f797f5 --- /dev/null +++ b/inetsrv/uddi/source/api/service.cs @@ -0,0 +1,1654 @@ +using System; +using UDDI; +using System.Data; +using System.Collections; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI.API.Binding; +using UDDI.Replication; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.API.Service +{ + /// ******************************************************************** + /// class BusinessService + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute( "businessService", Namespace=UDDI.API.Constants.Namespace )] + public class BusinessService : EntityBase + { + // + // Attribute: serviceKey + // + [XmlAttribute("serviceKey")] + public string ServiceKey = ""; + + // + // Attribute: businessKey + // + [XmlAttribute("businessKey")] + public string BusinessKey = ""; + + // + // Element: name + // + private NameCollection names; + + [XmlElement("name")] + public NameCollection Names + { + get + { + if( null == names ) + names = new NameCollection(); + + return names; + } + + set { names = value; } + } + + // + // Element: description + // + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // + // Element: bindingTemplates + // + [ XmlIgnore ] + public BindingTemplateCollection BindingTemplates = new BindingTemplateCollection(); + + [ XmlArray( "bindingTemplates" ), XmlArrayItem( "bindingTemplate" ) ] + public BindingTemplate[] BindingTemplatesSerialize + { + get + { + // + // Don't return an empty BindingTemplates collection if we are not using v1.0. + // + if( true == Utility.CollectionEmpty( BindingTemplates ) && + 1 != Context.ApiVersionMajor) + { + return null; + } + else + { + return BindingTemplates.ToArray(); + } + } + + set + { + BindingTemplates.Clear(); + BindingTemplates.CopyTo( value ); + } + } + + // + // Element: categoryBag + // + [ XmlIgnore ] + public KeyedReferenceCollection CategoryBag = new KeyedReferenceCollection(); + + [ XmlArray( "categoryBag" ), XmlArrayItem( "keyedReference" ) ] + public KeyedReference[] CategoryBagSerialize + { + get + { + if( Utility.CollectionEmpty( CategoryBag ) ) + return null; + + return CategoryBag.ToArray(); + } + + set + { + CategoryBag.Clear(); + CategoryBag.CopyTo( value ); + } + } + + [XmlIgnore] + public override UDDI.EntityType EntityType + { + get { return EntityType.BusinessService; } + } + + [XmlIgnore] + public override string EntityKey + { + get { return ServiceKey; } + } + + /// **************************************************************** + /// public BusinessService [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public BusinessService() + { + } + + /// **************************************************************** + /// public BusinessService [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public BusinessService( string serviceKey ) + { + ServiceKey = serviceKey; + } + + public BusinessService( string serviceKey, string businessKey ) + { + ServiceKey = serviceKey; + BusinessKey = businessKey; + } + + /// **************************************************************** + /// public Delete + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public override void Delete() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_businessService_delete"; + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + + sp.ExecuteNonQuery(); + + // + // Save the change log entry. + // + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.Payload = new ChangeRecordDelete( EntityType.BusinessService, ServiceKey ); + changeRecord.Log(); + } + } + + /// **************************************************************** + /// public Get + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public override void Get() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessService_get_batch" ); + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + + SqlDataReaderAccessor reader = null; + try + { + // + // net_businessEntity_get will return the objects contained in a business in the following order: + // + // - descriptions + // - names + // - binding templates + // - category bags + reader = sp.ExecuteReader(); + + // + // Read the descriptions + // + Descriptions.Read( reader ); + + // + // Read the names + // + if( true == reader.NextResult() ) + { + Names.Read( reader ); + } + + // + // Read the binding templates + // + if( true == reader.NextResult() ) + { + BindingTemplates.Read( reader ); + } + + // + // Read the category bags + // + if( true == reader.NextResult() ) + { + CategoryBag.Read( reader ); + } + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } + + // + // These calls will make separate sproc calls, so we have to close our reader first. + // + BindingTemplates.Populate(); + + // + // Output parameters + // + BusinessKey = sp.Parameters.GetGuidString( "@businessKey" ); + +#if never + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessService_get" ); + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + + sp.ExecuteNonQuery(); + + BusinessKey = sp.Parameters.GetGuidString( "@businessKey" ); + + // + // Get all contained objects. + // + Descriptions.Get( ServiceKey, EntityType.BusinessService ); + Names.Get( ServiceKey, EntityType.BusinessService ); + BindingTemplates.Get( ServiceKey ); + CategoryBag.Get( ServiceKey, EntityType.BusinessService, KeyedReferenceType.CategoryBag ); +#endif + + QueryLog.Write( QueryType.Get, EntityType.BusinessService ); + + Debug.Leave(); + } + + /// **************************************************************** + /// internal InnerSave + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + internal void InnerSave( string businessKey ) + { + Debug.Enter(); + + if( IsServiceProjection( businessKey ) ) + { + // + // Make sure that service projections are enabled. + // + if( 0 == Config.GetInt( "Service.ServiceProjectionEnable", 1 ) ) + { + // throw new UDDIException( UDDI.ErrorType.E_fatalError, "Service projections are not enabled" ); + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_SERVICE_PROJECTIONS_NOT_ENABLED" ); + } +#if never + Debug.Verify( + !Utility.StringEmpty( ServiceKey ), + "A valid serviceKey must be specified when saving a service projection" ); +#endif + + Debug.Verify( + !Utility.StringEmpty( ServiceKey ), + "UDDI_ERROR_INVALID_SERVICE_PROJECTION_KEY" ); + + try + { + // + // Save the service projection. + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_serviceProjection_save" ); + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + sp.Parameters.SetGuidFromString( "@businessKey", businessKey ); + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + + sp.ExecuteNonQuery(); + + // + // Get all of the containing objects for this service; we'll return this information. Do this + // in a try and ignore any exceptions because the projected service may not exist. It is not an + // error to project to a non-existing service. + // + + try + { + // + // Clear out collections first. There might be data in these collections if the request + // contained information about the service. + // + + Names.Clear(); + Descriptions.Clear(); + BindingTemplates.Clear(); + CategoryBag.Clear(); + + Get(); + } + catch + { + // + // Intentionally left blank. + // + } + } + catch( SqlException sqlException ) + { + // + // As per IN 60, we have to process service projection change records that refer to broken services. + // + if( sqlException.Number - UDDI.Constants.ErrorTypeSQLOffset == ( int ) ErrorType.E_invalidKeyPassed && + sqlException.Message.IndexOf( "serviceKey" ) >= 0 && + Context.ContextType == ContextType.Replication ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_serviceProjection_repl_save" ); + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey2", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + sp.Parameters.SetGuidFromString( "@businessKey", businessKey ); + sp.Parameters.SetGuidFromString( "@businessKey2", BusinessKey ); + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + + sp.ExecuteNonQuery(); + + // + // Set our exception source + // + Context.ExceptionSource = ExceptionSource.BrokenServiceProjection; + } + else + { + Context.ExceptionSource = ExceptionSource.Other; + } + + // + // Re-throw the exception so replication can properly log it. + // + throw sqlException; + } + } + else + { + // + // If we are not saving a service projection, then we want to still validate our names collection before + // saving our service, since the schema has made optional in order to accomodate service projections. + // + Names.Validate(); + + // + // Save the contained business service. + // + BusinessKey = businessKey; + + if( Utility.StringEmpty( ServiceKey ) ) + ServiceKey = Guid.NewGuid().ToString(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessService_save" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@generic", SqlDbType.VarChar, UDDI.Constants.Lengths.generic ); + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + sp.Parameters.SetString( "@generic", Constants.Version ); + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + + sp.ExecuteNonQuery(); + + // + // Save all contained objects + // + Names.Save( ServiceKey, EntityType.BusinessService ); + Descriptions.Save( ServiceKey, EntityType.BusinessService ); + BindingTemplates.Save( ServiceKey ); + CategoryBag.Save( ServiceKey, EntityType.BusinessService, KeyedReferenceType.CategoryBag ); + } + + Debug.Leave(); + } + + /// **************************************************************** + /// internal Validate + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + internal void Validate( string businessEntityBusinessKey ) + { + Debug.Enter(); + + // + // We don't want to do this if our save was a service projection because in that case + // the caller of this operation may or may not be the publisher of the service being + // projected. + // + // If we are doing a service projection, then the business key will be the value of another businessEntity and + // the serviceKey will be the value of the service in that entity that we want to project. + + // + // Only do this check if this service is not a service projection. + // + + if( false == IsServiceProjection( businessEntityBusinessKey ) ) + { + // + // We are not doing a service projection, so make sure the caller is the person who published + // this service. + // + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessService_validate" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + if( Context.User.AllowPreassignedKeys ) + sp.Parameters.SetInt( "@flag", 1 ); + else + sp.Parameters.SetInt( "@flag", 0 ); + + // + // The sproc will throw an exception if anything goes wrong + // + sp.ExecuteNonQuery(); + + // + // Validate all contained objects. + // + Names.Validate(); + Descriptions.Validate(); + BindingTemplates.Validate(); + CategoryBag.Validate( ServiceKey, KeyedReferenceType.CategoryBag ); + } + else + { + // + // Make sure that service projections are enabled. + // + if( 0 == Config.GetInt( "Service.ServiceProjectionEnable", 1 ) ) + { + // throw new UDDIException( UDDI.ErrorType.E_fatalError, "Service projections are not enabled" ); + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_SERVICE_PROJECTIONS_NOT_ENABLED" ); + } + + // + // Validation for a service projection is different than a regular service. + // + + // + // First check to see that we are using the version 2 API, service projections + // are not supported in version 1. + if( Context.ApiVersionMajor == 1 ) + { + // throw new UDDIException( ErrorType.E_userMismatch, "Service projections are not supported using the version 1.0 API. Use version 2.0 or higher." ); + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_SERVICE_PROJECTIONS_NOT_ENABLED_FOR_VERSION" ); + } + + // + // We need to check that the service being projected really belongs to the business key that was specified. It's ok + // if the service does not exist, but it cannot belong to someone else (like us). + // + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_serviceProjection_validate" ); + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + sp.Parameters.SetGuidFromString( "@businessKey", BusinessKey ); + + // + // The sproc will throw an exception if anything goes wrong + // + try + { + sp.ExecuteNonQuery(); + } + catch( System.Data.SqlClient.SqlException se ) + { + switch ( se.Number - UDDI.Constants.ErrorTypeSQLOffset ) + { + case (int) ErrorType.E_invalidKeyPassed : + // + // E_invalidKey: parent businessKey of service projection is not true owner + // + + if( Context.ContextType == ContextType.Replication ) + { + // + //We are going to allow this under replication but write a warning + // + string message = "Service projection saved with invalid businessKey. serviceKey = " + ServiceKey.ToString() + "; businessKey = " + BusinessKey.ToString(); + Debug.Write( UDDI.Diagnostics.SeverityType.Warning, UDDI.Diagnostics.CategoryType.Data, message ); + } + else + { + // + // re-throw error if not running in replication + // + + throw se; + } + + break; + + default: + throw se; + } + + } + catch( Exception e ) + { + throw e; + } + } + Debug.Leave(); + } + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public override void Save() + { + Validate( this.BusinessKey ); + InnerSave( this.BusinessKey ); + + // + // Save the change log entry. + // + if( Context.LogChangeRecords ) + { + // + // If we used a V1 API message, make sure to add in language codes for the names. We will + // then take these names out after we save the change record. + // + if( 1 == Context.ApiVersionMajor ) + { + foreach( Name name in Names ) + { + name.IsoLangCode = Context.User.IsoLangCode; + } + } + + ChangeRecord changeRecord = new ChangeRecord(); + changeRecord.Payload = new ChangeRecordNewData( this ); + changeRecord.Log(); + + // + // Take out language names if we are using V1. + // + if( 1 == Context.ApiVersionMajor ) + { + foreach( Name name in Names ) + { + name.IsoLangCode = null; + } + } + } + } + + // + // TODO: is this the best way to determine that this is a service project? + // + private bool IsServiceProjection( string businessEntityBusinessKey ) + { + // + // If the business key in the service does not match the key + // of the business entity saving it, this is a service + // projection. + // + if( !Utility.StringEmpty( BusinessKey ) + && 0 != String.Compare( BusinessKey, businessEntityBusinessKey, true ) ) + { + return true; + } + else + { + return false; + } + } + } + + public class BusinessServiceCollection : CollectionBase + { + public BusinessService this[int index] + { + get { return (BusinessService)List[index]; } + set { List[index] = value; } + } + + internal void Validate( string businessKey ) + { + foreach( BusinessService service in this ) + { + service.Validate( businessKey ); + } + } + + public void Save( string businessKey ) + { + // + // Implement IN92 restriction which states: + // "A service must not contain a service and a service projection to this service. As a result, a service + // cannot be moved to a BE that already has a projection to that service. Regardless of the order of operation, + // a service and a service projection can never appear under the same business. Implementations are required to + // reject and return an E_fatalError during a save_business operation. Should a changeRecord be processed via + // the replication stream with a business containing a service and a service projection to that same service, + // this occurrence will result in the processing node throwing an error and halting replication." + // + + for( int i=0; i < this.Count; i++ ) + { + if( !Utility.StringEmpty( this[ i ].BusinessKey ) && 0 != String.Compare( this[ i ].BusinessKey, businessKey, true ) ) + { + // + // Current service is a service projection + // Check all the other services to see if the same service is being saved elsewhere + // + + for( int j=0; j < this.Count; j++ ) + { + if( j == i ) + { + continue; + } + + if( 0 == String.Compare( this[ j ].ServiceKey, this[ i ].ServiceKey, true ) + && ( !Utility.StringEmpty( this[ j ].BusinessKey ) && 0 == String.Compare( this[ j ].BusinessKey, businessKey, true ) ) ) + { + // + // The serviceKey of a projection has been used a second time in the body of a save + // This second use is not a service project itself, and should therefore be rejected + // + + //throw new UDDIException( UDDI.ErrorType.E_fatalError, "The serviceKey associated with a service projection cannot be referenced in a subsequent serviceDetail that is not itself a service projection. serviceKey = " + this[ i ].ServiceKey ); + throw new UDDIException( UDDI.ErrorType.E_fatalError, "UDDI_ERROR_INVALID_SERVICEKEY_FOR_PROJECTION", this[ i ].ServiceKey ); + } + + } + } + } + foreach( BusinessService service in this ) + { + service.InnerSave( businessKey ); + } + } + + public void Get( string businessKey ) + { + // + // Retrieve the core information for this business + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_businessEntity_businessServices_get" ); + + // + // Add parameters and set values + // + cmd.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + cmd.Parameters.SetGuidFromString( "@businessKey", businessKey ); + + // + // Execute query to retreive services for this businesskey + // + SqlDataReaderAccessor reader = cmd.ExecuteReader(); + try + { + Read( reader ); +#if never + while( rdr.Read() ) + { + // + // Add a BusinessService object to the collection. We'll populate it + // with the serviceKey (column 0) and a businessKey (column 1). The + // businessKey will only have a meaningful value if this BusinessService is + // a service projection, otherwise it will be null. We need this value now + // because we might not be able to get any other information for this BusinessService + // if it is a projection of a non-existant BusinessService. + // + if( false == rdr.IsDBNull ( 1 ) ) + { + Add( rdr.GetGuid( 0 ).ToString(), rdr.GetGuid( 1 ).ToString() ); + } + else + { + Add( rdr.GetGuid( 0 ).ToString(), null ); + } + } +#endif + } + finally + { + reader.Close(); + } + + Populate(); + +#if never + foreach( BusinessService service in this ) + { + // + // Get will throw an exception if this service is a service projection for service that no longer + // exists. If that's the case, we'll eat the exception since we already have businessKey and serviceKey, + // which is the only data that we need for this type of service projection. + // + try + { + service.Get(); + } + catch( SqlException sqlException ) + { + // + // If we don't have a valid businessKey for this service, then the key really was invalid, so rethrow the + // exception. + // + if( null == service.BusinessKey ) + { + throw sqlException; + } + } + } +#endif + } + + public void Read( SqlDataReaderAccessor reader ) + { + while( reader.Read() ) + { + // + // Add a BusinessService object to the collection. We'll populate it + // with the serviceKey (column 0) and a businessKey (column 1). The + // businessKey will only have a meaningful value if this BusinessService is + // a service projection, otherwise it will be null. We need this value now + // because we might not be able to get any other information for this BusinessService + // if it is a projection of a non-existant BusinessService. + // + if( false == reader.IsDBNull ( 1 ) ) + { + Add( reader.GetGuidString( 0 ), reader.GetGuidString( 1 ) ); + } + else + { + Add( reader.GetGuidString( 0 ), null ); + } + } + } + + public void Populate() + { + foreach( BusinessService service in this ) + { + // + // Get will throw an exception if this service is a service projection for service that no longer + // exists. If that's the case, we'll eat the exception since we already have businessKey and serviceKey, + // which is the only data that we need for this type of service projection. + // + try + { + service.Get(); + } + catch( SqlException sqlException ) + { + // + // If we don't have a valid businessKey for this service, then the key really was invalid, so rethrow the + // exception. + // + if( null == service.BusinessKey ) + { + throw sqlException; + } + } + } + } + + public int Add() + { + return List.Add( new BusinessService() ); + } + + public int Add(BusinessService value) + { + return List.Add(value); + } + + public int Add( string serviceKey, string businessKey ) + { + return List.Add( new BusinessService( serviceKey, businessKey ) ); + } + + public int Add( string serviceKey ) + { + return List.Add( new BusinessService( serviceKey ) ); + } + + public void Insert(int index, BusinessService value) + { + List.Insert(index, value); + } + + public int IndexOf(BusinessService value) + { + return List.IndexOf(value); + } + + public bool Contains(BusinessService value) + { + return List.Contains(value); + } + + public void Remove(BusinessService value) + { + List.Remove(value); + } + + public void CopyTo( BusinessService[] array ) + { + foreach( BusinessService service in array ) + Add( service ); + } + + public BusinessService[] ToArray() + { + return (BusinessService[])InnerList.ToArray( typeof( BusinessService ) ); + } + public void Sort() + { + InnerList.Sort( new BusinessServiceComparer() ); + } + + internal class BusinessServiceComparer : IComparer + { + public int Compare( object x, object y ) + { + BusinessService entity1 = (BusinessService)x; + BusinessService entity2 = (BusinessService)y; + + // + // Service projections might not have names + // + if( 0 == entity1.Names.Count && 0 == entity2.Names.Count ) + { + return 0; + } + else if ( 0 == entity1.Names.Count ) + { + return -1; + } + else if ( 0 == entity2.Names.Count ) + { + return 1; + } + else + { + return string.Compare( entity1.Names[ 0 ].Value, entity2.Names[ 0 ].Value, true ); + } + } + } + } + + public class ServiceInfoCollection : CollectionBase + { + public void Get( string businessKey ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_businessServices_get" ); + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", businessKey ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + Read( reader ); + } + finally + { + reader.Close(); + } + + Populate(); + +#if never + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessEntity_businessServices_get" ); + + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", businessKey ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + // + // Add a ServiceInfo object to the collection. We'll populate it + // with the serviceKey (column 0) and a businessKey (column 1). The + // businessKey will only have a meaningful value if the BusinessService this ServiceInfo refers + // to is a service projection, otherwise it will be null. We need this value now + // because we might not be able to get any other information for this BusinessService + // if it is a projection of a non-existant BusinessService. + // + Add( reader.GetGuidString( 0 ) , reader.GetGuidString( 1 ) ); + } + } + finally + { + reader.Close(); + } + + // + // Get the details for each service info. + // + foreach( ServiceInfo serviceInfo in this ) + { + // + // Get will throw an exception if this service is a service projection for service that no longer + // exists. If that's the case, we'll eat the exception since we already have businessKey and serviceKey, + // which is the only data that we need for this type of service projection. + // + try + { + serviceInfo.Get(); + } + catch( SqlException sqlException ) + { + // + // If we don't have a valid businessKey for this service, then the key really was invalid, so rethrow the + // exception. + // + if( null == serviceInfo.BusinessKey ) + { + throw sqlException; + } + } + } +#endif + } + + public void Read( SqlDataReaderAccessor reader ) + { + while( reader.Read() ) + { + // + // Add a ServiceInfo object to the collection. We'll populate it + // with the serviceKey (column 0) and a businessKey (column 1). The + // businessKey will only have a meaningful value if the BusinessService this ServiceInfo refers + // to is a service projection, otherwise it will be null. We need this value now + // because we might not be able to get any other information for this BusinessService + // if it is a projection of a non-existant BusinessService. + // + if( false == reader.IsDBNull ( 1 ) ) + { + Add( reader.GetGuidString( 0 ), reader.GetGuidString( 1 ) ); + } + else + { + Add( reader.GetGuidString( 0 ), null ); + } + } + } + + public void Populate() + { + // + // Get the details for each service info. + // + foreach( ServiceInfo serviceInfo in this ) + { + // + // Get will throw an exception if this service is a service projection for service that no longer + // exists. If that's the case, we'll eat the exception since we already have businessKey and serviceKey, + // which is the only data that we need for this type of service projection. + // + try + { + serviceInfo.Get(); + } + catch( SqlException sqlException ) + { + // + // If we don't have a valid businessKey for this service, then the key really was invalid, so rethrow the + // exception. + // + if( null == serviceInfo.BusinessKey ) + { + throw sqlException; + } + } + } + } + + public ServiceInfo this[ int index ] + { + get { return (ServiceInfo)List[ index ]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new ServiceInfo() ); + } + + public int Add( string serviceKey, string businessKey ) + { + return List.Add( new ServiceInfo( serviceKey, businessKey ) ); + } + + public int Add( ServiceInfo serviceInfo ) + { + return List.Add( serviceInfo ); + } + public void Insert( int index, ServiceInfo serviceInfo ) + { + List.Insert( index, serviceInfo ); + } + public int IndexOf( ServiceInfo serviceInfo ) + { + return List.IndexOf( serviceInfo ); + } + public bool Contains( ServiceInfo serviceInfo ) + { + return List.Contains( serviceInfo ); + } + public void Remove( ServiceInfo serviceInfo ) + { + List.Remove( serviceInfo ); + } + public void CopyTo( ServiceInfo[] array, int index ) + { + List.CopyTo( array, index ); + } + + public void Sort() + { + InnerList.Sort( new ServiceInfoComparer() ); + } + + internal class ServiceInfoComparer : IComparer + { + public int Compare( object x, object y ) + { + ServiceInfo entity1 = (ServiceInfo)x; + ServiceInfo entity2 = (ServiceInfo)y; + + // + // Service projections might not have names + // + if( 0 == entity1.Names.Count && 0 == entity2.Names.Count ) + { + return 0; + } + else if ( 0 == entity1.Names.Count ) + { + return -1; + } + else if ( 0 == entity2.Names.Count ) + { + return 1; + } + else + { + return string.Compare( entity1.Names[ 0 ].Value, entity2.Names[ 0 ].Value, true ); + } + } + } + } + + public class ServiceInfo + { + // + // Attribute: serviceKey + // + [XmlAttribute("serviceKey")] + public string ServiceKey; + + // + // Attribute: businessKey + // + [XmlAttribute("businessKey")] + public string BusinessKey; + + // + // Element: name + // + [XmlElement("name")] + public NameCollection Names = new NameCollection(); + + public ServiceInfo() + { + } + + public ServiceInfo( string serviceKey, string businessKey ) + { + ServiceKey = serviceKey; + BusinessKey = businessKey; + } + + public void Get() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_serviceInfo_get_batch" ); + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + + SqlDataReaderAccessor reader = null; + try + { + // + // net_serviceInfo_get_batch will return the objects contained in a business in the following order: + // + // - names + reader = sp.ExecuteReader(); + + // + // Read the names + // + Names.Read( reader ); + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } + + // + // Output parameters + // + BusinessKey = sp.Parameters.GetGuidString( "@businessKey" ); +#if never + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_businessService_get" ); + + sp.Parameters.Add( "@serviceKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@serviceKey", ServiceKey ); + + sp.ExecuteNonQuery(); + + BusinessKey = sp.Parameters.GetGuidString( "@businessKey" ); + + // + // Get all contained objects. + // + Names.Get( ServiceKey, EntityType.BusinessService ); +#endif + } + } + + /// **************************************************************** + /// class DeleteService + /// ---------------------------------------------------------------- + /// + /// The DeleteService class contains data and methods associated + /// with the delete_service message. It is typically populated + /// via deserialization by the .NET runtime as part of the + /// message processing interface. + /// + /// As part of the publisher API, this message implements + /// IAuthenticateable. This allows the enclosed authInfo to be + /// authorized prior to processing + /// + /// **************************************************************** + /// + [XmlRootAttribute( "delete_service", Namespace=UDDI.API.Constants.Namespace )] + public class DeleteService : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: serviceKey + // + [XmlElement("serviceKey")] + public StringCollection ServiceKeys; + + public void Delete() + { + foreach( string key in ServiceKeys ) + { + BusinessService bs = new BusinessService( key ); + bs.Delete(); + } + } + } + + [XmlRootAttribute("find_service", Namespace=UDDI.API.Constants.Namespace)] + public class FindService : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: maxRows + // + private int maxRows = -1; + + [XmlAttribute( "maxRows" ), DefaultValue( -1 )] + public int MaxRows + { + get { return maxRows; } + set + { + if( value < 0 ) + { + // throw new UDDIException( ErrorType.E_fatalError, "maxRows must not be less than 0" ); + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_MAXROW_CANNOT_BE_LESS_THAN_0" ); + } + + maxRows = value; + } + } + + [XmlAttribute("businessKey")] + public string BusinessKey; + + [XmlArray("findQualifiers"), XmlArrayItem("findQualifier")] + public FindQualifierCollection FindQualifiers; + + [XmlElement("name")] + public NameCollection Names = new NameCollection(); + + [XmlArray("categoryBag"), XmlArrayItem( "keyedReference" )] + public KeyedReferenceCollection CategoryBag; + + [XmlArray("tModelBag"), XmlArrayItem("tModelKey")] + public StringCollection TModelBag; + + public ServiceList Find() + { + ServiceList serviceList = new ServiceList(); + + QueryLog.Write( QueryType.Find, EntityType.BusinessService ); + + // + // Validate find parameters. + // + if( !Utility.StringEmpty( BusinessKey ) ) + Utility.IsValidKey( EntityType.BusinessEntity, BusinessKey ); + + // + // Process each find constraint. + // + FindBuilder find = new FindBuilder( EntityType.BusinessService, FindQualifiers, BusinessKey ); + + // + // If no search arguments are given, search the whole thing. The arguments below are optional. + // + if( !Utility.CollectionEmpty( Names ) ) + { + Names.ValidateForFind(); + } + else + { +#if never + Debug.Verify( find.CaseSensitiveMatch == false && find.ExactNameMatch == false, + "Cannot specifiy find qualifiers on names without specifying names", ErrorType.E_unsupported ); +#endif + Debug.Verify( find.CaseSensitiveMatch == false && find.ExactNameMatch == false, + "UDDI_ERROR_NO_NAME_ON_FIND_QUALIFIER", + ErrorType.E_unsupported ); + } + + // + // TODO: Override may be better for these calls to KeyedReference.Validate because no parent key is used + // + if( !Utility.CollectionEmpty( CategoryBag ) ) + CategoryBag.Validate( "", KeyedReferenceType.CategoryBag ); + + try + { + int rows = 1; + + // + // First validate all the keys, this will make sure any invalid keys are 'caught' beforehand. + // + foreach( string tModelKey in TModelBag ) + { + Utility.IsValidKey( EntityType.TModel, tModelKey ); + } + + // + // Find entities with matching parent key. + // + if( !Utility.StringEmpty( BusinessKey ) ) + rows = find.FindByParentKey( BusinessKey ); + + // + // Find entities with matching category bag items. + // + if( rows > 0 && !Utility.CollectionEmpty( CategoryBag ) ) + rows = find.FindByKeyedReferences( KeyedReferenceType.CategoryBag, CategoryBag ); + + // + // Find entities with matching TModel bag items. + // + if( rows > 0 && !Utility.CollectionEmpty( TModelBag ) ) + rows = find.FindByTModelBag( TModelBag ); + + // + // Find entities with matching names + // + if( rows > 0 && !Utility.CollectionEmpty( Names ) ) + rows = find.FindByNames( Names ); + + // + // Process the find result set. + // + if( 0 == rows ) + { + // + // Cleanup any temporary tables. + // + find.Abort(); + } + else if( 0 == MaxRows ) + { + serviceList.Truncated = Truncated.True; + return serviceList; + } + else + { + // + // Read in the find results. + // + SqlDataReaderAccessor reader; + SqlStoredProcedureAccessor sp; + sp = find.RetrieveResults( MaxRows ); + + reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + serviceList.ServiceInfos.Add( + reader.GetGuidString( "entityKey" ), + reader.GetGuidString( "parentEntityKey" ) ); + } + } + finally + { + reader.Close(); + } + + if( sp.Parameters.GetBool( "@truncated" ) ) + serviceList.Truncated = Truncated.True; + else + serviceList.Truncated = Truncated.False; + + foreach( ServiceInfo serviceInfo in serviceList.ServiceInfos ) + serviceInfo.Get(); + } + } + catch( Exception ) + { + find.Abort(); + throw; + } + + return serviceList; + } + } + + /// ******************************************************************** + /// public class GetServiceDetail + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute( "get_serviceDetail", Namespace=UDDI.API.Constants.Namespace )] + public class GetServiceDetail : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: serviceKey + // + [XmlElement("serviceKey")] + public StringCollection ServiceKeys; + + public GetServiceDetail() + { + } + } + + /// ******************************************************************** + /// public class SaveService + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute( "save_service", Namespace=UDDI.API.Constants.Namespace )] + public class SaveService : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: businessService + // + [XmlElement("businessService")] + public BusinessServiceCollection BusinessServices; + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Save() + { + foreach( BusinessService BusinessService in BusinessServices ) + BusinessService.Save(); + } + } + + [XmlRootAttribute("serviceDetail", Namespace=UDDI.API.Constants.Namespace)] + public class ServiceDetail + { + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + [XmlAttribute("truncated")] + public Truncated Truncated; + + [XmlElement("businessService")] + public BusinessServiceCollection BusinessServices = new BusinessServiceCollection(); + + public void Get( StringCollection serviceKeys ) + { + foreach( string key in serviceKeys ) + { + int n = BusinessServices.Add( key ); + BusinessServices[ n ].Get(); + } + } + } + + [XmlRootAttribute("serviceList", Namespace=UDDI.API.Constants.Namespace)] + public class ServiceList + { + // + // Attribute: generic + // + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + // + // Attribute: operator + // + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + // + // Attribute: truncated + // + [XmlAttribute("truncated")] + public Truncated Truncated; + + // + // Element: serviceInfos + // + private ServiceInfoCollection serviceInfos; + + [ XmlArray( "serviceInfos" ), XmlArrayItem( "serviceInfo" ) ] + public ServiceInfoCollection ServiceInfos + { + get + { + if( null == serviceInfos ) + serviceInfos = new ServiceInfoCollection(); + + return serviceInfos; + } + + set { serviceInfos = value; } + } + } +} diff --git a/inetsrv/uddi/source/api/sources b/inetsrv/uddi/source/api/sources new file mode 100644 index 0000000..c13e667 --- /dev/null +++ b/inetsrv/uddi/source/api/sources @@ -0,0 +1,43 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=uddi.api +TARGETPATH=obj +TARGETTYPE=DYNLINK +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + +# Reference the Core DLL in its actual location +REFERENCES=system.dll, system.data.dll, system.web.dll, system.web.services.dll, system.xml.dll, ..\core\obj\i386\uddi.core.dll, passportlib.dll + +SOURCES=\ + address.cs \ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + assertion.cs \ + authentication.cs \ + binding.cs \ + business.cs \ + category.cs \ + changerecord.cs \ + contact.cs \ + description.cs \ + discoveryurl.cs \ + email.cs \ + extension.cs \ + find.cs \ + inquire.cs \ + keyedreference.cs \ + logs.cs \ + messages.cs \ + name.cs \ + phone.cs \ + publish.cs \ + service.cs \ + taxonomy.cs \ + tmodel.cs \ + types.cs \ + serializer.cs + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/api/taxonomy.cs b/inetsrv/uddi/source/api/taxonomy.cs new file mode 100644 index 0000000..107f622 --- /dev/null +++ b/inetsrv/uddi/source/api/taxonomy.cs @@ -0,0 +1,510 @@ +using System; +using System.Data; +using System.IO; +using System.Collections; +using System.Data.SqlClient; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + +using UDDI.API; +using UDDI; +using UDDI.Diagnostics; +using UDDI.API.Binding; +using UDDI.API.Service; +using UDDI.API.Business; +using UDDI.API.ServiceType; + +namespace UDDI.Admin +{ + [XmlRootAttribute("resources", Namespace="urn:microsoft-com:uddi_bootstrap_v1")] + public class Resources + { + private TModelDetail tModelDetail; + + [XmlElement("tModelDetail", Namespace=UDDI.API.Constants.Namespace)] + public TModelDetail TModelDetail + { + get + { + if( null == (object) tModelDetail ) + { + tModelDetail = new TModelDetail(); + } + + return tModelDetail; + } + set + { + tModelDetail = value; + } + } + + [XmlIgnore()] + public TaxonomyCollection Taxonomies = new TaxonomyCollection(); + + [XmlArray( "categorizationSchemes" ), XmlArrayItem( "categorizationScheme" )] + public Taxonomy[] TaxonomiesSerialize + { + get + { + return Taxonomies.ToArray(); + } + set + { + Taxonomies.CopyTo( value ); + } + } + + private BusinessDetail businessDetail; + + [XmlElement("businessDetail", Namespace=UDDI.API.Constants.Namespace)] + public BusinessDetail BusinessDetail + { + get + { + if( null == businessDetail ) + { + businessDetail = new BusinessDetail(); + } + + return businessDetail; + } + set + { + businessDetail = value; + } + } + + private ServiceDetail serviceDetail; + + [XmlElement("serviceDetail", Namespace=UDDI.API.Constants.Namespace)] + public ServiceDetail ServiceDetail + { + get + { + if( null == serviceDetail ) + { + serviceDetail = new ServiceDetail(); + } + + return serviceDetail; + } + set + { + serviceDetail = value; + } + } + + private BindingDetail bindingDetail; + + [XmlElement("bindingDetail", Namespace=UDDI.API.Constants.Namespace)] + public BindingDetail BindingDetail + { + get + { + if( null == bindingDetail ) + { + bindingDetail = new BindingDetail(); + } + + return bindingDetail; + } + set + { + bindingDetail = value; + } + } + + public Resources(){} + + public static void Validate( Stream strm ) + { + Debug.VerifySetting( "Schema-v2" ); + Debug.VerifySetting( "InstallRoot" ); + + string apiSchema = Config.GetString( "Schema-v2" ); + string resourceSchema = Config.GetString( "InstallRoot") + "uddi.resources.xsd"; + + Debug.Verify( File.Exists( apiSchema ), "The API schema was not found in the location " + apiSchema ); + Debug.Verify( File.Exists( resourceSchema ), "The UDDI data resource schema was not found in the location " + resourceSchema ); + + XmlSchemaCollection xsc = new XmlSchemaCollection(); + xsc.Add( "urn:uddi-org:api_v2", apiSchema ); + xsc.Add( "urn:microsoft-com:uddi_bootstrap_v1", resourceSchema ); + + // + // Rewind stream (to be safe) and validate + // + strm.Seek( 0, SeekOrigin.Begin ); + + // + // Construct a validating reader to verify the document is kosher + // + XmlTextReader reader = new XmlTextReader( strm ); + XmlValidatingReader vreader = new XmlValidatingReader( reader ); + vreader.Schemas.Add( xsc ); + while( vreader.Read()){} + + // + // Rewind stream again, so someone else can use it + // + strm.Seek( 0, SeekOrigin.Begin ); + + } + + public void Save() + { + UDDI.Diagnostics.Debug.Enter(); + + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing tModels..." ); + foreach( TModel tm in TModelDetail.TModels ) + { + tm.Save(); + } + + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing Categorization schemes..." ); + foreach( Taxonomy cs in Taxonomies ) + { + cs.Save(); + } + + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing Providers..." ); + foreach( BusinessEntity be in BusinessDetail.BusinessEntities ) + { + be.Save(); + } + + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing Services..." ); + foreach( BusinessService bs in ServiceDetail.BusinessServices ) + { + bs.Save(); + } + + Debug.Write( SeverityType.Info, CategoryType.Data, "Importing bindings..." ); + foreach( BindingTemplate bind in BindingDetail.BindingTemplates ) + { + bind.Save(); + } + } + } + + public class Taxonomy + { + private string tModelKey = ""; + + private int taxonomyFlag = 1; + + [XmlAttribute( "checked" )] + public XmlBoolType Checked + { + get { return ( 1 == taxonomyFlag ) ? XmlBoolType.True : XmlBoolType.False; } + set + { + if( XmlBoolType.True == value ) + taxonomyFlag = 1; + else + taxonomyFlag = 2; + } + } + + [XmlElement( "tModelKey" )] + public string TModelKey + { + get + { + return tModelKey; + } + set + { + tModelKey = value; + } + } + + [XmlIgnore()] + public TaxonomyValueCollection TaxonomyValues = new TaxonomyValueCollection(); + + [XmlArray( "categoryValues" ), XmlArrayItem( "categoryValue" )] + public TaxonomyValue[] TaxonomyValuesSerialize + { + get + { + return TaxonomyValues.ToArray(); + } + set + { + TaxonomyValues.CopyTo( value ); + } + } + + public Taxonomy() + { + } + + public void Delete() + { + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "net_taxonomy_delete", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetGuidFromKey( "@tModelKey", tModelKey ); + + cmd.ExecuteNonQuery(); + + Debug.Leave(); + } + + public void Save() + { + Debug.Enter(); + + // + // Save the taxonomy entry. + // + SqlCommand cmd = new SqlCommand( "net_taxonomy_save", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@flag", SqlDbType.Int ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@taxonomyID", SqlDbType.Int ) ).Direction = ParameterDirection.Output; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetGuidFromKey( "@tModelKey", tModelKey ); + paramacc.SetInt( "@flag", taxonomyFlag ); + + cmd.ExecuteNonQuery(); + + int taxonomyID = paramacc.GetInt( "@taxonomyID" ); + + foreach( TaxonomyValue tv in TaxonomyValues ) + { + tv.Save( tModelKey ); + } + } + } + + public enum ValidForCategorization + { + [XmlEnumAttribute("false")] + False = 0, + [XmlEnumAttribute("true")] + True = 1, + } + + public class TaxonomyValue + { + [XmlAttribute( "categoryKey" )] + public string KeyValue; + + private bool validForClassification = true; + + [XmlAttribute( "isValid" )] + public ValidForCategorization ValidForClassification + { + get + { + return validForClassification ? ValidForCategorization.True : ValidForCategorization.False; + } + set + { + if( ValidForCategorization.True == value ) + validForClassification = true; + else + validForClassification = false; + } + } + + [XmlElement( "parentCategoryKey" )] + public string ParentKeyValue; + + [XmlArray( "categoryNames" ), XmlArrayItem( "categoryName" )] + public KeyName[] KeyNames; + + public TaxonomyValue(){} + public TaxonomyValue( string keyValue, string parentKeyValue, string keyName, bool validForClassification ) + { + this.KeyValue = keyValue; + this.ParentKeyValue = parentKeyValue; + KeyNames = new KeyName[ 1 ]; + KeyNames[0].Name = keyName; + this.validForClassification = validForClassification; + } + + public void Save( string tModelKey ) + { + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "net_taxonomyValue_save", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@keyValue", SqlDbType.NVarChar, 128 ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@parentKeyValue", SqlDbType.NVarChar, 128 ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@keyName", SqlDbType.NVarChar, 128 ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@valid", SqlDbType.Bit ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetGuidFromKey( "@tModelKey", tModelKey ); + paramacc.SetString( "@keyValue", KeyValue ); + paramacc.SetString( "@keyName", KeyNames[0].Name ); + cmd.Parameters[ "@valid" ].Value = ValidForClassification; + + if( Utility.StringEmpty( ParentKeyValue ) ) + paramacc.SetString( "@parentKeyValue", KeyValue ); + else + paramacc.SetString( "@parentKeyValue", ParentKeyValue ); + + cmd.ExecuteNonQuery(); + } + } + + public class KeyName + { + [XmlText()] + public string Name; + + [XmlAttribute( "xml:lang" )] + public string IsoLanguageCode; + + public KeyName(){} + } + + public class TaxonomyCollection : CollectionBase + { + public TaxonomyCollection() + { + } + + + public void Save() + { + Debug.Enter(); + + foreach( Taxonomy tax in this ) + { + tax.Save(); + } + + Debug.Leave(); + } + + public Taxonomy this[int index] + { + get + { return (Taxonomy)List[index]; } + set + { List[index] = value; } + } + + public int Add(Taxonomy value) + { + return List.Add(value); + } + + public void Insert(int index, Taxonomy value) + { + List.Insert(index, value); + } + + public int IndexOf( Taxonomy value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Taxonomy value ) + { + return List.Contains( value ); + } + + public void Remove( Taxonomy value ) + { + List.Remove( value ); + } + + public void CopyTo(Taxonomy[] array, int index) + { + List.CopyTo( array, index ); + } + + public void CopyTo( Taxonomy[] array ) + { + foreach( Taxonomy tax in array ) + Add( tax ); + } + + public Taxonomy[] ToArray() + { + return (Taxonomy[]) InnerList.ToArray( typeof( Taxonomy ) ); + } + } + + public class TaxonomyValueCollection : CollectionBase + { + public TaxonomyValueCollection() + { + } + + public TaxonomyValue this[int index] + { + get + { return (TaxonomyValue)List[index]; } + set + { List[index] = value; } + } + + public int Add(TaxonomyValue value) + { + return List.Add(value); + } + + public void Insert(int index, TaxonomyValue value) + { + List.Insert(index, value); + } + + public int IndexOf( TaxonomyValue value ) + { + return List.IndexOf( value ); + } + + public bool Contains( TaxonomyValue value ) + { + return List.Contains( value ); + } + + public void Remove( TaxonomyValue value ) + { + List.Remove( value ); + } + + public void CopyTo(TaxonomyValue[] array, int index) + { + List.CopyTo( array, index ); + } + + public void CopyTo( TaxonomyValue[] array ) + { + foreach( TaxonomyValue tax in array ) + Add( tax ); + } + + public TaxonomyValue[] ToArray() + { + return (TaxonomyValue[]) InnerList.ToArray( typeof( TaxonomyValue ) ); + } + } +} + diff --git a/inetsrv/uddi/source/api/tmodel.cs b/inetsrv/uddi/source/api/tmodel.cs new file mode 100644 index 0000000..79667f2 --- /dev/null +++ b/inetsrv/uddi/source/api/tmodel.cs @@ -0,0 +1,1682 @@ +using System; +using System.Data; +using System.Collections; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI.API; +using UDDI.Replication; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.API.ServiceType +{ + [XmlRootAttribute("tModel", Namespace=UDDI.API.Constants.Namespace)] + public class TModel : EntityBase + { + // + // Attribute: tModelKey + // + [XmlAttribute("tModelKey")] + public string TModelKey = ""; + + // + // Attribute: operator + // + [XmlAttribute("operator")] + public string Operator; + + // + // Attribute: authorizedName + // + [XmlAttribute("authorizedName")] + public string AuthorizedName; + + // + // Attribute: name + // + [XmlElement("name")] + public string Name; + + // + // Element: description + // + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // + // Element: overviewDoc + // + private OverviewDoc overviewDoc; + + [XmlElement("overviewDoc")] + public OverviewDoc OverviewDocSerialize + { + get + { + if( null != overviewDoc && overviewDoc.ShouldSerialize ) + return overviewDoc; + + return null; + } + + set { overviewDoc = value; } + } + + [XmlIgnore] + public OverviewDoc OverviewDoc + { + get + { + if( null == overviewDoc ) + overviewDoc = new OverviewDoc(); + + return overviewDoc; + } + } + + // + // Element: identifierBag + // + [ XmlIgnore ] + public KeyedReferenceCollection IdentifierBag = new KeyedReferenceCollection(); + + [ XmlArray( "identifierBag" ), XmlArrayItem( "keyedReference" ) ] + public KeyedReference[] IdentifierBagSerialize + { + get + { + if( Utility.CollectionEmpty( IdentifierBag ) ) + return null; + + return IdentifierBag.ToArray(); + } + + set + { + IdentifierBag.Clear(); + IdentifierBag.CopyTo( value ); + } + } + + // + // Element: categoryBag + // + [ XmlIgnore ] + public KeyedReferenceCollection CategoryBag = new KeyedReferenceCollection(); + + [ XmlArray( "categoryBag" ), XmlArrayItem( "keyedReference" ) ] + public KeyedReference[] CategoryBagSerialize + { + get + { + if( Utility.CollectionEmpty( CategoryBag ) ) + return null; + + return CategoryBag.ToArray(); + } + + set + { + CategoryBag.Clear(); + CategoryBag.CopyTo( value ); + } + } + + [XmlIgnore] + public override UDDI.EntityType EntityType + { + get { return EntityType.TModel; } + } + + [XmlIgnore] + public override string EntityKey + { + get { return TModelKey; } + } + + public TModel() + { + } + + public TModel( string tModelKey ) + { + TModelKey = tModelKey; + } + + public override void Get() + { + // + // Create a command object to invoke the stored procedure + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_tModel_get_batch" ); + + // + // Add parameters + // + cmd.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier, ParameterDirection.Input ); + cmd.Parameters.Add( "@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output ); + cmd.Parameters.Add( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output ); + cmd.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name, ParameterDirection.Output ); + cmd.Parameters.Add( "@overviewURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.OverviewURL, ParameterDirection.Output ); + + cmd.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + + SqlDataReaderAccessor reader = null; + try + { + // + // net_tModel_get will return the objects contained in a business in the following order: + // + // - descriptions + // - overview descriptions + // - identifier bags + // - category bags + // + reader = cmd.ExecuteReader(); + + // + // Read the descriptions + // + Descriptions.Read( reader ); + + // + // Read the overview descriptions + // + if( true == reader.NextResult() ) + { + OverviewDoc.Descriptions.Read( reader ); + } + + // + // Read the identifier bags + // + if( true == reader.NextResult() ) + { + IdentifierBag.Read( reader ); + } + + // + // Read the category bags + // + if( true == reader.NextResult() ) + { + CategoryBag.Read( reader ); + } + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } + + // + // Output parameters + // + Operator = cmd.Parameters.GetString( "@operatorName" ); + AuthorizedName = cmd.Parameters.GetString( "@authorizedName" ); + Name = cmd.Parameters.GetString( "@name" ); + OverviewDoc.OverviewURL = cmd.Parameters.GetString( "@overviewURL" ); +#if never + // + // Create a command object to invoke the stored procedure + // + SqlCommand cmd = new SqlCommand( "net_tModel_get", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Add parameters + // + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName ) ).Direction = ParameterDirection.Output; + cmd.Parameters.Add( new SqlParameter( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName ) ).Direction = ParameterDirection.Output; + cmd.Parameters.Add( new SqlParameter( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ) ).Direction = ParameterDirection.Output; + cmd.Parameters.Add( new SqlParameter( "@overviewURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.OverviewURL ) ).Direction = ParameterDirection.Output; + + // + // Set parameter values and execute query + // + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + paramacc.SetGuidFromKey( "@tModelKey", TModelKey ); + + cmd.ExecuteScalar(); + + // + // Move query results into member variables + // + Operator = paramacc.GetString( "@operatorName" ); + AuthorizedName = paramacc.GetString( "@authorizedName" ); + Name = paramacc.GetString( "@name" ); + OverviewDoc.OverviewURL = paramacc.GetString( "@overviewURL" ); + + // + // Retrieve sub-objects + // + Descriptions.Get( TModelKey, EntityType.TModel ); + OverviewDoc.Descriptions.Get( TModelKey, EntityType.TModelOverviewDoc ); + IdentifierBag.Get( TModelKey, EntityType.TModel, KeyedReferenceType.IdentifierBag ); + CategoryBag.Get( TModelKey, EntityType.TModel, KeyedReferenceType.CategoryBag ); +#endif + + QueryLog.Write( QueryType.Get, EntityType.TModel ); + } + + internal void Validate() + { + // + // Check to make sure publisher's limit allows save of this + // entity. If this is an update, we won't check since they + // are simply replacing an existing entity. We also won't + // check if the limit is 0, since this indicates unlimited + // publishing rights. + // + int limit = Context.User.TModelLimit; + int count = Context.User.TModelCount; + + if( 0 != limit && Utility.StringEmpty( TModelKey ) ) + { + // + // Verify that the publisher has not exceeded their limit. + // + if( count >= limit ) + { +#if never + throw new UDDIException( + ErrorType.E_accountLimitExceeded, + "Publisher limit for 'tModel' exceeded (limit=" + limit + ", count=" + count + ")" ); +#endif + throw new UDDIException( ErrorType.E_accountLimitExceeded, "UDDI_ERROR_PUBLISHER_LIMIT_FOR_TMODELS_EXCEEDED", limit, count ); + } + } + + // + // Check field lengths and truncate if necessary. + // + Utility.ValidateLength( ref Name, "name", UDDI.Constants.Lengths.Name, 1 ); + Utility.ValidateLength( ref AuthorizedName, "authorizedName", UDDI.Constants.Lengths.AuthorizedName ); + Utility.ValidateLength( ref Operator, "operator", UDDI.Constants.Lengths.Operator ); + + // + // SECURITY: The operator field should be validated to ensure it is + // the local operator name or empty. This is not currently being done. + // + + // + // If no tModelKey is specified, then it is an add and no + // database validation is necessary here. Otherwise, we do + // need to validate that the specified tModel exists and + // is owned by the user. + // + if( !Utility.StringEmpty( TModelKey ) ) + { + // + // call net_tModel_validate + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_tModel_validate" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + if( Context.User.AllowPreassignedKeys ) + sp.Parameters.SetInt( "@flag", 1 ); + else + sp.Parameters.SetInt( "@flag", 0 ); + + sp.ExecuteNonQuery(); + } + + Descriptions.Validate(); + IdentifierBag.Validate( TModelKey, KeyedReferenceType.IdentifierBag ); + CategoryBag.Validate( TModelKey, KeyedReferenceType.CategoryBag ); + OverviewDoc.Validate(); + } + + public override void Save() + { + Debug.Enter(); + + // + // If we're not in replication mode, we'll set the operator + // name (ignoring whatever was specified). + // + if( ContextType.Replication != Context.ContextType ) + Operator = Config.GetString( "Operator" ); + + // + // Validate the tModel + // + Validate(); + + if( Utility.StringEmpty( TModelKey ) ) + { + // + // This is an insert, so generate a tmodelkey + // + TModelKey = "uuid:" + System.Guid.NewGuid().ToString(); + } + + // + // Create a command object to invoke the stored procedure + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_tModel_save" ); + + // + // Add parameters + // + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@generic", SqlDbType.NVarChar, UDDI.Constants.Lengths.generic ); + sp.Parameters.Add( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.InputOutput ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp.Parameters.Add( "@overviewURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.OverviewURL ); + + // + // Set parameter values + // + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + sp.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetString( "@generic", Constants.Version ); + sp.Parameters.SetString( "@authorizedName", AuthorizedName ); + sp.Parameters.SetString( "@name", Name ); + + if( null == (object)OverviewDoc ) + sp.Parameters.SetNull( "@overviewUrl" ); + else + sp.Parameters.SetString( "@overviewUrl", OverviewDoc.OverviewURL ); + + // + // Execute query + // + sp.ExecuteNonQuery(); + + AuthorizedName = sp.Parameters.GetString( "@authorizedName" ); + + // + // Save the descriptions, category, identifier and overview doc + // information + // + Descriptions.Save( TModelKey, EntityType.TModel ); + IdentifierBag.Save( TModelKey, EntityType.TModel, KeyedReferenceType.IdentifierBag ); + CategoryBag.Save( TModelKey, EntityType.TModel, KeyedReferenceType.CategoryBag ); + OverviewDoc.Descriptions.Save( TModelKey, EntityType.TModelOverviewDoc ); + + // + // Save the change log entry. + // + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.Payload = new ChangeRecordNewData( this ); + changeRecord.Log(); + } + + Debug.Leave(); + } + + public void Hide() + { + // + // TODO: We should really have a way of hiding vs. deleting + // + Delete(); + } + + public override void Delete() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_tModel_delete" ); + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + sp.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + + sp.ExecuteNonQuery(); + + // + // Save the change log entry. + // + if( Context.LogChangeRecords ) + { + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.AcknowledgementRequested = true; + changeRecord.Payload = new ChangeRecordHide( TModelKey ); + changeRecord.Log(); + } + } + } + public class TModelCollection : CollectionBase + { + public TModelCollection() + { + } + + public TModel this[int index] + { + get { return (TModel)List[index]; } + set { List[index] = value; } + } + + public int Add(TModel value) + { + return List.Add(value); + } + + public int Add( string tModelKey ) + { + return List.Add( new TModel( tModelKey ) ); + } + + public int Add() + { + return List.Add( new TModel() ); + } + + public void Insert(int index, TModel value) + { + List.Insert(index, value); + } + + public int IndexOf(TModel value) + { + return List.IndexOf(value); + } + + public bool Contains(TModel value) + { + return List.Contains(value); + } + + public void Remove(TModel value) + { + List.Remove(value); + } + + public void CopyTo(TModel[] array, int index) + { + InnerList.CopyTo(array, index); + } + + public void Save() + { + // + // Walk tModels collection and save each tModel + // + foreach( TModel tm in this ) + { + tm.Save(); + } + } + public void Sort() + { + InnerList.Sort( new TModelComparer() ); + } + + internal class TModelComparer : IComparer + { + public int Compare( object x, object y ) + { + TModel entity1 = (TModel)x; + TModel entity2 = (TModel)y; + + return string.Compare( entity1.Name, entity2.Name, true ); + } + } + } + + public class TModelInfoCollection : CollectionBase + { + public void GetForCurrentPublisher() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_publisher_tModelInfos_get"; + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.SetString( "@PUID", Context.User.ID ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + TModelInfo info = new TModelInfo( + reader.GetKeyFromGuid( "tModelKey" ), + reader.GetString( "name" ) ); + + info.IsHidden = ( 1 == reader.GetInt( "flag" ) ); + this.Add( info ); + } + } + finally + { + reader.Close(); + } + } + + public TModelInfo this[int index] + { + get { return (TModelInfo)List[index]; } + set { List[index] = value; } + } + + public int Add() + { + return List.Add( new TModelInfo() ); + } + + public int Add( string tModelKey ) + { + return List.Add( new TModelInfo( tModelKey ) ); + } + + public int Add( string tModelKey, string name ) + { + return List.Add( new TModelInfo( tModelKey, name ) ); + } + + public int Add(TModelInfo value) + { + return List.Add(value); + } + + public void Insert(int index, TModelInfo value) + { + List.Insert(index, value); + } + + public int IndexOf(TModelInfo value) + { + return List.IndexOf(value); + } + + public bool Contains(TModelInfo value) + { + return List.Contains(value); + } + + public void Remove(TModelInfo value) + { + List.Remove(value); + } + + public void CopyTo(TModelInfo[] array, int index) + { + List.CopyTo(array, index); + } + + public void Sort() + { + InnerList.Sort( new TModelInfoComparer() ); + } + + internal class TModelInfoComparer : IComparer + { + public int Compare( object x, object y ) + { + TModelInfo entity1 = (TModelInfo)x; + TModelInfo entity2 = (TModelInfo)y; + + return string.Compare( entity1.Name, entity2.Name, true ); + } + } + } + + public class TModelInstanceInfoCollection : CollectionBase + { + internal void Validate() + { + foreach( TModelInstanceInfo info in this ) + { + info.Validate(); + } + } + + public void Save( string bindingKey ) + { + foreach( TModelInstanceInfo tmii in this ) + { + tmii.Save( bindingKey ); + } + } + + public void Get( string bindingKey ) + { + ArrayList instanceIds = new ArrayList(); + + // + // Create a command object to invoke the stored procedure + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_bindingTemplate_tModelInstanceInfos_get" ); + + // + // Parameters + // + cmd.Parameters.Add( "@bindingKey", SqlDbType.UniqueIdentifier, ParameterDirection.Input ); + + // + // Set parameter values and execute query + // + cmd.Parameters.SetGuidFromString( "@bindingKey", bindingKey ); + + SqlDataReaderAccessor reader = cmd.ExecuteReader(); + + try + { + instanceIds = Read( reader ); +#if never + // + // The core data for this binding will be contained in the resultset + // + while( reader.Read() ) + { + instanceIds.Add( rdracc.GetInt( instanceIdIndex ) ); + + Add( rdracc.GetKeyFromGuid( tModelKeyIndex ), + rdracc.GetString( overviewURLIndex ), + rdracc.GetString( instanceParmIndex ) ); + } +#endif + } + finally + { + reader.Close(); + } + + Populate( instanceIds ); + } + + public ArrayList Read( SqlDataReaderAccessor reader ) + { + const int instanceIdIndex = 0; + const int tModelKeyIndex = 1; + const int overviewURLIndex = 2; + const int instanceParmIndex = 3; + + ArrayList instanceIds = new ArrayList(); + + // + // The core data for this binding will be contained in the resultset + // + while( reader.Read() ) + { + instanceIds.Add( reader.GetInt( instanceIdIndex ) ); + + Add( reader.GetKeyFromGuid( tModelKeyIndex ), + reader.GetString( overviewURLIndex ), + reader.GetString( instanceParmIndex ) ); + } + + return instanceIds; + } + + public void Populate( ArrayList instanceIds ) + { + int i = 0; + foreach( TModelInstanceInfo tmii in this ) + { + tmii.Get( (int) instanceIds[ i++ ] ); + } + } + + public TModelInstanceInfo this[int index] + { + get + { return (TModelInstanceInfo)List[index]; } + set + { List[index] = value; } + } + + public int Add() + { + return List.Add( new TModelInstanceInfo() ); + } + + public int Add(TModelInstanceInfo value) + { + return List.Add(value); + } + public int Add( string tModelKey, string overviewURL, string instanceParm ) + { + return List.Add( new TModelInstanceInfo( tModelKey, overviewURL, instanceParm ) ); + } + + public void Insert(int index, TModelInstanceInfo value) + { + List.Insert(index, value); + } + + public int IndexOf(TModelInstanceInfo value) + { + return List.IndexOf(value); + } + + public bool Contains(TModelInstanceInfo value) + { + return List.Contains(value); + } + + public void Remove(TModelInstanceInfo value) + { + List.Remove(value); + } + + public void CopyTo(TModelInstanceInfo[] array, int index) + { + List.CopyTo(array, index); + } + } + + public class TModelBag + { + [XmlElement("tModelKey")] + public StringCollection tmodelkeys; + + [XmlIgnore] + public StringCollection TModelKeys + { + get + { + if( null == tmodelkeys ) + tmodelkeys = new StringCollection(); + + return tmodelkeys; + } + } + } + + public class TModelInstanceInfo + { + // ----[Attribute: tModelKey]--------------------------------------- + + [XmlAttribute("tModelKey")] + public string TModelKey + { + get + { + return tmodelkey; + } + + set + { + if( null == value ) + tmodelkey = null; + else + tmodelkey = value.Trim(); + } + } + private string tmodelkey; + + // ----[Element: description]--------------------------------------- + + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // ----[Element: instanceDetails]----------------------------------- + + private InstanceDetail instanceDetail; + + [XmlElement("instanceDetails")] + public InstanceDetail InstanceDetailSerialize + { + get + { + if( null != instanceDetail && instanceDetail.ShouldSerialize ) + return instanceDetail; + + return null; + } + + set { instanceDetail = value; } + } + + [XmlIgnore] + public InstanceDetail InstanceDetail + { + get + { + if( null == instanceDetail ) + instanceDetail = new InstanceDetail(); + + return instanceDetail; + } + } + + public TModelInstanceInfo() + { + } + + public TModelInstanceInfo( string tModelKey, string overviewURL, string instanceParm ) + { + TModelKey = tModelKey.Trim(); + InstanceDetail.OverviewDoc.OverviewURL = overviewURL; + InstanceDetail.InstanceParm = instanceParm; + } + + public void Get( int instanceId ) + { + // + // Create a command object to invoke the stored procedure + // + SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor( "net_bindingTemplate_tModelInstanceInfo_get_batch" ); + + // + // Add parameters + // + cmd.Parameters.Add( "@instanceID", SqlDbType.BigInt, ParameterDirection.Input ); + cmd.Parameters.SetLong( "@instanceID", instanceId ); + + SqlDataReaderAccessor reader = null; + try + { + // + // net_bindingTemplate_tModelInstanceInfo_get_batch will return the objects contained in a business in the following order: + // + // - descriptions + // - instance detail descriptions + // - instance detail overview descriptions + reader = cmd.ExecuteReader(); + + // + // Read the descriptions + // + Descriptions.Read( reader ); + + // + // Read the instance detail descriptions + // + if ( true == reader.NextResult() ) + { + InstanceDetail.Descriptions.Read( reader ); + } + + // + // Read the overview document descriptions + // + if ( true == reader.NextResult() ) + { + InstanceDetail.OverviewDoc.Descriptions.Read( reader ); + } + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } +#if never + // + // Get sub-objects, current level stuff is already populated + // + Descriptions.Get( instanceId, EntityType.TModelInstanceInfo ); + InstanceDetail.Descriptions.Get( instanceId, EntityType.InstanceDetail ); + InstanceDetail.OverviewDoc.Descriptions.Get( instanceId, EntityType.InstanceDetailOverviewDoc ); +#endif + } + + internal void Validate() + { + Debug.Enter(); + Debug.VerifyKey( TModelKey ); + + // + // Validate that the current TModelKey is valid + // Replication shouldn't get in here + // + SqlCommand cmd = new SqlCommand( "net_bindingTemplate_tModelInstanceInfo_validate", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Parameters.Add( new SqlParameter( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + paramacc.SetString( "@PUID", Context.User.ID ); + paramacc.SetGuidFromKey( "@tModelKey", TModelKey ); + cmd.ExecuteNonQuery(); + + Descriptions.Validate(); + InstanceDetail.Validate(); + Debug.Leave(); + } + + public void Save( string bindingKey ) + { + // + // Create a command object to invoke the stored procedure + // + SqlCommand cmd = new SqlCommand( "net_bindingTemplate_tModelInstanceInfo_save", ConnectionManager.GetConnection() ); + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + // + // Input parameters + // + cmd.Parameters.Add( new SqlParameter( "@bindingKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@overviewUrl", SqlDbType.NVarChar, UDDI.Constants.Lengths.OverviewURL ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@instanceParms", SqlDbType.NVarChar, UDDI.Constants.Lengths.InstanceParms ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@instanceID", SqlDbType.BigInt ) ).Direction = ParameterDirection.Output; + + // + // Set parameter values and execute query + // + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetGuidFromString( "@bindingKey", bindingKey ); + paramacc.SetGuidFromKey( "@tModelKey", TModelKey ); + + // + // TODO: I think OverviewDoc will always be non-null... we should be + // testing for a non empty overviewURL + // Agreed there a bunch of these laying around. + // + if( null == (object) InstanceDetail.OverviewDoc ) + paramacc.SetNull( "@overviewUrl" ); + else + paramacc.SetString( "@overviewUrl", InstanceDetail.OverviewDoc.OverviewURL ); + + // TODO: same here + + if( null != (object) InstanceDetail ) + paramacc.SetString( "@instanceParms", InstanceDetail.InstanceParm ); + else + paramacc.SetNull( "@instanceParms" ); + + cmd.ExecuteScalar(); + + // + // Move out parameters into local variables + // + long InstanceID = paramacc.GetLong( "@instanceID" ); + + // + // Save sub-objects + // + Descriptions.Save( InstanceID, EntityType.TModelInstanceInfo ); + + if( null != (object) InstanceDetail ) + { + InstanceDetail.Descriptions.Save( InstanceID, EntityType.InstanceDetail ); + if( null != (object) InstanceDetail.OverviewDoc ) + { + InstanceDetail.OverviewDoc.Descriptions.Save( InstanceID, EntityType.InstanceDetailOverviewDoc ); + } + } + } + } + + public class TModelInfo + { + [XmlAttribute("tModelKey")] + public string TModelKey + { + get + { + return tmodelkey; + } + set + { + if( null == value ) + tmodelkey = null; + else + tmodelkey = value.Trim(); + } + } + private string tmodelkey = ""; + + [XmlElement("name")] + public string Name = ""; + + [XmlIgnore] + public bool IsHidden = false; + + public TModelInfo() + { + } + + public TModelInfo( string tModelKey ) + { + TModelKey = tModelKey; + } + + public TModelInfo( string tModelKey, string name ) + { + TModelKey = tModelKey; + Name = name; + } + + public void Get() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_tModel_get" ); + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output ); + sp.Parameters.Add( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name, ParameterDirection.Output ); + sp.Parameters.Add( "@overviewURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.OverviewURL, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromKey( "@tModelKey", TModelKey ); + + sp.ExecuteNonQuery(); + + Name = sp.Parameters.GetString( "@name" ); + } + } + + public class InstanceDetail + { + // ----[Element: description]--------------------------------------- + + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // ----[Element: overviewDoc]--------------------------------------- + + private OverviewDoc overviewDoc; + + [XmlElement("overviewDoc")] + public OverviewDoc OverviewDocSerialize + { + get + { + if( null != overviewDoc && overviewDoc.ShouldSerialize ) + return overviewDoc; + + return null; + } + + set { overviewDoc = value; } + } + + [XmlIgnore] + public OverviewDoc OverviewDoc + { + get + { + if( null == overviewDoc ) + overviewDoc = new OverviewDoc(); + + return overviewDoc; + } + } + + // ----[Element: instanceParms]------------------------------------- + + private string instanceParm; + + [XmlElement("instanceParms")] + public string InstanceParm + { + get { return instanceParm; } + set { instanceParm = value; } + } + + public InstanceDetail() + { + } + + internal void Validate() + { + // + // Check field lengths and truncate if necessary. + // + Utility.ValidateLength( ref instanceParm, "instanceParms", UDDI.Constants.Lengths.InstanceParms ); + + Descriptions.Validate(); + OverviewDoc.Validate(); + } + + [XmlIgnore] + public bool ShouldSerialize + { + get + { + if( null != descriptions && descriptions.Count > 0 ) + return true; + + if( null != overviewDoc && overviewDoc.ShouldSerialize ) + return true; + + if( null != InstanceParm ) + return true; + + return false; + } + } + } + + public class OverviewDoc + { + // --[element: description]----------------------------------------- + + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + descriptions = new DescriptionCollection(); + + return descriptions; + } + + set { descriptions = value; } + } + + // --[element: overviewURL]----------------------------------------- + + private string overviewURL; + + [XmlElement("overviewURL")] + public string OverviewURL + { + get { return overviewURL; } + set { overviewURL = value; } + } + + public OverviewDoc() + { + } + + [XmlIgnore] + public bool ShouldSerialize + { + get + { + if( ( null != descriptions && descriptions.Count > 0 ) + || null != OverviewURL ) + return true; + + return false; + } + } + + internal void Validate() + { + Utility.ValidateLength( ref overviewURL, "overviewURL", UDDI.Constants.Lengths.OverviewURL ); + + Descriptions.Validate(); + } + } + + /// **************************************************************** + /// class DeleteTModel + /// ---------------------------------------------------------------- + /// + /// The DeleteTModel class contains data and methods associated + /// with the delete_tModel message. It is typically populated + /// via deserialization by the .NET runtime as part of the + /// message processing interface. + /// + /// As part of the publisher API, this message implements + /// IAuthenticateable. This allows the enclosed authInfo to be + /// authorized prior to processing + /// + /// **************************************************************** + /// + [XmlRootAttribute( "delete_tModel", Namespace=UDDI.API.Constants.Namespace )] + public class DeleteTModel : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: tModelKey + // + [XmlElement("tModelKey")] + public StringCollection TModelKeys; + + public void Delete() + { + foreach( string key in TModelKeys ) + { + TModel tm = new TModel( key ); + tm.Delete(); + } + } + } + + [XmlRootAttribute("find_tModel", Namespace=UDDI.API.Constants.Namespace)] + public class FindTModel : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Attribute: maxRows + // + private int maxRows = -1; + + [XmlAttribute( "maxRows" ), DefaultValue( -1 )] + public int MaxRows + { + get { return maxRows; } + set + { + if( value < 0 ) + { +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "maxRows must not be less than 0" ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_MAXROW_CANNOT_BE_LESS_THAN_0" ); + } + + maxRows = value; + } + } + + [XmlArray("findQualifiers"), XmlArrayItem("findQualifier")] + public FindQualifierCollection FindQualifiers; + + [XmlElement("name")] + public string Name; + + [XmlArray("identifierBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection IdentifierBag; + + [XmlArray("categoryBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection CategoryBag; + + public FindTModel() + { + Generic = UDDI.API.Constants.Version; + } + + public TModelList Find() + { + TModelList tModelList = new TModelList(); + + QueryLog.Write( QueryType.Find, EntityType.TModel ); + + // + // Process each find constraint. + // + FindBuilder find = new FindBuilder( EntityType.TModel, FindQualifiers ); + + // + // If no search arguments are specified, return an empty result + // set. + // + if( Utility.StringEmpty( Name ) && + Utility.CollectionEmpty( IdentifierBag ) && + Utility.CollectionEmpty( CategoryBag ) ) + return tModelList; + + // + // Validate find parameters. + // + if( !Utility.StringEmpty( Name ) ) + { + if( 1 == Context.ApiVersionMajor ) + { + Name = Name.Trim(); + + if( Name.Length > UDDI.Constants.Lengths.Name ) + { + // throw new UDDIException( ErrorType.E_nameTooLong, "A name specified in the search exceeds the allowable length" ); + throw new UDDIException( ErrorType.E_nameTooLong, "UDDI_ERROR_NAME_TOO_LONG" ); + } + } + else + { + Utility.ValidateLength( ref Name, "Name", UDDI.Constants.Lengths.Name ); + } + } + + // + // TODO: Override may be better for these calls to KeyedReference.Validate because no parent key is used + // + if( !Utility.CollectionEmpty( IdentifierBag ) ) + IdentifierBag.Validate( "", KeyedReferenceType.IdentifierBag ); + + if( !Utility.CollectionEmpty( CategoryBag ) ) + CategoryBag.Validate( "", KeyedReferenceType.CategoryBag ); + + try + { + int rows = 1; + + // + // Find entities with matching identifier bag items. + // + if( !Utility.CollectionEmpty( IdentifierBag ) ) + rows = find.FindByKeyedReferences( KeyedReferenceType.IdentifierBag, IdentifierBag ); + + // + // Find entities with matching category bag items. + // + if( rows > 0 && !Utility.CollectionEmpty( CategoryBag ) ) + rows = find.FindByKeyedReferences( KeyedReferenceType.CategoryBag, CategoryBag ); + + // + // Find entities with matching names + // + if( rows > 0 && !Utility.StringEmpty( Name ) ) + rows = find.FindByName( Name ); + + // + // Process the find result set. + // + if( 0 == rows ) + { + // + // Cleanup any temporary tables. + // + find.Abort(); + } + else if( 0 == MaxRows ) + { + tModelList.Truncated = Truncated.True; + return tModelList; + } + else + { + // + // Read in the find results. + // + SqlDataReaderAccessor reader; + SqlStoredProcedureAccessor sp; + sp = find.RetrieveResults( MaxRows ); + + reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + tModelList.TModelInfos.Add( reader.GetKeyFromGuid( "entityKey" ) ); + } + } + finally + { + reader.Close(); + } + + if( sp.Parameters.GetBool( "@truncated" ) ) + tModelList.Truncated = Truncated.True; + else + tModelList.Truncated = Truncated.False; + + foreach( TModelInfo tModelInfo in tModelList.TModelInfos ) + tModelInfo.Get(); + } + } + catch( Exception ) + { + find.Abort(); + throw; + } + + return tModelList; + } + } + + /// ******************************************************************** + /// public class GetTModelDetail + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute("get_tModelDetail", Namespace=UDDI.API.Constants.Namespace)] + public class GetTModelDetail : IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: tModelKey + // + [XmlElement("tModelKey")] + public StringCollection TModelKeys; + + public GetTModelDetail() + { + } + } + + /// ******************************************************************** + /// public class SaveTModel + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRootAttribute("save_tModel", Namespace=UDDI.API.Constants.Namespace)] + public class SaveTModel : IAuthenticateable, IMessage + { + // + // Attribute: generic + // + private string generic; + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + + // + // Element: authInfo + // + private string authInfo; + + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + // + // Element: tModel + // + [XmlElement("tModel")] + public TModelCollection TModels; + + // + // Element: uploadRegister + // + [XmlElement("uploadRegister")] + public StringCollection UploadRegisters = new StringCollection(); + + public SaveTModel() + { + Generic = UDDI.API.Constants.Version; + } + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Save() + { + // + // This is outside of replication so any attempt to specify + // an upload register URL will force an E_unsupported response + // + if( 0 != UploadRegisters.Count ) + { + // throw new UDDIException( ErrorType.E_unsupported, "This node does not support the upload register facility" ); + throw new UDDIException( ErrorType.E_unsupported, "UDDI_ERROR_NODE_DOES_NOT_SUPPORT_UPLOAD" ); + } + + TModels.Save(); + } + } + + [XmlRootAttribute("tModelDetail", Namespace=UDDI.API.Constants.Namespace)] + public class TModelDetail + { + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + [XmlAttribute("truncated")] + public Truncated Truncated; + + [XmlElement("tModel")] + public TModelCollection TModels = new TModelCollection(); + + public void Get( StringCollection tModelKeys ) + { + foreach( string tModelKey in tModelKeys ) + { + int index = TModels.Add( tModelKey ); + TModels[ index ].Get(); + } + } + } + + [XmlRootAttribute("tModelList", Namespace=UDDI.API.Constants.Namespace)] + public class TModelList + { + // + // Attribute: generic + // + [XmlAttribute("generic")] + public string Generic = UDDI.API.Constants.Version; + + // + // Attribute: operator + // + [XmlAttribute("operator")] + public string Operator = Config.GetString( "Operator" ); + + // + // Attribute: truncated + // + [XmlAttribute("truncated")] + public Truncated Truncated; + + // + // Element: tModelInfos + // + private TModelInfoCollection tModelInfos; + + [ XmlArray( "tModelInfos" ), XmlArrayItem( "tModelInfo" ) ] + public TModelInfoCollection TModelInfos + { + get + { + if( null == tModelInfos ) + tModelInfos = new TModelInfoCollection(); + + return tModelInfos; + } + + set { tModelInfos = value; } + } + } +} diff --git a/inetsrv/uddi/source/api/types.cs b/inetsrv/uddi/source/api/types.cs new file mode 100644 index 0000000..35d253f --- /dev/null +++ b/inetsrv/uddi/source/api/types.cs @@ -0,0 +1,357 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; +using UDDI; + +namespace UDDI.API +{ + public enum XmlBoolType + { + [XmlEnum( "false" )] + False = 0, + + [XmlEnum( "true" )] + True = 1 + } + + public class Constants + { + public const string Version = "2.0"; + public const int VersionMajor = 2; + public const int VersionMinor = 0; + public const string Namespace = "urn:uddi-org:api_v2"; + } + + public enum ChangeRecordPayloadType + { + ChangeRecordNull = 0, + ChangeRecordNewData = 1, + ChangeRecordDelete = 2, + ChangeRecordHide = 3, + ChangeRecordPublisherAssertion = 4, + ChangeRecordDeleteAssertion = 5, + ChangeRecordCustodyTransfer = 6, + ChangeRecordAcknowledgement = 7, + ChangeRecordCorrection = 8, + ChangeRecordSetAssertions = 9 + } + + public enum MessageType + { + // + // Inquire message types + // + FindBinding = 1, + FindBusiness = 2, + FindService = 3, + FindTModel = 4, + GetBindingDetail = 5, + GetBusinessDetail = 6, + GetBusinessDetailExt = 7, + GetServiceDetail = 8, + GetTModelDetail = 9, + + // + // Publish message types + // + AddPublisherAssertions = 1001, + DeleteBinding = 1002, + DeleteBusiness = 1003, + DeletePublisherAssertions = 1004, + DeleteService = 1005, + DeleteTModel = 1006, + DiscardAuthToken = 1007, + GetAssertionStatusReport = 1008, + GetAuthToken = 1009, + GetPublisherAssertions = 1010, + GetRegisteredInfo = 1011, + SaveBinding = 1012, + SaveBusiness = 1013, + SaveService = 1014, + SaveTModel = 1015, + SetPublisherAssertions = 1016, + ValidateCategorization = 1017, + ValidateValues = 1018, + + // + // Replication message types + // + GetChangeRecords = 2001, + NotifyChangeRecordsAvailable = 2002, + DoPing = 2003, + GetHighWaterMarks = 2004 + } + + // + // TODO: This does not appear to be used remove it + // + public enum TaxonomyType + { + Business = 0, + Product = 1, + Geography = 2 + } + + /// ******************************************************************** + /// public IAuthenticateable [interface] + /// -------------------------------------------------------------------- + /// + /// Common interface for all publication API's that require + /// authentication. + /// + /// ******************************************************************** + /// + public interface IAuthenticateable + { + string AuthInfo { get; } + } + + /// ******************************************************************** + /// public IMessage [interface] + /// -------------------------------------------------------------------- + /// + /// Common interface for all messages. + /// + /// ******************************************************************** + /// + public interface IMessage + { + string Generic { get; } + } + + /// ******************************************************************** + /// public class EntityBase [abstract] + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public abstract class EntityBase + { + public abstract UDDI.EntityType EntityType { get; } + public abstract string EntityKey { get; } + + public abstract void Delete(); + public abstract void Get(); + public abstract void Save(); + } + + public enum KeyType + { + [XmlEnum( "" )] + Uninitialized, + [XmlEnum( "businessKey" )] + BusinessKey, + [XmlEnum( "tModelKey" )] + TModelKey, + [XmlEnum( "serviceKey" )] + ServiceKey, + [XmlEnum( "bindingKey" )] + BindingKey, + } + + public enum Truncated + { + [XmlEnum( "false" )] + False = 0, + [XmlEnum( "true" )] + True = 1, + } + + public enum URLType + { + [XmlEnum( "mailto" )] + Mailto = 0, + [XmlEnum( "http" )] + Http = 1, + [XmlEnum( "https" )] + Https = 2, + [XmlEnum( "ftp" )] + Ftp = 3, + [XmlEnum( "fax" )] + Fax = 4, + [XmlEnum( "phone" )] + Phone = 5, + [XmlEnum( "other" )] + Other = 6, + } + + public enum CompletionStatusType + { + [XmlEnum( "" )] + Uninitialized = 0, + [XmlEnum( "status:fromKey_incomplete" )] + FromKeyIncomplete = 1, + [XmlEnum( "status:toKey_incomplete" )] + ToKeyIncomplete = 2, + [XmlEnum( "status:complete" )] + Complete = 3, + } + + public class ErrInfo + { + [XmlAttribute("errCode")] + public string ErrCode = ""; + + [XmlText()] + public string Value = ""; + + } + + public class Result + { + public Result() + { + Errno = (int) ErrorType.E_success; + ErrInfo.ErrCode = ""; + ErrInfo.Value = ""; + } + + public Result( ErrorType err, string description ) + { + Errno = (int) err; + ErrInfo.ErrCode = err.ToString(); + ErrInfo.Value = description; + } + + [XmlIgnore] + public KeyType KeyType; + + [XmlAttribute("keyType")] + public string KeyTypeSerialized + { + get + { + if( KeyType.Uninitialized == KeyType ) + return null; + else + return KeyType.ToString(); + } + set + { + KeyType = (KeyType) KeyType.Parse( KeyType.GetType(), value ); + } + } + + [XmlAttribute("errno")] + public int Errno = (int) ErrorType.E_success; + + [XmlElement("errInfo")] + public ErrInfo ErrInfo = new ErrInfo(); + } + + // + // TODO: Move this class into find.cs + // + public class FindQualifier + { + [XmlText()] + public string Value; + + public FindQualifier() + { + } + + public FindQualifier( string findQualifierValue ) + { + Value = findQualifierValue; + } + } + + public class FindQualifierCollection : CollectionBase + { + public FindQualifierCollection() + { + } + + public FindQualifier this[int index] + { + get { return (FindQualifier)List[index]; } + set { List[index] = value; } + } + public int Add() + { + return List.Add( new FindQualifier() ); + } + public int Add( string value) + { + return List.Add( new FindQualifier(value) ); + } + public int Add( FindQualifier value ) + { + return List.Add( value ); + } + public void Insert(int index, FindQualifier value) + { + List.Insert(index, value); + } + public int IndexOf(FindQualifier value) + { + return List.IndexOf(value); + } + public bool Contains(FindQualifier value) + { + return List.Contains(value); + } + public void Remove(FindQualifier value) + { + List.Remove(value); + } + public void CopyTo(FindQualifier[] array, int index) + { + InnerList.CopyTo(array, index); + } + } + + public class ResultCollection : CollectionBase + { + public Result this[int index] + { + get { return (Result)List[index]; } + set { List[index] = value; } + } + + public int Add() + { + return List.Add( new Result() ); + } + + public int Add(Result value) + { + return List.Add(value); + } + + public int Add( ErrorType err, string description ) + { + return List.Add( new Result( err, description ) ); + } + + public void Insert(int index, Result value) + { + List.Insert(index, value); + } + + public int IndexOf(Result value) + { + return List.IndexOf(value); + } + + public bool Contains(Result value) + { + return List.Contains(value); + } + + public void Remove(Result value) + { + List.Remove(value); + } + + public void CopyTo(Result[] array, int index) + { + List.CopyTo(array, index); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/build.err b/inetsrv/uddi/source/build.err new file mode 100644 index 0000000..f5b1681 --- /dev/null +++ b/inetsrv/uddi/source/build.err @@ -0,0 +1,48 @@ +1>core\. : error CS1577: Assembly generation failed -- Unspecified error +1>core\binplace : error BNP0000: Unable to place file obj\i386\uddi.core.dll - exiting. +1>api\. : error CS0006: Metadata file '..\core\obj\i386\uddi.core.dll' could not be found +1>api\binplace : error BNP0000: Unable to place file obj\i386\uddi.api.dll - exiting. +1>web\. : error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>web\. : error CS0006: Metadata file '..\api\obj\I386\uddi.api.dll' could not be found +1>web\binplace : error BNP0000: Unable to place file obj\i386\uddi.web.dll - exiting. +1>addwebreference\. : error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>addwebreference\. : error CS0006: Metadata file '..\web\obj\I386\uddi.web.dll' could not be found +1>addwebreference\. : error CS0006: Metadata file '..\api\obj\I386\uddi.api.dll' could not be found +1>addwebreference\binplace : error BNP0000: Unable to place file obj\i386\uddi.addwebreference.dll - exiting. +1>operator\. : error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>operator\. : error CS0006: Metadata file '..\api\obj\I386\uddi.api.dll' could not be found +1>operator\binplace : error BNP0000: Unable to place file obj\i386\uddi.operator.dll - exiting. +1>replicate\. : error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>replicate\. : error CS0006: Metadata file '..\operator\obj\I386\uddi.operator.dll' could not be found +1>replicate\binplace : error BNP0000: Unable to place file obj\i386\replicate.exe - exiting. +1>tools\rcf\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\rcf\. : error CS0006: Metadata file '..\..\operator\obj\I386\uddi.operator.dll' could not be found +1>tools\rcf\binplace : error BNP0000: Unable to place file obj\i386\rcf.exe - exiting. +1>tools\monitor\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\monitor\. : error CS0006: Metadata file '..\..\operator\obj\I386\uddi.operator.dll' could not be found +1>tools\monitor\binplace : error BNP0000: Unable to place file obj\i386\monitor.exe - exiting. +1>tools\send\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\send\. : error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>tools\send\binplace : error BNP0000: Unable to place file obj\i386\send.exe - exiting. +1>tools\resetkey\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\resetkey\binplace : error BNP0000: Unable to place file obj\i386\resetkey.exe - exiting. +1>tools\validate\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\validate\binplace : error BNP0000: Unable to place file obj\i386\validate.exe - exiting. +1>tools\bootstrap\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\bootstrap\. : error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>tools\bootstrap\binplace : error BNP0000: Unable to place file obj\i386\Bootstrap.exe - exiting. +1>tools\migrate\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\migrate\. : error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>tools\migrate\binplace : error BNP0000: Unable to place file obj\i386\migrate.exe - exiting. +1>tools\replicationadmin\. : error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>tools\replicationadmin\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\replicationadmin\. : error CS0006: Metadata file '..\..\operator\obj\I386\uddi.operator.dll' could not be found +1>tools\replicationadmin\binplace : error BNP0000: Unable to place file obj\i386\replicationadmin.exe - exiting. +1>tools\recalcstats\. : error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>tools\recalcstats\binplace : error BNP0000: Unable to place file obj\i386\recalcstats.exe - exiting. +1>setup\web\ca\. : error CS0006: Metadata file '..\..\..\api\obj\I386\uddi.api.dll' could not be found +1>setup\web\ca\. : error CS0006: Metadata file '..\..\..\core\obj\I386\uddi.core.dll' could not be found +1>setup\web\ca\binplace : error BNP0000: Unable to place file obj\i386\webca.dll - exiting. +1>setup\db\ca\. : error CS0006: Metadata file '..\..\..\api\obj\I386\uddi.api.dll' could not be found +1>setup\db\ca\. : error CS0006: Metadata file '..\..\..\core\obj\I386\uddi.core.dll' could not be found +1>setup\db\ca\binplace : error BNP0000: Unable to place file obj\i386\dbca.dll - exiting. diff --git a/inetsrv/uddi/source/build.log b/inetsrv/uddi/source/build.log new file mode 100644 index 0000000..9cc536f --- /dev/null +++ b/inetsrv/uddi/source/build.log @@ -0,0 +1,1773 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source directory tree for files to compile. +Building generated files in d:\openxp\inetsrv\uddi\source\common ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 PASS0ONLY=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\common +Elapsed time [0:00:00.016] ******************** +Building generated files in d:\openxp\inetsrv\uddi\source\resources ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 PASS0ONLY=1 386=1' +2>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\resources +Elapsed time [0:00:00.016] ******************** +Building generated files in d:\openxp\inetsrv\uddi\source\setup\admin\wsi ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 PASS0ONLY=1 386=1' +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\admin\wsi +Elapsed time [0:00:00.016] ******************** +Building generated files in d:\openxp\inetsrv\uddi\source\setup\web\wsi ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 PASS0ONLY=1 386=1' +4>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\web\wsi +Elapsed time [0:00:00.031] ******************** +Building generated files in d:\openxp\inetsrv\uddi\source\setup\db\wsi ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 PASS0ONLY=1 386=1' +5>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\db\wsi +Elapsed time [0:00:00.031] ******************** +1> mc -h obj\i386 -r obj\i386 uddievents.mc +3> +4> +5> +2> +3>Stop. +4>Stop. +5>Stop. +2>Stop. +1>MC: Compiling uddievents.mc +1> +1>Stop. +Compiling d:\openxp\inetsrv\uddi\source\version directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\version +Elapsed time [0:00:00.844] ******************** +Compiling d:\openxp\inetsrv\uddi\source\common directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +2>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\common +Elapsed time [0:00:00.844] ******************** +Compiling d:\openxp\inetsrv\uddi\source\core directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\core +Elapsed time [0:00:00.922] ******************** +Compiling d:\openxp\inetsrv\uddi\source\api directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +4>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\api +Elapsed time [0:00:00.953] ******************** +1>cl -nologo -Ii386\ -I. -I\OpenXP\nt\public\sdk\inc\mfc42 -I\OpenXP\public\sdk\inc\atl30 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\version.cpp +2> rc -l 409 -DSXS_ASSEMBLY_NAME="""""" -DSXS_ASSEMBLY_VERSION="""""" -DSXS_ASSEMBLY_LANGUAGE="""""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""uddicommon.dll""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -r -fo obj\i386\uddicommon.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -D_AFXDLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt .\uddicommon.rc +3>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.core D:\OpenXP\Tools\coffbase.txt +Compiling d:\openxp\inetsrv\uddi\source\web directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +5>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\web +4>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.api D:\OpenXP\Tools\coffbase.txt +Elapsed time [0:00:00.984] ******************** +Compiling d:\openxp\inetsrv\uddi\source\addwebreference directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\addwebreference +Elapsed time [0:00:01.000] ******************** +Compiling d:\openxp\inetsrv\uddi\source\mmc directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +7>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\mmc +Elapsed time [0:00:01.016] ******************** +6>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.addwebreference D:\OpenXP\Tools\coffbase.txt +5>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.web D:\OpenXP\Tools\coffbase.txt +3>genbasemac: module uddi.core not found in D:\OpenXP\Tools\coffbase.txt +3> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +Compiling d:\openxp\inetsrv\uddi\source\filter directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +8>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\filter +Elapsed time [0:00:01.094] ******************** +Compiling d:\openxp\inetsrv\uddi\source\operator directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6>genbasemac: module uddi.addwebreference not found in D:\OpenXP\Tools\coffbase.txt +5>genbasemac: module uddi.web not found in D:\OpenXP\Tools\coffbase.txt +3>'..\version\obj\i386\version.exe' is not recognized as an internal or external command, +3>operable program or batch file. +4> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3> +6> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +4>'..\version\obj\i386\version.exe' is not recognized as an internal or external command, +4>operable program or batch file. +5> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3>Stop. +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\operator +6>'..\version\obj\i386\version.exe' is not recognized as an internal or external command, +6>operable program or batch file. +5>'..\version\obj\i386\version.exe' is not recognized as an internal or external command, +Elapsed time [0:00:01.187] ******************** +5>operable program or batch file. +4> +7> rc -l 409 -DSXS_ASSEMBLY_NAME="""Microsoft.Windows.ServerAdmin.UDDIServices""" -DSXS_ASSEMBLY_VERSION="""1.0.0.0""" -DSXS_ASSEMBLY_LANGUAGE="""x-ww""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""uddi.mmc.dll""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -DSXS_MANIFEST_OBJ1="\"obj/i386/uddimmc.man\"" -r -fo obj\i386\resource.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DISOLATION_AWARE_ENABLED /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP /DISOLATION_AWARE_ENABLED -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42\OpenXP\public\sdk\inc\atl30 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 .\resource.rc +6> +5> +4>Stop. +Compiling d:\openxp\inetsrv\uddi\source\replicate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +4>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\replicate +Elapsed time [0:00:01.234] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\rcf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +5>Stop. +6>Stop. +5>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\rcf +Elapsed time [0:00:01.266] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\monitor directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\monitor +Elapsed time [0:00:01.266] ******************** +7> preprocessor.exe -o obj\i386\uddimmc.man -i .\uddimmc.manifest -DSXS_ASSEMBLY_NAME="\"Microsoft.Windows.ServerAdmin.UDDIServices\"" -DSXS_ASSEMBLY_VERSION="\"1.0.0.0\"" -DSXS_ASSEMBLY_LANGUAGE="\"x-ww\"" -DSXS_PROCESSOR_ARCHITECTURE="\"x86\"" -DSXS_TARGET="\"uddi.mmc.dll\"" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="\"Microsoft.Windows.SystemCompatible\"" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"\"Microsoft.Windows.SystemCompatible\"" +8> rc -l 409 -DSXS_ASSEMBLY_NAME="""""" -DSXS_ASSEMBLY_VERSION="""""" -DSXS_ASSEMBLY_LANGUAGE="""""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""uddi.filter.dll""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -r -fo obj\i386\filter.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_USRDLL /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -D_AFXDLL /D_ATL_DLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 .\filter.rc +3>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.operator D:\OpenXP\Tools\coffbase.txt +4>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicate D:\OpenXP\Tools\coffbase.txt +6>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 monitor D:\OpenXP\Tools\coffbase.txt +5>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 rcf D:\OpenXP\Tools\coffbase.txt +3>genbasemac: module uddi.operator not found in D:\OpenXP\Tools\coffbase.txt +6>genbasemac: module monitor not found in D:\OpenXP\Tools\coffbase.txt +4>genbasemac: module replicate not found in D:\OpenXP\Tools\coffbase.txt +5>genbasemac: module rcf not found in D:\OpenXP\Tools\coffbase.txt +Compiling d:\openxp\inetsrv\uddi\source\tools\send directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +3> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +4> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3>'..\version\obj\i386\version.exe' is not recognized as an internal or external command, +3>operable program or batch file. +6> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +5> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +4>'..\version\obj\i386\version.exe' is not recognized as an internal or external command, +4>operable program or batch file. +3> +6>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +6>operable program or batch file. +5>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +5>operable program or batch file. +4> +3>Stop. +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\send +Elapsed time [0:00:01.547] ******************** +6> +5> +Compiling d:\openxp\inetsrv\uddi\source\tools\resetkey directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +4>Stop. +4>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\resetkey +5>Stop. +6>Stop. +Elapsed time [0:00:01.578] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\validate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\validate +Elapsed time [0:00:01.578] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\bootstrap directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +5>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\bootstrap +Elapsed time [0:00:01.594] ******************** +4>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 resetkey D:\OpenXP\Tools\coffbase.txt +4>genbasemac: module resetkey not found in D:\OpenXP\Tools\coffbase.txt +5>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 Bootstrap D:\OpenXP\Tools\coffbase.txt +4> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +5>genbasemac: module Bootstrap not found in D:\OpenXP\Tools\coffbase.txt +4>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +4>operable program or batch file. +3>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 send D:\OpenXP\Tools\coffbase.txt +6>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 validate D:\OpenXP\Tools\coffbase.txt +4> +5> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +5>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +5>operable program or batch file. +4>Stop. +1>version.cpp +5> +3>genbasemac: module send not found in D:\OpenXP\Tools\coffbase.txt +5>Stop. +Compiling d:\openxp\inetsrv\uddi\source\tools\migrate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +4>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\migrate +Elapsed time [0:00:01.812] ******************** +6>genbasemac: module validate not found in D:\OpenXP\Tools\coffbase.txt +Compiling d:\openxp\inetsrv\uddi\source\tools\replicationadmin directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +5>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\replicationadmin +Elapsed time [0:00:01.828] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\recalcstats directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +3> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +6> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +3>operable program or batch file. +6>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +6>operable program or batch file. +4>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 migrate D:\OpenXP\Tools\coffbase.txt +3> +5>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicationadmin D:\OpenXP\Tools\coffbase.txt +6> +3>Stop. +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\recalcstats +Elapsed time [0:00:01.922] ******************** +6>Stop. +Compiling d:\openxp\inetsrv\uddi\source\resources directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\resources +Elapsed time [0:00:01.937] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\admin\wsi directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +4>genbasemac: module migrate not found in D:\OpenXP\Tools\coffbase.txt +3>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 recalcstats D:\OpenXP\Tools\coffbase.txt +5>genbasemac: module replicationadmin not found in D:\OpenXP\Tools\coffbase.txt +4> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +6> ( echo. ) +4>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +4>operable program or batch file. +6> +3>genbasemac: module recalcstats not found in D:\OpenXP\Tools\coffbase.txt +4> +6> +4>Stop. +6>Stop. +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\admin\wsi +Elapsed time [0:00:02.078] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\web\ca.unmanaged directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +4>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\web\ca.unmanaged +5> resgen.exe .\adminframe.resx obj\i386\adminframe.resources +Elapsed time [0:00:02.078] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\web\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +3> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +3>operable program or batch file. +6> echo. +3> +6> +3>Stop. +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\web\ca +Elapsed time [0:00:02.172] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\web\wsi directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +3>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 webca D:\OpenXP\Tools\coffbase.txt +4> rc -l 409 -DSXS_ASSEMBLY_NAME="""""" -DSXS_ASSEMBLY_VERSION="""""" -DSXS_ASSEMBLY_LANGUAGE="""""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""webcaum.dll""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -r -fo obj\i386\webcaum.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DWEBCAUM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 .\webcaum.rc +6> ( echo. ) +6> +6> +6>Stop. +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\web\wsi +Elapsed time [0:00:02.297] ******************** +3>genbasemac: module webca not found in D:\OpenXP\Tools\coffbase.txt +3> resgen.exe .\webca.resx obj\i386\webca.resources +6> echo. +6> +Compiling d:\openxp\inetsrv\uddi\source\setup\db\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6> ( echo. ) +6> +6> +6>Stop. +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\db\ca +Elapsed time [0:00:02.484] ******************** +6>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 dbca D:\OpenXP\Tools\coffbase.txt +8>warning RC4005: 'WIN32' : redefinition +4>warning RC4005: 'WIN32' : redefinition +Compiling d:\openxp\inetsrv\uddi\source\setup\db\ca.unmanaged directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +2>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -D_AFXDLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\uddicommon.cpp +8>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_USRDLL /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\filter.cpp +4>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DWEBCAUM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\apppool.cpp .\common.cpp .\strlist.cpp .\iis.metabase.cpp .\setdacl.cpp .\webcaum.cpp +6>genbasemac: module dbca not found in D:\OpenXP\Tools\coffbase.txt +2>uddicommon.cpp +4>apppool.cpp +8>filter.cpp +6> resgen.exe .\dbca.resx obj\i386\dbca.resources +6> +6>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +6> at System.Resources.ResourceReader.StripVersionField(String typeName) +6> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +6> at System.Resources.ResourceReader.ReadResources() +6> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +6> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +6> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +6> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +6> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +6> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +6> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +6> at System.Environment.GetResourceString(String key) +6> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +6> at System.Globalization.CultureInfo..ctor(Int32 culture) +6> at System.Globalization.CultureInfo..cctor() +6> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +6> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +6> at System.Threading.Thread.get_CurrentUICulture()6> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +6>'..\..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +6>operable program or batch file. +6> echo. +6> +6> +6>Stop. +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\db\ca.unmanaged +Elapsed time [0:00:04.187] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\db\wsi directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6> rc -l 409 -DSXS_ASSEMBLY_NAME="""""" -DSXS_ASSEMBLY_VERSION="""""" -DSXS_ASSEMBLY_LANGUAGE="""""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""dbcaum.dll""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -r -fo obj\i386\dbcaum.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DDBCAUM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 .\dbcaum.rc +7> FusionManifestValidator /b /s:D:\OpenXP\Tools\appschema.xml /m:obj\i386\uddimmc.man +6>warning RC4005: 'WIN32' : redefinition +6>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DDBCAUM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\apppool.cpp .\common.cpp .\dbcaum.cpp +6>apppool.cpp +7>C:\Users\ntvbl06\AppData\Local\Temp\nmB7EE.tmp +7>.\resource.rc +7> 1 file(s) copied. +2> ( echo. ) +5> +5>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +5> at System.Resources.ResourceReader.StripVersionField(String typeName) +5> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +5> at System.Resources.ResourceReader.ReadResources() +5> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +5> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +5> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +5> at System.Environment.GetResourceString(String key) +5> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +5> at System.Globalization.CultureInfo..ctor(Int32 culture) +5> at System.Globalization.CultureInfo..cctor() +5> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +5> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +5> at System.Threading.Thread.get_CurrentUICulture()2> +5> resgen.exe .\changelogcontrol.resx obj\i386\changelogcontrol.resources +2> +2>Stop. +2>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\db\wsi +Elapsed time [0:00:05.281] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\ocm directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +2> echo. +1> +2> +1>Stop. +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\ocm +Elapsed time [0:00:05.391] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\msitoddf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +2> ( echo. ) +2> +2> +2>Stop. +2>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\msitoddf +Elapsed time [0:00:05.500] ******************** +Compiling d:\openxp\inetsrv\uddi\source\setup\uddimsifiler directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1> rc -l 409 -DSXS_ASSEMBLY_NAME="""""" -DSXS_ASSEMBLY_VERSION="""""" -DSXS_ASSEMBLY_LANGUAGE="""""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""uddiocm.dll""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -r -fo obj\i386\uddiocm.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DUDDIOCM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I..\shared -I\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 .\uddiocm.rc +2>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h /Ylmsitoddf /Ycstdafx.h /Fpobj\i386\stdafx.pch /Fo"D:\OpenXP\inetsrv\uddi\source\setup\msitoddf\obj\i386\stdafx.obj" /Tp +2> +2>#include "stdafx.h" +2> +7>warning RC4005: 'WIN32' : redefinition +2>pch_hdr.src +7>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42\OpenXP\public\sdk\inc\atl30 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DISOLATION_AWARE_ENABLED /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP /DISOLATION_AWARE_ENABLED -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\about.cpp .\basesnap.cpp .\comp.cpp .\compdata.cpp .\dataobj.cpp .\delebase.cpp .\mmccrack.cpp .\objectpicker.cpp .\scp.cpp .\scppublisher.cpp .\uddi.cpp .\uddiservicesnode.cpp .\uddisitenode.cpp .\webservernode.cpp .\servercheck.cpp .\stringutil.cpp +7>about.cpp +1>warning RC4005: 'WIN32' : redefinition +1>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I..\shared -I\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -DUDDIOCM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\appcompat.cpp .\strlist.cpp .\uddiinst.cpp .\uddiocm.cpp .\wizpage.cpp .\objectpicker.cpp .\ocmcallback.cpp .\common.cpp +3> +3>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +3> at System.Resources.ResourceReader.StripVersionField(String typeName) +3> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +3> at System.Resources.ResourceReader.ReadResources() +3> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +3> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +3> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +3> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +3> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +3> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +3> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +3> at System.Environment.GetResourceString(String key) +3> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +3> at System.Globalization.CultureInfo..ctor(Int32 culture) +3> at System.Globalization.CultureInfo..cctor() +3> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +3> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +3> at System.Threading.Thread.get_CurrentUICulture()3> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3>'..\..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +3>operable program or batch file. +1>appcompat.cpp +3> +3>Stop. +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\uddimsifiler +Elapsed time [0:00:06.000] ******************** +Compiling d:\openxp\inetsrv\uddi\source\xp directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +3>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h /Yluddimsifiler /Ycstdafx.h /Fpobj\i386\stdafx.pch /Fo"D:\OpenXP\inetsrv\uddi\source\setup\uddimsifiler\obj\i386\stdafx.obj" /Tp +3> +3>#include "stdafx.h" +3> +3>pch_hdr.src +2> rc -l 409 -DSXS_ASSEMBLY_NAME="""""" -DSXS_ASSEMBLY_VERSION="""""" -DSXS_ASSEMBLY_LANGUAGE="""""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""msitoddf.exe""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -r -fo obj\i386\msitoddf.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 .\msitoddf.rc +2>warning RC4005: 'WIN32' : redefinition +2>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h /Yustdafx.h /Fpobj\i386\stdafx.pch .\msitoddf.cpp +2>msitoddf.cpp +3> rc -l 409 -DSXS_ASSEMBLY_NAME="""""" -DSXS_ASSEMBLY_VERSION="""""" -DSXS_ASSEMBLY_LANGUAGE="""""" -DSXS_PROCESSOR_ARCHITECTURE="""x86""" -DSXS_TARGET="""uddimsifiler.exe""" -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="""Microsoft.Windows.SystemCompatible""" -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"""Microsoft.Windows.SystemCompatible""" -z "MS Sans Serif,Helv/MS Shell Dlg" -r -fo obj\i386\uddimsifiler.res -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 .\uddimsifiler.rc +5> +5>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +5> at System.Resources.ResourceReader.StripVersionField(String typeName) +5> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +5> at System.Resources.ResourceReader.ReadResources() +5> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +5> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +5> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +5> at System.Environment.GetResourceString(String key) +5> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +5> at System.Globalization.CultureInfo..ctor(Int32 culture) +5> at System.Globalization.CultureInfo..cctor() +5> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +5> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +5> at System.Threading.Thread.get_CurrentUICulture()5> resgen.exe .\correctionadmin.resx obj\i386\correctionadmin.resources +2> +2>Stop. +2>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\xp +Elapsed time [0:00:06.812] ******************** +3>warning RC4005: 'WIN32' : redefinition +3>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -ID:\OpenXP\public\sdk\inc\atl30 -I\OpenXP\public\sdk\inc\atl30 -IC:\nt\public\sdk\inc\mfc42 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /D_ATL_DLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h /Yustdafx.h /Fpobj\i386\stdafx.pch .\uddimsifiler.cpp +3>uddimsifiler.cpp +2>cl -nologo -Ii386\ -I. -ID:\OpenXP\public\sdk\inc\mfc42 -ID:\OpenXP\public\sdk\inc\dao350 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -ID:\OpenXP\public\sdk\inc\crt\stl60 -D_X86_=1 -Di386=1 -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -D_AFX_NOFORCE_LIBS -D_MFC_VER=0x0600 -DUNICODE -D_UNICODE -D_AFXDLL /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gd /QIfdiv- /QIf /G6 /GX /GR /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\uddi.xp.cpp .\xp_recalculate_statistics.cpp .\xp_reset_key.cpp +2>uddi.xp.cpp +3> +3>Stop. +5> +5>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +5> at System.Resources.ResourceReader.StripVersionField(String typeName) +5> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +5> at System.Resources.ResourceReader.ReadResources() +5> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +5> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +5> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +5> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +5> at System.Environment.GetResourceString(String key) +5> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +5> at System.Globalization.CultureInfo..ctor(Int32 culture) +5> at System.Globalization.CultureInfo..cctor() +5> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +5> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +5> at System.Threading.Thread.get_CurrentUICulture()5> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +5>'..\..\version\obj\i386\version.exe' is not recognized as an internal or external command, +5>operable program or batch file. +5> +5>Stop. +1>strlist.cpp +1>uddiinst.cpp +2>xp_recalculate_statistics.cpp +4>common.cpp +6>common.cpp +8> lib -out:obj\i386\uddi.filter.lib @C:\Users\ntvbl06\AppData\Local\Temp\nmC55C.tmp +2>xp_reset_key.cpp +2>Generating Code... +6>dbcaum.cpp +4>strlist.cpp +7>basesnap.cpp +4>iis.metabase.cpp +2> lib -out:obj\i386\uddi.xp.lib @C:\Users\ntvbl06\AppData\Local\Temp\nmC963.tmp +8>Microsoft (R) Library Manager Version 7.10.2179 +8>Copyright (C) Microsoft Corporation. All rights reserved. +8> +8>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +8>/WX +8>-nodefaultlib +8>-machine:ix86 +8>-def:filter.def +8>D:\OpenXP\public\sdk\lib\i386\mfcs42.lib +8>obj\i386\filter.res +8>obj\i386\filter.obj +6>Generating Code... +8> Creating library obj\i386\uddi.filter.lib and object obj\i386\uddi.filter.exp +2>Microsoft (R) Library Manager Version 7.10.2179 +2>Copyright (C) Microsoft Corporation. All rights reserved. +2> +2>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +2>/WX +2>-nodefaultlib +2>-machine:ix86 +2>-def:uddi.xp.def +2>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +2>obj\i386\uddi.xp.obj +2>obj\i386\xp_recalculate_statistics.obj +2>obj\i386\xp_reset_key.obj +2> Creating library obj\i386\uddi.xp.lib and object obj\i386\uddi.xp.exp +2> +8> +2>Stop. +8>Stop. +6> lib -out:obj\i386\dbcaum.lib @C:\Users\ntvbl06\AppData\Local\Temp\nmCACA.tmp +6>Microsoft (R) Library Manager Version 7.10.2179 +6>Copyright (C) Microsoft Corporation. All rights reserved. +6> +6>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +6>/WX +6>-nodefaultlib +6>-machine:ix86 +6>-def:dbcaum.def +6>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +6>obj\i386\dbcaum.res +6>obj\i386\apppool.obj +6>obj\i386\common.obj +6>obj\i386\dbcaum.obj +6> Creating library obj\i386\dbcaum.lib and object obj\i386\dbcaum.exp +6> +6>Stop. +4>setdacl.cpp +4>webcaum.cpp +7>comp.cpp +4>Generating Code... +4> lib -out:obj\i386\webcaum.lib @C:\Users\ntvbl06\AppData\Local\Temp\nmD20E.tmp +7>compdata.cpp +4>Microsoft (R) Library Manager Version 7.10.2179 +4>Copyright (C) Microsoft Corporation. All rights reserved. +4> +4>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +4>/WX +4>-nodefaultlib +4>-machine:ix86 +4>-def:webcaum.def +4>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +4>obj\i386\webcaum.res +4>obj\i386\apppool.obj +4>obj\i386\common.obj +4>obj\i386\strlist.obj +4>obj\i386\iis.metabase.obj +4>obj\i386\setdacl.obj +4>obj\i386\webcaum.obj +4> Creating library obj\i386\webcaum.lib and object obj\i386\webcaum.exp +4> +4>Stop. +1>uddiocm.cpp +7>dataobj.cpp +7>delebase.cpp +1>wizpage.cpp +7>mmccrack.cpp +7>objectpicker.cpp +7>scp.cpp +1>objectpicker.cpp +1>ocmcallback.cpp +1>common.cpp +7>scppublisher.cpp +1>Generating Code... +7>uddi.cpp +1> lib -out:obj\i386\uddiocm.lib @C:\Users\ntvbl06\AppData\Local\Temp\nmE056.tmp +1>Microsoft (R) Library Manager Version 7.10.2179 +1>Copyright (C) Microsoft Corporation. All rights reserved. +1> +1>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +1>/WX +1>-nodefaultlib +1>-machine:ix86 +1>-def:uddiocm.def +1>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +1>obj\i386\uddiocm.res +1>obj\i386\appcompat.obj +1>obj\i386\strlist.obj +1>obj\i386\uddiinst.obj +1>obj\i386\uddiocm.obj +1>obj\i386\wizpage.obj +1>obj\i386\objectpicker.obj +1>obj\i386\ocmcallback.obj +1>obj\i386\common.obj +1> Creating library obj\i386\uddiocm.lib and object obj\i386\uddiocm.exp +1> +1>Stop. +7>uddiservicesnode.cpp +7>uddisitenode.cpp +7>webservernode.cpp +7>servercheck.cpp +7>stringutil.cpp +7>Generating Code... +7> lib -out:obj\i386\uddi.mmc.lib @C:\Users\ntvbl06\AppData\Local\Temp\nmF798.tmp +7>Microsoft (R) Library Manager Version 7.10.2179 +7>Copyright (C) Microsoft Corporation. All rights reserved. +7> +7>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +7>/WX +7>-nodefaultlib +7>-machine:ix86 +7>-def:uddi.mmc.def +7>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +7>obj\i386\resource.res +7>obj\i386\about.obj +7>obj\i386\basesnap.obj +7>obj\i386\comp.obj +7>obj\i386\compdata.obj +7>obj\i386\dataobj.obj +7>obj\i386\delebase.obj +7>obj\i386\mmccrack.obj +7>obj\i386\objectpicker.obj +7>obj\i386\scp.obj +7>obj\i386\scppublisher.obj +7>obj\i386\uddi.obj +7>obj\i386\uddiservicesnode.obj +7>obj\i386\uddisitenode.obj +7>obj\i386\webservernode.obj +7>obj\i386\servercheck.obj +7>obj\i386\stringutil.obj +7> Creating library obj\i386\uddi.mmc.lib and object obj\i386\uddi.mmc.exp +7> +7>Stop. +Linking d:\openxp\inetsrv\uddi\source\version directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1> link -out:obj\i386\version.exe -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nmF8FF.tmp +1>Microsoft (R) Incremental Linker Version 7.10.2179 +1>Copyright (C) Microsoft Corporation. All rights reserved. +1> +1>-MERGE:_PAGE=PAGE +1>-MERGE:_TEXT=.text +1>-SECTION:INIT,d +1>-OPT:REF +1>-OPT:ICF +1>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +1>-INCREMENTAL:NO +1>-FULLBUILD +1>/release +1>-NODEFAULTLIB +1>/WX +1>-debug:FULL +1>-debugtype:cv +1>-version:5.2 +1>-osversion:5.2 +1>-debug:full +1>-debugtype:cv,fixup +1>/opt:nowin98 +1>-PDBPATH:NONE +1>-merge:.rdata=.text +1>-STACK:0x40000,0x2000 +1>/tsaware +1>-subsystem:console,4.00 +1>-base:@D:\OpenXP\Tools\coffbase.txt,usermode +1>-entry:mainCRTStartup +1>obj\i386\version.obj +1>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\libc.lib +1>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +1>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +1>D:\OpenXP\public\sdk\lib\i386\comdlg32.lib +1>D:\OpenXP\public\sdk\lib\i386\comsvcs.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\shell32.lib +1>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +1>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +1>D:\OpenXP\public\sdk\lib\i386\user32.lib +1> compact /c /q obj\i386\version.pdb +1> +1> Compressing files in d:\openxp\inetsrv\uddi\source\version\obj\i386\ +1> +1> +1>1 files within 1 directories were compressed. +1>199,680 total bytes of data are stored in 94,208 bytes. +1>The compression ratio is 2.1 to 1. +1> echo. +1> +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:23.141] ******************** +Linking d:\openxp\inetsrv\uddi\source\common directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +Elapsed time [0:00:23.156] ******************** +Linking d:\openxp\inetsrv\uddi\source\core directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.core D:\OpenXP\Tools\coffbase.txt +1> lib -out:obj\i386\uddicommon.lib @C:\Users\ntvbl06\AppData\Local\Temp\nmFF19.tmp +1>genbasemac: module uddi.core not found in D:\OpenXP\Tools\coffbase.txt +1>Microsoft (R) Library Manager Version 7.10.2179 +1>Copyright (C) Microsoft Corporation. All rights reserved. +1> +1>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +1>/WX +1>-nodefaultlib +1>-machine:ix86 +1>-def:uddicommon.def +1>D:\OpenXP\public\sdk\lib\i386\mfcs42.lib +1>obj\i386\uddicommon.res +1>obj\i386\uddicommon.obj +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> Creating library obj\i386\uddicommon.lib and object obj\i386\uddicommon.exp +1> link -out:obj\i386\uddicommon.dll -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nmFFD6.tmp +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.core.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.xml.dll,system.directoryservices.dll application.cs assemblyinfo.cs config.cs context.cs core.cs debug.cs localization.cs performance.cs schemacollection.cs sql.cs win32.cs uddiadconn.cs +1>Microsoft (R) Incremental Linker Version 7.10.2179 +1>Copyright (C) Microsoft Corporation. All rights reserved. +1> +1>/include:__afxForceSTDAFX +1>-MERGE:_PAGE=PAGE +1>-MERGE:_TEXT=.text +1>-SECTION:INIT,d +1>-OPT:REF +1>-OPT:ICF +1>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +1>-INCREMENTAL:NO +1>-FULLBUILD +1>/release +1>-NODEFAULTLIB +1>/WX +1>-debug:FULL +1>-debugtype:cv +1>-version:5.2 +1>-osversion:5.2 +1>-debug:full +1>-debugtype:cv,fixup +1>/opt:nowin98 +1>-PDBPATH:NONE +1>-merge:.rdata=.text +1>-STACK:0x40000,0x1000 +1>-dll +1>-base:@D:\OpenXP\Tools\coffbase.txt,uddicommon +1>-subsystem:windows,4.00 +1>-entry:_DllMainCRTStartup@12 +1>obj\i386\uddicommon.exp +1>obj\i386\uddicommon.res +1>obj\i386\uddicommon.obj +1>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\mfcs42.lib +1>D:\OpenXP\public\sdk\lib\i386\mfc42.lib +1>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +1>D:\OpenXP\public\sdk\lib\i386\ntdll.lib +1>error CS1577: Assembly generation failed -- Unspecified error +1>binplace d:\openxp\inetsrv\uddi\source\core\obj\i386\uddi.core.dll +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\core\obj\i386\uddi.core.dll,D:\binaries.x86chk\.\uddi\bin\uddi.core.dll) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\uddi.core.dll - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:24.016] ******************** +Linking d:\openxp\inetsrv\uddi\source\api directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.api D:\OpenXP\Tools\coffbase.txt +1> compact /c /q obj\i386\uddicommon.pdb +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1> Compressing files in d:\openxp\inetsrv\uddi\source\common\obj\i386\ +1> +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.api.dll /baseaddress:0x78400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\i386\uddi.core.dll,passportlib.dll address.cs assemblyinfo.cs assemblyversioninfo.cs assertion.cs authentication.cs binding.cs business.cs category.cs changerecord.cs contact.cs description.cs discoveryurl.cs email.cs extension.cs find.cs inquire.cs keyedreference.cs logs.cs messages.cs name.cs phone.cs publish.cs service.cs taxonomy.cs tmodel.cs types.cs serializer.cs +1> +1>1 files within 1 directories were compressed. +1>1,412,096 total bytes of data are stored in 831,488 bytes. +1>The compression ratio is 1.7 to 1. +1> echo. +1> +1>error CS0006: Metadata file '..\core\obj\i386\uddi.core.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\common\obj\i386\uddicommon.dll +1>binplace d:\openxp\inetsrv\uddi\source\api\obj\i386\uddi.api.dll +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\api\obj\i386\uddi.api.dll,D:\binaries.x86chk\.\uddi\bin\uddi.api.dll) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\uddi.api.dll - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:24.391] ******************** +Linking d:\openxp\inetsrv\uddi\source\web directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.web D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.web not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.web.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\api\obj\I386\uddi.api.dll address.cs assemblyinfo.cs assemblyversioninfo.cs base.cs bindings.cs box.cs breadcrumb.cs businesses.cs cache.cs categorybag.cs clientscripts.cs contacts.cs contextmenu.cs description.cs discoveryurl.cs editcontrol.cs email.cs explorer.cs format.cs header.cs helpcontrol.cs identifierbag.cs instanceinfos.cs localization.cs lookup.cs name.cs owner.cs phone.cs publisher.cs security.cs selection.cs services.cs sidenav.cs statistics.cs tab.cs taxonomy.cs tmodelbag.cs tmodels.cs tree.cs categorybrowser.cs taxonomytree.cs menu.cs validators.cs +1>error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\api\obj\I386\uddi.api.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\web\obj\i386\uddi.web.dll +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\web\obj\i386\uddi.web.dll,D:\binaries.x86chk\.\uddi\bin\uddi.web.dll) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\uddi.web.dll - exiting. +1> ( echo. ) +1> +1> +1> ( echo. ) +1>Stop. +Elapsed time [0:00:24.891] ******************** +Linking d:\openxp\inetsrv\uddi\source\addwebreference directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1> +1> +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.addwebreference D:\OpenXP\Tools\coffbase.txt +1>Stop. +1>genbasemac: module uddi.addwebreference not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.addwebreference.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\web\obj\I386\uddi.web.dll,..\api\obj\I386\uddi.api.dll addwebreference.cs paging.cs results.cs search.cs visualstudio.cs assemblyversioninfo.cs assemblyinfo.cs +1>error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\web\obj\I386\uddi.web.dll' could not be found +1>error CS0006: Metadata file '..\api\obj\I386\uddi.api.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\addwebreference\obj\i386\uddi.addwebreference.dll +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\addwebreference\obj\i386\uddi.addwebreference.dll,D:\binaries.x86chk\.\uddi\bin\uddi.addwebreference.dll) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\uddi.addwebreference.dll - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:25.187] ******************** +Linking d:\openxp\inetsrv\uddi\source\mmc directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +Elapsed time [0:00:25.203] ******************** +Linking d:\openxp\inetsrv\uddi\source\filter directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +Elapsed time [0:00:25.203] ******************** +Linking d:\openxp\inetsrv\uddi\source\operator directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.operator D:\OpenXP\Tools\coffbase.txt +3> link -out:obj\i386\uddi.filter.dll -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm728.tmp +2> link -out:obj\i386\uddi.mmc.dll -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm737.tmp +1>genbasemac: module uddi.operator not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3>Microsoft (R) Incremental Linker Version 7.10.2179 +3>Copyright (C) Microsoft Corporation. All rights reserved. +3> +3>/include:__afxForceSTDAFX +3>-MERGE:_PAGE=PAGE +3>-MERGE:_TEXT=.text +3>-SECTION:INIT,d +3>-OPT:REF +3>-OPT:ICF +3>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +3>-INCREMENTAL:NO +3>-FULLBUILD +3>/release +3>-NODEFAULTLIB +3>/WX +3>-debug:FULL +3>-debugtype:cv +3>-version:5.2 +3>-osversion:5.2 +3>-debug:full +3>-debugtype:cv,fixup +3>/opt:nowin98 +3>-PDBPATH:NONE +3>-merge:.rdata=.text +3>-STACK:0x40000,0x1000 +3>-dll +3>-base:@D:\OpenXP\Tools\coffbase.txt,uddi.filter +3>-subsystem:windows,4.00 +3>-entry:DllMain@12 +3>obj\i386\uddi.filter.exp +3>obj\i386\filter.res +3>obj\i386\filter.obj +3>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +3>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +3>D:\OpenXP\public\sdk\lib\i386\mfcs42.lib +3>D:\OpenXP\public\sdk\lib\i386\mfc42.lib +3>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +3>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +3>D:\OpenXP\public\sdk\lib\i386\atl.lib +3>D:\OpenXP\public\sdk\lib\i386\ntdll.lib +3>D:\OpenXP\public\sdk\lib\i386\atl.lib +3>D:\OpenXP\public\sdk\lib\i386\adsiid.lib +3>D:\OpenXP\public\sdk\lib\i386\shell32.lib +3>D:\OpenXP\public\sdk\lib\i386\odbc32.lib +3>D:\OpenXP\public\sdk\lib\i386\odbccp32.lib +3>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +3>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +3>D:\OpenXP\public\sdk\lib\i386\version.lib +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.operator.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\api\obj\I386\uddi.api.dll assemblyinfo.cs assemblyversioninfo.cs graph.cs messages.cs nodes.cs operator.cs replication.cs types.cs +2>Microsoft (R) Incremental Linker Version 7.10.2179 +2>Copyright (C) Microsoft Corporation. All rights reserved. +2> +2>/include:__afxForceSTDAFX +2>-MERGE:_PAGE=PAGE +2>-MERGE:_TEXT=.text +2>-SECTION:INIT,d +2>-OPT:REF +2>-OPT:ICF +2>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +2>-INCREMENTAL:NO +2>-FULLBUILD +2>/release +2>-NODEFAULTLIB +2>/WX +2>-debug:FULL +2>-debugtype:cv +2>-version:5.2 +2>-osversion:5.2 +2>-debug:full +2>-debugtype:cv,fixup +2>/opt:nowin98 +2>-PDBPATH:NONE +2>-merge:.rdata=.text +2>-STACK:0x40000,0x1000 +2>-dll +2>-base:@D:\OpenXP\Tools\coffbase.txt,uddi.mmc +2>-subsystem:windows,4.00 +2>-entry:_DllMainCRTStartup@12 +2>obj\i386\uddi.mmc.exp +2>obj\i386\resource.res +2>obj\i386\about.obj +2>obj\i386\basesnap.obj +2>obj\i386\comp.obj +2>obj\i386\compdata.obj +2>obj\i386\dataobj.obj +2>obj\i386\delebase.obj +2>obj\i386\mmccrack.obj +2>obj\i386\objectpicker.obj +2>obj\i386\scp.obj +2>obj\i386\scppublisher.obj +2>obj\i386\uddi.obj +2>obj\i386\uddiservicesnode.obj +2>obj\i386\uddisitenode.obj +2>obj\i386\webservernode.obj +2>obj\i386\servercheck.obj +2>obj\i386\stringutil.obj +2>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +2>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +2>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +2>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +2>D:\OpenXP\public\sdk\lib\i386\vccomsup.lib +2>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +2>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +2>D:\OpenXP\public\sdk\lib\i386\atl.lib +2>D:\OpenXP\public\sdk\lib\i386\ntdll.lib +2>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +2>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +2>D:\OpenXP\public\sdk\lib\i386\comdlg32.lib +2>D:\OpenXP\public\sdk\lib\i386\comsvcs.lib +2>D:\OpenXP\public\sdk\lib\i386\gdi32.lib +2>D:\OpenXP\public\sdk\lib\i386\htmlhelp.lib +2>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +2>D:\OpenXP\public\sdk\lib\i386\mmc.lib +2>D:\OpenXP\public\sdk\lib\i386\odbc32.lib +2>D:\OpenXP\public\sdk\lib\i386\odbccp32.lib +2>D:\OpenXP\public\sdk\lib\i386\oleaut32.lib +2>D:\OpenXP\public\sdk\lib\i386\ole32.lib +2>D:\OpenXP\public\sdk\lib\i386\shell32.lib +2>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +2>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +2>D:\OpenXP\public\sdk\lib\i386\user32.lib +2>D:\OpenXP\public\sdk\lib\i386\uuid.lib +2>D:\OpenXP\public\sdk\lib\i386\version.lib +2>D:\OpenXP\public\sdk\lib\i386\winspool.lib +2>D:\OpenXP\public\sdk\lib\i386\rpcrt4.lib +2>D:\OpenXP\public\sdk\lib\i386\adsiid.lib +2>D:\OpenXP\public\sdk\lib\i386\activeds.lib +2>D:\OpenXP\public\sdk\lib\i386\wbemuuid.lib +1>error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\api\obj\I386\uddi.api.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\operator\obj\i386\uddi.operator.dll +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\operator\obj\i386\uddi.operator.dll,D:\binaries.x86chk\.\uddi\bin\uddi.operator.dll) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\uddi.operator.dll - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:25.578] ******************** +Linking d:\openxp\inetsrv\uddi\source\replicate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module replicate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\replicate.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs replicate.cs +3> compact /c /q obj\i386\uddi.filter.pdb +3> +3> Compressing files in d:\openxp\inetsrv\uddi\source\filter\obj\i386\ +3> +1>error CS0006: Metadata file '..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\operator\obj\I386\uddi.operator.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\replicate\obj\i386\replicate.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\replicate\obj\i386\replicate.exe,D:\binaries.x86chk\.\uddi\bin\replicate.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\replicate.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:25.969] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\rcf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +3> +3>1 files within 1 directories were compressed. +3>1,518,592 total bytes of data are stored in 888,832 bytes. +3>The compression ratio is 1.7 to 1. +3> echo. +3> +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 rcf D:\OpenXP\Tools\coffbase.txt +3>binplace d:\openxp\inetsrv\uddi\source\filter\obj\i386\uddi.filter.dll +1>genbasemac: module rcf not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3> ( echo. ) +3> +3> +3>Stop. +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\rcf.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.xml.dll,..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs rcf.cs +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\..\operator\obj\I386\uddi.operator.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\rcf\obj\i386\rcf.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\rcf\obj\i386\rcf.exe,D:\binaries.x86chk\.\uddi\bin\rcf.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\rcf.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:26.594] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\monitor directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 monitor D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module monitor not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\monitor.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs monitor.cs +2> compact /c /q obj\i386\uddi.mmc.pdb +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +2> +2> Compressing files in d:\openxp\inetsrv\uddi\source\mmc\obj\i386\ +1>error CS0006: Metadata file '..\..\operator\obj\I386\uddi.operator.dll' could not be found +2> +1>binplace d:\openxp\inetsrv\uddi\source\tools\monitor\obj\i386\monitor.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\monitor\obj\i386\monitor.exe,D:\binaries.x86chk\.\uddi\bin\monitor.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\monitor.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:26.937] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\send directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 send D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module send not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +2> +2>1 files within 1 directories were compressed. +2>2,706,432 total bytes of data are stored in 1,462,272 bytes. +2>The compression ratio is 1.9 to 1. +2> echo. +2> +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\send.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll,..\..\api\obj\I386\uddi.api.dll uddisend.cs assemblyversioninfo.cs assemblyinfo.cs +2>binplace d:\openxp\inetsrv\uddi\source\mmc\obj\i386\uddi.mmc.dll +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\send\obj\i386\send.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\send\obj\i386\send.exe,D:\binaries.x86chk\.\uddi\bin\send.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\send.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:27.375] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\resetkey directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 resetkey D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module resetkey not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +2> ( ( echo. ) ) & ( echo SXS_ASSEMBLY_NAME="Microsoft.Windows.ServerAdmin.UDDIServices" SXS_ASSEMBLY_VERSION="1.0.0.0" SXS_ASSEMBLY_LANGUAGE="x-ww" SXS_MANIFEST="\uddi.mmc.dll" | appendtool.exe -file D:\binaries.x86chk\build_logs\binplace.log-sxs - ) +2> +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\resetkey.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll resetkey.cs assemblyversioninfo.cs assemblyinfo.cs +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\resetkey\obj\i386\resetkey.exe +2> +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\resetkey\obj\i386\resetkey.exe,D:\binaries.x86chk\.\uddi\bin\resetkey.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\resetkey.exe - exiting. +1> ( echo. ) +2>Stop. +1> +1> +1>Stop. +Elapsed time [0:00:27.734] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\validate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 validate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module validate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\validate.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll assemblyinfo.cs assemblyversioninfo.cs validate.cs +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\validate\obj\i386\validate.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\validate\obj\i386\validate.exe,D:\binaries.x86chk\.\uddi\bin\validate.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\validate.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:28.078] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\bootstrap directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 Bootstrap D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module Bootstrap not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\Bootstrap.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll,..\..\api\obj\I386\uddi.api.dll bootstrap.cs assemblyversioninfo.cs assemblyinfo.cs +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\bootstrap\obj\i386\Bootstrap.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\bootstrap\obj\i386\Bootstrap.exe,D:\binaries.x86chk\.\uddi\bin\Bootstrap.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\Bootstrap.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:28.422] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\migrate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 migrate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module migrate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\migrate.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /RES:uddi.v2.update_rc0_to_rc1.sql /RES:uddi.v2.update_rc1_to_rc2.sql /r:..\..\core\obj\I386\uddi.core.dll,..\..\api\obj\I386\uddi.api.dll migrate.cs assemblyinfo.cs +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\migrate\obj\i386\migrate.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\migrate\obj\i386\migrate.exe,D:\binaries.x86chk\.\uddi\bin\migrate.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\migrate.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:28.750] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\replicationadmin directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicationadmin D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module replicationadmin not found in D:\OpenXP\Tools\coffbase.txt +1> resgen.exe .\adminframe.resx obj\i386\adminframe.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> resgen.exe .\changelogcontrol.resx obj\i386\changelogcontrol.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> resgen.exe .\correctionadmin.resx obj\i386\correctionadmin.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\replicationadmin.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /resource:obj\i386\adminframe.resources /resource:obj\i386\changelogcontrol.resources /resource:obj\i386\correctionadmin.resources /r:system.dll,system.data.dll,system.drawing.dll,system.windows.forms.dll,system.xml.dll,..\..\api\obj\I386\uddi.api.dll,..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs adminframe.cs changelogcontrol.cs correctionadmin.cs +1>error CS0006: Metadata file '..\..\api\obj\I386\uddi.api.dll' could not be found +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>error CS0006: Metadata file '..\..\operator\obj\I386\uddi.operator.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\replicationadmin\obj\i386\replicationadmin.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\replicationadmin\obj\i386\replicationadmin.exe,D:\binaries.x86chk\.\uddi\bin\replicationadmin.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\replicationadmin.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:32.375] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\recalcstats directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 recalcstats D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module recalcstats not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\recalcstats.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll recalcstats.cs assemblyversioninfo.cs assemblyinfo.cs +1>error CS0006: Metadata file '..\..\core\obj\I386\uddi.core.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\tools\recalcstats\obj\i386\recalcstats.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\recalcstats\obj\i386\recalcstats.exe,D:\binaries.x86chk\.\uddi\bin\recalcstats.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\recalcstats.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:32.734] ******************** +Linking d:\openxp\inetsrv\uddi\source\setup\web\ca.unmanaged directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +Elapsed time [0:00:32.734] ******************** +Linking d:\openxp\inetsrv\uddi\source\setup\web\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 webca D:\OpenXP\Tools\coffbase.txt +4> link -out:obj\i386\webcaum.dll -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm2493.tmp +1>genbasemac: module webca not found in D:\OpenXP\Tools\coffbase.txt +1> resgen.exe .\webca.resx obj\i386\webca.resources +4>Microsoft (R) Incremental Linker Version 7.10.2179 +4>Copyright (C) Microsoft Corporation. All rights reserved. +4> +4>/include:__afxForceSTDAFX +4>-MERGE:_PAGE=PAGE +4>-MERGE:_TEXT=.text +4>-SECTION:INIT,d +4>-OPT:REF +4>-OPT:ICF +4>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +4>-INCREMENTAL:NO +4>-FULLBUILD +4>/release +4>-NODEFAULTLIB +4>/WX +4>-debug:FULL +4>-debugtype:cv +4>-version:5.2 +4>-osversion:5.2 +4>-debug:full +4>-debugtype:cv,fixup +4>/opt:nowin98 +4>-PDBPATH:NONE +4>-merge:.rdata=.text +4>-STACK:0x40000,0x1000 +4>-dll +4>-base:@D:\OpenXP\Tools\coffbase.txt,webcaum +4>-subsystem:windows,4.00 +4>-entry:_DllMainCRTStartup@12 +4>obj\i386\webcaum.exp +4>obj\i386\webcaum.res +4>obj\i386\apppool.obj +4>obj\i386\common.obj +4>obj\i386\strlist.obj +4>obj\i386\iis.metabase.obj +4>obj\i386\setdacl.obj +4>obj\i386\webcaum.obj +4>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +4>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +4>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +4>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +4>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +4>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +4>D:\OpenXP\public\sdk\lib\i386\atl.lib +4>D:\OpenXP\public\sdk\lib\i386\ntdll.lib +4>D:\OpenXP\public\sdk\lib\i386\atl.lib +4>D:\OpenXP\public\sdk\lib\i386\adsiid.lib +4>D:\OpenXP\public\sdk\lib\i386\shell32.lib +4>D:\OpenXP\public\sdk\lib\i386\setupapi.lib +4>D:\OpenXP\public\sdk\lib\i386\oleaut32.lib +4>D:\OpenXP\public\sdk\lib\i386\ole32.lib +4>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +4>D:\OpenXP\public\sdk\lib\i386\rpcrt4.lib +4>D:\OpenXP\public\sdk\lib\i386\user32.lib +4>D:\OpenXP\public\sdk\lib\i386\gdi32.lib +4>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +4>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +4>D:\OpenXP\public\sdk\lib\i386\netapi32.lib +4>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +4>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +4>D:\OpenXP\public\sdk\lib\i386\version.lib +4>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +4>D:\OpenXP\public\sdk\lib\i386\msi.lib +4>D:\OpenXP\public\sdk\lib\i386\wbemuuid.lib +4> compact /c /q obj\i386\webcaum.pdb +4> +4> Compressing files in d:\openxp\inetsrv\uddi\source\setup\web\ca.unmanaged\obj\i386\ +4> +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +4> +4>1 files within 1 directories were compressed. +4>1,698,816 total bytes of data are stored in 958,464 bytes. +4>The compression ratio is 1.8 to 1. +4> echo. +4> +4>binplace d:\openxp\inetsrv\uddi\source\setup\web\ca.unmanaged\obj\i386\webcaum.dll +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\webca.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /resource:obj\i386\webca.resources /r:system.dll,system.data.dll,system.xml.dll,system.management.dll,system.configuration.install.dll,system.directoryservices.dll,system.windows.forms.dll,..\..\..\api\obj\I386\uddi.api.dll,..\..\..\api\PassportLib.dll,..\..\..\core\obj\I386\uddi.core.dll assemblyinfo.cs assemblyversioninfo.cs webca.cs +1>error CS0006: Metadata file '..\..\..\api\obj\I386\uddi.api.dll' could not be found +1>error CS0006: Metadata file '..\..\..\core\obj\I386\uddi.core.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\setup\web\ca\obj\i386\webca.dll +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\setup\web\ca\obj\i386\webca.dll,D:\binaries.x86chk\.\uddi\bin\webca.dll) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\webca.dll - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:34.625] ******************** +Linking d:\openxp\inetsrv\uddi\source\setup\db\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 dbca D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module dbca not found in D:\OpenXP\Tools\coffbase.txt +4> ( echo. ) +1> resgen.exe .\dbca.resx obj\i386\dbca.resources +4> +4> +4>Stop. +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\dbca.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /resource:obj\i386\dbca.resources @cscresponse.txt /r:interop.sqldmo.dll,..\..\..\api\obj\I386\uddi.api.dll,..\..\..\api\PassportLib.dll,..\..\..\core\obj\I386\uddi.core.dll assemblyinfo.cs assemblyversioninfo.cs dbca.cs +1>error CS0006: Metadata file '..\..\..\api\obj\I386\uddi.api.dll' could not be found +1>error CS0006: Metadata file '..\..\..\core\obj\I386\uddi.core.dll' could not be found +1>binplace d:\openxp\inetsrv\uddi\source\setup\db\ca\obj\i386\dbca.dll +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\setup\db\ca\obj\i386\dbca.dll,D:\binaries.x86chk\.\uddi\bin\dbca.dll) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\dbca.dll - exiting. +1> echo. +1> +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:35.797] ******************** +Linking d:\openxp\inetsrv\uddi\source\setup\db\ca.unmanaged directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +Elapsed time [0:00:35.797] ******************** +Linking d:\openxp\inetsrv\uddi\source\setup\ocm directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +Elapsed time [0:00:35.812] ******************** +Linking d:\openxp\inetsrv\uddi\source\setup\msitoddf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +Elapsed time [0:00:35.812] ******************** +Linking d:\openxp\inetsrv\uddi\source\setup\uddimsifiler directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +Elapsed time [0:00:35.828] ******************** +Linking d:\openxp\inetsrv\uddi\source\xp directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +Elapsed time [0:00:35.828] ******************** +5> link -out:obj\i386\dbcaum.dll -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm30A9.tmp +7> link -out:obj\i386\msitoddf.exe -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm30B8.tmp +8> link -out:obj\i386\uddimsifiler.exe -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm30B9.tmp +6> link -out:obj\i386\uddiocm.dll -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm30BA.tmp +1> link -out:obj\i386\uddi.xp.dll -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm30BB.tmp +5>Microsoft (R) Incremental Linker Version 7.10.2179 +5>Copyright (C) Microsoft Corporation. All rights reserved. +5> +5>/include:__afxForceSTDAFX +5>-MERGE:_PAGE=PAGE +5>-MERGE:_TEXT=.text +5>-SECTION:INIT,d +5>-OPT:REF +5>-OPT:ICF +5>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +5>-INCREMENTAL:NO +5>-FULLBUILD +5>/release +5>-NODEFAULTLIB +5>/WX +5>-debug:FULL +5>-debugtype:cv +5>-version:5.2 +5>-osversion:5.2 +5>-debug:full +5>-debugtype:cv,fixup +5>/opt:nowin98 +5>-PDBPATH:NONE +5>-merge:.rdata=.text +5>-STACK:0x40000,0x1000 +5>-dll +5>-base:@D:\OpenXP\Tools\coffbase.txt,dbcaum +5>-subsystem:windows,4.00 +5>-entry:_DllMainCRTStartup@12 +5>obj\i386\dbcaum.exp +5>obj\i386\dbcaum.res +5>obj\i386\apppool.obj +5>obj\i386\common.obj +5>obj\i386\dbcaum.obj +5>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +5>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +5>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +5>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +5>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +5>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +5>D:\OpenXP\public\sdk\lib\i386\atl.lib +5>D:\OpenXP\public\sdk\lib\i386\ntdll.lib +5>D:\OpenXP\public\sdk\lib\i386\atl.lib +5>D:\OpenXP\public\sdk\lib\i386\adsiid.lib +5>D:\OpenXP\public\sdk\lib\i386\shell32.lib +5>D:\OpenXP\public\sdk\lib\i386\setupapi.lib +5>D:\OpenXP\public\sdk\lib\i386\oleaut32.lib +5>D:\OpenXP\public\sdk\lib\i386\ole32.lib +5>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +5>D:\OpenXP\public\sdk\lib\i386\rpcrt4.lib +5>D:\OpenXP\public\sdk\lib\i386\user32.lib +5>D:\OpenXP\public\sdk\lib\i386\gdi32.lib +5>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +5>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +5>D:\OpenXP\public\sdk\lib\i386\netapi32.lib +5>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +5>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +5>D:\OpenXP\public\sdk\lib\i386\version.lib +5>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +5>D:\OpenXP\public\sdk\lib\i386\msi.lib +5>D:\OpenXP\public\sdk\lib\i386\wbemuuid.lib +6>Microsoft (R) Incremental Linker Version 7.10.2179 +6>Copyright (C) Microsoft Corporation. All rights reserved. +6> +6>/include:__afxForceSTDAFX +6>-MERGE:_PAGE=PAGE +6>-MERGE:_TEXT=.text +6>-SECTION:INIT,d +6>-OPT:REF +6>-OPT:ICF +6>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +6>-INCREMENTAL:NO +6>-FULLBUILD +6>/release +6>-NODEFAULTLIB +6>/WX +6>-debug:FULL +6>-debugtype:cv +7>Microsoft (R) Incremental Linker Version 7.10.2179 +6>-version:5.2 +7>Copyright (C) Microsoft Corporation. All rights reserved. +6>-osversion:5.2 +6>-debug:full +7> +7>/include:__afxForceSTDAFX +6>-debugtype:cv,fixup +6>/opt:nowin98 +6>-PDBPATH:NONE +6>-merge:.rdata=.text +7>-MERGE:_PAGE=PAGE +7>-MERGE:_TEXT=.text +7>-SECTION:INIT,d +7>-OPT:REF +7>-OPT:ICF +7>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +6>-STACK:0x40000,0x1000 +6>-dll +7>-INCREMENTAL:NO +7>-FULLBUILD +8>Microsoft (R) Incremental Linker Version 7.10.2179 +7>/release +6>-base:@D:\OpenXP\Tools\coffbase.txt,uddiocm +6>-subsystem:windows,4.00 +6>-entry:_DllMainCRTStartup@12 +6>obj\i386\uddiocm.exp +6>obj\i386\uddiocm.res +6>obj\i386\appcompat.obj +7>-NODEFAULTLIB +7>/WX +8>Copyright (C) Microsoft Corporation. All rights reserved. +7>-debug:FULL +6>obj\i386\strlist.obj +6>obj\i386\uddiinst.obj +8> +8>/include:__afxForceSTDAFX +6>obj\i386\uddiocm.obj +8>-MERGE:_PAGE=PAGE +8>-MERGE:_TEXT=.text +7>-debugtype:cv +7>-version:5.2 +6>obj\i386\wizpage.obj +6>obj\i386\objectpicker.obj +8>-SECTION:INIT,d +8>-OPT:REF +7>-osversion:5.2 +7>-debug:full +6>obj\i386\ocmcallback.obj +6>obj\i386\common.obj +6>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +6>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +6>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +6>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +7>-debugtype:cv,fixup +6>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +8>-OPT:ICF +6>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +7>/opt:nowin98 +7>-PDBPATH:NONE +7>-merge:.rdata=.text +7>-STACK:0x40000,0x2000 +7>/tsaware +7>-subsystem:console,4.00 +7>-base:@D:\OpenXP\Tools\coffbase.txt,usermode +7>-entry:wmainCRTStartup +7>obj\i386\stdafx.obj +7>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +7>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +7>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +7>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +7>D:\OpenXP\public\sdk\lib\i386\atl.lib +7>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +7>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +7>obj\i386\msitoddf.res +7>obj\i386\msitoddf.obj +8>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +8>-INCREMENTAL:NO +8>-FULLBUILD +7>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +6>D:\OpenXP\public\sdk\lib\i386\atl.lib +8>/release +6>D:\OpenXP\public\sdk\lib\i386\ntdll.lib +6>D:\OpenXP\public\sdk\lib\i386\atl.lib +7>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +7>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +7>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +7>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +7>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +7>D:\OpenXP\public\sdk\lib\i386\atl.lib +7>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +7>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +7>D:\OpenXP\public\sdk\lib\i386\atl.lib +7>D:\OpenXP\public\sdk\lib\i386\adsiid.lib +7>D:\OpenXP\public\sdk\lib\i386\shell32.lib +7>D:\OpenXP\public\sdk\lib\i386\setupapi.lib +7>D:\OpenXP\public\sdk\lib\i386\oleaut32.lib +7>D:\OpenXP\public\sdk\lib\i386\ole32.lib +7>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +7>D:\OpenXP\public\sdk\lib\i386\rpcrt4.lib +7>D:\OpenXP\public\sdk\lib\i386\user32.lib +7>D:\OpenXP\public\sdk\lib\i386\gdi32.lib +7>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +7>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +7>D:\OpenXP\public\sdk\lib\i386\netapi32.lib +7>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +7>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +7>D:\OpenXP\public\sdk\lib\i386\version.lib +7>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +8>-NODEFAULTLIB +8>/WX +8>-debug:FULL +6>D:\OpenXP\public\sdk\lib\i386\adsiid.lib +7>D:\OpenXP\public\sdk\lib\i386\msi.lib +6>D:\OpenXP\public\sdk\lib\i386\shell32.lib +6>D:\OpenXP\public\sdk\lib\i386\setupapi.lib +6>D:\OpenXP\public\sdk\lib\i386\oleaut32.lib +6>D:\OpenXP\public\sdk\lib\i386\ole32.lib +6>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +6>D:\OpenXP\public\sdk\lib\i386\rpcrt4.lib +6>D:\OpenXP\public\sdk\lib\i386\user32.lib +6>D:\OpenXP\public\sdk\lib\i386\gdi32.lib +6>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +6>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +6>D:\OpenXP\public\sdk\lib\i386\netapi32.lib +6>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +6>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +6>D:\OpenXP\public\sdk\lib\i386\version.lib +6>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +6>D:\OpenXP\public\sdk\lib\i386\msi.lib +6>D:\OpenXP\public\sdk\lib\i386\version.lib +6>D:\OpenXP\public\sdk\lib\i386\clusapi.lib +6>D:\OpenXP\public\sdk\lib\i386\resutils.lib +8>-debugtype:cv +8>-version:5.2 +8>-osversion:5.2 +8>-debug:full +8>-debugtype:cv,fixup +6>D:\OpenXP\public\sdk\lib\i386\wbemuuid.lib +6>D:\OpenXP\public\sdk\lib\i386\uuid.lib +8>/opt:nowin98 +8>-PDBPATH:NONE +8>-merge:.rdata=.text +8>-STACK:0x40000,0x2000 +8>/tsaware +8>-subsystem:console,4.00 +8>-base:@D:\OpenXP\Tools\coffbase.txt,usermode +8>-entry:wmainCRTStartup +8>obj\i386\stdafx.obj +8>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +8>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +8>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +8>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +8>D:\OpenXP\public\sdk\lib\i386\atl.lib +8>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +8>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +8>obj\i386\uddimsifiler.res +8>obj\i386\uddimsifiler.obj +8>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +8>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +8>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +8>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +8>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +8>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +8>D:\OpenXP\public\sdk\lib\i386\atl.lib +8>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +8>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +8>D:\OpenXP\public\sdk\lib\i386\atl.lib +8>D:\OpenXP\public\sdk\lib\i386\adsiid.lib +8>D:\OpenXP\public\sdk\lib\i386\shell32.lib +8>D:\OpenXP\public\sdk\lib\i386\setupapi.lib +8>D:\OpenXP\public\sdk\lib\i386\oleaut32.lib +8>D:\OpenXP\public\sdk\lib\i386\ole32.lib +8>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +8>D:\OpenXP\public\sdk\lib\i386\rpcrt4.lib +8>D:\OpenXP\public\sdk\lib\i386\user32.lib +8>D:\OpenXP\public\sdk\lib\i386\gdi32.lib +8>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +8>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +8>D:\OpenXP\public\sdk\lib\i386\netapi32.lib +8>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +8>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +8>D:\OpenXP\public\sdk\lib\i386\version.lib +8>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +8>D:\OpenXP\public\sdk\lib\i386\msi.lib +1>Microsoft (R) Incremental Linker Version 7.10.2179 +1>Copyright (C) Microsoft Corporation. All rights reserved. +1> +1>/include:__afxForceSTDAFX +1>-MERGE:_PAGE=PAGE +1>-MERGE:_TEXT=.text +1>-SECTION:INIT,d +1>-OPT:REF +1>-OPT:ICF +1>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +1>-INCREMENTAL:NO +1>-FULLBUILD +1>/release +1>-NODEFAULTLIB +1>/WX +1>-debug:FULL +1>-debugtype:cv +1>-version:5.2 +1>-osversion:5.2 +1>-debug:full +1>-debugtype:cv,fixup +1>/opt:nowin98 +1>-PDBPATH:NONE +1>-merge:.rdata=.text +1>-STACK:0x40000,0x1000 +1>-dll +1>-base:@D:\OpenXP\Tools\coffbase.txt,uddi.xp +1>-subsystem:windows,4.00 +1>-entry:_DllMainCRTStartup@12 +1>obj\i386\uddi.xp.exp +1>obj\i386\uddi.xp.obj +1>obj\i386\xp_recalculate_statistics.obj +1>obj\i386\xp_reset_key.obj +1>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\mfcs42u.lib +1>D:\OpenXP\public\sdk\lib\i386\mfc42u.lib +1>D:\OpenXP\public\sdk\lib\i386\msvcrt.lib +1>D:\OpenXP\public\sdk\lib\i386\msvcprt.lib +1>D:\OpenXP\public\sdk\lib\i386\ntdll.lib +1>opends60.lib +1>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +1>D:\OpenXP\public\sdk\lib\i386\comsvcs.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\user32.lib +1>D:\OpenXP\public\sdk\lib\i386\version.lib +1>D:\OpenXP\public\sdk\lib\i386\winspool.lib +1>D:\OpenXP\public\sdk\lib\i386\rpcrt4.lib +5> compact /c /q obj\i386\dbcaum.pdb +1> compact /c /q obj\i386\uddi.xp.pdb +5> +5> Compressing files in d:\openxp\inetsrv\uddi\source\setup\db\ca.unmanaged\obj\i386\ +5> +8> compact /c /q obj\i386\uddimsifiler.pdb +1> +1> Compressing files in d:\openxp\inetsrv\uddi\source\xp\obj\i386\ +1> +7> compact /c /q obj\i386\msitoddf.pdb +8> +8> Compressing files in d:\openxp\inetsrv\uddi\source\setup\uddimsifiler\obj\i386\ +8> +7> +7> Compressing files in d:\openxp\inetsrv\uddi\source\setup\msitoddf\obj\i386\ +7> +6> compact /c /q obj\i386\uddiocm.pdb +6> +6> Compressing files in d:\openxp\inetsrv\uddi\source\setup\ocm\obj\i386\ +6> +1> +1>1 files within 1 directories were compressed. +1>1,518,592 total bytes of data are stored in 888,832 bytes. +1>The compression ratio is 1.7 to 1. +1> echo. +1> +1>binplace d:\openxp\inetsrv\uddi\source\xp\obj\i386\uddi.xp.dll +5> +5>1 files within 1 directories were compressed. +5>1,543,168 total bytes of data are stored in 892,928 bytes. +5>The compression ratio is 1.7 to 1. +5> echo. +5> +5>binplace d:\openxp\inetsrv\uddi\source\setup\db\ca.unmanaged\obj\i386\dbcaum.dll +1> ( echo. ) +1> +1> +1>Stop. +8> +8>1 files within 1 directories were compressed. +8>1,608,704 total bytes of data are stored in 933,888 bytes. +8>The compression ratio is 1.7 to 1. +8> echo. +7> +7>1 files within 1 directories were compressed. +7>1,616,896 total bytes of data are stored in 946,176 bytes. +7>The compression ratio is 1.7 to 1. +7> echo. +8> +7> +8>binplace d:\openxp\inetsrv\uddi\source\setup\uddimsifiler\obj\i386\uddimsifiler.exe +6> +6>1 files within 1 directories were compressed. +6>2,165,760 total bytes of data are stored in 1,183,744 bytes. +6>The compression ratio is 1.8 to 1. +6> echo. +7>binplace d:\openxp\inetsrv\uddi\source\setup\msitoddf\obj\i386\msitoddf.exe +6> +5> ( echo. ) +5> +6>binplace d:\openxp\inetsrv\uddi\source\setup\ocm\obj\i386\uddiocm.dll +5> +5>Stop. +7> ( echo. ) +8> ( echo. ) +8> +7> +7> +8> +7>Stop. +8>Stop. +6> ( echo. ) +6> +6> +6>Stop. +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' +1>Source Depot client error: +1> See http://sourcedepot for documentation on Source Depot. +1> No server or port specified; check $SDPORT. +1> 1 file(s) moved. +1>BUILDMSG: Error attempting to publish files +1>BUILDMSG: Source Depot client error: +1>Source Depot client error: +1> See http://sourcedepot for documentation on Source Depot. +1> No server or port specified; check $SDPORT. +1>exit: 1 diff --git a/inetsrv/uddi/source/build.wrn b/inetsrv/uddi/source/build.wrn new file mode 100644 index 0000000..26dbdea --- /dev/null +++ b/inetsrv/uddi/source/build.wrn @@ -0,0 +1,17 @@ +1>core\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\core\obj\i386\uddi.core.dll,D:\binaries.x86chk\.\uddi\bin\uddi.core.dll) failed 2 +1>api\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\api\obj\i386\uddi.api.dll,D:\binaries.x86chk\.\uddi\bin\uddi.api.dll) failed 2 +1>web\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\web\obj\i386\uddi.web.dll,D:\binaries.x86chk\.\uddi\bin\uddi.web.dll) failed 2 +1>addwebreference\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\addwebreference\obj\i386\uddi.addwebreference.dll,D:\binaries.x86chk\.\uddi\bin\uddi.addwebreference.dll) failed 2 +1>operator\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\operator\obj\i386\uddi.operator.dll,D:\binaries.x86chk\.\uddi\bin\uddi.operator.dll) failed 2 +1>replicate\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\replicate\obj\i386\replicate.exe,D:\binaries.x86chk\.\uddi\bin\replicate.exe) failed 2 +1>tools\rcf\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\rcf\obj\i386\rcf.exe,D:\binaries.x86chk\.\uddi\bin\rcf.exe) failed 2 +1>tools\monitor\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\monitor\obj\i386\monitor.exe,D:\binaries.x86chk\.\uddi\bin\monitor.exe) failed 2 +1>tools\send\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\send\obj\i386\send.exe,D:\binaries.x86chk\.\uddi\bin\send.exe) failed 2 +1>tools\resetkey\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\resetkey\obj\i386\resetkey.exe,D:\binaries.x86chk\.\uddi\bin\resetkey.exe) failed 2 +1>tools\validate\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\validate\obj\i386\validate.exe,D:\binaries.x86chk\.\uddi\bin\validate.exe) failed 2 +1>tools\bootstrap\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\bootstrap\obj\i386\Bootstrap.exe,D:\binaries.x86chk\.\uddi\bin\Bootstrap.exe) failed 2 +1>tools\migrate\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\migrate\obj\i386\migrate.exe,D:\binaries.x86chk\.\uddi\bin\migrate.exe) failed 2 +1>tools\replicationadmin\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\replicationadmin\obj\i386\replicationadmin.exe,D:\binaries.x86chk\.\uddi\bin\replicationadmin.exe) failed 2 +1>tools\recalcstats\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\recalcstats\obj\i386\recalcstats.exe,D:\binaries.x86chk\.\uddi\bin\recalcstats.exe) failed 2 +1>setup\web\ca\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\setup\web\ca\obj\i386\webca.dll,D:\binaries.x86chk\.\uddi\bin\webca.dll) failed 2 +1>setup\db\ca\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\setup\db\ca\obj\i386\dbca.dll,D:\binaries.x86chk\.\uddi\bin\dbca.dll) failed 2 diff --git a/inetsrv/uddi/source/common/common.vcproj b/inetsrv/uddi/source/common/common.vcproj new file mode 100644 index 0000000..20fe00b --- /dev/null +++ b/inetsrv/uddi/source/common/common.vcproj @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/common/makefile b/inetsrv/uddi/source/common/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/common/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/common/obj/_objects.mac b/inetsrv/uddi/source/common/obj/_objects.mac new file mode 100644 index 0000000..24c4696 --- /dev/null +++ b/inetsrv/uddi/source/common/obj/_objects.mac @@ -0,0 +1,32 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\uddicommon.res \ + $(_OBJ_DIR)\i386\uddicommon.obj + +PASS0_386_OBJECTS= \ + $(PASS0_HEADERDIR)\uddievents.h \ + $(MC_SOURCEDIR)\uddievents.rc + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\uddicommon.res \ + $(_OBJ_DIR)\ia64\uddicommon.obj + +PASS0_IA64_OBJECTS= \ + $(PASS0_HEADERDIR)\uddievents.h \ + $(MC_SOURCEDIR)\uddievents.rc + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\uddicommon.res \ + $(_OBJ_DIR)\amd64\uddicommon.obj + +PASS0_AMD64_OBJECTS= \ + $(PASS0_HEADERDIR)\uddievents.h \ + $(MC_SOURCEDIR)\uddievents.rc + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\uddicommon.res \ + $(_OBJ_DIR)\arm\uddicommon.obj + +PASS0_ARM_OBJECTS= \ + $(PASS0_HEADERDIR)\uddievents.h \ + $(MC_SOURCEDIR)\uddievents.rc + diff --git a/inetsrv/uddi/source/common/obj/i386/MSG00001.bin b/inetsrv/uddi/source/common/obj/i386/MSG00001.bin new file mode 100644 index 0000000..af7b5c3 Binary files /dev/null and b/inetsrv/uddi/source/common/obj/i386/MSG00001.bin differ diff --git a/inetsrv/uddi/source/common/obj/i386/uddicommon.dll b/inetsrv/uddi/source/common/obj/i386/uddicommon.dll new file mode 100644 index 0000000..2fa9ea9 Binary files /dev/null and b/inetsrv/uddi/source/common/obj/i386/uddicommon.dll differ diff --git a/inetsrv/uddi/source/common/obj/i386/uddicommon.exp b/inetsrv/uddi/source/common/obj/i386/uddicommon.exp new file mode 100644 index 0000000..d97c66d Binary files /dev/null and b/inetsrv/uddi/source/common/obj/i386/uddicommon.exp differ diff --git a/inetsrv/uddi/source/common/obj/i386/uddicommon.lib b/inetsrv/uddi/source/common/obj/i386/uddicommon.lib new file mode 100644 index 0000000..9c1ab02 Binary files /dev/null and b/inetsrv/uddi/source/common/obj/i386/uddicommon.lib differ diff --git a/inetsrv/uddi/source/common/obj/i386/uddicommon.obj b/inetsrv/uddi/source/common/obj/i386/uddicommon.obj new file mode 100644 index 0000000..c5863c3 Binary files /dev/null and b/inetsrv/uddi/source/common/obj/i386/uddicommon.obj differ diff --git a/inetsrv/uddi/source/common/obj/i386/uddicommon.pdb b/inetsrv/uddi/source/common/obj/i386/uddicommon.pdb new file mode 100644 index 0000000..5140a4a Binary files /dev/null and b/inetsrv/uddi/source/common/obj/i386/uddicommon.pdb differ diff --git a/inetsrv/uddi/source/common/obj/i386/uddicommon.res b/inetsrv/uddi/source/common/obj/i386/uddicommon.res new file mode 100644 index 0000000..ca77ddb Binary files /dev/null and b/inetsrv/uddi/source/common/obj/i386/uddicommon.res differ diff --git a/inetsrv/uddi/source/common/obj/i386/uddievents.h b/inetsrv/uddi/source/common/obj/i386/uddievents.h new file mode 100644 index 0000000..620cd49 --- /dev/null +++ b/inetsrv/uddi/source/common/obj/i386/uddievents.h @@ -0,0 +1,2193 @@ +-------------------------------------------------------------------- + + Event categories and message placeholders for UDDI. + If you change this file, run buildeventdll.cmd to rebuild the dll. + +-------------------------------------------------------------------- + + Category Strings + +// +// Values are 32 bit values layed out as follows: +// +// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +// +---+-+-+-----------------------+-------------------------------+ +// |Sev|C|R| Facility | Code | +// +---+-+-+-----------------------+-------------------------------+ +// +// where +// +// Sev - is the severity code +// +// 00 - Success +// 01 - Informational +// 10 - Warning +// 11 - Error +// +// C - is the Customer code flag +// +// R - is a reserved bit +// +// Facility - is the facility code +// +// Code - is the facility's status code +// +// +// Define the facility codes +// + + +// +// Define the severity codes +// + + +// +// MessageId: CATEGORY_NONE +// +// MessageText: +// +// None +// +#define CATEGORY_NONE 0x00000000L + +// +// MessageId: CATEGORY_CONFIG +// +// MessageText: +// +// Config +// +#define CATEGORY_CONFIG 0x00000001L + +// +// MessageId: CATEGORY_SOAP +// +// MessageText: +// +// Soap +// +#define CATEGORY_SOAP 0x00000002L + +// +// MessageId: CATEGORY_DATA +// +// MessageText: +// +// Data +// +#define CATEGORY_DATA 0x00000003L + +// +// MessageId: CATEGORY_AUTHORIZATION +// +// MessageText: +// +// Authorization +// +#define CATEGORY_AUTHORIZATION 0x00000004L + +// +// MessageId: CATEGORY_WEBSITE +// +// MessageText: +// +// Website +// +#define CATEGORY_WEBSITE 0x00000005L + +// +// MessageId: CATEGORY_REPLICATION +// +// MessageText: +// +// Replication +// +#define CATEGORY_REPLICATION 0x00000006L + +------------------------------------------------ + Start of Event Messages + + There are approx 200 entries, number from 100 to 300 + + +// +// MessageId: 0x00000064L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000065L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000066L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000067L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000068L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000069L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000006AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000006BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000006CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000006DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000006EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000006FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000070L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000071L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000072L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000073L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000074L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000075L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000076L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000077L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000078L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000079L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000007AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000007BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000007CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000007DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000007EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000007FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000080L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000081L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000082L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000083L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000084L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000085L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000086L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000087L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000088L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000089L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000008AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000008BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000008CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000008DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000008EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000008FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000090L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000091L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000092L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000093L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000094L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000095L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000096L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000097L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000098L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000099L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000009AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000009BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000009CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000009DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000009EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000009FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A0L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A1L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A2L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A3L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A4L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A5L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A6L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A7L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A8L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000A9L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000AAL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000ABL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000ACL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000ADL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000AEL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000AFL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B0L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B1L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B2L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B3L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B4L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B5L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B6L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B7L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B8L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000B9L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000BAL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000BBL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000BCL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000BDL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000BEL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000BFL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C0L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C1L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C2L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C3L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C4L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C5L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C6L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C7L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C8L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000C9L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000CAL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000CBL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000CCL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000CDL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000CEL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000CFL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D0L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D1L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D2L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D3L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D4L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D5L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D6L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D7L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D8L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000D9L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000DAL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000DBL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000DCL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000DDL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000DEL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000DFL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E0L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E1L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E2L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E3L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E4L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E5L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E6L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E7L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E8L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000E9L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000EAL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000EBL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000ECL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000EDL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000EEL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000EFL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F0L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F1L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F2L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F3L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F4L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F5L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F6L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F7L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F8L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000F9L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000FAL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000FBL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000FCL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000FDL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000FEL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x000000FFL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000100L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000101L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000102L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000103L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000104L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000105L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000106L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000107L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000108L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000109L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000010AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000010BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000010CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000010DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000010EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000010FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000110L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000111L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000112L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000113L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000114L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000115L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000116L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000117L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000118L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000119L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000011AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000011BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000011CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000011DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000011EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000011FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000120L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000121L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000122L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000123L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000124L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000125L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000126L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000127L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000128L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000129L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000012AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000012BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000012CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000012DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000012EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000012FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000130L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000131L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000132L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000133L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000134L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000135L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000136L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000137L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000138L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000139L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000013AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000013BL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000013CL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000013DL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000013EL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000013FL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000140L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000141L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000142L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000143L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000144L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000145L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000146L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000147L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000148L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x00000149L (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + +// +// MessageId: 0x0000014AL (No symbolic name defined) +// +// MessageText: +// +// %1 +// + + diff --git a/inetsrv/uddi/source/common/obj/i386/uddievents.rc b/inetsrv/uddi/source/common/obj/i386/uddievents.rc new file mode 100644 index 0000000..0885a89 --- /dev/null +++ b/inetsrv/uddi/source/common/obj/i386/uddievents.rc @@ -0,0 +1,2 @@ +LANGUAGE 0x9,0x1 +1 11 MSG00001.bin diff --git a/inetsrv/uddi/source/common/placefil.txt b/inetsrv/uddi/source/common/placefil.txt new file mode 100644 index 0000000..2f7863e --- /dev/null +++ b/inetsrv/uddi/source/common/placefil.txt @@ -0,0 +1 @@ +uddicommon.dll uddi\bin diff --git a/inetsrv/uddi/source/common/resource.h b/inetsrv/uddi/source/common/resource.h new file mode 100644 index 0000000..2d96e04 --- /dev/null +++ b/inetsrv/uddi/source/common/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by uddicommon.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/inetsrv/uddi/source/common/sources b/inetsrv/uddi/source/common/sources new file mode 100644 index 0000000..326f9f5 --- /dev/null +++ b/inetsrv/uddi/source/common/sources @@ -0,0 +1,15 @@ +TARGETNAME=uddicommon +TARGETPATH=obj +TARGETTYPE=DYNLINK +MAKEDLL=1 +USE_MFC=1 +#UMTYPE=console +#SYNCHRONIZE_PASS2_BLOCK=1 + + +SOURCES= uddievents.mc \ + uddicommon.rc \ + uddicommon.cpp + +BINPLACE_PLACEFILE=placefil.txt + diff --git a/inetsrv/uddi/source/common/uddicommon.cpp b/inetsrv/uddi/source/common/uddicommon.cpp new file mode 100644 index 0000000..5438267 --- /dev/null +++ b/inetsrv/uddi/source/common/uddicommon.cpp @@ -0,0 +1,16 @@ +// +// This creates a "dummy" entry point for the DLL and helps the build system +// in figuring out the build order +// +// The DLL contains some common functions used across the UDDI universe, +// along with resources (Message Tables, Strings, Version stamps etc.) +// that are commonly used by other UDDI subsystems +// + +#include + +BOOL APIENTRY DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +{ + return TRUE; +} + diff --git a/inetsrv/uddi/source/common/uddicommon.def b/inetsrv/uddi/source/common/uddicommon.def new file mode 100644 index 0000000..4b1f2c3 --- /dev/null +++ b/inetsrv/uddi/source/common/uddicommon.def @@ -0,0 +1,2 @@ +EXPORTS + DllMain \ No newline at end of file diff --git a/inetsrv/uddi/source/common/uddicommon.rc b/inetsrv/uddi/source/common/uddicommon.rc new file mode 100644 index 0000000..e5f08de --- /dev/null +++ b/inetsrv/uddi/source/common/uddicommon.rc @@ -0,0 +1,72 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include ""uddievents.rc""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "uddievents.rc" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + + +#include +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "UDDI Common Library" +#define VER_INTERNALNAME_STR "uddicommon.dll" +#define VER_ORIGINALFILENAME_STR "uddicommon.dll " +#include "common.ver" + diff --git a/inetsrv/uddi/source/common/uddievents.mc b/inetsrv/uddi/source/common/uddievents.mc new file mode 100644 index 0000000..fbf2de6 --- /dev/null +++ b/inetsrv/uddi/source/common/uddievents.mc @@ -0,0 +1,983 @@ +;-------------------------------------------------------------------- +; +; Event categories and message placeholders for UDDI. +; If you change this file, run buildeventdll.cmd to rebuild the dll. +; +;-------------------------------------------------------------------- + +; +; Category Strings +; +MessageId=0 +Severity=Success +SymbolicName=CATEGORY_NONE +Language=English +None +. +MessageId=+1 +Severity=Success +SymbolicName=CATEGORY_CONFIG +Language=English +Config +. +MessageId=+1 +Severity=Success +SymbolicName=CATEGORY_SOAP +Language=English +Soap +. +MessageId=+1 +Severity=Success +SymbolicName=CATEGORY_DATA +Language=English +Data +. +MessageId=+1 +Severity=Success +SymbolicName=CATEGORY_AUTHORIZATION +Language=English +Authorization +. +MessageId=+1 +Severity=Success +SymbolicName=CATEGORY_WEBSITE +Language=English +Website +. +MessageId=+1 +Severity=Success +SymbolicName=CATEGORY_REPLICATION +Language=English +Replication +. + +;------------------------------------------------ +; Start of Event Messages +; +; There are approx 200 entries, number from 100 to 300 +; +; +MessageId=100 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. +MessageId=+1 +Language=English +%1 +. diff --git a/inetsrv/uddi/source/core/application.cs b/inetsrv/uddi/source/core/application.cs new file mode 100644 index 0000000..7007640 --- /dev/null +++ b/inetsrv/uddi/source/core/application.cs @@ -0,0 +1,81 @@ +using System; +using UDDI.Diagnostics; + +namespace UDDI +{ + /// ******************************************************************** + /// public class Application + /// -------------------------------------------------------------------- + /// + /// + /// + /// ******************************************************************** + /// + public class Application + { + private static Application application; + + private Config config; + private Debug debug; + + /// **************************************************************** + /// private Application [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private Application() + { + config = new Config(); + debug = new Debug(); + } + + /// **************************************************************** + /// public Current [static] + /// ---------------------------------------------------------------- + /// + /// Returns the current Application instance. + /// + /// **************************************************************** + /// + public static Application Current + { + get + { + if( null == application ) + application = new Application(); + + return application; + } + } + + /// **************************************************************** + /// public Config [static] + /// ---------------------------------------------------------------- + /// + /// Returns the Config instance associated with the global + /// Application instance. + /// + /// **************************************************************** + /// + public static Config Config + { + get { return Current.config; } + } + + /// **************************************************************** + /// public Debug [static] + /// ---------------------------------------------------------------- + /// + /// Returns the Debug instance associated with the global + /// Application instance. + /// + /// **************************************************************** + /// + public static Debug Debug + { + get { return Current.debug; } + } + } +} diff --git a/inetsrv/uddi/source/core/assemblyinfo.cs b/inetsrv/uddi/source/core/assemblyinfo.cs new file mode 100644 index 0000000..e312f45 --- /dev/null +++ b/inetsrv/uddi/source/core/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("uddi.core.dll")] +[assembly: AssemblyDescription("Common Server DLL for UDDI Services")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/inetsrv/uddi/source/core/assemblyversioninfo.cs b/inetsrv/uddi/source/core/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/core/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/core/build.log b/inetsrv/uddi/source/core/build.log new file mode 100644 index 0000000..4d2526c --- /dev/null +++ b/inetsrv/uddi/source/core/build.log @@ -0,0 +1,26 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\core directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\core directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\core +Elapsed time [0:00:00.015] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.core D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.core not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\core directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.core D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.core not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.core.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.xml.dll,system.directoryservices.dll application.cs assemblyinfo.cs config.cs context.cs core.cs debug.cs localization.cs performance.cs schemacollection.cs sql.cs win32.cs uddiadconn.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\core\obj\i386\uddi.core.dll +1>binplace D:\OpenXP\inetsrv\uddi\source\core\obj\i386\uddi.core.dll +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:04.109] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/core/config.cs b/inetsrv/uddi/source/core/config.cs new file mode 100644 index 0000000..5c47288 --- /dev/null +++ b/inetsrv/uddi/source/core/config.cs @@ -0,0 +1,1590 @@ +using System; +using System.Collections; +using System.Data; +using System.Data.SqlClient; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Security.Principal; +using System.Threading; +using Microsoft.Win32; + +namespace UDDI +{ + /// **************************************************************** + /// public class Config + /// ---------------------------------------------------------------- + /// + /// Manages configuration settings for UDDI. + /// + /// ---------------------------------------------------------------- + /// + /// The configuration table is of very high importance, so if + /// we fail to retrieve the configuration settings we'll mark + /// the table as being invalid by setting it to NULL. Any + /// attempt to retrieve a setting while the table is in this + /// invalid state will result in an exception. + /// + /// **************************************************************** + /// + + // + // TODO: Get and Set static methods should check the IsValid property through a + // common piece of code method. This would avoid a significant + // amount of code bload in the try/catch blocks. + // + public class Config + { + private const string registryRoot = @"SOFTWARE\Microsoft\UDDI"; + + private static Hashtable settings = null; + private static ReaderWriterLock readWriteLock = new ReaderWriterLock(); + + private static Thread monitor = null; + private static WindowsIdentity identity = null; + public static Exception LastError = null; + + public delegate void ConfigChangeHandler(); + public static event ConfigChangeHandler ConfigChange; + + /// **************************************************************** + /// private Config + /// ---------------------------------------------------------------- + /// + /// Constructor. + /// + /// **************************************************************** + /// + static Config() + { + // + // 730294 - Never throw exceptions out of this static initializer + // + try + { + System.Diagnostics.Debug.Write( "INFO CONF Configuration manager starting (thread=" + + Thread.CurrentThread.GetHashCode().ToString() + + ", user='" + WindowsIdentity.GetCurrent().Name + "')\r\n" ); + // + // Initialize the settings collection. + // + Refresh(); + + // + // Verify that the version of the database that we are using is compatible. + // + string versionRegKeyName = "Setup.WebServer.DBSchemaVersion"; + + // + // This key will not exist if only the DB was installed on this machine. In that case, + // default to the DbServer.DBSchemaVersion setting. + // + if( false == Config.SettingExists( versionRegKeyName ) ) + { + versionRegKeyName = "Setup.DbServer.DBSchemaVersion"; + } + + UDDI.Diagnostics.Debug.VerifySetting( versionRegKeyName ); + UDDI.Diagnostics.Debug.VerifySetting( "Database.Version" ); + + Version webServerVersion = new Version( Config.GetString( versionRegKeyName ) ); + Version dataBaseVersion = new Version( Config.GetString( "Database.Version" ) ); + + // + // The major and minor versions must be equal. + // + if( ( dataBaseVersion.Major != webServerVersion.Major ) || + ( dataBaseVersion.Minor != webServerVersion.Minor ) ) + { + UDDIText errorMessage = new UDDIText( "UDDI_ERROR_SCHEMA_MISMATCH", webServerVersion.ToString(), dataBaseVersion.ToString() ); + + throw new UDDIException( ErrorType.E_fatalError, errorMessage ); + } + + // + // Install the registry change notification event handler. By + // marking this thread as a background thread, the runtime will + // automatically terminate it when all foreground threads have + // finished processing. This eliminates the need for a separate + // shutdown mechanism. + // + identity = WindowsIdentity.GetCurrent(); + + monitor = new Thread( new ThreadStart( Registry_OnChange ) ); + + monitor.IsBackground = true; + monitor.Start(); + } + catch( UDDIException uddiException ) + { + // + // Something has thrown a UDDIException; in this case, just make this exception the last error. + // + LastError = uddiException; + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigError, uddiException.Message ); + + // + // If any exception occurs, invalidate ourselves. + // + InvalidateSelf(); + } + catch( Exception ) + { + // + // Something has thrown a generic Exception; in this case, just create a generic UDDIException, and make + // that the last error. + // + UDDIText errorMessage = new UDDIText( "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + LastError = new UDDIException( ErrorType.E_fatalError, errorMessage ); + + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, errorMessage.GetText() ); + + // + // If any exception occurs, invalidate ourselves. + // + InvalidateSelf(); + } + } + + /// **************************************************************** + /// public CheckForUpdate [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public static void CheckForUpdate() + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + SqlConnection conn = new SqlConnection( Config.GetString( "Database.WriterConnectionString" ) ); + SqlCommand cmd = new SqlCommand( "net_config_getLastChangeDate", conn ); + conn.Open(); + + try + { + cmd.CommandType = CommandType.StoredProcedure; + + string lastChange = (string)cmd.ExecuteScalar(); + string lastRefresh = Config.GetString( "LastChange", "Jan 01 0001 12:00AM" ); + + // + // Compare the database last change configuration with our latest + // config. If it differs, the database has changed and we need + // to refresh. Use the minimum SQL date value if the config value + // isn't available. + // + if( 0 != String.Compare( lastChange, lastRefresh ) ) + Config.Refresh(); + } + finally + { + conn.Close(); + } + } + + /// **************************************************************** + /// public IsValid [static] + /// ---------------------------------------------------------------- + /// + /// Returns true if the config table is valid (i.e. has been + /// properly initialized). + /// + /// ---------------------------------------------------------------- + /// + /// True if the table is valid, false otherwise. + /// + /// **************************************************************** + /// + public static bool IsValid + { + get + { + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + try + { + return ( null != settings ); + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + } + + /// **************************************************************** + /// private OperatorMessage [static] + /// ---------------------------------------------------------------- + /// + /// Writes a message to the event log. + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// ---------------------------------------------------------------- + /// + /// This is a safe version of the Debug.WriteEventLog method + /// that prevents re-entrancy issues with the config. + /// + /// **************************************************************** + /// + private static void OperatorMessage( UDDI.Diagnostics.OperatorMessageType messageType, string message ) + { + try + { + EventLog.WriteEntry( + "UDDIRuntime", + message, + EventLogEntryType.Error, + (int)messageType, + (int)UDDI.Diagnostics.CategoryType.Config ); + } + catch( Exception ) + { + Debug.Write( + "ERRO CONF Error writing message to event log.\r\n\r\n" + + "Message:\r\n" + message ); + } + } + + /// **************************************************************** + /// private AddSetting [static] + /// ---------------------------------------------------------------- + /// + /// Adds a configuration setting. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// + /// + /// The configuration setting data. + /// + /// ---------------------------------------------------------------- + /// + /// This function assumes that the writer lock has already been + /// obtained. + /// + /// **************************************************************** + /// + private static void AddSetting( string key, object data ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + if( true == settings.ContainsKey( key ) ) + { + Debug.Write( "INFO CONF Updating setting '" + key + "' value '" + data.ToString() + "'\r\n" ); + settings[ key ] = data; + } + else + { + Debug.Write( "INFO CONF Adding setting '" + key + "' value '" + data.ToString() + "'\r\n" ); + settings.Add( key, data ); + } + } + + /// **************************************************************** + /// private SetString [static] + /// ---------------------------------------------------------------- + /// + /// Adds a configuration setting to the database configuration table. + /// + /// ---------------------------------------------------------------- + /// + /// The configuration setting name. + /// + /// + /// + /// The value to store in the configuration. + /// + /// ---------------------------------------------------------------- + /// + /// This function does not update the in memory cache. + /// + /// **************************************************************** + /// + public static void SetString( string name, string value ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + // + // Connect to the database and get the configuration settings. + // + SqlConnection conn = new SqlConnection( Config.GetString( "Database.WriterConnectionString" ) ); + SqlCommand cmd = new SqlCommand( "net_config_save", conn ); + + conn.Open(); + + try + { + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.Add( new SqlParameter( "@configName", SqlDbType.NVarChar, UDDI.Constants.Lengths.ConfigName ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@configValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.ConfigValue ) ).Direction = ParameterDirection.Input; + + cmd.Parameters[ "@configName" ].Value = name; + cmd.Parameters[ "@configValue" ].Value = value; + cmd.ExecuteNonQuery(); + } + finally + { + conn.Close(); + } + } + + public static int GetCount() + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + int n = 0; + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + try + { + n = settings.Count; + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + + return n; + } + + /// **************************************************************** + /// private CopyTo [static] + /// ---------------------------------------------------------------- + /// + /// Adds a configuration setting. + /// + /// ---------------------------------------------------------------- + /// + /// The array to copy the stuff into. + /// + /// + /// + /// The location in the array to start copying the stuff into. + /// + /// ---------------------------------------------------------------- + /// + /// This function assumes that the writer lock has already been + /// obtained. + /// + /// **************************************************************** + /// + public static void CopyTo( Array array, int arrayIndex ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + try + { + settings.CopyTo( array, arrayIndex ); + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + + /// **************************************************************** + /// public GetObject [static] + /// ---------------------------------------------------------------- + /// + /// Retrieves the setting with the given key. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// ---------------------------------------------------------------- + /// + /// The value of the key, if it exists. An exception is raised + /// if it does not. + /// + /// **************************************************************** + /// + public static object GetObject( string key ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + object setting = null; + + try + { + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + setting = settings[ key ]; + } + catch( NullReferenceException ) + { + // + // Null reference exceptions are generated when the settings + // table could not be read. + // +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, + "Configuration table is in an invalid state.\r\n\r\n" + LastError.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE", LastError.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, operatorMessage.GetText() ); +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Server configuration error.\r\n\r\n" + LastError.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + finally + { + // + // Release the reader lock. + // + readWriteLock.ReleaseReaderLock(); + } + + return setting; + } + + /// **************************************************************** + /// public GetObject [static] + /// ---------------------------------------------------------------- + /// + /// Retrieves the setting with the given key. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// + /// + /// Default value to use if the key does not exist. + /// + /// ---------------------------------------------------------------- + /// + /// The value of the key, if it exists, or the specified default + /// value if it does not. + /// + /// **************************************************************** + /// + public static object GetObject( string key, object defaultValue ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + object setting = defaultValue; + + try + { + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + if( settings.ContainsKey( key ) ) + setting = settings[ key ]; + } + catch( NullReferenceException ) + { + // + // Null reference exceptions are generated when the settings + // table could not be read. + // +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, + "Configuration table is in an invalid state.\r\n\r\n" + LastError.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE", LastError.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, operatorMessage.GetText() ); + +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Server configuration error.\r\n\r\n" + LastError.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + finally + { + // + // Release the reader lock. + // + readWriteLock.ReleaseReaderLock(); + } + + return setting; + } + + /// **************************************************************** + /// public GetInt [static] + /// ---------------------------------------------------------------- + /// + /// Retrieves the setting with the given key. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// ---------------------------------------------------------------- + /// + /// The value of the key, if it exists. An exception is raised + /// if it does not. + /// + /// **************************************************************** + /// + public static string GetString( string key ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + string setting = null; + + try + { + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + object data = settings[ key ]; + + if( data is System.String ) + setting = (string)data; + else + setting = Convert.ToString( data ); + } + catch( NullReferenceException ) + { + // + // Null reference exceptions are generated when the settings + // table could not be read. + // +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, + "Configuration table is in an invalid state.\r\n\r\n" + LastError.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE", LastError.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, operatorMessage.GetText() ); +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Server configuration error.\r\n\r\n" + LastError.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + finally + { + // + // Release the reader lock. + // + readWriteLock.ReleaseReaderLock(); + } + + return setting; + } + + /// **************************************************************** + /// public GetString [static] + /// ---------------------------------------------------------------- + /// + /// Retrieves the setting with the given key. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// + /// + /// Default value to use if the key does not exist. + /// + /// ---------------------------------------------------------------- + /// + /// The value of the key, if it exists. Otherwise returns the + /// default value. + /// + /// **************************************************************** + /// + public static string GetString( string key, string defaultValue ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + string setting = defaultValue; + + try + { + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + if( settings.ContainsKey( key ) ) + { + object data = settings[ key ]; + + if( data is System.String ) + setting = (string)data; + else + setting = Convert.ToString( data ); + } + } + catch( NullReferenceException ) + { + // + // Null reference exceptions are generated when the settings + // table could not be read. + // +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, + "Configuration table is in an invalid state.\r\n\r\n" + LastError.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE", LastError.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, operatorMessage.GetText() ); + +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Server configuration error.\r\n\r\n" + LastError.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + finally + { + // + // Release the reader lock. + // + readWriteLock.ReleaseReaderLock(); + } + + return setting; + } + + /// **************************************************************** + /// public GetInt [static] + /// ---------------------------------------------------------------- + /// + /// Retrieves the setting with the given key. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// ---------------------------------------------------------------- + /// + /// The value of the key. + /// + /// **************************************************************** + /// + public static int GetInt( string key ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + int setting = 0; + + try + { + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + object data = settings[ key ]; + + if( data is System.Int32 ) + setting = (int)data; + else + setting = Convert.ToInt32( data ); + } + catch( NullReferenceException ) + { + // + // Null reference exceptions are generated when the settings + // table could not be read. + // +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, + "Configuration table is in an invalid state.\r\n\r\n" + LastError.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE", LastError.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, operatorMessage.GetText() ); +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Server configuration error.\r\n\r\n" + LastError.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + finally + { + // + // Release the reader lock. + // + readWriteLock.ReleaseReaderLock(); + } + + return setting; + } + + /// **************************************************************** + /// public GetInt [static] + /// ---------------------------------------------------------------- + /// + /// Retrieves the setting with the given key. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// + /// + /// Default value to use if the key does not exist. + /// + /// ---------------------------------------------------------------- + /// + /// The value of the key, if it exists. Otherwise returns the + /// default value. + /// + /// **************************************************************** + /// + public static int GetInt( string key, int defaultValue ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + int setting = defaultValue; + + try + { + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + if( settings.ContainsKey( key ) ) + { + object data = settings[ key ]; + + if( data is System.Int32 ) + setting = (int)data; + else + setting = Convert.ToInt32( data ); + } + } + catch( NullReferenceException ) + { + // + // Null reference exceptions are generated when the settings + // table could not be read. + // +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, + "Configuration table is in an invalid state.\r\n\r\n" + LastError.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE", LastError.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, operatorMessage.GetText() ); +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Server configuration error.\r\n\r\n" + LastError.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + finally + { + // + // Release the reader lock. + // + readWriteLock.ReleaseReaderLock(); + } + + return setting; + } + + /// **************************************************************** + /// public SettingExists [static] + /// ---------------------------------------------------------------- + /// + /// Determines whether the given setting exists in the + /// collection. + /// + /// ---------------------------------------------------------------- + /// + /// The setting key. + /// + /// ---------------------------------------------------------------- + /// + /// Returns true if the setting exists. + /// + /// **************************************************************** + /// + public static bool SettingExists( string key ) + { + // + // Throw an exception if we are not in a valid state. + // + CheckIsValid(); + + bool exists = false; + + try + { + // + // Acquire the reader lock and read the setting. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + exists = settings.ContainsKey( key ); + } + catch( NullReferenceException ) + { + // + // Null reference exceptions are generated when the settings + // table could not be read. + // +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, + "Configuration table is in an invalid state.\r\n\r\n" + LastError.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE", LastError.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.ConfigInvalid, operatorMessage.GetText() ); + +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Server configuration error.\r\n\r\n" + LastError.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + finally + { + // + // Release the reader lock. + // + readWriteLock.ReleaseReaderLock(); + } + + return exists; + } + + /// **************************************************************** + /// public Refresh [static] + /// ---------------------------------------------------------------- + /// + /// Refreshes setting information. + /// + /// **************************************************************** + /// + public static void Refresh() + { + try + { + Debug.Write( + "INFO CONF Refreshing configuration settings (thread=" + + Thread.CurrentThread.GetHashCode().ToString() + + ", user='" + WindowsIdentity.GetCurrent().Name + "')\r\n" ); + + // + // Obtain the writer lock. + // + readWriteLock.AcquireWriterLock( Timeout.Infinite ); + + // + // Clear the existing setting table. + // + settings = new Hashtable( CaseInsensitiveHashCodeProvider.Default, + CaseInsensitiveComparer.Default ); + + // + // Attempt to get the database connection string. + // + RegistryKey databaseKey = Registry.LocalMachine.OpenSubKey( registryRoot + @"\Database" ); + + string writerConnectionString = null; + + if( null != databaseKey ) + { + try + { + writerConnectionString = (string)databaseKey.GetValue( "WriterConnectionString" ); + } + catch( Exception ) + { + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_DB_WRITER_CONNECTION_STRING" ); + } + } + + // + // 730294 - The MMC will set this value to "", so use StringEmtpy, not just check for null. + // + if( true == Utility.StringEmpty( writerConnectionString ) ) + { + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_DB_WRITER_CONNECTION_STRING" ); + } + + // + // Connect to the database and get the configuration settings. + // + SqlConnection conn = new SqlConnection( writerConnectionString ); + SqlCommand cmd = new SqlCommand( "net_config_get", conn ); + + conn.Open(); + + try + { + cmd.CommandType = CommandType.StoredProcedure; + + SqlDataReader reader = cmd.ExecuteReader(); + + while( reader.Read() ) + { + // + // We'll treat all database settings as strings, except for those + // with special prefixes. + // + string keyName = reader.GetString( 0 ); + string keyPrefix = ""; + + int separator = keyName.IndexOf( "." ); + if( -1 != separator ) + keyPrefix = keyName.Substring( 0, separator ); + + if( "Length" == keyPrefix ) + { + AddSetting( keyName, Convert.ToInt32( reader.GetString( 1 ) ) ); + } + else + { + AddSetting( keyName, reader.GetString( 1 ) ); + } + } + } + finally + { + conn.Close(); + } + + // + // Read configuration data from the registry. + // + RegistryKey root = Registry.LocalMachine.OpenSubKey( registryRoot ); + + if( null != root ) + RefreshRegistrySettings( root, "", true ); + } + catch( SqlException e ) + { + LastError = e; + + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_ERROR_READING_CONFIG_SETTINGS", e.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, operatorMessage.GetText() ); + + // + // Mark the table as being invalid. + // + settings = null; + } + catch( Exception e ) + { + LastError = e; + + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_ERROR_READING_CONFIG_SETTINGS", e.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, operatorMessage.GetText() ); + + // + // Mark the table as being invalid. + // + settings = null; + } + finally + { + // + // Release the writer lock. + // + readWriteLock.ReleaseWriterLock(); + + if( null != ConfigChange ) + { + try + { + ConfigChange(); + } + catch( Exception ) + { + } + } + } + } + + /// **************************************************************** + /// private RefreshRegistrySettings [static] + /// ---------------------------------------------------------------- + /// + /// Refreshes configuration settings from the registry, + /// starting at the specified root. + /// + /// ---------------------------------------------------------------- + /// + /// Registry key that contains the settings. + /// + /// + /// + /// Optional. Prefix to add to the beginning of setting names + /// in the collection. + /// + /// + /// + /// True if subkeys of the root should be searched. + /// + /// ---------------------------------------------------------------- + /// + /// If recursion is enabled, values in subkeys of the root are + /// also enumerated. When enumerating subkeys, the value names + /// are prefixed with the name of the subkey. + /// + /// **************************************************************** + /// + private static void RefreshRegistrySettings( RegistryKey root, string prefix, bool recurse ) + { + // + // Add the values in the given root. + // + foreach( string name in root.GetValueNames() ) + AddSetting( prefix + name, root.GetValue( name ) ); + + // + // If recursion is enabled, search through the subkeys under the given root. The + // key will be prefixed with the subkey name. + // + if( true == recurse ) + { + foreach( string name in root.GetSubKeyNames() ) + RefreshRegistrySettings( root.OpenSubKey( name ), prefix + name + ".", true ); + } + } + + /// **************************************************************** + /// private Registry_OnChange [static] + /// ---------------------------------------------------------------- + /// + /// Event handler for setting change events in the registry. + /// + /// **************************************************************** + /// + private static void Registry_OnChange() + { + // + // Impersonate the identity of the main thread. + // + if( WindowsIdentity.GetCurrent().Name != identity.Name ) + { + try + { + identity.Impersonate(); + + } + catch( Exception e ) + { +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, + "Configuration refresh thread was unable take on the identity " + + "of the creating thread (thread=" + Thread.CurrentThread.GetHashCode().ToString() + + ").\r\n\r\nDetails:\r\n" + e.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_CANNOT_IMPERSONATE", Thread.CurrentThread.GetHashCode().ToString(), e.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, operatorMessage.GetText() ); + + return; + } + } + + Debug.Write( + "INFO CONF Configuration registry change handler starting (thread=" + + Thread.CurrentThread.GetHashCode().ToString() + + ", user='" + WindowsIdentity.GetCurrent().Name + "')\r\n" ); + + // + // Obtain a handle to the registry key we want to monitor. + // + uint hkey; + + int hr = Win32.RegOpenKeyEx( Win32.HKEY_LOCAL_MACHINE, registryRoot, 0, Win32.KEY_READ, out hkey ); + + if( 0 != hr ) + { +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, + "Unable to access registry root '" + registryRoot + "'" ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_UNABLE_TO_ACCESS_REGISTRY", registryRoot ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, operatorMessage.GetText() ); + } + + // + // Monitor changes to the registry key. + // + AutoResetEvent changeEvent = new AutoResetEvent( false ); + + while( true ) + { + // + // Wait for a change notification event. + // + Win32.RegNotifyChangeKeyValue( hkey, true, + Win32.REG_NOTIFY_CHANGE_LAST_SET, (uint)changeEvent.Handle.ToInt32(), true ); + + changeEvent.WaitOne(); + + // + // Refresh the settings. We trap all errors since we never + // want to kill the refresh thread, otherwise who would read + // the settings when they finally become available? + // + try + { + Refresh(); + } + catch( Exception e ) + { +#if never + OperatorMessage( + UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, + "Unable to refresh configuration settings from registry monitor thread.\r\n\r\nDetails:\r\n" + e.ToString() ); +#endif + UDDIText operatorMessage = new UDDIText( "UDDI_ERROR_OPERATOR_MESSAGE_UNABLE_TO_REFRESH", e.ToString() ); + OperatorMessage( UDDI.Diagnostics.OperatorMessageType.CannotReadSettings, operatorMessage.GetText() ); + } + } + } + + // + // 730294 - Centralize what exceptions we throw. + // + private static void CheckIsValid() + { + if( !IsValid ) + { + // + // Make sure we are always throwing a nice UDDIException; construct a generic one if you have to. + // + UDDIException uddiException = LastError as UDDIException; + if( null == uddiException ) + { + uddiException = new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_COMMUNICATION_ERROR" ); + } + + throw uddiException; + } + } + + // + // 730294 - Clean up the way we do exceptions. + // + private static void InvalidateSelf() + { + // + // Make ourself invalid by nulling out the setting table. Make sure to keep this in sync with + // what the IsValid property is doing. + // + try + { + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + settings = null; + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + } + + /// ******************************************************************** + /// public class CachedSetting + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class CachedSetting + { + private ReaderWriterLock readWriteLock = new ReaderWriterLock(); + + // + // 730294 - Keep the state of a CachedSetting in sync with the Config by just using the Config.IsValid property instead + // of keeping a valid member. Remove the valid member. + // + + private string key; + private object setting; + private object defaultValue; + private bool exists; + private bool defaultSpecified; + + public event Config.ConfigChangeHandler ConfigChange; + + /// **************************************************************** + /// public CachedSetting [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public CachedSetting( string key ) + { + this.key = key; + this.defaultSpecified = false; + this.defaultValue = null; + + Config_OnChange(); + Config.ConfigChange += new Config.ConfigChangeHandler( Config_OnChange ); + } + + /// **************************************************************** + /// public CachedSetting [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// + /// + /// + /// + /// **************************************************************** + /// + public CachedSetting( string key, object defaultValue ) + { + this.key = key; + this.defaultSpecified = true; + this.defaultValue = defaultValue; + + Config_OnChange(); + Config.ConfigChange += new Config.ConfigChangeHandler( Config_OnChange ); + } + + /// **************************************************************** + /// private Config_OnChange [event handler] + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// We don't have to worry about acquiring a reader lock in + /// this method because the configuration update only executes + /// on a single background thread. + /// + /// **************************************************************** + /// + private void Config_OnChange() + { + // + // Make sure the config is valid. If not, just return. + // + if( !Config.IsValid ) + { + return; + } + + object setting = null; + + // + // Retrieve the new setting. + // + bool exists = Config.SettingExists( key ); + + if( exists ) + setting = Config.GetObject( key ); + + // + // Check to see if we need to do anything. First of all, if the + // existance of the setting has changed, we need to update that + // information. If that has not changed, then the only other way + // we do not have to update is if the setting itself hasn't + // changed. + // + + if( exists == this.exists && + null != setting && setting.Equals( this.setting ) ) + return; + + // + // Store the new setting details. + // + System.Diagnostics.Debug.Write( + "INFO CONF Refreshing cached setting '" + key + "' (thread=" + + Thread.CurrentThread.GetHashCode().ToString() + + ", user='" + WindowsIdentity.GetCurrent().Name + "')\r\n" ); + + readWriteLock.AcquireWriterLock( Timeout.Infinite ); + + try + { + this.exists = exists; + this.setting = setting; + } + finally + { + readWriteLock.ReleaseWriterLock(); + + if( null != ConfigChange ) + ConfigChange(); + } + } + + /// **************************************************************** + /// public Exists + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public bool Exists + { + get + { + // + // Don't call CheckSetting() here because we don't want to throw an exception if the setting + // does not exist. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + try + { + // + // Make sure that our configuration is still valid. + // + CheckIsConfigValid(); + + return exists; + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + } + + /// **************************************************************** + /// public HasDefaultValue + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public bool HasDefaultValue + { + get { return defaultSpecified; } + } + + /// **************************************************************** + /// public DefaultValue + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public object DefaultValue + { + get { return defaultValue; } + } + + /// **************************************************************** + /// public GetString + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public string GetString() + { + // + // 730294 - Centralize checking of setting state and validity. + // + CheckSetting(); + + // + // Return the setting as a string. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + try + { + if( exists ) + return Convert.ToString( setting ); + else + return Convert.ToString( defaultValue ); + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + + /// **************************************************************** + /// public GetInt + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public int GetInt() + { + // + // 730294 - Centralize checking of setting state and validity. + // + CheckSetting(); + + // + // Return the setting as an integer. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + try + { + if( exists ) + return Convert.ToInt32( setting ); + else + return Convert.ToInt32( defaultValue ); + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + + /// **************************************************************** + /// public GetObject + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public object GetObject() + { + // + // 730294 - Centralize checking of setting state and validity. + // + CheckSetting(); + + // + // Return the setting as an object. + // + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + try + { + if( exists ) + return setting; + else + return defaultValue; + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + + // + // 730294 - Keep the state of a CachedSetting in sync with the Config by just using the Config.IsValid property instead + // of keeping a valid member. + // + private void CheckSetting() + { + // + // First, make sure that we still exist. + // + if( !exists && !defaultSpecified ) + { + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_CONFIG_SETTING_MISSING", key ); + } + + // + // Make sure that our configuration is still valid. + // + CheckIsConfigValid(); + } + + private void CheckIsConfigValid() + { + if( false == Config.IsValid ) + { + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_SERVER_CONFIGURATION_ERROR", Config.LastError.Message ); + } + } + + public void AcquireReaderLock( int millisecondsTimeout ) + { + readWriteLock.AcquireReaderLock( millisecondsTimeout ); + } + + public void AcquireReaderLock( TimeSpan timeout ) + { + readWriteLock.AcquireReaderLock( timeout ); + } + + public void ReleaseReaderLock() + { + readWriteLock.ReleaseReaderLock(); + } + } +} diff --git a/inetsrv/uddi/source/core/context.cs b/inetsrv/uddi/source/core/context.cs new file mode 100644 index 0000000..3c2309c --- /dev/null +++ b/inetsrv/uddi/source/core/context.cs @@ -0,0 +1,864 @@ +using System; +using System.Data; +using System.IO; +using System.Security.Principal; +using System.Text; +using System.Web; +using System.Xml.Serialization; +using System.Runtime.InteropServices; +using UDDI.Diagnostics; + +namespace UDDI +{ + public enum AuthenticationMode : int + { + None = 0, + Uddi = 1, + Windows = 2, + AuthenticatedRead = 4, + Passport = 8, + Both = Uddi | Windows, + WindowsWithAuthenticatedRead = Windows | AuthenticatedRead + } + + /// ******************************************************************** + /// public enum ContextType + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public enum ContextType + { + Other = 0, + SOAP = 1, + UserInterface = 2, + Replication = 3 + } + + // + // Used in replication to determine where the exception came from + // + public enum ExceptionSource + { + Other = 0, + BrokenServiceProjection = 1, + PublisherAssertion = 2 + } + + /// ******************************************************************** + /// public enum RoleType + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public enum RoleType + { + Anonymous = 0, + User = 1, + Publisher = 2, + Coordinator = 3, + Administrator = 4 + } + + /// ******************************************************************** + /// public class Context + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class Context + { + [ThreadStatic] + private static Context context = null; + + private ContextType contextType; + private ExceptionSource exceptionSource; + + internal UserInfo userInfo; + private Guid contextID; + private int threadID; + private int apiVersionMajor; + private bool logChangeRecords = false; + private DateTime timeStamp; + private string remoteOperator = null; + + /// **************************************************************** + /// private Context [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private Context() + { + // + // SECURITY: These member variables are not initialized during construction + // + // apiVersionMajor + // contextType + // + + // + // Verify that the operating system is supported. + // + Win32.OsVersionInfoEx osVersion = new Win32.OsVersionInfoEx(); + + if( !Win32.GetVersionEx( osVersion ) ) + { +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Could not retrieve operating system version." ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_COULD_NOT_RETRIEVE_OPERATING_SYSTEM_VERSION" ); + } + + if( ( Win32.ProductType.WindowsServer != osVersion.ProductType + && Win32.ProductType.DomainController != osVersion.ProductType ) + || osVersion.MajorVersion < 5 + || ( 5 == osVersion.MajorVersion && osVersion.MinorVersion < 1 ) ) + { +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Microsoft UDDI Services is not supported on this platform." ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UNSUPPORTED_PLATFORM" ); + } + +#if never + contextID = Guid.NewGuid(); + threadID = System.Threading.Thread.CurrentThread.GetHashCode(); + timeStamp = DateTime.UtcNow; + userInfo = new UserInfo(); +#endif + } + + /// **************************************************************** + /// public Initialize + /// ---------------------------------------------------------------- + /// + /// Initialize per-request data for the context. This method + /// MUST be called once per request. Multiple calls will + /// re-initialize the contents of the current context. + /// + /// + /// **************************************************************** + public void Initialize() + { + // + // Reset our state. apiVersionMajor is not reset since it will be set in our VersionSupportExtension + // + contextType = ContextType.Other; + exceptionSource = ExceptionSource.Other; + userInfo = new UserInfo(); + contextID = Guid.NewGuid(); + threadID = System.Threading.Thread.CurrentThread.GetHashCode(); + + // + // 738148 - To reduce disk usage, make it configurable as to whether we log change records or not. + // + logChangeRecords = Config.GetInt( "LogChangeRecords", 0 ) == 0 ? false : true; + timeStamp = DateTime.UtcNow; + remoteOperator = null; + + // + // In our log, we should never ever see multiple calls to this method + // in the same application_request_started/application_request_ended blocks (see global.asax) + // In the event log, correct behaviour is: + // application_request started: + // "Context.Initialize" message + // ... (any number of messages) + // application_request ended + // + Debug.Write( SeverityType.Info, + CategoryType.Soap, + "Context.Initialize" ); + } + + /// **************************************************************** + /// public Current [static] + /// ---------------------------------------------------------------- + /// + /// Returns the current Context instance. This is either + /// the Context instance that is associated with the + /// current HttpContext, or the instance that is associated with + /// the thread. + /// + /// **************************************************************** + /// + public static Context Current + { + get + { + HttpContext httpContext = HttpContext.Current; + + if( null == httpContext ) + { + // + // There is no HttpContext, so we must be running within + // the context of an application. In such cases, we + // create a message context for each thread. + // + if( null == context ) + { + context = new Context(); + + // + // Since we are running in an application, we want to initialize each + // instance that we create. + // + context.Initialize(); + } + } + else + { + // + // Check to see if the we have seen this HttpContext + // before. If not, we create a new message context and + // mark the HttpContext. + // + if( null == httpContext.Items[ "UddiContext" ] || !( httpContext.Items[ "UddiContext" ] is Context ) ) + httpContext.Items.Add( "UddiContext", new Context() ); + + context = (Context)httpContext.Items[ "UddiContext" ]; + } + + return context; + } + } + + /// **************************************************************** + /// public LogChangeRecords [static] + /// ---------------------------------------------------------------- + /// + /// Specifies whether change records should be generated when + /// updating registry data. + /// + /// **************************************************************** + /// + public static bool LogChangeRecords + { + get { return Current.logChangeRecords; } + set + { + Debug.Verify( User.IsAdministrator, "UDDI_ERROR_FATALERROR_CONTEXT_SETLOGCHANGESNOTADMIN" ); + Current.logChangeRecords = value; + } + } + + /// **************************************************************** + /// public TimeStamp [static] + /// ---------------------------------------------------------------- + /// + /// Gets or sets the context timestamp. + /// + /// **************************************************************** + /// + + // + // TODO: Why not use a field for this instead of a property + // + public static DateTime TimeStamp + { + get { return Current.timeStamp; } + set { Current.timeStamp = value; } + } + + /// **************************************************************** + /// public RemoteOperator [static] + /// ---------------------------------------------------------------- + /// + /// Gets or sets the context remote operator. + /// + /// **************************************************************** + /// + + // + // TODO: Why not use a field for this instead of a property + // + public static string RemoteOperator + { + get { return Current.remoteOperator; } + set { Current.remoteOperator = value; } + } + + /// **************************************************************** + /// public User [static] + /// ---------------------------------------------------------------- + /// + /// Returns the UserInfo associated with the current + /// Context instance. + /// + /// **************************************************************** + /// + + // + // TODO: Why not use a field for this instead of a property + // + public static UserInfo User + { + get { return Current.userInfo; } + set { Current.userInfo = value; } + } + + /// **************************************************************** + /// public ContextID [static] + /// ---------------------------------------------------------------- + /// + /// Returns the ContextID associated with the current + /// Context instance. + /// + /// **************************************************************** + /// + public static Guid ContextID + { + get { return Current.contextID; } + } + + /// **************************************************************** + /// public ThreadID [static] + /// ---------------------------------------------------------------- + /// + /// Returns the ThreadID associated with the current + /// Context instance. + /// + /// **************************************************************** + /// + public static int ThreadID + { + get { return Current.threadID; } + } + + /// **************************************************************** + /// public ContextType [static] + /// ---------------------------------------------------------------- + /// + /// Gets/sets the ContextType associated with the current + /// Context instance. + /// + /// **************************************************************** + /// + + // + // TODO: Why not use a field for this instead of a property + // + public static UDDI.ContextType ContextType + { + get { return Current.contextType; } + set { Current.contextType = value; } + } + + public static UDDI.ExceptionSource ExceptionSource + { + get { return Current.exceptionSource; } + set { Current.exceptionSource = value; } + } + + /// **************************************************************** + /// public ApiVersionMajor [static] + /// ---------------------------------------------------------------- + /// + /// Returns the major version number of the request associated + /// with the current Context instance. + /// + /// **************************************************************** + /// + + // + // TODO: Why not use a field for this instead of a property + // + public static int ApiVersionMajor + { + get { return Current.apiVersionMajor; } + set { Current.apiVersionMajor = value; } + } + } + + /// ******************************************************************** + /// public class UserInfo + /// -------------------------------------------------------------------- + /// + /// Stores information about an authenticated publisher. + /// + /// ******************************************************************** + /// + + // + // SECURITY: Could probably use some SALT to fuzzy up the content + // of this class when serialized as a ticket/token + // + public class UserInfo + { + // + // pInvoke stuff to work with the SID strings + // + + [DllImport("ADVAPI32.DLL", EntryPoint="ConvertStringSidToSidW", + SetLastError=true, + CharSet=CharSet.Unicode, ExactSpelling=true, + CallingConvention=CallingConvention.StdCall)] + public static extern int ConvertStringSidToSid( string sidStr, out IntPtr psid ); + + [DllImport("ADVAPI32.DLL", EntryPoint="LookupAccountSidW", + SetLastError=true, + CharSet=CharSet.Unicode, ExactSpelling=true, + CallingConvention=CallingConvention.StdCall)] + public static extern int LookupAccountSid( string systemName, + IntPtr psid, + StringBuilder acctName, + out int cbAcctName, + StringBuilder domainName, + out int cbDomainName, + out int sidUse ); + + [XmlAttribute( "a" )] + public Guid guid = Guid.NewGuid(); + + [XmlElement( "created", DataType="dateTime" )] + public DateTime created = DateTime.Now; + + [XmlAttribute( "Role" )] + public RoleType Role = RoleType.Anonymous; + + [XmlAttribute( "ID" )] + public string ID = null; + + [XmlAttribute( "Language" )] + public string IsoLangCode = "en"; + + [XmlIgnore()] + public string ImpersonatorID = null; + [XmlIgnore()] + public string Name = null; + [XmlIgnore()] + public string Email = null; + [XmlIgnore()] + public string Phone = null; + [XmlIgnore()] + public string CompanyName = null; + [XmlIgnore()] + public string AltPhone = null; + [XmlIgnore()] + public string AddressLine1 = null; + [XmlIgnore()] + public string AddressLine2 = null; + [XmlIgnore()] + public string City = null; + [XmlIgnore()] + public string StateProvince = null; + [XmlIgnore()] + public string PostalCode = null; + [XmlIgnore()] + public string Country = null; + [XmlIgnore()] + public bool TrackPassport = true; + [XmlIgnore()] + public bool Verified = false; + [XmlIgnore()] + public int BusinessLimit = 0; + [XmlIgnore()] + public int BusinessCount = 0; + [XmlIgnore()] + public int TModelLimit = 0; + [XmlIgnore()] + public int TModelCount = 0; + [XmlIgnore()] + public int ServiceLimit = 0; + [XmlIgnore()] + public int BindingLimit = 0; + [XmlIgnore()] + public int AssertionLimit = 0; + [XmlIgnore()] + public int AssertionCount = 0; + [XmlIgnore()] + public bool AllowPreassignedKeys = false; + + + /// **************************************************************** + /// public IsInRole [static] + /// ---------------------------------------------------------------- + /// + /// Checks membership of the windows identity of the current + /// thread in a Windows Group. + /// + /// **************************************************************** + /// + public bool IsInRole( string strSID ) + { + WindowsPrincipal prin = new WindowsPrincipal( WindowsIdentity.GetCurrent() ); + + return IsInRole( strSID, prin ); + } + + + public bool IsInRole( string strSID, IPrincipal principal ) + { + return principal.IsInRole( GroupNameFromSid( strSID ) ); + } + + public string GroupNameFromSid( string strSid ) + { + IntPtr psid; + StringBuilder szstrSid = new StringBuilder( strSid ); + StringBuilder domainName = new StringBuilder( 1024 ); + StringBuilder acctName = new StringBuilder( 1024 ); + int cbDomainName = 1024; + int cbAcctName = 1024; + int sidUse = -1; + + int iRet = ConvertStringSidToSid( strSid, out psid ); + if( 0 == iRet ) + { + // throw new UDDIException( ErrorType.E_fatalError, "An attempt to convert a security id to a group name failed. ConvertStringSidToSid failed. " ); + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_SID_CONVERSION_FAILED" ); + } + + iRet = LookupAccountSid( null, psid, acctName, out cbAcctName, domainName, out cbDomainName, out sidUse ); + if( 0 == iRet ) + { + //throw new UDDIException( ErrorType.E_fatalError, "An attempt to convert a security id to a group name failed. An attempt to LookupAccountSid failed." ); + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_SID_LOOKUP_FAILED" ); + } + return domainName.ToString() + "\\" + acctName.ToString(); + } + + /// **************************************************************** + /// public IsUser + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public bool IsUser + { + get { return Role >= RoleType.User; } + } + + /// **************************************************************** + /// public IsPublisher + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public bool IsPublisher + { + get { return Role >= RoleType.Publisher; } + } + + /// **************************************************************** + /// public IsCoordinator + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public bool IsCoordinator + { + get { return Role >= RoleType.Coordinator; } + } + + /// **************************************************************** + /// public IsAdministrator + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public bool IsAdministrator + { + get { return Role >= RoleType.Administrator; } + } + + /// **************************************************************** + /// public IsImpersonated + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public bool IsImpersonated + { + get + { + return ( null != ImpersonatorID && ID != ImpersonatorID ); + } + } + + /// **************************************************************** + /// public Register [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Register() + { + Debug.Enter(); + + // + // If the Name has not been populated during authentication + // use the ID. This is needed to populate the authorizedName + // field. + // + if( null == Name || 0 == Name.Length ) + { + Name = ID; + } + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "UI_savePublisher" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@isoLangCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.IsoLangCode ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp.Parameters.Add( "@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email ); + sp.Parameters.Add( "@phone", SqlDbType.NVarChar, UDDI.Constants.Lengths.Phone ); + sp.Parameters.Add( "@companyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.CompanyName ); + sp.Parameters.Add( "@altphone", SqlDbType.NVarChar, UDDI.Constants.Lengths.Phone ); + sp.Parameters.Add( "@addressLine1", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine ); + sp.Parameters.Add( "@addressLine2", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine ); + sp.Parameters.Add( "@city", SqlDbType.NVarChar, UDDI.Constants.Lengths.City ); + sp.Parameters.Add( "@stateProvince", SqlDbType.NVarChar, UDDI.Constants.Lengths.StateProvince ); + sp.Parameters.Add( "@postalCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.PostalCode ); + sp.Parameters.Add( "@country", SqlDbType.NVarChar, UDDI.Constants.Lengths.Country ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + sp.Parameters.Add( "@tier", SqlDbType.NVarChar, UDDI.Constants.Lengths.Tier ); + + sp.Parameters.SetString( "@PUID", ID ); + sp.Parameters.SetString( "@isoLangCode", IsoLangCode ); + sp.Parameters.SetString( "@name", Name ); + sp.Parameters.SetString( "@email", Email ); + sp.Parameters.SetString( "@phone", Phone ); + sp.Parameters.SetString( "@companyName", CompanyName ); + sp.Parameters.SetString( "@altphone", AltPhone ); + sp.Parameters.SetString( "@addressLine1", AddressLine1 ); + sp.Parameters.SetString( "@addressLine2", AddressLine2 ); + sp.Parameters.SetString( "@city", City ); + sp.Parameters.SetString( "@stateProvince", StateProvince ); + sp.Parameters.SetString( "@postalCode", PostalCode ); + sp.Parameters.SetString( "@country", Country ); + sp.Parameters.SetString( "@tier", Config.GetString( "Publisher.DefaultTier", "2" ) ); + + int flag = 0; + + // + // TODO: Comments or an enumeration please + // + if( !TrackPassport ) + flag = flag | 0x02; + + if( Verified ) + flag = flag | 0x01; + + sp.Parameters.SetInt( "@flag", flag ); + sp.ExecuteNonQuery(); + + Debug.Leave(); + } + + /// **************************************************************** + /// public IsRegistered + /// ---------------------------------------------------------------- + /// + /// Determines whether the current user is registered as a + /// publisher. + /// + /// **************************************************************** + /// + public bool IsRegistered + { + get + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_isRegistered" ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@returnValue", SqlDbType.Int, ParameterDirection.ReturnValue ); + + sp.Parameters.SetString( "@PUID", ID ); + sp.ExecuteNonQuery(); + + int returnValue = sp.Parameters.GetInt( "@returnValue" ); + + Debug.Leave(); + + return ( 0 == returnValue ); + } + } + + /// **************************************************************** + /// public IsVerified + /// ---------------------------------------------------------------- + /// + /// Determines whether the current user is registered as a + /// publisher. + /// + /// **************************************************************** + /// + public bool IsVerified + { + get + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_isVerified" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@returnValue", SqlDbType.Int, ParameterDirection.ReturnValue ); + + sp.Parameters.SetString( "@PUID", ID ); + sp.ExecuteNonQuery(); + + int returnValue = sp.Parameters.GetInt( "@returnValue" ); + + Debug.Leave(); + + return ( 0 == returnValue ); + } + } + + /// **************************************************************** + /// public Login + /// ---------------------------------------------------------------- + /// + /// Logs the current user in. + /// + /// **************************************************************** + /// + public void Login() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_publisher_login" ); + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email, ParameterDirection.InputOutput ); + + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name, ParameterDirection.Output ); + sp.Parameters.Add( "@phone", SqlDbType.VarChar, UDDI.Constants.Lengths.Phone, ParameterDirection.Output ); + sp.Parameters.Add( "@companyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.CompanyName, ParameterDirection.Output ); + sp.Parameters.Add( "@altPhone", SqlDbType.VarChar, UDDI.Constants.Lengths.Phone, ParameterDirection.Output ); + sp.Parameters.Add( "@addressLine1", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine, ParameterDirection.Output ); + sp.Parameters.Add( "@addressLine2", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine, ParameterDirection.Output ); + sp.Parameters.Add( "@city", SqlDbType.NVarChar, UDDI.Constants.Lengths.City, ParameterDirection.Output ); + sp.Parameters.Add( "@stateProvince", SqlDbType.NVarChar, UDDI.Constants.Lengths.StateProvince, ParameterDirection.Output ); + sp.Parameters.Add( "@postalCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.PostalCode, ParameterDirection.Output ); + sp.Parameters.Add( "@country", SqlDbType.NVarChar, UDDI.Constants.Lengths.Country, ParameterDirection.Output ); + sp.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode, ParameterDirection.Output ); + sp.Parameters.Add( "@businessLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@businessCount", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@tModelLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@tModelCount", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@serviceLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@bindingLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@assertionLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@assertionCount", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetString( "@PUID", ID ); + sp.Parameters.SetString( "@email", Email ); + + sp.ExecuteNonQuery(); + + Email = sp.Parameters.GetString( "@email" ); + Name = sp.Parameters.GetString( "@name" ); + Phone = sp.Parameters.GetString( "@phone" ); + CompanyName = sp.Parameters.GetString( "@companyName" ); + AltPhone = sp.Parameters.GetString( "@altPhone" ); + AddressLine1 = sp.Parameters.GetString( "@addressLine1" ); + AddressLine2 = sp.Parameters.GetString( "@addressLine2" ); + City = sp.Parameters.GetString( "@city" ); + StateProvince = sp.Parameters.GetString( "@stateProvince" ); + PostalCode = sp.Parameters.GetString( "@postalCode" ); + Country = sp.Parameters.GetString( "@country" ); + IsoLangCode = sp.Parameters.GetString( "@isoLangCode" ); + + BusinessLimit = sp.Parameters.GetInt( "@businessLimit" ); + BusinessCount = sp.Parameters.GetInt( "@businessCount" ); + TModelLimit = sp.Parameters.GetInt( "@tModelLimit" ); + TModelCount = sp.Parameters.GetInt( "@tModelCount" ); + ServiceLimit = sp.Parameters.GetInt( "@serviceLimit" ); + BindingLimit = sp.Parameters.GetInt( "@bindingLimit" ); + AssertionLimit = sp.Parameters.GetInt( "@assertionLimit" ); + AssertionCount = sp.Parameters.GetInt( "@assertionCount" ); + + Debug.Leave(); + } + + public void Serialize( Stream stream ) + { + // + // Serialize it as XML into a stream + // + StreamWriter writer = new StreamWriter( stream, Encoding.UTF8 ); + + XmlSerializer serializer = new XmlSerializer( typeof( UserInfo ) ); + serializer.Serialize( writer, this ); + writer.Flush(); + + stream.Position = 0; + } + + public void CheckAge( int timeWindow ) + { + TimeSpan duration = DateTime.Now - created; + + Debug.Write( SeverityType.Info, + CategoryType.Authorization, + "Ticket is dated: " + created.ToLongDateString() + ", " + created.ToLongTimeString() ); + + if( duration.TotalMinutes > timeWindow ) + { +#if never + throw new UDDIException( UDDI.ErrorType.E_authTokenExpired, + "The submitted credentials have expired." ); +#endif + throw new UDDIException( UDDI.ErrorType.E_authTokenExpired, "UDDI_ERROR_CREDENTIALS_EXPIRED" ); + } + } + + public void SetPublisherRole( string userID ) + { + Role = RoleType.Publisher; + ID = userID; + } + + public void SetRole( IPrincipal principal ) + { + // + // Determine the role of the caller and assign it into the user object + // + if( IsInRole( Config.GetString( "GroupName.Administrators", "S-1-5-32-544" ), principal ) ) + { + Role = RoleType.Administrator; + } + else if( IsInRole( Config.GetString( "GroupName.Coordinators", "S-1-5-32-544" ), principal ) ) + { + Role = RoleType.Coordinator; + } + else if( IsInRole( Config.GetString( "GroupName.Publishers", "S-1-5-32-544" ), principal ) ) + { + Role = RoleType.Publisher; + } + else if( IsInRole( Config.GetString( "GroupName.Users", "S-1-5-32-545" ), principal ) ) + { + Role = RoleType.User; + } + else + { + Role = RoleType.Anonymous; + } + + ID = principal.Identity.Name; + Name = ID; + } + + public void SetAllowPreassignedKeys( bool flag ) + { + AllowPreassignedKeys = flag; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/core/core.cs b/inetsrv/uddi/source/core/core.cs new file mode 100644 index 0000000..44cf304 --- /dev/null +++ b/inetsrv/uddi/source/core/core.cs @@ -0,0 +1,911 @@ +using System; +using System.Data; +using System.Collections; +using System.Data.SqlClient; +using System.IO; +using System.Security.Principal; +using System.Xml; +using System.Text; +using System.Xml.Serialization; +using System.Globalization; + +using UDDI.Diagnostics; + +namespace UDDI +{ + // + // 739955 - Make sure date is parsed in the same format it was written. + // + public class UDDILastResetDate + { + private const string dateTimeFormat = "MM/dd/yyyy HH:mm:ss"; + private static DateTimeFormatInfo dateTimeFormatInfo; + + static UDDILastResetDate() + { + dateTimeFormatInfo = new DateTimeFormatInfo(); + + // + // When you specify a '/' in a date/time format string, this tells the DateTime + // class to use the default Date Separator, not the character '/'. Same goes + // for ':' and Time Separator. + // + // So all we do is change the defaults to '/' and ':'. + // + dateTimeFormatInfo.DateSeparator = "/"; + dateTimeFormatInfo.TimeSeparator = ":"; + } + + public static DateTime Get() + { + return DateTime.ParseExact( Config.GetString( "Security.KeyLastResetDate" ), dateTimeFormat, dateTimeFormatInfo ); + } + + public static void Set( DateTime dateTime ) + { + Config.SetString( "Security.KeyLastResetDate", dateTime.ToString( dateTimeFormat, dateTimeFormatInfo ) ); + } + } + + public class Constants + { + public const int ReadLockTimeout = 120000; // milliseconds + // + // Subtract this offset from error numbers that come from our DB layer to get an + // ErrorType value. This offset is added in our DB to keep us away from SQL-defined + // error numbers. + // + public const int ErrorTypeSQLOffset = 50000; + + public const string OwningBusinessTModelKey = "uuid:4064c064-6d14-4f35-8953-9652106476a9"; + + public const string UDDITypeTaxonomyTModelKey = "uuid:c1acf26d-9672-4404-9d70-39b756e62ab4"; + public const string UDDITypeTaxonomyWSDLSpecKeyValue = "wsdlSpec"; + + public const int Run = 1; + public class Site + { + public const string Version = ""; + } + public class Passport + { + public const int TimeWindow = 14400; + } + public class Web + { + public const int HttpsPort = 443; + public const int HttpPort = 80; + public const int BetaSite = 0; + public const int TestSite = 0; + public const string SiteStatus = "open"; + public const string OutageStart = ""; + public const string OutageEnd = ""; + public const int EnableRegistration = 1; + } + public class Security + { + public const int HTTPS = 1; + + } + public class Debug + { + public const int StackTrace = 0; + } + public class Lengths + { + //public const int Behavior = 1; + //public const int ReplicationBehavior = 2; + public const int AccessPoint = 255; + public const int AddressLine = 80; + public const int AuthInfo = 4096; + public const int AuthorizedName = 255; + //public const int BindingKey = 41; + //public const int BusinessKey = 41; + //public const int ServiceKey = 41; + public const int Key = 41; + public const int TModelKey = 255; + + public const int Description = 255; + public const int DiscoveryURL = 255; + public const int Email = 255; + public const int HostingRedirector = 41; + public const int InstanceParms = 255; + public const int KeyName = 255; + public const int KeyType = 16; + public const int KeyValue = 255; + //public const int MaxRows = 5; + public const int Name = 255; + public const int Operator = 48; + public const int OverviewURL = 255; + public const int PersonName = 255; + public const int Phone = 50; + public const int SortCode = 10; + public const int UploadRegister = 255; + public const int URLType = 16; + public const int UseType = 255; + public const int UserID = 450; + + // additional lengths + public const int ConfigName = 450; + public const int ConfigValue = 4000; + public const int Context = 20; + public const int IsoLangCode = 17; + public const int generic = 20; + public const int OperatorName = 450; + public const int CertSerialNo = 450; + public const int PublisherStatus = 256; + public const int SoapReplicationURL = 4000; + public const int CertIssuer = 225; + public const int CertSubject = 225; + public const int Certificate = 225; + public const int CompanyName = 100; + public const int City = 100; + public const int StateProvince = 100; + public const int PostalCode = 100; + public const int Country = 100; + public const int Tier = 256; + } + } + + public enum EntityType + { + TModel = 0, + BusinessEntity = 1, + BusinessService = 2, + BindingTemplate = 3, + Contact = 4, + TModelInstanceInfo = 5, + InstanceDetail = 6, + TModelOverviewDoc = 7, + InstanceDetailOverviewDoc = 8 + } + + public enum KeyedReferenceType + { + CategoryBag = 1, + IdentifierBag = 2, + Assertion = 3 + } + + public enum ErrorType + { + E_success = 0, + E_nameTooLong = 10020, + E_tooManyOptions = 10030, + E_unrecognizedVersion = 10040, + E_unsupported = 10050, + E_authTokenExpired = 10110, + E_authTokenRequired = 10120, + E_operatorMismatch = 10130, // Deprecated. + E_userMismatch = 10140, + E_unknownUser = 10150, + E_accountLimitExceeded = 10160, + E_invalidKeyPassed = 10210, + E_invalidURLPassed = 10220, // Deprecated. + E_keyRetired = 10310, + E_busy = 10400, // Deprecated. + E_fatalError = 10500, + E_languageError = 10060, + E_invalidCategory = 20000, // Deprecated. Use E_invalidValue + E_categorizationNotAllowed = 20100, // Deprecated. Use E_valueNotAllowed + E_invalidValue = 20200, + E_valueNotAllowed = 20210, + E_invalidProjection = 20230, + E_assertionNotFound = 30000, + E_messageTooLarge = 30110, // TODO: Error codes duplicated? + E_invalidCompletionStatus = 30100, // TODO: Error codes duplicated? + E_transferAborted = 30200, + E_requestDenied = 30210, + E_publisherCancelled = 30220, + E_secretUnknown = 30230 + } + + public enum QueryType + { + Get = 0, + Find = 1 + } + + // + // Use this enumerated type to determine where the UDDIException instance is being + // used. + // + public enum UDDITextContext + { + API, + UI, + EventLog, + FileLog + } + + // + // This class should be used for any message that the user would see. Depending on the + // context, this class will localize it's message as the system locale, or the user's locale. + // + public class UDDIText + { + private string defaultLocaleText; + private string textName; + private object[] textFormatParts; + + public UDDIText( string textName ) : this( textName, null ) + { + } + + public UDDIText( string textName, params object[] textFormatParts ) + { + this.textName = textName; + this.textFormatParts = textFormatParts; + defaultLocaleText = ConstructString( Localization.GetStringLocalMachineCulture( textName ) ); + } + + public string GetText() + { + return defaultLocaleText; + } + + public override string ToString() + { + return defaultLocaleText; + } + + public string GetText( UDDITextContext context ) + { + switch( context ) + { + case UDDITextContext.API: + { + return defaultLocaleText; + } + case UDDITextContext.UI: + { + return ConstructString( Localization.GetString( textName ) ); + } + case UDDITextContext.EventLog: + { + return defaultLocaleText; + } + case UDDITextContext.FileLog: + { + return defaultLocaleText; + } + default: + { + return defaultLocaleText; + } + } + } + + private string ConstructString( string stringToConstruct ) + { + if( null != textFormatParts ) + { + stringToConstruct = string.Format( stringToConstruct, textFormatParts ); + } + + return stringToConstruct; + } + } + + public class UDDIException : ApplicationException + { + private UDDIText uddiText; + + public UDDIException() : this( ErrorType.E_fatalError, "", null ) + { + } + + public UDDIException( ErrorType number, string errorMsgName ) : this( number, errorMsgName, null ) + { + } + + public UDDIException( ErrorType number, string errorMsgName, params object[] errorMsgFormatParts ) : this( number, new UDDIText( errorMsgName, errorMsgFormatParts ) ) + { + } + + public UDDIException( ErrorType number, UDDIText uddiText ) + { + this.uddiText = uddiText; + this.Number = number; + } + + // + // GetMessage will localize the exception message depending on who is + // using the exception. Currently, in all cases we localize the message + // using the server local, except if the exception is coming from the + // UI. + // + public string GetMessage( UDDITextContext context ) + { + return uddiText.GetText( context ); + } + + public override string Message + { + get + { + return uddiText.GetText(); + } + } + + public override string ToString() + { + return uddiText.GetText(); + } + + public ErrorType Number = 0; + } + + public class Conversions + { + public static string EntityNameFromID( EntityType entityType ) + { + switch( entityType ) + { + case EntityType.BusinessEntity: + return "businessEntity"; + + case EntityType.BusinessService: + return "businessService"; + + case EntityType.BindingTemplate: + return "bindingTemplate"; + + case EntityType.TModel: + return "tModel"; + + default: + return null; + } + } + + /// **************************************************************** + /// public GuidFromKey [static] + /// ---------------------------------------------------------------- + /// + /// Converts "uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" keys to + /// a standard GUID. + /// + /// ---------------------------------------------------------------- + /// + /// The key to convert. + /// + /// ---------------------------------------------------------------- + /// + /// The equivalent GUID. + /// + /// **************************************************************** + /// + public static Guid GuidFromKey( string key ) + { + Debug.VerifyKey( key ); + + return new Guid( key.Substring(5) ); + } + + /// **************************************************************** + /// public KeyFromGuid [static] + /// ---------------------------------------------------------------- + /// + /// Converts standard GUIDs to a key of the form + /// "uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx". + /// + /// ---------------------------------------------------------------- + /// + /// The GUID to convert. + /// + /// ---------------------------------------------------------------- + /// + /// The equivalent key. + /// + /// **************************************************************** + /// + public static string KeyFromGuid( Guid guid ) + { + if( null == (object)guid ) + return null; + + return "uuid:" + Convert.ToString( guid ); + } + + /// **************************************************************** + /// public KeyFromGuid [static] + /// ---------------------------------------------------------------- + /// + /// Converts standard GUIDs to a key of the form + /// "uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx". + /// + /// ---------------------------------------------------------------- + /// + /// The GUID to convert. + /// + /// ---------------------------------------------------------------- + /// + /// The equivalent key. + /// + /// **************************************************************** + /// + public static string KeyFromGuid( string guid ) + { + if( null == guid ) + return null; + + return "uuid:" + guid; + } + + public static string GuidStringFromKey( string key ) + { + // + // Convert uuid:E31A569A-AEFF-4468-BA4D-2BF22FE4ACEE + // to string type without uuid: + // Example: E31A569A-AEFF-4468-BA4D-2BF22FE4ACEE + // + string NewGuidStr = ""; + + switch ( key ) + { + case null: + NewGuidStr = null; + break; + + case "": + NewGuidStr = ""; + break; + + default: + Debug.VerifyKey( key ); + + NewGuidStr = new Guid( key.Substring(5) ).ToString(); + break; + } + + return( NewGuidStr ); + } + } + + /// ******************************************************************** + /// public class Utility + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class Utility + { + public enum LengthBehavior + { + Ignore = 0, + Truncate = 1, + ThrowException = 2 + }; + + /// **************************************************************** + /// public Iff [static] + /// ---------------------------------------------------------------- + /// + /// Returns a particular value depending on whether the given + /// expression is true or false. Useful for web page templates + /// where arbitrary expressions cannot be evaluated, but + /// functions that take expressions as arguments can be + /// evaluated. + /// + /// ---------------------------------------------------------------- + /// + /// The boolean result of an expression. + /// + /// + /// + /// The object to return if the expression is true. + /// + /// + /// + /// The object to return if the expression is false. + /// + /// ---------------------------------------------------------------- + /// + /// The value of trueReturnValue if the expression is true, + /// otherwise falseReturnValue. + /// + /// **************************************************************** + /// + public static object Iff( bool expression, object trueReturnValue, object falseReturnValue ) + { + if( expression ) + return trueReturnValue; + else + return falseReturnValue; + } + + /// **************************************************************** + /// public StringEmpty [static] + /// ---------------------------------------------------------------- + /// + /// Checks if a string is empty. + /// + /// ---------------------------------------------------------------- + /// + /// The string to check. + /// + /// ---------------------------------------------------------------- + /// + /// True if the string is empty or null. + /// + /// **************************************************************** + /// + public static bool StringEmpty( string str ) + { + if( null == str ) + return true; + + return String.Empty == str; + } + + /// **************************************************************** + /// public CollectionEmpty [static] + /// ---------------------------------------------------------------- + /// + /// Checks if a collection is empty. + /// + /// ---------------------------------------------------------------- + /// + /// The collection to check. + /// + /// ---------------------------------------------------------------- + /// + /// True if the collection is empty or null. + /// + /// **************************************************************** + /// + public static bool CollectionEmpty( ICollection col ) + { + if( null == col || 0 == col.Count ) + return true; + + return false; + } + + /// **************************************************************** + /// public ValidateLength [static] + /// ---------------------------------------------------------------- + /// + /// Removes leading and trailing whitespace. + /// The resulting string is then truncated to the specified length. + /// + /// ---------------------------------------------------------------- + /// + /// The string to check. + /// + /// + /// + /// The attribute or element from which the string came. + /// + /// + /// + /// The maximum length for the string. + /// + /// **************************************************************** + /// + public static void ValidateLength( ref string str, string field, int maxLength ) + { + if( Utility.StringEmpty( str ) ) + return; + + // + // Remove leading and trailing whitespace + // + str = str.Trim(); + +// FixCRLF( ref str ); + + if( str.Length > maxLength ) + { + Debug.Write( SeverityType.Info, CategoryType.Data, "String is too long" ); + Debug.Write( SeverityType.Info, CategoryType.Data, "Trimmed length is " + str.Length.ToString() ); + Debug.Write( SeverityType.Info, CategoryType.Data, "Trimmed String follows:\n" + str ); + Debug.Write( SeverityType.Info, CategoryType.Data, "Trimmed field follows:\n" + field ); + + for( int i=0; i= 0x20 && ch <= 0xD7FF ) || ( ch >= 0xE000 && ch <= 0xFFFD ) ) + { + newstring.Append( ch ); + } + } + + return newstring.ToString(); + } + + public static string GetDefaultPublisher() + { + // + // TODO: Need to do the right thing here + // + return "System"; + } + + // + // TODO: remove once we have verified .NET does this for us + // + private static void FixCRLF( ref string str ) + { + char[] bytes = new char[ str.Length ]; + int n = 0; + int length = str.Length; + + for( int i = 0; i < length; i++ ) + { + // + // If the char is not a CR write it out + // + if( 0x0D != str[ i ] ) + bytes[ n++ ] = str[ i ]; + else + { + // + // If a CRLF combo is found or we are on a CR + // at the end of the string write out a LF + // + if( ( ( i != length - 1 ) && ( 0x0A != str[ i + 1 ] ) ) || + ( i == length - 1 ) ) + { + bytes[ n++ ] = (char) 0x0A; + } + } + } + + str = new string( bytes, 0, n ); + } + + /// **************************************************************** + /// public ValidateLength [static] + /// ---------------------------------------------------------------- + /// + /// Checks that a string is shorter than a given maximum and longer than the specified + /// minimum. It also removes any leading or trailing whitespace. + /// + /// ---------------------------------------------------------------- + /// + /// The string to check. + /// + /// + /// + /// The attribute or element from which the string came. + /// + /// + /// + /// The maximum length for the string. + /// + /// + /// + /// The minimum length for the string. + /// + /// **************************************************************** + /// + + // + // TODO: This function should call the other overload for ValidateLength + // + public static void ValidateLength( ref string str, string field, int maxLength, int minLength ) + { + int length = 0; + + if( null != str ) + { + // + // Remove leading and trailing whitespace + // + str = str.Trim(); +// FixCRLF( ref str ); + + length = str.Length; + } + + if( length < minLength ) + { +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Value for '" + field + "' does not meet minimum length requirement of " + minLength.ToString() ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_FIELD_TOO_SHORT", field, minLength.ToString() ); + } + + if( null != str && length > maxLength ) + { + LengthBehavior mode; + + if( ContextType.Replication == Context.ContextType ) + mode = (LengthBehavior)Config.GetInt( "Length.ReplicationBehavior", (int)LengthBehavior.ThrowException ); + else + mode = (LengthBehavior)Config.GetInt( "Length.Behavior", (int)LengthBehavior.Truncate ); + + if( LengthBehavior.Truncate == mode ) + { + str = str.Substring( 0, maxLength ); + str = str.Trim(); + } + else if( LengthBehavior.ThrowException == mode ) + { +#if never + throw new UDDIException( + ErrorType.E_nameTooLong, + "Field " + field + " exceeds maximum length" ); +#endif + throw new UDDIException( ErrorType.E_nameTooLong, "UDDI_ERROR_FIELD_TOO_LONG", field ); + } + } + } + + /// **************************************************************** + /// public ParseDelimitedToken [static] + /// ---------------------------------------------------------------- + /// + /// Retrieves a token from a string given the delimiter that + /// immediately preceeds (and optionally, the delimiter that + /// follows) the desired token. + /// + /// ---------------------------------------------------------------- + /// + /// The starting delimiter. + /// + /// + /// + /// [Optional] The ending delimiter. This can be null. + /// + /// + /// + /// The string to search. + /// + /// ---------------------------------------------------------------- + /// + /// The token, if successful. Otherwise, null. + /// + /// **************************************************************** + /// + public static string ParseDelimitedToken( string beginDelimiter, string endDelimiter, string text ) + { + Debug.Assert( null != beginDelimiter, "beginDelimiter cannot be null" ); + Debug.Assert( null != text, "text cannot be null" ); + + // + // Find the beginning of the starting delimiter. Add the length to + // give the starting position of the token. + // + int startPos = text.IndexOf( beginDelimiter ); + + if( -1 == startPos ) + return null; + + startPos += beginDelimiter.Length; + + // + // Find the ending delimiter. If no ending delimiter was specified, then + // simply return the remaining string after the beginning delimiter. + // + if( null == endDelimiter ) + return text.Substring( startPos ); + + int endPos = text.IndexOf( endDelimiter, startPos ); + + if( -1 == endPos ) + return null; + + return text.Substring( startPos, endPos - startPos ); + } + + /// **************************************************************** + /// public IsValidKey [static] + /// ---------------------------------------------------------------- + /// + /// Checks to see if the entity associated with a key actually + /// exists in the database. + /// + /// **************************************************************** + /// + + // + // TODO: This function need to be re-written + // + public static void IsValidKey( EntityType entityType, string key ) + { + SqlCommand cmd = new SqlCommand( "net_key_validate", ConnectionManager.GetConnection() ); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Parameters.Add( new SqlParameter( "@entityTypeID", SqlDbType.TinyInt ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@entityKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor parmacc = new SqlParameterAccessor( cmd.Parameters ); + + parmacc.SetShort( "@entityTypeID", (short)entityType ); + + + // + // Check for a tModel key vs other + // + if( key.ToLower().StartsWith( "uuid:" ) ) + { + if( entityType != EntityType.TModel ) + { + //throw new UDDIException( ErrorType.E_invalidKeyPassed, "Only TModel Keys can start with uuid:" ); + throw new UDDIException( ErrorType.E_invalidKeyPassed, "UDDI_ERROR_INVALID_TMODEL_KEY" ); + } + + parmacc.SetGuidFromKey( "@entityKey", key ); + } + else + { + if( EntityType.TModel == entityType ) + { + //throw new UDDIException( ErrorType.E_invalidKeyPassed, "Only TModel Keys can start with uuid:" ); + throw new UDDIException( ErrorType.E_invalidKeyPassed, "UDDI_ERROR_INVALID_TMODEL_KEY" ); + } + try + { + parmacc.SetGuidFromString( "@entityKey", key ); + } + catch( Exception ) + { + //throw new UDDIException( ErrorType.E_invalidKeyPassed, "Key has invalid format" ); + throw new UDDIException( ErrorType.E_invalidKeyPassed, "UDDI_ERROR_INVALID_KEY_FORMAT" ); + } + } + + cmd.ExecuteScalar(); + } + } + + public class UTF8EncodedStringWriter : StringWriter + { + private System.Text.UTF8Encoding utfEncoding; + + public UTF8EncodedStringWriter() : base() + { + utfEncoding = new UTF8Encoding(); + } + + public override Encoding Encoding + { + get + { + return utfEncoding; + } + } + } +} diff --git a/inetsrv/uddi/source/core/core.csproj b/inetsrv/uddi/source/core/core.csproj new file mode 100644 index 0000000..bda6162 --- /dev/null +++ b/inetsrv/uddi/source/core/core.csproj @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/core/core.snk b/inetsrv/uddi/source/core/core.snk new file mode 100644 index 0000000..11120ba Binary files /dev/null and b/inetsrv/uddi/source/core/core.snk differ diff --git a/inetsrv/uddi/source/core/debug.cs b/inetsrv/uddi/source/core/debug.cs new file mode 100644 index 0000000..86f7dcc --- /dev/null +++ b/inetsrv/uddi/source/core/debug.cs @@ -0,0 +1,1007 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading; +using System.Web.Mail; +using UDDI; + +namespace UDDI.Diagnostics +{ + /// ******************************************************************** + /// public enum SeverityType + /// -------------------------------------------------------------------- + /// + /// Severity codes for error reporting. + /// + /// ******************************************************************** + /// + public enum SeverityType : int + { + None = 0, + Error = 1, + Warning = 2, + FailAudit = 3, + PassAudit = 4, + Info = 5, + Verbose = 6 + } + + /// ******************************************************************** + /// public enum CategoryType + /// -------------------------------------------------------------------- + /// + /// Category codes for specifying where an error occurred. + /// + /// ******************************************************************** + /// + public enum CategoryType : int + { + None = 0, + Config = 1, + Soap = 2, + Data = 3, + Authorization = 4, + Website = 5, + Replication = 6 + } + + /// ******************************************************************** + /// public enum OperatorMessageType + /// -------------------------------------------------------------------- + /// + /// Error message codes for the various operator messages. + /// + /// ******************************************************************** + /// + public enum OperatorMessageType : int + { + None = 100, + + // + // Client messages (100 level) + // + InvalidUserId = 101, + + // + // Server messages (200 level) + // + ConfigError = 200, + CannotReadSettings = 201, + MissingSetting = 202, + ConfigInvalid = 203, + UnableToPublishCounter = 204, + CouldNotCreateEventLog = 205, + PassportNotConfigured = 206, + UnknownLoginURL = 207, + PassportSiteUnavailable = 208, + CannotRetrieveClientXml = 209, + InvalidTicketFormat = 210, + StartingReplicationSession = 211, + StartingReplicationWithNode = 212, + EndingReplicationWithNode = 213, + ReplicationSessionSummary = 214, + NoReplicationOperators = 215, + CannotRetrieveHighWaterMarks = 216, + ErrorCommunicatingWithNode = 217, + ValidationError = 218, + UnknownOperator = 219, + CouldNotSendMail = 220, + InvalidKey = 221 + + // + // if you exceed 300, you must edit uddievents.mc and add more event numbers + // + } + + /// ******************************************************************** + /// public class Debug + /// -------------------------------------------------------------------- + /// + /// Manages error reporting and logging. + /// + /// ******************************************************************** + /// + public class Debug + { + private static ReaderWriterLock readWriteLock = new ReaderWriterLock(); + + // + // The default values of these settings should be kept in sync with the values stored in the UDO_config table + // in the database. + // + private static CachedSetting debuggerLevel = new CachedSetting( "Debug.DebuggerLevel", SeverityType.Verbose ); + private static CachedSetting eventLogLevel = new CachedSetting( "Debug.EventLogLevel", SeverityType.Warning ); + private static CachedSetting fileLogLevel = new CachedSetting( "Debug.FileLogLevel", SeverityType.None ); + + // + // SECURITY: Default location of the log file needs to be changed + // It should not go to the root of the c: drive. This location may not be + // accessible. + // + private static CachedSetting logFilename = new CachedSetting( "Debug.LogFilename", @"c:\uddi.log" ); + private static DateTime lastLogEvent = DateTime.Now; + + private static TextWriter textStream = null; + + /// **************************************************************** + /// static Debug [constructor] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + static Debug() + { + // + // Register a configuration change handler for the logFilename + // setting. + // + logFilename.ConfigChange += new Config.ConfigChangeHandler( LogFilename_OnChange ); + + // + // Register a configuration change handler for the file log level setting. When this + // setting becomes SeverityType.None, we'll release our handle to the log file (if we have one). + // + fileLogLevel.ConfigChange += new Config.ConfigChangeHandler( FileLogLevel_OnChange ); + } + + /// **************************************************************** + /// private FileLogLevel_OnChange [static] + /// ---------------------------------------------------------------- + /// + /// Handler for file log level configuration change events. + /// + /// **************************************************************** + /// + private static void FileLogLevel_OnChange() + { + try + { + SeverityType newSeverity = ( SeverityType ) fileLogLevel.GetInt(); + + // + // If logging is turned off, release our handle to the log file. + // + if( SeverityType.None == newSeverity ) + { + ReleaseLogFile(); + } + } + catch + { + // + // We should never get any exceptions from this, but eat them if we do. We don't want to + // put our file logging in an inconsistent state. + // + } + } + + /// **************************************************************** + /// private LogFilename_OnChange [static] + /// ---------------------------------------------------------------- + /// + /// Handler for logFilename configuration change events. + /// + /// **************************************************************** + /// + private static void LogFilename_OnChange() + { + ReleaseLogFile(); + } + + private static void ReleaseLogFile() + { + // + // Acquire the writer lock. + // + readWriteLock.AcquireWriterLock( Timeout.Infinite ); + + try + { + // + // Close the text stream, if open. We do this so that the file + // logging method will reopen with the current log filename. + // + if( null != textStream ) + { + textStream.Close(); + textStream = null; + } + } + finally + { + readWriteLock.ReleaseWriterLock(); + } + } + + /// **************************************************************** + /// public Enter [static] + /// ---------------------------------------------------------------- + /// + /// Writes trace information indicating the beginning of + /// execution of a function + /// + /// ---------------------------------------------------------------- + /// + /// The trace information generated by this function + /// is published at the verbose level. + /// + /// **************************************************************** + /// + public static void Enter() + { +#if DEBUG + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Debug.Write( + SeverityType.Verbose, + CategoryType.None, + "Entering " + method.ReflectedType.FullName + "." + method.Name + "..." ); +#endif + } + + /// **************************************************************** + /// public Leave [static] + /// ---------------------------------------------------------------- + /// + /// Writes trace information indicating the end of execution of + /// a function + /// + /// ---------------------------------------------------------------- + /// + /// The trace information generated by this function + /// is published at the verbose level. + /// + /// **************************************************************** + /// + public static void Leave() + { +#if DEBUG + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Debug.Write( + SeverityType.Verbose, + CategoryType.None, + "Leaving " + method.ReflectedType.FullName + "." + method.Name ); +#endif + } + + /// **************************************************************** + /// public OperatorMessage [static] + /// ---------------------------------------------------------------- + /// + /// Writes an operator message to the event log. + /// + /// ---------------------------------------------------------------- + /// + /// The severity of the message. + /// + /// + /// + /// The category of the message. + /// + /// + /// + /// Operator message type. + /// + /// + /// + /// Message to write to the event log. + /// + /// **************************************************************** + /// + public static void OperatorMessage( SeverityType severity, CategoryType category, OperatorMessageType messageId, string message ) + { + try + { + // + // Store the entry in the event log as an error. + // + WriteEventLog( + severity, + category, + messageId, + message ); + + // + // Also write this as a warning level message to any debug message + // listeners (other than event log, since we already logged this + // message there). + // + if( (int)severity <= debuggerLevel.GetInt() ) + { + WriteDebugger( + severity, + category, + "Operator message [" + messageId.ToString() + "]: " + message ); + } + + if( (int)severity <= fileLogLevel.GetInt() ) + { + WriteFileLog( + severity, + category, + "Operator message [" + messageId.ToString() + "]: " + message ); + } + } + catch( Exception ) + { + } + } + + /// **************************************************************** + /// public Assert [static] + /// ---------------------------------------------------------------- + /// + /// Checks for a condition and displays a message if false. + /// + /// ---------------------------------------------------------------- + /// + /// The condition to verify. If the condition is false, the + /// given message is displayed. + /// + /// + /// + /// LocalizaitonKey to use for the Exception. + /// + /// ---------------------------------------------------------------- + /// + /// Calls to Assert are ignored in non-debug builds. + /// + /// **************************************************************** + /// + [System.Diagnostics.Conditional( "DEBUG" )] + [System.Diagnostics.DebuggerHidden()] + public static void Assert( bool condition, string message ) + { + if( false == condition ) + { + try + { + // + // Build the assert message. We'll attempt to build a pretty stack + // trace, eliminating our frame from the list. + // + string trace = System.Environment.StackTrace; + + int pos = trace.IndexOf( "Debug.Assert" ); + if( pos >= 0 && pos < trace.Length - 1 ) + { + pos = trace.IndexOf( "at", pos + 1 ); + if( pos >= 0 ) + trace = " " + trace.Substring( pos ); + } + + string text = "Assertion failed: " + message + "\r\n\r\n" + + "Stack trace:\r\n" + trace; + + // + // Write the assertion to the debugger and break. + // + WriteDebugger( SeverityType.Error, CategoryType.None, text ); + System.Diagnostics.Debugger.Break(); + } + catch( Exception ) + { + } + finally + { + throw new UDDIException( ErrorType.E_fatalError, message ); + } + } + } + + /// **************************************************************** + /// public VerifyKey [static] + /// ---------------------------------------------------------------- + /// + /// Checks for a tModelKey of the form uuid:xxx...xxx + /// + /// ---------------------------------------------------------------- + /// + /// A string presumed to begin with "uuid:" and followed by a properly formed Guid + /// + /// + /// ---------------------------------------------------------------- + /// + /// Message to display if the assertion fails. + /// + /// + /// ---------------------------------------------------------------- + /// + /// Calls to this function are honored, even in non-debug + /// builds. + /// + /// **************************************************************** + /// + [System.Diagnostics.DebuggerHidden()] + public static void VerifyKey( string key ) + { + Debug.Verify( + null != key, + "UDDI_ERROR_INVALIDKEYPASSED_INVALIDTMODELKEY", + ErrorType.E_invalidKeyPassed + ); + + Debug.Verify( + key.Length >= 5 && key.Substring( 0, 5 ).ToLower().Equals( "uuid:" ), + "UDDI_ERROR_INVALIDKEYPASSED_NOUUIDONTMODELKEY", + ErrorType.E_invalidKeyPassed + ); + + Debug.Verify( + 41 == key.Length, + "UDDI_ERROR_INVALIDKEYPASSED_INVALIDTMODELKEYLENGTH" , + ErrorType.E_invalidKeyPassed + ); + + + /*try + { + Debug.Verify( null != key, "A valid tModelKey is required", ErrorType.E_fatalError ); + Debug.Verify( key.Length >= 5 && key.Substring( 0, 5 ).ToLower().Equals( "uuid:" ), "Specified tModelKey does not begin with uuid:" ); + Debug.Verify( 41 == key.Length, "Specified tModelKey is not the correct length" ); + } + catch( Exception e ) + { + throw new UDDIException( ErrorType.E_invalidKeyPassed, e.Message ); + }*/ + } + + /// **************************************************************** + /// public Verify [static] + /// ---------------------------------------------------------------- + /// + /// Checks for a condition and displays a message if false. + /// + /// ---------------------------------------------------------------- + /// + /// The condition to verify. If the condition is false, the + /// given message is displayed. + /// + /// + /// + /// Message to display if the assertion fails. + /// + /// ---------------------------------------------------------------- + /// + /// Calls to this function are honored, even in non-debug + /// builds. + /// + /// **************************************************************** + /// + [System.Diagnostics.DebuggerHidden()] + public static void Verify( bool condition, string message ) + { + Verify( condition, message, ErrorType.E_fatalError ); + } + + /// **************************************************************** + /// public Verify [static] + /// ---------------------------------------------------------------- + /// + /// Checks for a condition and displays a message if false. + /// + /// ---------------------------------------------------------------- + /// + /// The condition to verify. If the condition is false, the + /// given message is displayed. + /// + /// + /// + /// Message to display if the assertion fails. + /// + /// + /// + /// Specifies the type of error to throw should the condition + /// evaluate to false. + /// + /// ---------------------------------------------------------------- + /// + /// Calls to this function are honored, even in non-debug + /// builds. + /// + /// **************************************************************** + [System.Diagnostics.DebuggerHidden()] + public static void Verify( bool condition, string message, ErrorType errorType ) + { + Verify( condition,message,errorType,null ); + } + + /// **************************************************************** + /// public Verify [static] + /// ---------------------------------------------------------------- + /// + /// Checks for a condition and displays a message if false. + /// + /// ---------------------------------------------------------------- + /// + /// The condition to verify. If the condition is false, the + /// given message is displayed. + /// + /// + /// + /// Message to display if the assertion fails. + /// + /// + /// + /// Specifies the type of error to throw should the condition + /// evaluate to false. + /// + /// + /// Error string format arguments used for localized messages. + /// + /// ---------------------------------------------------------------- + /// + /// Calls to this function are honored, even in non-debug + /// builds. + /// + /// **************************************************************** + [System.Diagnostics.DebuggerHidden()] + public static void Verify( bool condition, string message, ErrorType errorType, params object[] format ) + { + if( false == condition ) + { + try + { + // + // Build the verify failure message. We'll attempt to + // build a pretty stack trace, eliminating our frame from + // the list. + // + string trace = System.Environment.StackTrace; + + int pos = trace.IndexOf( "Debug.Verify" ); + if( pos >= 0 && pos < trace.Length - 1 ) + { + pos = trace.IndexOf( "at", pos + 1 ); + if( pos >= 0 ) + trace = " " + trace.Substring( pos ); + } + + string text = "Verify failed: " + message + "\r\n\r\n" + + "Stack trace:\r\n" + trace; + + // + // Write the verify failure to the debugging logs. + // + Write( SeverityType.Error, CategoryType.None, text ); + } + catch( Exception ) + { + } + finally + { + throw new UDDIException( errorType, message,format ); + } + } + } + + /// **************************************************************** + /// public VerifySetting [static] + /// ---------------------------------------------------------------- + /// + /// Verifies that the specified setting exists, and writes an + /// error to the debugger and operator log if not. + /// + /// ---------------------------------------------------------------- + /// + /// Configuration setting to verify. + /// + /// **************************************************************** + /// + [System.Diagnostics.DebuggerHidden()] + public static void VerifySetting( string key ) + { + if( false == Config.SettingExists( key ) ) + { + OperatorMessage( + SeverityType.Error, + CategoryType.Config, + OperatorMessageType.MissingSetting, + "Missing required setting: " + key ); + + Verify( false, "Server configuration error" ); + } + } + + /// **************************************************************** + /// public WriteIf [static] + /// ---------------------------------------------------------------- + /// + /// Writes a message to the debugging logs if the specified + /// condition is true. + /// + /// ---------------------------------------------------------------- + /// + /// The condition to verify. If the condition is true, the + /// given message is displayed. + /// + /// + /// + /// The severity type. + /// + /// + /// + /// The category type. + /// + /// + /// + /// The message to log. + /// + /// **************************************************************** + /// + public static void WriteIf( bool condition, SeverityType severity, CategoryType category, string message ) + { + if( true == condition ) + Write( severity, category, message ); + } + + /// **************************************************************** + /// public Write [static] + /// ---------------------------------------------------------------- + /// + /// Writes a message to the debugging logs. + /// + /// ---------------------------------------------------------------- + /// + /// The Severity type. + /// + /// + /// + /// The category type. + /// + /// + /// + /// The message to log. + /// + /// ---------------------------------------------------------------- + /// + /// Debugging information is logged to the debugger, log file, + /// and event log depending on the level of the following + /// configuration settings: + /// + /// Debug.DebuggerLevel + /// Debug.EventLogLevel + /// Debug.FileLogLevel + /// + /// Where the trace level is the highest severity to log: + /// 0 = none + /// 1 = errors + /// 2 = warnings + /// 3 = failure audit messages + /// 4 = success audit messages + /// 5 = information messages + /// 6 = all (verbose) + /// + /// **************************************************************** + /// + public static void Write( SeverityType severity, CategoryType category, string message ) + { + // + // Write to the debugger if the level setting is high enough. + // + if( (int)severity <= debuggerLevel.GetInt() ) + WriteDebugger( severity, category, message ); + + // + // Write to the event log if the level setting is high enough. + // + if( (int)severity <= eventLogLevel.GetInt() ) + WriteEventLog( severity, category, OperatorMessageType.None, message ); + + // + // Write to the file log if the level setting is high enough. + // + if( (int)severity <= fileLogLevel.GetInt() ) + WriteFileLog( severity, category, message ); + } + + + /// **************************************************************** + /// public WriteDebugger [static] + /// ---------------------------------------------------------------- + /// + /// Writes a message to the debugger. + /// + /// ---------------------------------------------------------------- + /// + /// The severity type. + /// + /// + /// + /// The category type. + /// + /// + /// + /// The message. + /// + /// **************************************************************** + /// + public static void WriteDebugger( SeverityType severity, CategoryType category, string message ) + { + try + { + string text = string.Format( + "{0,-4} {1,-4} {2}", + severity.ToString().Substring( 0, 4 ).ToUpper(), + category.ToString().Substring( 0, 4 ).ToUpper(), + message.Replace( "\r\n", "\r\n\t\t" ) ); + + // + // Write out the debugger message. + // + System.Diagnostics.Trace.WriteLine( text ); + } + catch( Exception ) + { + // + // WriteDebugger is used as a last ditch logging mechanism + // in many cases. This should never throw an exception, + // but if it does, there really isn't any more we can do + // about it. We'll simply eat the error. + // + } + } + + /// **************************************************************** + /// public WriteFileLog [static] + /// ---------------------------------------------------------------- + /// + /// Writes a message to the file log. + /// + /// ---------------------------------------------------------------- + /// + /// The severity type. + /// + /// + /// + /// The category type. + /// + /// + /// + /// The message. + /// + /// **************************************************************** + /// + public static void WriteFileLog( SeverityType severity, CategoryType category, string message ) + { + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + try + { + // + // If the log filename has not yet been initialized, there is nothing we + // can log yet. + // + if( null == logFilename ) + return; + + // + // Open the logging file, if it is not already. + // + if( null == textStream ) + { + // + // Get the full path to our log file. + // + string logFilePath = logFilename.GetString(); + + // + // Pull off the directory of the log file and see if we need to + // create it. + // + string logFileDirectory = Path.GetDirectoryName( logFilePath ); + if( false == Directory.Exists( logFileDirectory ) ) + { + Directory.CreateDirectory( logFileDirectory ); + } + + // + // Append to an existing log file, or create a new one. + // + FileStream file = File.Open( + logFilePath, + FileMode.Append, + FileAccess.Write, + FileShare.ReadWrite ); + + textStream = TextWriter.Synchronized( new StreamWriter( file, System.Text.Encoding.UTF8 ) ); + textStream.NewLine = "\r\n"; + } + + // + // Build a time string of the format: YYMMDD:hhmmss + // + DateTime time = DateTime.Now; + + string timeString = string.Format( + "{0,-4:D4}/{1:D2}/{2:D2} {3:D2}:{4:D2}:{5:D2}", + time.Year, + time.Month, + time.Day, + time.Hour, + time.Minute, + time.Second ); + + // + // Write out the file log entry. + // + textStream.WriteLine( + severity.ToString().Substring( 0, 4 ).ToUpper() + " " + + category.ToString().Substring( 0, 4 ).ToUpper() + " " + + timeString + " " + + message.Replace( "\r\n", "\r\n\t\t" ) ); + + textStream.Flush(); + } + catch( Exception e ) + { + WriteDebugger( + SeverityType.Error, + CategoryType.None, + "Could not write to log file " + logFilename + ".\r\n\r\nDetails:\r\n" + e.ToString() ); + + // + // If for whatever reason we could not write output to the log file, we dump the logfile name, + // and the reason to the event log. + // + WriteEventLog( + SeverityType.Error, + CategoryType.None, + OperatorMessageType.None, + "Could not write to log file " + logFilename + ".\r\n\r\nDetails:\r\n" + e.ToString() ); + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + + /// **************************************************************** + /// public WriteEventLog [static] + /// ---------------------------------------------------------------- + /// + /// Writes a message to the event log. + /// + /// ---------------------------------------------------------------- + /// + /// The severity type. + /// + /// + /// + /// The category type. + /// + /// + /// + /// The message type. + /// + /// + /// + /// The message. + /// + /// **************************************************************** + /// + public static void WriteEventLog( SeverityType severity, CategoryType category, OperatorMessageType messageId, string message ) + { + readWriteLock.AcquireReaderLock( Constants.ReadLockTimeout ); + + try + { + // + // Map the severity type to an event log entry type. + // + System.Diagnostics.EventLogEntryType entryType; + + switch( severity ) + { + case SeverityType.Error: + entryType = System.Diagnostics.EventLogEntryType.Error; + break; + + case SeverityType.Warning: + entryType = System.Diagnostics.EventLogEntryType.Warning; + break; + + case SeverityType.PassAudit: + entryType = System.Diagnostics.EventLogEntryType.SuccessAudit; + break; + + case SeverityType.FailAudit: + entryType = System.Diagnostics.EventLogEntryType.FailureAudit; + break; + + default: + // + // SeverityType.Info and Verbose are mapped to info + // + entryType = System.Diagnostics.EventLogEntryType.Information; + break; + } + + System.Diagnostics.EventLog.WriteEntry( + "UDDIRuntime", + message, + entryType, + (int)messageId, + (short)category ); + + } + catch( Exception e ) + { + WriteDebugger( + SeverityType.Error, + CategoryType.None, + "Could not write to event log.\r\n\r\nDetails:\r\n" + e.ToString() ); + } + finally + { + readWriteLock.ReleaseReaderLock(); + } + } + + // + // Note: All calls to this function should occur in administrator initiated + // processes. No calls to this function should as a result of an HTTP request from + // a SOAP API. + // This is verified to be true on 3/1/2002 by creeves + // + public static void OperatorMail( SeverityType severity, CategoryType category, OperatorMessageType messageId, string message ) + { + string mailTo = Config.GetString( "Debug.MailTo", null ); + + if( null == mailTo ) + { + Debug.Write( + SeverityType.Info, + CategoryType.Config, + "Skipping send of operator mail. Configuration setting 'Debug.MailTo' not set." ); + + return; + } + + Debug.VerifySetting( "Debug.MailFrom" ); + + try + { + string mailCc = Config.GetString( "Debug.MailCc", null ); + string mailSubject = Config.GetString( + "Debug.MailSubject", + "Operator message from {0}. Severity: {1}, Category: {2}" ); + + MailMessage mail = new MailMessage(); + + mail.To = mailTo; + mail.From = Config.GetString( "Debug.MailFrom" ); + mail.Subject = String.Format( + mailSubject, + System.Environment.MachineName, + severity.ToString(), + category.ToString(), + (int)messageId ); + + if( null != mailCc ) + mail.Cc = mailCc; + + mail.BodyFormat = MailFormat.Text; + mail.Body = + "SEVERITY: " + severity.ToString() + "\r\n" + + "CATEGORY: " + category.ToString() + "\r\n" + + "EVENT ID: " + (int)messageId + "\r\n\r\n" + + message; + + SmtpMail.Send( mail ); + } + catch( Exception e ) + { + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.None, + OperatorMessageType.CouldNotSendMail, + "Could not send operator mail.\r\n\r\nDetails:\r\n\r\n" + e.ToString() ); + } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/core/localization.cs b/inetsrv/uddi/source/core/localization.cs new file mode 100644 index 0000000..e70a61b --- /dev/null +++ b/inetsrv/uddi/source/core/localization.cs @@ -0,0 +1,220 @@ +using System; +using System.Threading; +using System.Resources; +using System.Globalization; +using System.Web; + +using Microsoft.Win32; + +using UDDI.Diagnostics; + +namespace UDDI +{ + public class Localization + { + protected static ResourceManager manager = null; + + static Localization() + { + try + { + Debug.VerifySetting( "InstallRoot" ); + manager = ResourceManager.CreateFileBasedResourceManager( "uddi", + Config.GetString( "InstallRoot" ) + "resources", + null ); + } + catch + { + // + // There may be a case where we get called before the database and hence our configuration + // settings are setup. The only information we need is the install root. If we can't get + // this information from the database, we'll try to get it from the registry. + // + + // + // TODO should make this field non-private on Config + // + + string registryRoot = @"SOFTWARE\Microsoft\UDDI"; + RegistryKey uddiRegKey = Registry.LocalMachine.OpenSubKey( registryRoot ); + + // + // At this point, let any exceptions just propogate since we can't get the information that we need. + // + manager = ResourceManager.CreateFileBasedResourceManager( "uddi", + uddiRegKey.GetValue( "InstallRoot" ) + "resources", + null ); + } + } + + public static CultureInfo GetCulture() + { + Thread thread = Thread.CurrentThread; + CultureInfo culture = thread.CurrentUICulture; + + try + { + // + // If this is an HTTP request, attempt to use the browser's + // preferred language setting. + // + HttpContext context = HttpContext.Current; + + if( null != context && context.Request.UserLanguages.Length >= 1 ) + { + string language = context.Request.UserLanguages[ 0 ]; + + // + // BUG: 778542. To fully support MUI Builds via the UI, we must + // first attempt to create a specific culture, and if that failes, create a + // primary culture. + // + try + { + culture = CultureInfo.CreateSpecificCulture( language ); + } + catch + { + culture = new CultureInfo( language ); + } + } + } + catch + { + culture = thread.CurrentUICulture; + } + + return culture; + } + + // + // Return the given string using the local machine culture rather than the + // caller's culture. TODO consider creating a new method, GetString( string name, bool useLocalMachine ) + // + public static string GetStringLocalMachineCulture( string name ) + { + string resource = null; + + try + { + resource = manager.GetString( name ); + + } + catch + {} + if( null == resource ) + resource = "[[" + name + "]]"; + + return resource; + } + public static CultureInfo GetCultureWithFallback( ) + { + CultureInfo localculture = GetCulture(); + string filebase = Config.GetString( "InstallRoot" ) + "resources\\uddi{0}resources"; + string file = string.Format( filebase, "." + localculture.Name + "." ) ; + + bool installed = System.IO.File.Exists( file ); + + if( installed ) + return localculture; + else + { + do + { + localculture = localculture.Parent; + file = string.Format( filebase, "." + localculture.Name + "." ) ; + installed = System.IO.File.Exists( file ); + + }while( !installed && 127!=localculture.LCID ); + + if( installed ) + return localculture; + else + return CultureInfo.InstalledUICulture; + } + + } + public static string GetString( string name ) + { + CultureInfo culture = GetCulture(); + + // + // Retrieve the resource. + // + string resource = null; + + try + { + resource = manager.GetString( name, culture ); + } + catch + { + } + + if( null == resource ) + resource = "[[" + name + "]]"; + + return resource; + } + + /// ***************************************************************************** + /// + /// Check to see if a string is marked up with '[[' at the start and ']]' at + /// the end. If so, return true, else return false. + /// + /// Key to validate + /// Boolean indicated if it is a valide key + /// ***************************************************************************** + public static bool IsKey( string key ) + { + return( null!=key && key.StartsWith( "[[" ) && key.EndsWith( "]]" ) ); + } + + /// ***************************************************************************** + /// + /// Removes the UDDI Localization Markup tags from a string. It will remove + /// '[[' from the begining and ']]' from the end. + /// + /// If the key doesn't contain markup tags, the string is returned in its + /// original state. + /// + /// Key to remove markup on + /// Bare Localization key. + /// ***************************************************************************** + public static string StripMarkup( string key ) + { + return key.TrimEnd( "]]".ToCharArray() ).TrimStart( "[[".ToCharArray() ); + } + + /// ***************************************************************************** + /// + /// Translation of kernel32:SetThreadUILanguage semantics into managed code. + /// Used for overridding console CurrentUICulture when console code page + /// doesn't match the current ANSI or OEM code page. + /// + /// ***************************************************************************** + public static void SetConsoleUICulture() + { + int iConsoleCodePage = System.Console.Out.Encoding.CodePage; + System.Threading.Thread currentThread = Thread.CurrentThread; + + // + // if no code page set, we're not in a console + // + if( 0 != iConsoleCodePage ) + { + if( !((iConsoleCodePage == currentThread.CurrentCulture.TextInfo.ANSICodePage || + iConsoleCodePage == currentThread.CurrentCulture.TextInfo.OEMCodePage) && + (iConsoleCodePage == currentThread.CurrentUICulture.TextInfo.ANSICodePage || + iConsoleCodePage == currentThread.CurrentUICulture.TextInfo.OEMCodePage)) ) + { + // + // override with en-US culture + // + currentThread.CurrentUICulture = new CultureInfo( "en-US" ); + } + } + } + + } +} diff --git a/inetsrv/uddi/source/core/makefile b/inetsrv/uddi/source/core/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/core/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/core/makefile.inc b/inetsrv/uddi/source/core/makefile.inc new file mode 100644 index 0000000..47a253a --- /dev/null +++ b/inetsrv/uddi/source/core/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/core/obj/_objects.mac b/inetsrv/uddi/source/core/obj/_objects.mac new file mode 100644 index 0000000..79cc5de --- /dev/null +++ b/inetsrv/uddi/source/core/obj/_objects.mac @@ -0,0 +1,64 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\application.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\config.obj \ + $(_OBJ_DIR)\i386\context.obj \ + $(_OBJ_DIR)\i386\core.obj \ + $(_OBJ_DIR)\i386\debug.obj \ + $(_OBJ_DIR)\i386\localization.obj \ + $(_OBJ_DIR)\i386\performance.obj \ + $(_OBJ_DIR)\i386\schemacollection.obj \ + $(_OBJ_DIR)\i386\sql.obj \ + $(_OBJ_DIR)\i386\win32.obj \ + $(_OBJ_DIR)\i386\uddiadconn.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\application.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\config.obj \ + $(_OBJ_DIR)\ia64\context.obj \ + $(_OBJ_DIR)\ia64\core.obj \ + $(_OBJ_DIR)\ia64\debug.obj \ + $(_OBJ_DIR)\ia64\localization.obj \ + $(_OBJ_DIR)\ia64\performance.obj \ + $(_OBJ_DIR)\ia64\schemacollection.obj \ + $(_OBJ_DIR)\ia64\sql.obj \ + $(_OBJ_DIR)\ia64\win32.obj \ + $(_OBJ_DIR)\ia64\uddiadconn.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\application.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\config.obj \ + $(_OBJ_DIR)\amd64\context.obj \ + $(_OBJ_DIR)\amd64\core.obj \ + $(_OBJ_DIR)\amd64\debug.obj \ + $(_OBJ_DIR)\amd64\localization.obj \ + $(_OBJ_DIR)\amd64\performance.obj \ + $(_OBJ_DIR)\amd64\schemacollection.obj \ + $(_OBJ_DIR)\amd64\sql.obj \ + $(_OBJ_DIR)\amd64\win32.obj \ + $(_OBJ_DIR)\amd64\uddiadconn.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\application.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\config.obj \ + $(_OBJ_DIR)\arm\context.obj \ + $(_OBJ_DIR)\arm\core.obj \ + $(_OBJ_DIR)\arm\debug.obj \ + $(_OBJ_DIR)\arm\localization.obj \ + $(_OBJ_DIR)\arm\performance.obj \ + $(_OBJ_DIR)\arm\schemacollection.obj \ + $(_OBJ_DIR)\arm\sql.obj \ + $(_OBJ_DIR)\arm\win32.obj \ + $(_OBJ_DIR)\arm\uddiadconn.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/core/obj/i386/uddi.core.dll b/inetsrv/uddi/source/core/obj/i386/uddi.core.dll new file mode 100644 index 0000000..cbce81a Binary files /dev/null and b/inetsrv/uddi/source/core/obj/i386/uddi.core.dll differ diff --git a/inetsrv/uddi/source/core/obj/i386/uddi.core.pdb b/inetsrv/uddi/source/core/obj/i386/uddi.core.pdb new file mode 100644 index 0000000..307b7f9 Binary files /dev/null and b/inetsrv/uddi/source/core/obj/i386/uddi.core.pdb differ diff --git a/inetsrv/uddi/source/core/performance.cs b/inetsrv/uddi/source/core/performance.cs new file mode 100644 index 0000000..47bd093 --- /dev/null +++ b/inetsrv/uddi/source/core/performance.cs @@ -0,0 +1,181 @@ +namespace UDDI.Diagnostics +{ + using System; + using System.Diagnostics; + using System.Collections; + using System.Text; + + /// + /// This class provides support for publication of all of the + /// UDDI performance counters + /// + public class Performance + { + // + // suffix use to identify average base counters + // + private static string BaseSuffix = "b"; + + public Performance() + { + } + + public static void DeleteCounters() + { + PerformanceCounterCategory.Delete( "UDDI.API.Times" ); + PerformanceCounterCategory.Delete( "UDDI.API.Counts" ); + } + + public static void InitializeCounters() + { + if( !PerformanceCounterCategory.Exists( "UDDI.API.Times" ) ) + { + // + // Create performance counters to measure the duration of message calls. + // + CounterCreationDataCollection times = new CounterCreationDataCollection(); + + foreach( string messageName in MessageNames.Names ) + { + AddAverageTimesCounter( ref times, messageName ); + } + + PerformanceCounterCategory.Create( "UDDI.API.Times", "UDDI.API.Times.Category.Help", times ); + } + + if( !PerformanceCounterCategory.Exists( "UDDI.API.Counts" ) ) + { + // + // Create performance counters to measure the number of times each message is called. + // + CounterCreationDataCollection counts = new CounterCreationDataCollection(); + + foreach( string messageName in MessageNames.Names ) + { + AddCumulativeAccessCountCounter(ref counts, messageName); + } + PerformanceCounterCategory.Create( "UDDI.API.Counts", "UDDI.API.Counts.Category.Help", counts ); + } + } + + public static void PublishMessageData( string name, TimeSpan duration ) + { + PerformanceCounter pc = new PerformanceCounter( "UDDI.API.Counts", name, false ); + pc.Increment(); + + // + // The milliseconds value is a double, IncrementBy accepts a long check to + // avoid casting errors + // + if( duration.TotalMilliseconds <= long.MaxValue ) + { + PerformanceCounter pcduration = new PerformanceCounter( "UDDI.API.Times", name, false ); + pcduration.IncrementBy( (long) duration.TotalMilliseconds ); + + // + // The RawFraction counter type multiplies by 100 to generate a percentage; we don't + // want this, so increment by 100 to offset. + // + PerformanceCounter pcdurationbase = new PerformanceCounter( "UDDI.API.Times", name + BaseSuffix, false ); + pcdurationbase.IncrementBy( 100 ); + } + } + + private static void AddAverageTimesCounter(ref CounterCreationDataCollection counters, string name) + { + string helpstr = string.Format( Localization.GetString( "AVERAGE_DURATION_COUNT_HELP" ), name ); + string avgstr = string.Format( Localization.GetString( "AVERAGE_DURATION_COUNT_BASE" ), name ); + + + CounterCreationData newCounter = new CounterCreationData( name, + helpstr, + PerformanceCounterType.RawFraction ); + + CounterCreationData baseCounter = new CounterCreationData( name + BaseSuffix, + avgstr, + PerformanceCounterType.RawBase ); + + // + // RawFraction counter types must be followed by their corresponding base counter type in list of counters added to CounterCreationDataCollection. + // + counters.Add( newCounter ); + counters.Add( baseCounter ); + } + + private static void AddCumulativeAccessCountCounter(ref CounterCreationDataCollection counters, string name) + { + string helpstr = string.Format( Localization.GetString( "CUMULATIVE_ACCESS_COUNT_HELP" ), name ); + + + CounterCreationData newCounter = new CounterCreationData( name, + helpstr, + PerformanceCounterType.NumberOfItems64 ); + counters.Add( newCounter ); + } + + + + // + // TODO: This class should probably go somewhere else. API is a likely choice, but do we want Core to have + // a dependency on API? + // + // We can't, it would be a cyclical reference. + + // + // SOAP message names. V2 API messages were added as part of bug# 1388 + // + class MessageNames + { + public static string[] Names = + { + // + // Inquire message names + // + "find_binding", + "find_business", + "find_relatedBusinesses", + "find_service", + "find_tModel", + "get_bindingDetail", + "get_businessDetail", + "get_businessDetailExt", + "get_serviceDetail", + "get_tModelDetail", + "validate_categorization", + + // + // Publish message types + // + "add_publisherAssertions", + "delete_binding", + "delete_business", + "delete_publisherAssertions", + "delete_service", + "delete_tModel", + "discard_authToken", + "get_assertionStatusReport", + "get_authToken", + "get_publisherAssertions", + "get_registeredInfo", + "save_binding", + "save_business", + "save_service", + "save_tModel", + "set_publisherAssertions", + + // + // Replication message types + // + "get_changeRecords", + "notify_changeRecordsAvailable", + "do_ping", + "get_highWaterMarks", + + // + // MS Extensions + // + "get_relatedCategories" + }; + } + } +} diff --git a/inetsrv/uddi/source/core/placefil.txt b/inetsrv/uddi/source/core/placefil.txt new file mode 100644 index 0000000..144639a --- /dev/null +++ b/inetsrv/uddi/source/core/placefil.txt @@ -0,0 +1 @@ +uddi.core.dll uddi\bin:uddi\webroot\bin diff --git a/inetsrv/uddi/source/core/schemacollection.cs b/inetsrv/uddi/source/core/schemacollection.cs new file mode 100644 index 0000000..84125dc --- /dev/null +++ b/inetsrv/uddi/source/core/schemacollection.cs @@ -0,0 +1,100 @@ +using System; +using System.IO; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; +using UDDI.Diagnostics; + +namespace UDDI +{ + /// ******************************************************************** + /// public class SchemaCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class SchemaCollection + { + private static XmlSchemaCollection xsc = new XmlSchemaCollection(); + private static bool initialized = false; + + static SchemaCollection() + { + Debug.VerifySetting( "InstallRoot" ); + + string installRoot = Config.GetString( "InstallRoot" ); + + AddSchema( "urn:uddi-org:api", installRoot + "uddi_v1.xsd" ); + AddSchema( "urn:uddi-org:api_v2", installRoot + "uddi_v2.xsd" ); + AddSchema( "urn:uddi-org:repl", installRoot + "uddi_v2replication.xsd" ); + AddSchema( "urn:uddi-microsoft-com:api_v2_extensions", installRoot + "extensions.xsd" ); + + Debug.Verify( 4 == xsc.Count, "UDDI_ERROR_FATALERROR_SCHEAMAS_LOADING" ); + + initialized = true; + } + + public static void AddSchema( string ns, string filename ) + { + Debug.Verify( + File.Exists( filename ), + "UDDI_ERROR_FATALERROR_SCHEMEMISSING", + ErrorType.E_fatalError, + filename + ); + + xsc.Add( ns, filename ); + } + + public static void Validate( object obj ) + { + Debug.Verify( initialized, "UDDI_ERROR_FATALERROR_SCHEAMAS_LOADING" ); + + MemoryStream stream = new MemoryStream(); + XmlSerializer serializer = new XmlSerializer( obj.GetType() ); + + serializer.Serialize( stream, obj ); + + stream.Seek( 0, SeekOrigin.Begin ); + XmlTextReader reader = new XmlTextReader( stream ); + + LocalValidate( reader ); + } + + public static void Validate( Stream stream ) + { + Debug.Verify( initialized, "UDDI_ERROR_FATALERROR_SCHEAMAS_LOADING" ); + + // + // Rewind stream and validate + // + stream.Seek( 0, SeekOrigin.Begin ); + + XmlTextReader reader = new XmlTextReader( stream ); + LocalValidate( reader ); + + // + // Rewind stream again, so someone else can use it + // + stream.Seek( 0, SeekOrigin.Begin ); + } + + public static void ValidateFile( string filename ) + { + Debug.Verify( initialized, "UDDI_ERROR_FATALERROR_SCHEAMAS_LOADING" ); + + XmlTextReader reader = new XmlTextReader( filename ); + + LocalValidate( reader ); + } + + private static void LocalValidate( XmlTextReader reader ) + { + XmlValidatingReader validator = new XmlValidatingReader( reader ); + validator.Schemas.Add( xsc ); + + while( validator.Read()){} + } + } +} diff --git a/inetsrv/uddi/source/core/sources b/inetsrv/uddi/source/core/sources new file mode 100644 index 0000000..a72a968 --- /dev/null +++ b/inetsrv/uddi/source/core/sources @@ -0,0 +1,29 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=uddi.core +TARGETPATH=obj +TARGETTYPE=DYNLINK +#UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + +REFERENCES=system.dll, system.data.dll, system.web.dll, system.xml.dll, system.directoryservices.dll + +SOURCES=\ + application.cs \ + assemblyinfo.cs \ + config.cs \ + context.cs \ + core.cs \ + debug.cs \ + localization.cs \ + performance.cs \ + schemacollection.cs \ + sql.cs \ + win32.cs \ + uddiadconn.cs + +BINPLACE_PLACEFILE=placefil.txt + diff --git a/inetsrv/uddi/source/core/sql.cs b/inetsrv/uddi/source/core/sql.cs new file mode 100644 index 0000000..2d159cb --- /dev/null +++ b/inetsrv/uddi/source/core/sql.cs @@ -0,0 +1,784 @@ +using System; +using System.IO; +using System.Xml; +using System.Web; +using System.Text; +using System.Collections; +using System.Data; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI.Diagnostics; + +namespace UDDI +{ + public class ConnectionManager + { + private static string readerConnectionString; + private static string writerConnectionString; + + private SqlConnection conn; + private SqlTransaction txn; + + [ThreadStatic] + static private ConnectionManager cm; + + private ConnectionManager( bool writeAccess, bool transactional ) + { + try + { + Debug.VerifySetting( "Database.ReaderConnectionString" ); + Debug.VerifySetting( "Database.WriterConnectionString" ); + + // + // Get the database connection strings. We do this each time a + // connection is opened so that an operator can change database + // connection strings without having to restart the server. + // + readerConnectionString = Config.GetString( "Database.ReaderConnectionString" ); + writerConnectionString = Config.GetString( "Database.WriterConnectionString" ); + } + catch( UDDIException ) + { + // + // Treat these specially; we want to give the user a better error message since this + // means that this web server is not associated with a UDDI site. + // + //throw new UDDIException( ErrorType.E_fatalError, "This web server cannot process UDDI requests because it is not part of a UDDI site or the UDDI site being used is not valid. Ensure that values in the ReaderConnectionString and WriterConnectionString registry keys specify a valid UDDI Site." ); + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_INVALID_UDDI_SITE" ); + } + + if( writeAccess ) + conn = new SqlConnection( writerConnectionString ); + else + conn = new SqlConnection( readerConnectionString ); + + conn.Open(); + + if( transactional ) + { + txn = conn.BeginTransaction(); + Debug.Write( SeverityType.Info, CategoryType.Data, "Initiating a Transaction" ); + } + } + + public static void Open( bool writeAccess, bool transactional ) + { + Debug.Enter(); + + ConnectionManager cm = new ConnectionManager( writeAccess, transactional ); + HttpContext ctx = HttpContext.Current; + + if( null != (object) ctx ) + { + ctx.Items[ "Connection" ] = cm; + } + else + { + ConnectionManager.cm = cm; + } + + Debug.Leave(); + } + + public static ConnectionManager Get() + { + HttpContext ctx = HttpContext.Current; + + if( null != (object) ctx ) + { + return (ConnectionManager) ctx.Items[ "Connection" ]; + } + else + { + return ConnectionManager.cm; + } + } + + public static SqlConnection GetConnection() + { + ConnectionManager cm = Get(); + if( null == (object) cm ) + return null; + + return cm.conn; + } + + public static SqlTransaction GetTransaction() + { + ConnectionManager cm = Get(); + if( null == (object) cm ) + return null; + + return cm.txn; + } + + public static void BeginTransaction() + { + Debug.Enter(); + + ConnectionManager cm = Get(); +#if never + Debug.Verify( null != (object)cm, "Static connection manager was null in attempt to begin transaction." ); + Debug.Verify( null != (object)cm.conn, "Database connection was null in attempt to begin transaction." ); + Debug.Verify( null == (object)cm.txn, "Database was already in a transaction in attempt to begin a new transaction." ); +#endif + Debug.Verify( null != (object)cm, "UDDI_ERROR_TRANSACTION_BEGIN_CONNECTION_MANAGER" ); + Debug.Verify( null != (object)cm.conn, "UDDI_ERROR_TRANSACTION_BEGIN_CONNECTION" ); + Debug.Verify( null == (object)cm.txn, "UDDI_ERROR_ALREADY_IN_TRANSACTION" ); + + cm.txn = cm.conn.BeginTransaction(); + + Debug.Leave(); + } + + public static void Commit() + { + Debug.Enter(); + + ConnectionManager cm = Get(); +#if never + Debug.Verify( null != (object)cm.conn, "Database connection was null in attempt to commit transaction." ); + Debug.Verify( null != (object)cm.txn, "Database transaction was null in attempt to commit transaction." ); +#endif + Debug.Verify( null != (object)cm.conn, "UDDI_ERROR_TRANSACTION_COMMIT_CONNECTION" ); + Debug.Verify( null != (object)cm.txn, "UDDI_ERROR_TRANSACTION_COMMIT_TRANSACTION" ); + + cm.txn.Commit(); + cm.txn = null; + + Debug.Leave(); + } + + public static void Abort() + { + Debug.Enter(); + + ConnectionManager cm = Get(); +#if never + Debug.Verify( null != (object)cm.conn, "Database connection was null in attempt to abort transaction." ); + Debug.Verify( null != (object)cm.txn, "Database transaction was null in attempt to abort transaction." ); +#endif + Debug.Verify( null != (object)cm.conn, "UDDI_ERROR_TRANSACTION_ABORT_CONNECTION" ); + Debug.Verify( null != (object)cm.txn, "UDDI_ERROR_TRANSACTION_ABORT_TRANSACTION" ); + + cm.txn.Rollback(); + cm.txn = null; + + Debug.Leave(); + } + + public static void Close() + { + Debug.Enter(); + + SqlConnection cn = GetConnection(); + SqlTransaction txn = GetTransaction(); + + // + // This function can be safely called repeatedly + if( null == (object) cn ) + return; + + cn.Close(); + + HttpContext ctx = HttpContext.Current; + + if( null != (object) ctx ) + { + ctx.Items.Remove( "Connection" ); + } + else + { + ConnectionManager.cm = null; + } + + Debug.Leave(); + } + } + + public class SqlStoredProcedureAccessor + { + private SqlCommand cmd; + private SqlParameterAccessor paramAcc; + + public SqlStoredProcedureAccessor() + { + cmd = new SqlCommand(); + + cmd.Connection = ConnectionManager.GetConnection(); + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.CommandType = CommandType.StoredProcedure; + + paramAcc = new SqlParameterAccessor( cmd.Parameters ); + } + + public SqlStoredProcedureAccessor( string procedureName ) + : this() + { + ProcedureName = procedureName; + } + + public void Close() + { + cmd.Dispose(); + } + + public int Fill( DataSet dataSet, string srcTable ) + { + SqlDataAdapter adapter = new SqlDataAdapter( cmd ); + + return adapter.Fill( dataSet, srcTable ); + } + + public string ProcedureName + { + get { return cmd.CommandText; } + set { cmd.CommandText = value; } + } + + public SqlParameterAccessor Parameters + { + get { return paramAcc; } + } + + public int ExecuteNonQuery() + { + return cmd.ExecuteNonQuery(); + } + + public SqlDataReaderAccessor ExecuteReader() + { + return new SqlDataReaderAccessor( cmd.ExecuteReader() ); + } + + public object ExecuteScalar() + { + return cmd.ExecuteScalar(); + } + } + + public class SqlParameterAccessor + { + private SqlParameterCollection parameters; + + public SqlParameterAccessor( SqlParameterCollection parameters ) + { + this.parameters = parameters; + } + + public void Clear() + { + parameters.Clear(); + } + + public void Add( string name, SqlDbType dbType ) + { + Add( name, dbType, ParameterDirection.Input ); + } + + public void Add( string name, SqlDbType dbType, ParameterDirection direction ) + { + parameters.Add( new SqlParameter( name, dbType ) ).Direction = direction; + } + + public void Add( string name, SqlDbType dbType, int size ) + { + Add( name, dbType, size, ParameterDirection.Input ); + } + + public void Add( string name, SqlDbType dbType, int size, ParameterDirection direction ) + { + parameters.Add( new SqlParameter( name, dbType, size ) ).Direction = direction; + } + + public void SetNull( string index ) + { + parameters[ index ].Value = DBNull.Value; + } + + public void SetNull( int index ) + { + parameters[ index ].Value = DBNull.Value; + } + + public void SetBinary( string index, byte[] data ) + { + if( null == data ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = data; + } + + public void SetString( string index, string data ) + { + if( null == data ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = data; + } + + public void SetString( int index, string data ) + { + if( null == data ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = data; + } + + public void SetShort( string index, short data ) + { + parameters[ index ].Value = data; + } + + public void SetShort( int index, short data ) + { + parameters[ index ].Value = data; + } + + public void SetInt( string index, int data ) + { + parameters[ index ].Value = data; + } + + public void SetInt( int index, int data ) + { + parameters[ index ].Value = data; + } + + public void SetLong( string index, long data ) + { + parameters[ index ].Value = data; + } + + public void SetLong( int index, long data ) + { + parameters[ index ].Value = data; + } + + public void SetGuid( string index, Guid guid ) + { + if( null == (object)guid ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = guid; + } + + public void SetGuid( int index, Guid guid ) + { + if( null == (object)guid ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = guid; + } + + public void SetGuidFromString( string index, string guid ) + { + try + { + if( Utility.StringEmpty( guid ) ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = new Guid( guid ); + } + catch + { + throw new UDDIException( ErrorType.E_invalidKeyPassed, "UDDI_ERROR_INVALID_KEY" ); + } + } + + public void SetGuidFromString( int index, string guid ) + { + try + { + if( Utility.StringEmpty( guid ) ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = new Guid( guid ); + } + catch + { + throw new UDDIException( ErrorType.E_invalidKeyPassed, "UDDI_ERROR_INVALID_KEY" ); + } + } + + public void SetGuidFromKey( string index, string key ) + { + try + { + if( Utility.StringEmpty( key ) ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = Conversions.GuidFromKey( key ); + } + catch + { + throw new UDDIException( ErrorType.E_invalidKeyPassed, "UDDI_ERROR_INVALID_KEY" ); + } + } + + public void SetGuidFromKey( int index, string key ) + { + try + { + if( Utility.StringEmpty( key ) ) + parameters[ index ].Value = DBNull.Value; + else + parameters[ index ].Value = Conversions.GuidFromKey( key ); + } + catch + { + throw new UDDIException( ErrorType.E_invalidKeyPassed, "UDDI_ERROR_INVALID_KEY" ); + } + } + + public void SetBool( string index, bool flag ) + { + parameters[ index ].Value = flag; + } + + public void SetBool( int index, bool flag ) + { + parameters[ index ].Value = flag; + } + + public void SetDateTime( string index, DateTime datetime ) + { + parameters[ index ].Value = datetime; + } + + public void SetDateTime( int index, DateTime datetime ) + { + parameters[ index ].Value = datetime; + } + + public byte[] GetBinary( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return null; + + return (byte[])data; + } + + public string GetString( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return null; + + return Convert.ToString( data ); + } + + public string GetString( int index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return null; + + return Convert.ToString( data ); + } + + public int GetInt( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt32( data ); + } + + public int GetInt( int index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt32( data ); + } + + public short GetShort( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt16( data ); + } + + public short GetShort( int index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt16( data ); + } + + public long GetLong( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt64( data ); + } + + public long GetLong( int index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt64( data ); + } + + public string GetGuidString( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return null; + + System.Guid guid = (System.Guid)data; + + return Convert.ToString( guid ); + } + + public string GetGuidString( int index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return null; + + System.Guid guid = (System.Guid)data; + + return Convert.ToString( guid ); + } + + public bool GetBool( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return false; + + return Convert.ToBoolean( parameters[ index ].Value ); + } + + public bool GetBool( int index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return false; + + return Convert.ToBoolean( parameters[ index ].Value ); + } + + + public object GetDateTime( string index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return null; + + return parameters[ index ].Value ; + } + + public object GetDateTime( int index ) + { + object data = parameters[ index ].Value; + + if( DBNull.Value == data ) + return null; + + return parameters[ index ].Value ; + } + + + public bool IsNull( string index ) + { + return DBNull.Value == parameters[ index ].Value; + } + + public bool IsNull( int index ) + { + return DBNull.Value == parameters[ index ].Value; + } + } + + public class SqlDataReaderAccessor + { + private SqlDataReader reader; + + public SqlDataReaderAccessor( SqlDataReader reader ) + { + this.reader = reader; + } + + ~SqlDataReaderAccessor() + { + } + + public void Close() + { + reader.Close(); + } + + public bool Read() + { + return reader.Read(); + } + + public bool NextResult() + { + return reader.NextResult(); + } + + public bool IsDBNull( int index ) + { + return reader.IsDBNull( index ); + } + + public byte[] GetBinary( string index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return null; + + return (byte[])data; + } + + public string GetString( string index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return null; + + return Convert.ToString( data ); + } + + public string GetString( int index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return null; + + return Convert.ToString( data ); + } + + public int GetInt( string index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt32( data ); + } + + public int GetInt( int index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt32( data ); + } + + public short GetShort( string index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt16( data ); + } + + public short GetShort( int index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt16( data ); + } + + public long GetLong( string index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt64( data ); + } + + public long GetLong( int index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return 0; + + return Convert.ToInt64( data ); + } + + public string GetGuidString( string index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return null; + + return Convert.ToString( data ); + } + + public string GetGuidString( int index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return null; + + return Convert.ToString( data ); + } + + public string GetKeyFromGuid( string index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return null; + + return "uuid:" + Convert.ToString( data ); + } + + public string GetKeyFromGuid( int index ) + { + object data = reader[ index ]; + + if( DBNull.Value == data ) + return null; + + return "uuid:" + Convert.ToString( data ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/core/uddiadconn.cs b/inetsrv/uddi/source/core/uddiadconn.cs new file mode 100644 index 0000000..c905be7 --- /dev/null +++ b/inetsrv/uddi/source/core/uddiadconn.cs @@ -0,0 +1,366 @@ +using System; +using System.DirectoryServices; + +namespace UDDI.ActiveDirectory +{ + /// + /// This class manages the ServiceConnectionPoint publication into the AD + /// + public class UDDIServiceConnPoint + { + + //------------------------- PUBLIC KEYWORDS ----------------------------- + // + public const string kwdVendor = "Microsoft Corporation"; + public const string kwdVendorGuid = "83C29870-1DFC-11D3-A193-0000F87A9099"; + public const string kwdTechnology = "UDDI"; + public const string kwdTechnologyVer = "2.0"; + public const string kwdProduct = "UDDI Services"; + public const string kwdProductGuid = "09A92664-D144-49DB-A600-2B3ED04BF639"; + + public const string kwdInquireAPI = "Inquire API"; + public const string kwdInquireAPIGuid = "4CD7E4BC-648B-426D-9936-443EAAC8AE23"; + public const string kwdInquireSvcClass = "UddiInquireUrl"; + + public const string kwdPublishAPI = "Publish API"; + public const string kwdPublishAPIGuid = "64C756D1-3374-4E00-AE83-EE12E38FAE63"; + public const string kwdPublishSvcClass = "UddiPublishUrl"; + + public const string kwdWebSiteSignature = "Web Site"; + public const string kwdWebSiteGuid = "316F991C-2591-4F1A-8FF1-352A76669E37"; + public const string kwdWebSiteSvcClass = "UddiWebSiteUrl"; + + public const string kwdDiscovery = "DiscoveryUrl"; + public const string kwdDiscoveryGuid = "1276768A-1488-4C6F-A8D8-19556C6BE583"; + public const string kwdDiscoverySvcClass= "UddiDiscoveryUrl"; + + public const string kwdAddWebRef = "Add Web Reference"; + public const string kwdAddWebRefGuid = "CE653789-F6D4-41B7-B7F4-31501831897D"; + public const string kwdAddWebRefSvcClass= "UddiAddWebReferenceUrl"; + + //-------------------------- PRIVATE DEFINITIONS -------------------------- + // + // default keywords for the site node + // comma separates keywords + // + private const string szDefSiteKeywords = kwdTechnology + "," + kwdTechnologyVer + "," + + kwdVendor + "," + kwdVendorGuid + "," + + kwdProduct + "," + kwdProductGuid; + + // INTERNAL representation of the path. Slashes will be replaced with CN's + // Do not remove or change the separators + private const char cADPathSeparator = '/'; + private const string szADUDDIRootPath = "System/Microsoft/UDDI/Sites"; + + + //------------------------------------------------------------------------- + // Creates a new entry for the site, right under the root path + // above + // + static public DirectoryEntry CreateSiteEntry( string siteCN ) + { + if ( siteCN == null ) + throw new ArgumentNullException( "Site CN cannot be null" ); + + if ( siteCN.Length == 0 ) + throw new ArgumentException( "Site CN cannot be empty" ); + + string[] ADPath = szADUDDIRootPath.Split( cADPathSeparator ); + string nodeCN = NormalizeCN( siteCN ); + + DirectoryEntry adRootNode = CreateFullADPath (ADPath); + + DirectoryEntry adSiteNode = null; + try + { + adSiteNode = adRootNode.Children.Find( nodeCN, "container" ); + } + catch (Exception) + { + adSiteNode = null; + } + + if ( adSiteNode == null ) + { + adSiteNode = adRootNode.Children.Add( nodeCN, "container" ); + adSiteNode.CommitChanges(); + } + + try + { + AddNodeKeywords( adSiteNode ); + } + catch (Exception) + { + } + + return adSiteNode; + } + + // + // Removes the Site entry and all the children + // + public static void DeleteSiteEntry( string siteCN ) + { + if ( siteCN == null ) + throw new ArgumentNullException( "Site CN cannot be null" ); + + if ( siteCN.Length == 0 ) + throw new ArgumentException( "Site CN cannot be empty" ); + + string nodeCN = NormalizeCN( siteCN ); + string fullyQualifiedPath = GetFullyQualifiedPath( "" ); + DirectoryEntry entry = new DirectoryEntry( fullyQualifiedPath ); + + DirectoryEntry sub = entry.Children.Find( nodeCN ); + try + { + // first, try deleting the node as if it was a leaf + entry.Children.Remove (sub); + entry.CommitChanges (); + } + catch (Exception) // most likely this is a tree, or we don't have permissions + { + // retry deleting the whole tree + sub.DeleteTree (); + } + } + + + // Drop + Create the whole site node + public static DirectoryEntry ResetSiteEntry( string siteCN ) + { + if ( siteCN == null ) + throw new ArgumentNullException( "Site CN cannot be null" ); + + if ( siteCN.Length == 0 ) + throw new ArgumentException( "Site CN cannot be empty" ); + + try + { + DeleteSiteEntry( siteCN ); + } + catch(Exception) + { + } + + return CreateSiteEntry( siteCN ); + } + + + // + // Creates a Web Service entry point (e.g. Publish API) + // + public static void CreateEntryPoint( string siteCN, + string bindingKey, string accessPoint, + string serviceClass, + string displayName, string description, + params object[] additionalKeywords ) + { + if ( siteCN == null || bindingKey == null || accessPoint == null || serviceClass == null) + throw new ArgumentNullException( "'Site CN', 'Binding Key', 'Acess Point' and 'Service Class' are required parameters" ); + + if ( siteCN.Length == 0 || bindingKey.Length == 0 ) + throw new ArgumentException( "'Site CN', 'Binding Key', 'Acess Point' and 'Service Class' are required parameters" ); + + string entryKey = NormalizeCN( bindingKey ); + + // + // first, make sure the Site node is OK + // + DirectoryEntry siteNode = CreateSiteEntry( siteCN ); + + // + // then see whether the entry has been created already + // + DirectoryEntry svcEntry = null; + try + { + svcEntry = siteNode.Children.Find( entryKey, "serviceConnectionPoint" ); + } + catch (Exception) + { + svcEntry = null; + } + + // + // create a new entry if there is no one yet. + // Otherwise, just leave it alone + // + if ( svcEntry == null ) + { + svcEntry = siteNode.Children.Add( entryKey, "serviceConnectionPoint" ); + + // now add all the rest + svcEntry.Properties[ "url" ].Add( accessPoint ); + + if ( displayName != null && displayName.Length > 0 ) + svcEntry.Properties[ "displayName" ].Add( displayName ); + + if ( description != null && description.Length > 0 ) + svcEntry.Properties[ "description" ].Add( description ); + + svcEntry.Properties[ "serviceClassName" ].Add( serviceClass ); + svcEntry.Properties[ "serviceBindingInformation" ].Add( accessPoint ); + + // + // try to save... + // + svcEntry.CommitChanges(); + } + + // now set the keywords + try + { + AddNodeKeywords( svcEntry, additionalKeywords ); + } + catch (Exception) + { + } + } + + + // + // Removes specific service "entry point" node for the Site + // E.g., one can drop "Publish API" entry but leave the rest intact + // + public static void RemoveEntryPoint( string siteCN, string bindingKey ) + { + if ( siteCN == null || bindingKey == null ) + throw new ArgumentNullException( "Neither 'Site CN' nor 'Binding Key' can be null" ); + + if ( siteCN.Length == 0 || bindingKey.Length == 0 ) + throw new ArgumentException( "Neither 'Site CN' nor 'Binding Key' can be empty" ); + + string nodeCN = NormalizeCN( siteCN ); + string subKey = NormalizeCN( bindingKey ); + string fullyQualifiedPath = GetFullyQualifiedPath( nodeCN ); + DirectoryEntry entry = new DirectoryEntry( fullyQualifiedPath ); + + DirectoryEntry sub = entry.Children.Find( subKey ); + try + { + // first, try deleting the node as if it was a leaf + entry.Children.Remove (sub); + entry.CommitChanges (); + } + catch (Exception) // most likely this is a tree, or we don't have permissions + { + // retry deleting the whole tree + sub.DeleteTree (); + } + } + + //*************************************************************************** + // Internal helpers go here + // + + // + // Verifies the AD path from the root and creates the missing nodes + // if necessary. Returns the AD Directory entry that corresponds to + // the last (rightmost) node in the path + // + protected static DirectoryEntry CreateFullADPath (string[] path) + { + DirectoryEntry objDE = new DirectoryEntry( "LDAP://RootDSE" ); + string szNamingContext = objDE.Properties["defaultNamingContext"][0].ToString(); + + DirectoryEntry adOurRoot = new DirectoryEntry ("LDAP://" + szNamingContext); + DirectoryEntry adNode = adOurRoot; + + if ( path.Length == 0 ) + return adNode; + + foreach (string pathCN in path) + { + string pathPart = NormalizeCN( pathCN ); + + DirectoryEntry subnode = null; + try + { + subnode = adNode.Children.Find( pathPart, "container" ); + } + catch (Exception) // not found + { + subnode = null; + } + + if ( subnode == null ) // not found, go create one + { + subnode = adNode.Children.Add( pathPart, "container" ); + subnode.CommitChanges(); + } + + adNode = subnode; + } + + return adNode; + } + + // + // Makes sure the CN node is prepended with "cn=" + // + static protected string NormalizeCN( string szCN ) + { + string nodeCN = szCN.ToLower(); + + if ( !nodeCN.StartsWith( "cn=" ) ) + nodeCN = "CN=" + szCN; + else + nodeCN = szCN; + + return nodeCN; + } + + + // + // Composes a full "path" based on the defaule naming context and our "root" path + // Optionally, a "leaf" under the path can be specified + // + static protected string GetFullyQualifiedPath( string leafNode ) + { + string[] ADPath = szADUDDIRootPath.Split( cADPathSeparator ); + string fullyQualifiedPath = ""; + + if ( leafNode != null && leafNode.Length > 0 ) + fullyQualifiedPath = NormalizeCN( leafNode ) + ","; + + for (int i = ADPath.Length - 1; i >= 0; i-- ) + { + fullyQualifiedPath += NormalizeCN( ADPath[i] ); + fullyQualifiedPath += ","; + } + + DirectoryEntry objRoot = new DirectoryEntry ("LDAP://RootDSE"); + string szNamingContext = objRoot.Properties["defaultNamingContext"][0].ToString(); + + fullyQualifiedPath = "LDAP://" + fullyQualifiedPath + szNamingContext; + + return fullyQualifiedPath; + } + + + // + // Attempts to add the required keywords to the node + // Sets up the "required" ones and then appends the "optional" + // + static protected void AddNodeKeywords( DirectoryEntry node, params object[] optionalKwds ) + { + if ( node == null ) + throw new ArgumentNullException ("'Node' cannot be null"); + + string[] keywords = szDefSiteKeywords.Split( ',' ); + foreach ( string szKwd in keywords ) + { + node.Properties[ "keywords" ].Add( szKwd ); + } + + foreach ( object szOptKwd in optionalKwds ) + { + node.Properties[ "keywords" ].Add( szOptKwd.ToString() ); + } + + node.CommitChanges(); + } + } +} diff --git a/inetsrv/uddi/source/core/win32.cs b/inetsrv/uddi/source/core/win32.cs new file mode 100644 index 0000000..ac1a4db --- /dev/null +++ b/inetsrv/uddi/source/core/win32.cs @@ -0,0 +1,80 @@ +using System; +using System.Runtime.InteropServices; + +namespace UDDI +{ + public class Win32 + { + public static readonly uint HKEY_LOCAL_MACHINE = 0x80000002; + public static readonly uint KEY_READ = 0x00020019; + public static readonly uint KEY_WRITE = 0x00020006; + public static readonly uint KEY_ALL_ACCESS = 0x0002003F; + public static readonly uint REG_NOTIFY_CHANGE_LAST_SET = 0x0004; + + public enum ProductType : byte + { + WindowsWorkstation = 0x01, + DomainController = 0x02, + WindowsServer = 0x03 + } + + [ StructLayout( LayoutKind.Sequential ) ] + public class OsVersionInfo + { + private int size = Marshal.SizeOf( typeof( OsVersionInfo ) ); + + public uint MajorVersion; + public uint MinorVersion; + public uint BuildNumber; + public uint PlatformID; + + [ MarshalAs( UnmanagedType.ByValTStr, SizeConst=128 ) ] + public string AdditionalInformation; + } + + [ StructLayout( LayoutKind.Explicit ) ] + public class OsVersionInfoEx + { + [ FieldOffset( 0 ) ] + private int size = Marshal.SizeOf( typeof( OsVersionInfoEx ) ); + + [ FieldOffset( 4 ) ] + public uint MajorVersion; + [ FieldOffset( 8 ) ] + public uint MinorVersion; + [ FieldOffset( 12 ) ] + public uint BuildNumber; + [ FieldOffset( 16 ) ] + public uint PlatformID; + + [ FieldOffset( 20 ), MarshalAs( UnmanagedType.ByValTStr, SizeConst=128 ) ] + public string AdditionalInformation; + + [ FieldOffset( 276 ) ] + public ushort ServicePackMajor; + [ FieldOffset( 278 ) ] + public ushort ServicePackMinor; + [ FieldOffset( 280 ) ] + public ushort SuiteMask; + [ FieldOffset( 282 ) ] + public Win32.ProductType ProductType; + [ FieldOffset( 283 ) ] + public byte Reserved; + } + + [ DllImport( "kernel32", EntryPoint="GetVersionExW" ) ] + public static extern bool GetVersionEx( [In, Out] OsVersionInfo versionInfo ); + + [ DllImport( "kernel32", EntryPoint="GetVersionExW" ) ] + public static extern bool GetVersionEx( [In, Out] OsVersionInfoEx versionInfo ); + + [ DllImport( "advapi32.dll", CharSet=CharSet.Auto ) ] + public static extern int RegCreateKeyEx( uint hkey, string subKey, uint reserved, string className, uint options, uint security, uint attributes, out uint result, uint disposition ); + + [ DllImport( "advapi32.dll", CharSet=CharSet.Auto ) ] + public static extern int RegNotifyChangeKeyValue( uint hkey, bool watchSubtree, uint notifyFilter, uint eventHandle, bool asynchronous ); + + [ DllImport( "advapi32.dll", CharSet=CharSet.Auto ) ] + public static extern int RegOpenKeyEx( uint hkey, string subKey, uint options, uint security, out uint result ); + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/dirs b/inetsrv/uddi/source/dirs new file mode 100644 index 0000000..09765f6 --- /dev/null +++ b/inetsrv/uddi/source/dirs @@ -0,0 +1 @@ +dirs = version common core api web addwebreference mmc filter operator replicate tools resources setup xp diff --git a/inetsrv/uddi/source/filter/filter.cpp b/inetsrv/uddi/source/filter/filter.cpp new file mode 100644 index 0000000..e16d12c --- /dev/null +++ b/inetsrv/uddi/source/filter/filter.cpp @@ -0,0 +1,280 @@ +#include +#include +#include + +#include + +using namespace std; + +// +// Incoming URL variables +// +string g_strPublishURL( "/publish" ); +string g_strInquireURL( "/inquire" ); +string g_strDiscoveryURL( "/discovery" ); +string g_strReplicationURL( "/replication" ); +string g_strPublishContractURL( "/publish?wsdl" ); +string g_strInquireContractURL( "/inquire?wsdl" ); + +string g_strPublishListenerURL( "/uddi/publish.asmx" ); +string g_strInquireListenerURL( "/uddi/inquire.asmx" ); +string g_strDiscoveryListenerURL( "/uddi/discovery.ashx" ); +string g_strReplicationListenerURL( "/uddi/replication.ashx" ); +string g_strPublishContractListenerURL( "/uddi/publish.wsdl" ); +string g_strInquireContractListenerURL( "/uddi/inquire.wsdl" ); + +BOOL WINAPI +GetFilterVersion( HTTP_FILTER_VERSION * pVer ) +{ + // + // Specify the types and order of notification + // + pVer->dwFlags = SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_URL_MAP; + pVer->dwFilterVersion = HTTP_FILTER_REVISION; + + strcpy( pVer->lpszFilterDesc, "UDDI Services Url Map Filter" ); + + return TRUE; +} + + +DWORD WINAPI +HttpFilterProc( HTTP_FILTER_CONTEXT* pfc, DWORD NotificationType, void* pvData ) +{ + //char szMessage[ 1000 ]; + + if( SF_NOTIFY_URL_MAP == NotificationType ) + { +#ifdef _DEBUG + PHTTP_FILTER_URL_MAP pURLMap; + pURLMap = (PHTTP_FILTER_URL_MAP) pvData; + //sprintf( szMessage, "Physical Path: %s Buffer Size: %d\n", pURLMap->pszPhysicalPath, pURLMap->cbPathBuff ); + //OutputDebugStringA( szMessage ); + + + pfc->pFilterContext = 0; +#endif + } + else if( SF_NOTIFY_PREPROC_HEADERS == NotificationType ) + { + PHTTP_FILTER_PREPROC_HEADERS pHeaders = (PHTTP_FILTER_PREPROC_HEADERS) pvData; + + char szUrl[ 256 ]; + char szContentType[ 256 ]; + + DWORD cbUrl = sizeof(szUrl); + DWORD cbContentType = sizeof(szContentType); + + BOOL bResult; + + // + // Map the URL + // + bResult = pHeaders->GetHeader( pfc, "url", szUrl, &cbUrl ); + + //sprintf( szMessage, "URL: %s\n", szUrl ); + //OutputDebugStringA( szMessage ); + + // + // Check for Inquire API Reference + // + if( 0 == _stricmp( szUrl, g_strInquireURL.c_str() ) ) + { + bResult = pHeaders->SetHeader( pfc, "url", (char*) g_strInquireListenerURL.c_str() ); + } + + // + // Check for Publish API Reference + // + else if( 0 == _stricmp( szUrl, g_strPublishURL.c_str() ) ) + { + bResult = pHeaders->SetHeader( pfc, "url", (char*) g_strPublishListenerURL.c_str() ); + } + + // + // Check for Inquire API Contract Reference + // + else if( 0 == _stricmp( szUrl, g_strInquireContractURL.c_str() ) ) + { + bResult = pHeaders->SetHeader( pfc, "url", (char*) g_strInquireContractListenerURL.c_str() ); + } + + // + // Check for Publish API Contract Reference + // + else if( 0 == _stricmp( szUrl, g_strPublishContractURL.c_str() ) ) + { + bResult = pHeaders->SetHeader( pfc, "url", (char*) g_strPublishContractListenerURL.c_str() ); + } + + // + // Check for Replication URL Reference + // + else if( 0 == _strnicmp( szUrl, g_strReplicationURL.c_str(), g_strReplicationURL.length() ) ) + { + // + // Amend URL to point to replication URL + // + string strUrl( g_strReplicationListenerURL ); + + // + // This appears to be a Replication URL + // + string strTemp( szUrl ); + + // + // Find the beginning of the query string + // + string::size_type n = strTemp.find( "?" ); + if( string::npos != n ) + { + // + // Found a query string + // + + // + // Attach the query string to the new URL + // + strUrl += strTemp.substr( n ); + } + + // + // Update the headers with the new destination + // + bResult = pHeaders->SetHeader( pfc, "url", (char*) strUrl.c_str() ); + + string strDebug = string( "\nURL mapped to: " ) + strUrl; + OutputDebugStringA( strDebug.c_str() ); + +// sprintf( szMessage, "New URL: %s\n", strUrl.c_str() ); +// OutputDebugStringA( szMessage ); + } + + // + // Check for Discovery URL Reference + // + + else if( 0 == _strnicmp( szUrl, g_strDiscoveryURL.c_str(), g_strDiscoveryURL.length() ) ) + { + // + // This appears to be a discovery URL + // + string strTemp( szUrl ); + string strUrl( g_strDiscoveryListenerURL ); + + // + // Find the beginning of the query string + // + string::size_type n = strTemp.find( "?" ); + if( string::npos != n ) + { + // + // Found a query string + // + + // + // Attach the query string to the new URL + // + strUrl += strTemp.substr( n ); + } + + // + // Update the headers with the new destination + // + bResult = pHeaders->SetHeader( pfc, "url", (char*) strUrl.c_str() ); + } + } + + return SF_STATUS_REQ_NEXT_NOTIFICATION; +} + +void WINAPI +GetRegKeyStringValue( HKEY& hKey, const char* regKeyName, string& regKeyValue ) +{ + long nResult = ERROR_SUCCESS; + DWORD dwType = REG_SZ; + DWORD dwCount = 0; + + nResult = ::RegQueryValueExA( hKey, + regKeyName, + NULL, + &dwType, + NULL, + &dwCount ); + + if( dwCount && ( nResult == ERROR_SUCCESS ) && ( dwType == REG_SZ || dwType == REG_EXPAND_SZ ) ) + { + char* pszBuf = new char[ dwCount ]; + + if( NULL != pszBuf ) + { + __try + { + nResult = ::RegQueryValueExA( hKey, + regKeyName, + NULL, + &dwType, + ( LPBYTE )pszBuf, + &dwCount ); + regKeyValue = pszBuf; + } + __finally + { + delete [] pszBuf; + pszBuf = NULL; + } + } + } +} + +extern "C" +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) +{ + try + { + if( DLL_PROCESS_ATTACH == dwReason ) + { + DisableThreadLibraryCalls( hInstance ); + + HKEY hKey = NULL; + if ( ::RegOpenKeyEx( HKEY_LOCAL_MACHINE, + "Software\\Microsoft\\UDDI\\Filter", + 0, + KEY_QUERY_VALUE, + &hKey ) == ERROR_SUCCESS ) + { + GetRegKeyStringValue( hKey, "PublishURL", g_strPublishURL ); + GetRegKeyStringValue( hKey, "PublishListenerURL", g_strPublishListenerURL ); + GetRegKeyStringValue( hKey, "PublishContractURL", g_strPublishContractURL ); + GetRegKeyStringValue( hKey, "PublishContractListenerURL", g_strPublishContractListenerURL ); + + GetRegKeyStringValue( hKey, "InquireURL", g_strInquireURL ); + GetRegKeyStringValue( hKey, "InquireListenerURL", g_strInquireListenerURL ); + GetRegKeyStringValue( hKey, "InquireContractURL", g_strInquireContractURL ); + GetRegKeyStringValue( hKey, "InquireContractListenerURL", g_strInquireContractListenerURL ); + + GetRegKeyStringValue( hKey, "DiscoveryURL", g_strDiscoveryURL ); + GetRegKeyStringValue( hKey, "DiscoveryListenerURL", g_strDiscoveryListenerURL ); + + GetRegKeyStringValue( hKey, "ReplicationURL", g_strReplicationURL ); + GetRegKeyStringValue( hKey, "ReplicationListenerURL", g_strReplicationListenerURL ); + + ::RegCloseKey( hKey ); + + string strUrls = string( "\nInquire [" ) + string( g_strInquireURL ) + string( "]: " ) + string( g_strInquireListenerURL ) + + string( "\nPublish [" ) + string( g_strPublishURL ) + string( "]: " ) + g_strPublishListenerURL + + string( "\nDiscovery [" ) + string( g_strDiscoveryURL ) + string( "]: " ) + g_strDiscoveryListenerURL + + string( "\nReplication [" ) + string( g_strReplicationURL ) + string( "]: " ) + g_strReplicationListenerURL + + string( "\nInquire Contract [" ) + string( g_strInquireContractURL ) + string( "]: " ) + string( g_strInquireContractListenerURL ) + + string( "\nPublish Contract [" ) + string( g_strPublishContractURL ) + string( "]: " ) + g_strPublishContractListenerURL; + + OutputDebugStringA( strUrls.c_str() ); + } + } + return TRUE; + } + catch( ... ) + { + return FALSE; + } +} diff --git a/inetsrv/uddi/source/filter/filter.def b/inetsrv/uddi/source/filter/filter.def new file mode 100644 index 0000000..5f0b9a0 --- /dev/null +++ b/inetsrv/uddi/source/filter/filter.def @@ -0,0 +1,6 @@ +LIBRARY uddi.filter.dll + +EXPORTS + HttpFilterProc + GetFilterVersion + DllMain diff --git a/inetsrv/uddi/source/filter/filter.rc b/inetsrv/uddi/source/filter/filter.rc new file mode 100644 index 0000000..2a7e396 --- /dev/null +++ b/inetsrv/uddi/source/filter/filter.rc @@ -0,0 +1,77 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\0" +END + +3 TEXTINCLUDE +BEGIN + "#include \r\n" + "\r\n" + "#define\tVER_FILETYPE\t\t VFT_DLL\r\n" + "#define VER_FILESUBTYPE\t\t VFT2_UNKNOWN\r\n" + "#define VER_FILEDESCRIPTION_STR ""UDDI Services IIS Filter""\r\n" + "#define VER_INTERNALNAME_STR\t ""UDDI.FILTER.DLL""\r\n" + "#define VER_ORIGINALFILENAME_STR ""UDDI.FILTER.DLL""\r\n" + "\r\n" + "#include ""common.ver""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "UDDI Services IIS Filter" +#define VER_INTERNALNAME_STR "UDDI.FILTER.DLL" +#define VER_ORIGINALFILENAME_STR "UDDI.FILTER.DLL" + +#include "common.ver" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/inetsrv/uddi/source/filter/filter.vcproj b/inetsrv/uddi/source/filter/filter.vcproj new file mode 100644 index 0000000..563c821 --- /dev/null +++ b/inetsrv/uddi/source/filter/filter.vcproj @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/filter/filter.vcxproj b/inetsrv/uddi/source/filter/filter.vcxproj new file mode 100644 index 0000000..025883d --- /dev/null +++ b/inetsrv/uddi/source/filter/filter.vcxproj @@ -0,0 +1,141 @@ + + + + + Unicode Debug + Win32 + + + Unicode Release + Win32 + + + + 18.0 + {70731D7E-08C5-4555-9707-71665BFC642A} + + + + DynamicLibrary + v145 + false + MultiByte + + + DynamicLibrary + v145 + false + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>18.0.11304.63 + + + .\release\ + .\release\ + false + + + .\debug\ + .\debug\ + true + + + + OnlyExplicitInline + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + .\release\ + .\release\ + .\release\ + Level3 + true + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) + .\release\uddi.filter.dll + true + .\filter.def + .\release\uddi.filter.pdb + .\release\uddi.filter.lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\release\uddi.filter.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + .\debug\ + .\debug\ + .\debug\ + Level3 + true + EditAndContinue + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) + .\debug\uddi.filter.dll + true + .\filter.def + true + .\debug\uddi.filter.pdb + .\debug\uddi.filter.lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\debug\uddi.filter.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/filter/filter.vcxproj.filters b/inetsrv/uddi/source/filter/filter.vcxproj.filters new file mode 100644 index 0000000..6bc24c0 --- /dev/null +++ b/inetsrv/uddi/source/filter/filter.vcxproj.filters @@ -0,0 +1,37 @@ + + + + + {75705904-b838-4cd9-b3df-28d34f5ef725} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {784401f7-4f09-472d-8fc1-d97e9e566be1} + h;hpp;hxx;hm;inl + + + {69be374f-d8aa-48e0-a254-47a4f1d2956e} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + + + Source Files + + + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/filter/filter.vcxproj.user b/inetsrv/uddi/source/filter/filter.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/inetsrv/uddi/source/filter/filter.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/filter/makefile b/inetsrv/uddi/source/filter/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/filter/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/filter/obj/_objects.mac b/inetsrv/uddi/source/filter/obj/_objects.mac new file mode 100644 index 0000000..58d06d0 --- /dev/null +++ b/inetsrv/uddi/source/filter/obj/_objects.mac @@ -0,0 +1,24 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\filter.res \ + $(_OBJ_DIR)\i386\filter.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\filter.res \ + $(_OBJ_DIR)\ia64\filter.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\filter.res \ + $(_OBJ_DIR)\amd64\filter.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\filter.res \ + $(_OBJ_DIR)\arm\filter.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/filter/obj/i386/filter.obj b/inetsrv/uddi/source/filter/obj/i386/filter.obj new file mode 100644 index 0000000..2903080 Binary files /dev/null and b/inetsrv/uddi/source/filter/obj/i386/filter.obj differ diff --git a/inetsrv/uddi/source/filter/obj/i386/filter.res b/inetsrv/uddi/source/filter/obj/i386/filter.res new file mode 100644 index 0000000..b4fa469 Binary files /dev/null and b/inetsrv/uddi/source/filter/obj/i386/filter.res differ diff --git a/inetsrv/uddi/source/filter/obj/i386/uddi.filter.dll b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.dll new file mode 100644 index 0000000..5ec04fa Binary files /dev/null and b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.dll differ diff --git a/inetsrv/uddi/source/filter/obj/i386/uddi.filter.exp b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.exp new file mode 100644 index 0000000..8cdaaa9 Binary files /dev/null and b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.exp differ diff --git a/inetsrv/uddi/source/filter/obj/i386/uddi.filter.lib b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.lib new file mode 100644 index 0000000..50e5fa8 Binary files /dev/null and b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.lib differ diff --git a/inetsrv/uddi/source/filter/obj/i386/uddi.filter.pdb b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.pdb new file mode 100644 index 0000000..4ea803d Binary files /dev/null and b/inetsrv/uddi/source/filter/obj/i386/uddi.filter.pdb differ diff --git a/inetsrv/uddi/source/filter/placefil.txt b/inetsrv/uddi/source/filter/placefil.txt new file mode 100644 index 0000000..418207a --- /dev/null +++ b/inetsrv/uddi/source/filter/placefil.txt @@ -0,0 +1 @@ +uddi.filter.dll uddi\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/filter/resource.h b/inetsrv/uddi/source/filter/resource.h new file mode 100644 index 0000000..4fca560 --- /dev/null +++ b/inetsrv/uddi/source/filter/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by filter.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/inetsrv/uddi/source/filter/sources b/inetsrv/uddi/source/filter/sources new file mode 100644 index 0000000..b12042a --- /dev/null +++ b/inetsrv/uddi/source/filter/sources @@ -0,0 +1,36 @@ +# +# uddi.filter.dll +# +TARGETNAME=uddi.filter +TARGETPATH=obj +TARGETTYPE=DYNLINK +DLLDEF=filter.def +DLLENTRY=DllMain + +INCLUDES=$(INCLUDES);$(_NTROOT)\public\sdk\inc\atl30 + +USE_MFC=1 +USE_STL=1 +USE_ATL=1 +USE_MSVCRT=1 +ATL_VER=30 + +TARGETLIBS=\ + $(SDK_LIB_PATH)\atl.lib \ + $(SDK_LIB_PATH)\adsiid.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\odbc32.lib \ + $(SDK_LIB_PATH)\odbccp32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\version.lib + + + +SOURCES = \ + filter.cpp \ + filter.rc + +C_DEFINES= $(C_DEFINES) /DWIN32 /D_USRDLL /DUSE_NTVERP + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/help/how to/uddi_installing_uddi_services.htm b/inetsrv/uddi/source/help/how to/uddi_installing_uddi_services.htm new file mode 100644 index 0000000..e8925ba --- /dev/null +++ b/inetsrv/uddi/source/help/how to/uddi_installing_uddi_services.htm @@ -0,0 +1,119 @@ + + + + Installing UDDI Services + + + + + + + + + +
Microsoft Windows graphic
+

Installing UDDI Services

+

Universal Description, Discovery, and Integration (UDDI) is an industry + specification for the description and discovery of Web services. The UDDI + specification builds on the Simple Object Access Protocol (SOAP), Extensible + Markup Language (XML), and HTTP/S protocol standards developed by the World + Wide Web Consortium (W3C) and Internet Engineering Task Force (IETF). UDDI + Services is an optional component of the + Windows .NET Server + family that provides UDDI capabilities within an enterprise. +

+

UDDI Services is not installed by default during setup of a + Windows .NET + server operating system.

+

UDDI Services requirements checklist

+ Before you install and deploy UDDI Services, make sure your system meets the + following hardware and software requirements. +

+

Hardware requirements

+

In addition to the + Windows .NET Server + family minimum requirements, UDDI Services requires:

+
    +
  • + 128 megabytes (MB) of RAM minimum +
  • + 80 MB free disk space (plus additional storage for UDDI Services data) +
  • +
+

Software requirements

+

You must use one of the following Microsoft operating systems to host UDDI + Services:

+
    +
  • + + XOX + +
  • + + XOX + +
  • + + XOX +
+

UDDI Services Installation

+

When you first install UDDI Services, all components are selected by default. + Deselecting components can decrease or disable UDDI Services functionality. If + you are unfamiliar with UDDI Services components or deployment options, + complete the default installation and then view Deploying and Installing UDDI + Services in the snap-in online Help for more information. +

+

To install UDDI Services, or add or remove a component

+
    +
  1. + Open + Add or Remove Programs. +
  2. + Click Add/Remove Windows Components. The Windows Component Wizard + appears. +
  3. + Select the UDDI Services check box, and then follow the on-screen + instructions to install, remove, or add components to UDDI Services. +
  4. +
+

After you have installed UDDI Services, open the + UDDI Services snap-in.

+

Notes

+
    +
  • + To run UDDI Services, you must also run Microsoft Internet Information Services + (IIS). +
  • +
  • + You can use the administrative tools to administer local or remote + installations of UDDI Services. +
  • +
  • + To open the UDDI Services snap-in, from the computer where you installed the + administrative tools, click Start, point to Programs, point to Administrative + Tools, and then click UDDI Services. +
  • +
  • + If you have already installed UDDI Services, see the + UDDI Services + snap-in online Help. +
  • +
  • + After installing and configuring UDDI Services, you can view the Web-based user + interface on any server to which you have installed the user interface + subcomponent. For example, http://servername/uddi/, or if you using a secure sever, https://servername/uddi/. +
  • +
  • + For more information about UDDI Services, see the Help and Support Center + overview of + UDDI Services. +
  • +
  • + For additional planning, installation, configuration, troubleshooting, + development, or other UDDI Services resources, see + Additional Resources on the Web. + (http://www.microsoft.com/) +
  • +
+ + diff --git a/inetsrv/uddi/source/help/how to/uddi_uddi_services_overview.htm b/inetsrv/uddi/source/help/how to/uddi_uddi_services_overview.htm new file mode 100644 index 0000000..63ca689 --- /dev/null +++ b/inetsrv/uddi/source/help/how to/uddi_uddi_services_overview.htm @@ -0,0 +1,52 @@ + + + + UDDI Services + + + + + + + + + + +
Microsoft Windows graphic
+

UDDI Services

+

Universal Description, Discovery, and Integration (UDDI) is an industry + specification for publishing and locating information about Web services. The + Windows .NET Server + family includes UDDI Services, an optional component that provides UDDI + capabilities for use within an enterprise or between business partners. UDDI + Services is a standards-based XML Web service that enables enterprise + developers to efficiently publish, discover, share, and reuse Web Services + directly through their development tools and business applications.

+

Built on the Microsoft .NET Framework, UDDI Services is a reliable and scalable + solution that provides easy integration with enterprise technologies and tools. + IT Managers can leverage native support for standard categorization schemes, + Microsoft SQL Server, and Active Directory authentication. As a UDDI version + 1.0 and 2.0 API-compliant service, UDDI Services also includes a Web interface + fully localized to each of the 17 languages supported by the + Windows .NET Server + family. +

+

Accessing UDDI Services documentation

+

UDDI Services product documentation is available in the UDDI Services snap-in + online Help. To view product documentation, install UDDI Services, and then + click + UDDI Services. +

+

For information about installing UDDI Services, see + Installing UDDI Services in the Help and Support Center.

+

Note

+
    +
  • + For additional planning, installation, configuration, troubleshooting, + development, or other UDDI Services resources, see + Additional Resources on the Web + (http://www.microsoft.com/) +
  • +
+ + diff --git a/inetsrv/uddi/source/help/mmc/alttext.xml b/inetsrv/uddi/source/help/mmc/alttext.xml new file mode 100644 index 0000000..aff4551 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/alttext.xml differ diff --git a/inetsrv/uddi/source/help/mmc/caution.gif b/inetsrv/uddi/source/help/mmc/caution.gif new file mode 100644 index 0000000..a45b0de Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/caution.gif differ diff --git a/inetsrv/uddi/source/help/mmc/colegal.htm b/inetsrv/uddi/source/help/mmc/colegal.htm new file mode 100644 index 0000000..11b72de --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/colegal.htm @@ -0,0 +1,41 @@ + + + + Legal Information + + + + + + + + +

Legal Information

+

Microsoft Documentation

+

Information in this document is subject to change without notice. The example + companies, organizations, products, people and events depicted herein are + fictitious. No association with any real company, organization, product, person + or event is intended or should be inferred. Complying with all applicable + copyright laws is the responsibility of the user. Without limiting the rights + under copyright, no part of this document may be reproduced, stored in or + introduced into a retrieval system, or transmitted in any form or by any means + (electronic, mechanical, photocopying, recording, or otherwise), or for any + purpose, without the express written permission of Microsoft Corporation.

+

Microsoft may have patents, patent applications, trademarks, copyrights, or + other intellectual property rights covering subject matter in this document. + Except as expressly provided in any written license agreement from Microsoft, + the furnishing of this document does not give you any license to these patents, + trademarks, copyrights, or other intellectual property.

+

© 1997-2002 Microsoft Corporation. All rights reserved.

+

Microsoft, MS-DOS, MS, Windows, Windows NT, ActiveX, JScript, Microsoft Press, + Visual Basic, Visual C++, Visual J++, Win32, and Win32s are either registered + trademarks or trademarks of Microsoft Corporation in the United States and/or + other countries.

+

Macintosh and QuickTime are registered trademarks of Apple Computer, Inc.

+

Other product and company names mentioned herein may be the trademarks of their + respective owners.

+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/compile.date.htm b/inetsrv/uddi/source/help/mmc/compile.date.htm new file mode 100644 index 0000000..7161de5 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/compile.date.htm @@ -0,0 +1,19 @@ + + + + Compile Date + + + + + + + + + + Compile Date: 2003-01-03 +
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/coua.css b/inetsrv/uddi/source/help/mmc/coua.css new file mode 100644 index 0000000..5c66fd1 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/coua.css @@ -0,0 +1,401 @@ +/* Style sheet optimized for IE4x - Last updated 01/16/01 RWF */ +/* Added Table.nested, TH, TD for nested tables -- 02/26/01 */ + +body { color: #000000; + background: #FFFFFF; + font-size: 70%; + font-family: Verdana, Arial, Sans Serif; + margin-left: 0em; + padding-left: 1.5em; } + + +a:link, a:visited { color: #0000FF; text-decoration:underline;} + +a:active, a:hover { color: #FF0000; cursor:hand; text-decoration:underline;} + +/* Puts a little more breathing room above related topics link. - AMS*/ +a.#reltopics { position:relative; top:1em; } + +h1 + { font-size: 125%; + margin-bottom: .5em; clear:both; width: 85%; } + +h2 + { font-size: 110%; + margin-top: 1.5em; + margin-bottom: .5em; clear:both; } + +h3 + { font-size: 100%; + margin-top: 1.2em; + margin-bottom: .5em; clear:both; } + +h4 + { font-size: 100%; + margin-top: 1.2em; + margin-bottom: .5em; clear:both; } + +h5 + { font-size: 100%; + margin-top: 1.2em; + margin-bottom: .5em; clear:both; } + +p + { margin-top: .6em; + margin-bottom: .6em; } + +ol + { margin-top: .5em; + margin-bottom: 0em; + margin-left: 2.1em; + padding-left: 0em; + margin-right:2.1em; } + +ul + { margin-top: .6em; + margin-bottom: 0em; + list-style-type: disc; + margin-left: 1.5em; + padding-left: 0em; + margin-right: 1.5em; } + +li + { margin-bottom: .7em; clear:both; } + +dd + { margin-bottom: 0em; + margin-left: 1.5em; } + +/* for defined terms, follow the Document Conventions listing in the Microsoft Manual of Style: */ +/* Keywords, functions, and anything else the user must enter exactly as shown are bold--add font-weight: bold; to the dt tag */ +/* Variables, book titles, and placeholders the user must provide are italic--add font-style: italic; to the dt tag */ +/* pre-defined arguments are bold and italic--add font-weight: bold; and font-style: italic; to the dt tag */ + +dt + { margin-top: 1em; } + +pre + { margin-top: .5em; + margin-bottom: .5em; } + +code + { font-family: Courier New; + font-size: 1.1em; } + +table + { font-size: 100%; + margin-top: 1em; + margin-bottom: 1em; } + +th + { text-align: left; + background: #DDDDDD; + vertical-align: bottom; + padding: .2em; + padding-left: .45em; + padding-right: .5em;} + +tr + { vertical-align: top; } + +td + { background: #EEEEEE; + vertical-align: top; + padding: .2em; + padding-left: .45em; + padding-right: .5em;} + + +/**** extended class styles ************************/ +/* */ +/* add comment tags to disable the style */ + +p.indent { margin-left: 1.3em; } /* used to indent text for notes and warnings; use this instead of the blockquote tag */ + +p.indent2 { margin-left: 3.5em; } /* used to indent text a second level under the first indent */ + +P.indentGray { color: #666666; } /* used in quad-method procedures */ + +p.procLabel { font-size: 100%; + font-weight: bold; clear: both; width: 85%; margin-top: 2em; } + +p.uatshoot { font-weight: bold; margin-bottom: -.5em; margin-top: 1em; } + +/***********************************************/ +/* these class styles are used for the expanding and collapsing text files (expand function in shared.js) */ + +#expand {margin-bottom: 0.6em; margin-left: 0em; margin-right: 0em;} + +a:link.expandToggle, a:visited.expandToggle {color:#000000; font-weight: bold; text-decoration:none;} + +a:hover.expandToggle, a:active.expandToggle {color:#0000FF;} + +img.expand { border: none; margin-right: 0.5em; width:.8em;} + +div.expand { margin-left: 1.5em; margin-right: 1.5em;margin-bottom: 1em; display:none;} + + + +/***********************************************/ +/* this class for expand collapse appearing in a table */ + +table.uatshoot {background-color: #FFFFFF; width: 90%; } + +table.uatshoot td { padding: 0px 0px 0px 5px; } + +a:link.uatshoot, a:visited.uatshoot {color:#000000; font-weight: normal; text-decoration:none;} + +a:hover.uatshoot, a:active.uatshoot {color:#0000FF; text-decoration: none; } + + +/*******************************************/ +/* these classes are for thumbnail art */ + +a:link img.thumbnail {border-color: #0000FF;} + +a:active img.thumbnail { border-color: #FF0000;} + +a:hover img.thumbnail {border-color: #FF0000;} + +img.thumbnail {vertical-align: top; margin-left: 0; + width:90; border-width:1;} + +div.thumbnail {float:left; width: 105; margin-top: 1em; margin-bottom: -0.3em; + clear: both; } + +/*********************************************/ +/* this class style is used for the navigation tree in MMC */ + +p.navTree { margin-top: .2em; } + +ul.navTree { list-style-type: none; } + +li.branch { margin-top: -.5em; margin-bottom: .6em;} + +a.where {} /* use for the expand tag */ + +/***************************************************************/ +/* these class styles are used for tags simulating buttons & their div */ + +#buttonMenu { padding: 0.5em 0.3em 0.1em 0.3em; + padding-left:6px; + border-bottom: thin solid #999999; + background: #BBBBBB; + vertical-align:top; + z-index:2; + visibility:visible; + left:0; top:0; + text-align:left; + margin:0 1em 0 0; + position:absolute; + width: 100%; + } + +a:link.button, a:visited.button, span.button { + border-top-color: #EEEEEE ; + border-left-color: #EEEEEE ; + border-bottom-color: #666666 ; + border-right-color: #666666 ; + background-color: #DDDDDD ; + color:#0000FF; + text-decoration: none; + text-align: center; + font-weight: bold ; + height:1.5em; width:17px; cursor:hand; + border-style: solid; border-width: 1; + } + +a:active.button, a:hover.button { + border-top-color: #666666 ; + border-left-color: #666666 ; + border-bottom-color: #EEEEEE ; + border-right-color: #EEEEEE; + background-color: #FFFFFF; + text-decoration: none; + text-align: center; + font-weight: bold ; + height:1.5em; width:17px; cursor:hand; + border-style: solid; border-width: 1; + } + +/* The following span is used to display +items that have no entries - AMS */ + +span.buttoninactive {background: #C0C0C0; + border: 1 solid #eeeeee; + height: 1.4em; + width: 1.4em; + text-align: center; + font-weight: bold; + color: #808080; + vertical-align:top; + cursor: default; + } + +#list { padding:.4em 0.3em 100% 0.3em; + overflow:auto; + line-height:0.4em; + height:100%; width: 100%; + z-index:1; + left:0; top:0; + text-align:left; + margin:0; + position:absolute; + margin-left:1em; line-height:100%; + } + +p.marker { font-weight:bold; + margin-top: 2em; + color:#000000; + font-size:110%; + } +/************************************************/ +/* class styles reserved for mouseover/mouseout DHTML */ + +.cold {} +.hot {} + +/**********************************************************************/ +/* ID styles reserved for tags calling OCX's within HTML Help by creating OBJECTS */ + + +#wPopup {} + +a:link#wPopup, a:visited#wPopup {color: #006600;} +a:hover#wPopup, a:active#wPopup {color: #FF0000;} + + +img.popup {border: none; margin-right: 0.5em; vertical-align:middle;} + +#shortcut {} + +img.shortcut {border: none; margin-right: 0.5em; vertical-align:middle;} + +#specLoc {} + +#altLoc {} + +p.note,p.tip, p.important, p.caution, p.warning + { font-weight:bold; clear:both; + margin-top:1em; + margin-bottom:-.25em; } + +img.alert {border:none;} /* for icon images - note, tip, important, caution, warning*/ + +/************************************************/ +/* styles used to modify the appearance of XML popups */ + +SPAN.XMLPopup {margin-bottom:.75em;height: 100%; width: 100%; border: solid; border-width:1px; background-color: #FFFFCC; } + + +DIV.PopTerm { font-weight: bold; margin-left: 1em; margin-top: .75em; margin-right: 1em; } +DIV.PopDef { line-height: 1.25em; margin-left: 1em; margin-top: .25em; margin-right: 1em;} +DIV.PopSeeAlso { margin-left: 1em; margin-top: .5em; margin-right: 1em;} +DIV.PopDef UL { margin-left: 1.45em; line-height: 1.25em; } + +/************************************************/ +/* Styles for listed-out/hard-coded links for Related Topics with page GIF */ + +p.#relTopics { font-weight:bold; margin-top: 2em;} +img.relTopics { border: none; } +p.relTopics { margin-left: 1.5em; margin-top: -1.7em; margin-bottom: .5em;} + +/***********************************/ +/* Style for print only functionality used with external URL link coUA_print.css*/ + +span.printonly {display:none } + +/***********************************/ +/* Styles for checklists */ + +.userData {behavior:url(#default#userdata); } /*sets persistance*/ + +#checklist {width:100%; text-align:left; margin:0.3em 0em;} + +#checklist li {text-indent:0.2em;} + +/*********************************/ +/* these classes are for previous next navigation */ + +a:hover.navbar, a:active.navbar {} /* text in nav */ +a:link.navbar, a:visited.navbar {} + +#nav { left:0; top:0px; + text-align:left; + margin:0; + position:absolute; + padding-bottom: 1px; padding-top: 3px; + padding-right:6px; padding-left:5px; + align:top; + visibility:hidden; + z-index:1; } + +#text { left:0; top:0px; + /*text-align:left;*/ /*Commented out because it was causing a problem with BI-DI. Remove style if no ill effects are found from commenting it out. - 5/28/99 AMS */ + margin:0; + position:absolute; + padding:10px; + overflow:auto; + height:100%; + z-index:1; + background-repeat:no-repeat; + background-position: bottom right; + background-attachment:fixed; } + +/***************************************************/ +/* STYLES USED IN THE WEB DELIVERABLE ONLY */ + + +/***********************************/ +/* links */ + +#wPopupWeb {} + +a:link#wPopupWeb {color: #006600;} +a:hover#wPopupWeb {color: #FF0000;} +a:active#wPopupWeb {color: #FF0000;} +a:visited#wPopupWeb {color: #006600;} + +#shortcutWeb {} + +#specLocWeb {} + +#relTopicsWeb {} + +#altLocWeb {} + + +/***********************************/ +/* popups */ + +div.popup { visibility:hidden; z-index:3; + position:absolute; + top:200; left:200; + width:250; padding:6px; + background-color:#FFFFCC; + border-style: solid; + border-width: 1; + border-color: #666666; + } +/***********************************/ +/* Added the following DIV 12/20/00 to incorporate branding GIF (currently Windows Flag) to designate material in HSS as Microsoft (as opposed to OEM material. This style also required WIDTH tags on H1 and WIDTH and Margin-Top tags on P.Proclabel. - AMS*/ + +DIV.UAbrand { direction: RTL; margin-top:-.25em; margin-right: -.25em; margin-bottom: -3em; } + + +TABLE.nested +{ + BACKGROUND-COLOR: #ffffff; +} + +TABLE.nested TH +{ + BACKGROUND-COLOR: #bbbbbb; +} + +TABLE.nested TD +{ + BACKGROUND-COLOR: #dddddd; +} + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/mmc/couaprint.css b/inetsrv/uddi/source/help/mmc/couaprint.css new file mode 100644 index 0000000..2256412 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/couaprint.css @@ -0,0 +1,79 @@ +/* last updated 01/16/01 - RWF */ +/* Added Table.nested margin nested tables -- 02/26/01 */ + + +body { font-size: 70%; + font-family: Verdana, Arial, MS Sans Serif; + margin-left: 0em; + padding-left: 1.5em; } + +H1 { font-size: 150%; } + +H2 { font-size: 125%; } + +H3 { font-size: 100%; } + +p { margin-top: .5em; margin-bottom: .75em; } + +p.procLabel { font-weight: bold; } + +p.note { margin-bottom: 0em; } +p.important { margin-bottom: 0em; } +p.caution { margin-bottom: 0em; } +p.warning { margin-bottom: 0em; } + +p.relTopics { margin-left: 1.5em; margin-top: -1.7em; margin-bottom: 1em; } + +ul { margin-top: 0em; margin-left: 1.5em; list-style-type: disc; } +ul li { margin-top: .25em; } + +ol { margin-top: 1em; margin-left: 2em; } + + +table { font-size: 100%; border-collapse: collapse; } +th { text-align:left; border-style: solid; border-width: 1px; border-bottom-width: 2px; } +td { border-style: solid; border-width: 1px; } + +dt { margin-top: 1em; } +dd { margin-left: 1.5em; } + +img.shortcut { border: none; margin-right: 0.5em; } + + +/* Styles used for expand/collapse information */ + +div.expand { margin-left: 1.5em; display: block !important; } +img.expand { margin-left: 1.5em; display: none !important; } + + +/* Styles used for (not) printing thumbnails */ + +span.webOnly {display:none !important; } +span.printonly { display:inline !important; } + + +/* Styles used for Previous/Next navigation */ + +#nav { display:none; } +#text { overflow:visible; } + +/* Testing to see if this removes underline and color from bookmarks */ + +H1 a:link { text-decoration: none; } +H2 a:link { text-decoration: none; } +H3 a:link { text-decoration: none; } +dt a:link { text-decoration: none; } + +a:link, a:visited { color: #000000; text-decoration: underline; } + +/* Indent this tag to match the online display */ +p.indent { margin-left: 1.3em; } +p.indent2 { margin-left: 3.5em; } + +TABLE.nested +{ + MARGIN-LEFT: .5em; + MARGIN-RIGHT: .5em; + MARGIN-TOP: .25em; + MARGIN-BOTTOM: .25em; +} \ No newline at end of file diff --git a/inetsrv/uddi/source/help/mmc/default.htm b/inetsrv/uddi/source/help/mmc/default.htm new file mode 100644 index 0000000..df5dcc5 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/default.htm @@ -0,0 +1,61 @@ + + + + UDDI Services + + + + + + + + + +
Microsoft Windows Graphic
+

UDDI Services

+

+ Universal Description, Discovery and Integration (UDDI) is an industry + specification for publishing and locating information about Web services. It + defines an information framework that enables you to describe and classify your + organization, its services, and the technical details about the interfaces of + the Web services you expose. The framework enables consistent discovery of + services or interfaces of a particular type, classification, or function. UDDI + also defines a set of Application Programming Interfaces (APIs) that can be + used by applications and services to directly interact with UDDI data. For + example, you can develop services that automatically publish and update their + UDDI data, react dynamically to service availability, or automatically discover + interface details for other services with which they interact. +

+ UDDI Services + is a Microsoft® Windows® .NET Web service that provides UDDI + capabilities for use within an enterprise or between business partners. It + includes a Web interface with searching, publishing, and coordinating features + that are compatible with Microsoft Internet Explorer 4.0 or later and + Netscape Navigator 4.5 or later. + UDDI Services + supports the UDDI version 1.0 and 2.0 APIs, enabling enterprise + developers to publish, discover, share, and reuse Web services directly through + their development tools and business applications. +

+
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/images/bbullet.gif b/inetsrv/uddi/source/help/mmc/images/bbullet.gif new file mode 100644 index 0000000..8fec840 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/bbullet.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/binding.gif b/inetsrv/uddi/source/help/mmc/images/binding.gif new file mode 100644 index 0000000..bcf96af Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/binding.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/blank.gif b/inetsrv/uddi/source/help/mmc/images/blank.gif new file mode 100644 index 0000000..8f23503 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/blank.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/business.gif b/inetsrv/uddi/source/help/mmc/images/business.gif new file mode 100644 index 0000000..e399b83 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/business.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/caution.gif b/inetsrv/uddi/source/help/mmc/images/caution.gif new file mode 100644 index 0000000..a45b0de Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/caution.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/contact.gif b/inetsrv/uddi/source/help/mmc/images/contact.gif new file mode 100644 index 0000000..d275733 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/contact.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/important.gif b/inetsrv/uddi/source/help/mmc/images/important.gif new file mode 100644 index 0000000..74f8597 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/important.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/instance.gif b/inetsrv/uddi/source/help/mmc/images/instance.gif new file mode 100644 index 0000000..6a448ef Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/instance.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/line-e.gif b/inetsrv/uddi/source/help/mmc/images/line-e.gif new file mode 100644 index 0000000..f6c58a5 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/line-e.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/line-ne.gif b/inetsrv/uddi/source/help/mmc/images/line-ne.gif new file mode 100644 index 0000000..bdde202 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/line-ne.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/line-nes.gif b/inetsrv/uddi/source/help/mmc/images/line-nes.gif new file mode 100644 index 0000000..77b4905 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/line-nes.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/line-ns.gif b/inetsrv/uddi/source/help/mmc/images/line-ns.gif new file mode 100644 index 0000000..ec5d0a5 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/line-ns.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/logo.gif b/inetsrv/uddi/source/help/mmc/images/logo.gif new file mode 100644 index 0000000..79178df Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/logo.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/my_uddi.gif b/inetsrv/uddi/source/help/mmc/images/my_uddi.gif new file mode 100644 index 0000000..051ab3c Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/my_uddi.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/note.gif b/inetsrv/uddi/source/help/mmc/images/note.gif new file mode 100644 index 0000000..a6b3931 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/note.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/obullet.gif b/inetsrv/uddi/source/help/mmc/images/obullet.gif new file mode 100644 index 0000000..ca43a92 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/obullet.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/service.gif b/inetsrv/uddi/source/help/mmc/images/service.gif new file mode 100644 index 0000000..754b7d5 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/service.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/shortcutcold.gif b/inetsrv/uddi/source/help/mmc/images/shortcutcold.gif new file mode 100644 index 0000000..6317cc0 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/shortcutcold.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/shortcuthot.gif b/inetsrv/uddi/source/help/mmc/images/shortcuthot.gif new file mode 100644 index 0000000..ad123cb Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/shortcuthot.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/site.gif b/inetsrv/uddi/source/help/mmc/images/site.gif new file mode 100644 index 0000000..0c40f98 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/site.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/tip.gif b/inetsrv/uddi/source/help/mmc/images/tip.gif new file mode 100644 index 0000000..898e40c Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/tip.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/tmodel.gif b/inetsrv/uddi/source/help/mmc/images/tmodel.gif new file mode 100644 index 0000000..ed1632c Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/tmodel.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/uabrand.gif b/inetsrv/uddi/source/help/mmc/images/uabrand.gif new file mode 100644 index 0000000..0bf9693 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/uabrand.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/uddi.gif b/inetsrv/uddi/source/help/mmc/images/uddi.gif new file mode 100644 index 0000000..42bcb25 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/uddi.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/warning.gif b/inetsrv/uddi/source/help/mmc/images/warning.gif new file mode 100644 index 0000000..76dcd23 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/warning.gif differ diff --git a/inetsrv/uddi/source/help/mmc/images/webserver.gif b/inetsrv/uddi/source/help/mmc/images/webserver.gif new file mode 100644 index 0000000..5ccf294 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/images/webserver.gif differ diff --git a/inetsrv/uddi/source/help/mmc/important.gif b/inetsrv/uddi/source/help/mmc/important.gif new file mode 100644 index 0000000..74f8597 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/important.gif differ diff --git a/inetsrv/uddi/source/help/mmc/minuscold.gif b/inetsrv/uddi/source/help/mmc/minuscold.gif new file mode 100644 index 0000000..b92d996 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/minuscold.gif differ diff --git a/inetsrv/uddi/source/help/mmc/minushot.gif b/inetsrv/uddi/source/help/mmc/minushot.gif new file mode 100644 index 0000000..eae6292 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/minushot.gif differ diff --git a/inetsrv/uddi/source/help/mmc/nextcold.gif b/inetsrv/uddi/source/help/mmc/nextcold.gif new file mode 100644 index 0000000..0b1d7a0 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/nextcold.gif differ diff --git a/inetsrv/uddi/source/help/mmc/nexthot.gif b/inetsrv/uddi/source/help/mmc/nexthot.gif new file mode 100644 index 0000000..07f8e3e Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/nexthot.gif differ diff --git a/inetsrv/uddi/source/help/mmc/note.gif b/inetsrv/uddi/source/help/mmc/note.gif new file mode 100644 index 0000000..a6b3931 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/note.gif differ diff --git a/inetsrv/uddi/source/help/mmc/pluscold.gif b/inetsrv/uddi/source/help/mmc/pluscold.gif new file mode 100644 index 0000000..784e57b Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/pluscold.gif differ diff --git a/inetsrv/uddi/source/help/mmc/plushot.gif b/inetsrv/uddi/source/help/mmc/plushot.gif new file mode 100644 index 0000000..a582fdd Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/plushot.gif differ diff --git a/inetsrv/uddi/source/help/mmc/shared.js b/inetsrv/uddi/source/help/mmc/shared.js new file mode 100644 index 0000000..f5a4e30 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/shared.js @@ -0,0 +1,1940 @@ +// Filename: shared.js +// Version shared.js for windows server 2003 +// version for 2.2.3 + +//************************************************ Shared components path setting ***************************************** +//******************************************************************************************************************* +// Date 11/07/01 +// + +set_path = "" + document.URL +ntshared = set_path.indexOf("::/") + +if (ntshared == -1) { + var moniker= "ms-its:"; + var sSharedCHM = moniker+"uddi.mmc.chm::/"; + } +else + { + path = set_path.substring(0,ntshared) + path = path.toLowerCase() + ntshared = path.lastIndexOf("\\") + var moniker = path.substring(0,ntshared)+ "\\"; + //var ntshared = moniker.lastIndexOf("\\") + //var moniker = moniker.substring(0,ntshared) + "\\"; + var sSharedCHM= moniker+"uddi.mmc.chm::/"; + } + + + + +//************************************************ EVENT HANDLING ******************************************** +//******************************************************************************************************************* +// re-directs to the proper event-driven functions. + +// window.onload = load_object; +window.onload = loadPage; +document.onclick= onclickTriage; +document.onmouseover= gettingHot; +document.onmouseout= gettingCold; +window.onunload=saveChecklistState; +window.onresize= resizeDiv; + +window.onbeforeprint = set_to_print; +window.onafterprint = reset_form; + +//******************************************** USER-DEFINED GLOBAL VARIABLES ************************************ +//******************************************************************************************************************** +// The images listed below can all be changed by the user. +var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4); +var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0); +if (isIE5 && isIE55) isIE5 = false; +var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0); +var isIE4 = (navigator.appVersion.indexOf("MSIE 4")>0); + +if (isIE4){ + var moniker= "ms-its:"; // moniker= ""; for flat files + var sSharedCHM= moniker+"ntshared.chm::/"; +} + + +if (!isIE5 && !isIE55 && !isIE4 && !isIE6) { + isIE6 = true; + } + + +var sShortcutTip= ""; + +var gifwithin = false; + + + +if(!isIE4){ + xmldoc = new ActiveXObject("microsoft.XMLDOM"); + xmldoc.async = false; + xmldoc.load(sSharedCHM + "alttext.xml"); + + var Alt_sPreviousTip= xmldoc.getElementsByTagName("sPreviousTip") + var Alt_sNextTip= xmldoc.getElementsByTagName("sNextTip") + var Alt_sExpandTip= xmldoc.getElementsByTagName("sExpandTip") + var Alt_sPopupTip= xmldoc.getElementsByTagName("sPopupTip") + var hld_path2reuse= xmldoc.getElementsByTagName("path2reuse") + var hld_path2glossary= xmldoc.getElementsByTagName("path2glossary") + var hld_rel_gif = xmldoc.getElementsByTagName("reltopgif") + var hld_chmName = xmldoc.getElementsByTagName("chmName") + var hld_emailer = xmldoc.getElementsByTagName("emailer") + var hld_sendtext = xmldoc.getElementsByTagName("sendtext") + var hld_sendto = xmldoc.getElementsByTagName("sendto") + + // + + var defaultStartMode; + var defaultCPanelMode; + var smartErrorTextNode; + var smartErrorText; + var xmldocSKUSettings; + + // Grab the ALTTEXT.XML enteries for smart span classes. + // Get SKU specific defaults. + var defaultSKUSettingsURL = xmldoc.documentElement.selectSingleNode("smartreusabletext"); + if (defaultSKUSettingsURL != null) { + if (defaultSKUSettingsURL.text == sSharedCHM + "alttext.xml") { + xmldocSKUSettings = xmldoc; + } else { + xmldocSKUSettings = new ActiveXObject("microsoft.XMLDOM"); + xmldocSKUSettings.async = false; + xmldocSKUSettings.load(moniker + defaultSKUSettingsURL.text); + } + if (xmldocSKUSettings.documentElement != null) { + defaultStartMode = xmldocSKUSettings.documentElement.selectSingleNode("smartstartdefault"); + defaultCPanelMode = xmldocSKUSettings.documentElement.selectSingleNode("smartcpaneldefault"); + smartErrorTextNode = xmldocSKUSettings.documentElement.selectSingleNode("smarterrortext"); + smartErrorText = smartErrorTextNode ? smartErrorTextNode.text : "XOXOX"; + } + } // (defaultSKUSettingsURL != NULL) + +// + + + var sPreviousTip="" + Alt_sPreviousTip.item(0).nodeTypedValue + var sNextTip="" + Alt_sNextTip.item(0).nodeTypedValue + var sExpandTip="" + Alt_sExpandTip.item(0).nodeTypedValue + var sPopupTip="" + Alt_sPopupTip.item(0).nodeTypedValue + var path2reuse="" + hld_path2reuse.item(0).nodeTypedValue + var path2glossary="" + hld_path2glossary.item(0).nodeTypedValue + var rel_gif="" + hld_rel_gif.item(0).nodeTypedValue + var chmName="" + hld_chmName.item(0).nodeTypedValue+"::/" + var emailer="" + hld_emailer.item(0).nodeTypedValue + var sendtext="" + hld_sendtext.item(0).nodeTypedValue + var sendto="" + hld_sendto.item(0).nodeTypedValue + +var xmldom = new ActiveXObject("microsoft.XMLDOM"); + xmldom.async = false; + +//if (!xmlLoaded) { + + xmldoc = new ActiveXObject("microsoft.XMLDOM"); + + // Init Properties + xmldoc.async = false; + xmldoc.validateOnParse = false; // improve perf + xmldoc.resolveExternals = false; + xmldoc.preserveWhiteSpace = false; + + // Load Document + xmldoc.load(moniker + path2reuse + "reusable.xml"); + // if (xmldoc == null || xmldoc.documentElement == null) return; // couldn't open reusable.xml + xmlLoaded = true; +// } + +} // skip all this because ie4 doesn't support xml. +else +{ +var sPreviousTip="" + var sNextTip="" + var sExpandTip="" + var sPopupTip="" + var rel_gif="no" +} + +var closed = sSharedCHM + "plusCold.gif"; //image used for collapsed item in callExpand() +var closedHot = sSharedCHM + "plusHot.gif"; //hot image used for collapsed item in callExpand() +var expand = sSharedCHM + "minusCold.gif"; //image used for expanded item in callExpand() +var expandHot = sSharedCHM + "minusHot.gif"; //hot image used for expanded item in callExpand() + +var previousCold= sSharedCHM + "previousCold.gif"; +var previousHot= sSharedCHM + "previousHot.gif"; +var nextCold= sSharedCHM + "nextCold.gif"; +var nextHot= sSharedCHM + "nextHot.gif"; + +var shortcutCold= sSharedCHM + "shortcutCold.gif"; +var shortcutHot= sSharedCHM + "shortcutHot.gif"; + +var popupCold= sSharedCHM + "popupCold.gif"; +var popupHot= sSharedCHM + "popupHot.gif"; + +var emptyImg= sSharedCHM + "empty.gif"; //image used for empty expand +var noteImg= sSharedCHM + "note.gif"; //image used for notes +var tipImg= sSharedCHM + "tip.gif"; //image used for tips +var warningImg= sSharedCHM + "warning.gif"; //image used for warnings +var cautionImg= sSharedCHM + "caution.gif"; //image used for cautions +var importantImg= sSharedCHM + "important.gif"; //image used for important notice +var relTopicsImg= sSharedCHM + "rel_top.gif"; //image used for important notice + +var branchImg= sSharedCHM + "elle.gif"; +var branchImg_RTL= sSharedCHM + "elle_rtl.gif"; + + +//******************************************** GLOBAL VARIABLES ****************************************** +//******************************************************************************************************** + +var joejoe = false; +var printing = false; +var single = "FALSE"; +var scroller = "FALSE"; +var valet = "FALSE"; +var isRTL= (document.dir=="rtl"); +var imgStyleRTL= ""; + if (isRTL) imgStyleRTL=" style='filter:flipH' "; + +var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'"; //Tabular Data Control for reusable text data +var sSharedReusableTextFile= sSharedCHM + "reusable.xml"; // common reusable text file +var sSharedReusableTextFileRecord= "para"; //reusable text record + +var numbers= /\d/g; //javascript regular expression +var spaces= /\s/g; //javascript regular expression +var semicolon= /;/g; //javascript regular expression + +var isPersistent= false; + + + + +//******************************************** INITIALIZATION ************************************************* +//****************************************************************************************************************** +function list_them(){ + + var envelope = sSharedCHM +'envelope.gif'; + var server = "
 " + sendtext + " "; + server += "
"; + + var i; + + for (i=0; i < document.all.length; i++){ + if ((document.all[i].tagName == "P") || + (document.all[i].tagName == "H1")|| + (document.all[i].tagName == "H6")){ + document.all[i].outerHTML = server + document.all[i].outerHTML; + i = document.all.length; + } + } +} +//*** loadPage ********************************************************************************************** +// Adds the default image tags and re-usable text to the HTML page. + +function loadPage(){ +if (printing == true) return; + +if (emailer == "yes" ) list_them(); + +isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE55) ||(isIE6)); + + setPreviousNext(); + + resizeDiv(); + if (isPersistent) getChecklistState(); + + load_object(); + addReusableText(); + + insertImages(); +} + +//****** setPreviousNext ************************************************************************ ********************************************************************************************* +// insert previous/next navbar +// called by: + +function setPreviousNext(){ + + var oNav = document.all.item("nav"); + if (oNav == null ) return; + + var sPreviousALT= sPreviousTip; + var sNextALT= sNextTip; + var sHTMLfile= oNav.innerHTML; + + var imgPrev= ""+ sPreviousALT +""; + var imgNext= ""+ sNextALT  + ""; + + var previousNextObject= ""; + + oNav.innerHTML= "" + + "
" + +imgPrev + "
"; + + document.body.innerHTML= document.body.innerHTML + previousNextObject; + findPageSeq(); + if (printing == true) return; + var thisLoc= document.location.href +"#"; + + if (previousLink.href== thisLoc) previousLink.style.display="none"; + else previousLink.style.display="block"; + + if (nextLink.href== thisLoc) nextLink.style.display="none"; + else nextLink.style.display="block"; + +} + +function findPageSeq() { + +var rs= HTMlist.recordset; +var thisLoc= document.location.href; +var iLoc= thisLoc.lastIndexOf("/"); + + if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length); + + + if (nav.style == "[object]") { + nav.style.visibility="hidden"; + printing = false; + } + else + { + printing = true; + return; + } + + + rs.moveFirst(); + + while (!rs.EOF) { + if (thisLoc == rs.fields("HTMfiles").value){ + nav.style.visibility="visible"; + rs.MoveNext(); + break; + } + previousLink.href=rs.fields("HTMfiles").value; + rs.moveNext(); + } + + if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value; +} + +//******Re-usable text ********************************************************************************************* +// Inserts the Tabular Data Control (TDC) object at the end of the page +// Inserts "re-usable text" from the txt file at: +// e.g. for record#4 in the printing.txt in printing.chm. + +// + +// addReusableText() - called during document load to find all references +// render time bound contents. Extracts content resources from reusable.xml. +// +// "class" names bound (reuse, smart) +// "reuse" static lookup of commonly referred to text. +// "smart" dynamic lookup of navigation text relevent +// to the shell presentation of the start menu +// and the control panel, (simple and classic), for the logged on user. +// Requires inserting custom supported by Help and Support Services viewer. +// Currently not available from HTML Help control. 2000/01/12. +// +function smarthelperror(){ + // alert("error - error") + addReusableText(); + + insertImages(); + return true; + // alert("error - error") + } + +//var obj = window.document.createElement("OBJECT"); + +function load_object(){ + if(!isIE6) return; + + //window.onerror = smarthelperror; + try{ + var obj = window.document.createElement("OBJECT"); + var sActX_PCHealth = "CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7"; + objLoaded = true; + obj.width = 1; + obj.height = 1; + + obj = document.body.insertAdjacentElement("beforeEnd", obj) + obj.id = "pchealth"; + obj.classid = sActX_PCHealth; + // alert("success") + } + catch(e){} + } + +function addReusableText(){ + if (isIE4) return; // no reusable text for IE4 + var coll = document.all.tags("SPAN"); + var xmlLoaded = false; + var control = null; + var thisID; + var strKey; + var text; + + // original error text + text = "OXO"; + + // + //queried state of shell presentation for start menu and control panel. + var menuSimple = false; + var controlSimple = false; + + // holds calculated lookup suffixes for smart class items. + var strSuffixStartMenuOnly = ""; + var strSuffixStartMenuAndControlPanel = ""; + + // smart class UserSettings Interface classid + var sActX_PCHealth = "CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7"; + + // smart class lookup suffixes per shell presentation mode. + // TODO: Findout where these constants are best documented. + var strMenuClassic = "_smclassic"; + var strMenuSimple = "_smsimple"; + var strCPanelClassic = "_cpclassic"; + var strCPanelSimple = "_cpsimple"; + + // only attempt to query once per rendering + var bPresentationModeQueried = false; + // + span_count = coll.length; + // Check every span in the document. + for (var i=0; i< span_count; i++) { + + var thisSpan = coll[i]; + var spanClass = thisSpan.className.toLowerCase(); + if (spanClass == "reuse" || spanClass == "smart") { + if (isRTL) thisSpan.dir = "rtl"; + if (thisSpan.id == null) break; + + // strKey is the key we'll use to look up the replaceable text in the XML file + strKey = thisSpan.id.toLowerCase(); + + + + // skip smart tags when defaults are not present + if ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) { + if (spanClass == "smart") { + + // Query Presentation Mode once per rendering. + if (!bPresentationModeQueried) { + + bPresentationModeQueried=true; + + // Set To Defaults + if (defaultStartMode != null) { + menuSimple = (defaultStartMode.text == strMenuSimple); + } else { + menuSimple = true; + } + + if (defaultCPanelMode != null) { + controlSimple = (defaultCPanelMode.text == strCPanelSimple); + } else { + controlSimple = true; + } + + + + // alert("inside of reuse") + + // Get the current user's presentation settings + // Attempt to read smart help values from system + var test = window.document.all("pchealth"); + + if (test != null) { + + if (test.UserSettings != null) { + + + menuSimple = test.UserSettings.IsStartPanelOn; + + controlSimple = test.UserSettings.IsWebViewBarricadeOn; + + + } + else + { + menuSimple = (defaultStartMode.text == strMenuSimple) + controlSimple = (defaultCPanelMode.text == strCPanelSimple); + } + + + + + }// (test != null) + + }// (!bPresentationModeQueried) + + // get the error text to display + text = smartErrorText; + + // Build key suffixes. One for start menu only and one for start menu and control panel. + strSuffixStartMenuOnly = (menuSimple ? strMenuSimple : strMenuClassic); + strSuffixStartMenuAndControlPanel = strSuffixStartMenuOnly + (controlSimple ? strCPanelSimple : strCPanelClassic); + + // The actual key could have either strSuffixStartMenuOnly or strSuffixStartMenuAndControlPanel suffixes. + // strSuffixStartMenuAndControlPanel has precedence over strSuffixStartMenuOnly + strKey = strKey + strSuffixStartMenuAndControlPanel; + //alert(strKey) + }//if (spanClass == "smart") + + }// ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) + + // Lookup XML node containing reference + + var strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def"; + var node = xmldoc.documentElement.selectSingleNode(strNodeSelector); + + // if we haven't found the node yet, try the other suffix if this is a smart span + if (node == null && spanClass == "smart" && (defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) { + // one more try--use the other suffix + strKey = thisSpan.id.toLowerCase() + strSuffixStartMenuOnly; + strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def"; + node = xmldoc.documentElement.selectSingleNode(strNodeSelector); + } + + // okay, we found the node, get the text + // alert(coll.length) + if (node != null) { + // replace the span's contents with the reusable text + thisSpan.insertAdjacentHTML("BeforeBegin",node.text); + // var coll = document.all.tags("SPAN"); + thisSpan.className = "anything" + thisSpan.innerHTML = ""; + //alert(node.text) + //thisSpan.innerHTML = node.text; + } else { + // error shown by this OXO + thisSpan.innerHTML = text; + } + + } // if (spanClass == "reuse" || spanClass == "smart") + }// for + +}// addReusableText() +// + + +//****** insertImages ********************************************************************************************* +// Inserts shared images in User-Defined Variables section and thumbnails. +var booking = false; +function insertImages(){ + +if (printing == false) booking = true; +if (printing == true && booking == true ) { + booking = false; + return; + } +// insert alert icons + var collP = document.all.tags("P"); + + for (var i=0; i " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="warning") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="caution") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="tip") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="important") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="empty") collP[i].innerHTML =" " + collP[i].innerHTML; + if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes") { + collP[i].outerHTML =" " + collP[i].outerHTML; + } + } + +//alert(printing) +//alert(isIE55) +//indents for Navigation Tree +var collUL = document.all.tags("UL"); +if (!printing) { +for (var i=0; i" + imgSpace; + } + +// insert SHORTCUT icons + if (oAnchor=="shortcut") { + document.anchors[i].title= sShortcutTip; + if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut") + imgInsert= ""; // not to re-insert when persistent + else imgInsert= "" + imgSpace; + } + +// insert POPUP icons + else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip; + else if (document.anchors[i].className.toLowerCase()=="popupicon") + if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup") + imgInsert= ""; // not to re-insert when persistent + else imgInsert= "" + imgSpace; + +// insert EXPAND icons + else if (oAnchor=="expand") { + document.anchors[i].title= sExpandTip; + if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand") + imgInsert= ""; // not to re-insert when persistent + else{ + if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) { + imgSpace= ""; + if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em"; imgStyle=" style=margin-right:'-1.5em'";} + else { document.anchors[i].parentElement.style.marginLeft= "1.5em"; imgStyle=" style=margin-left:'-1.5em'";} + } + imgInsert= "" +imgSpace; + } + } + + + +// insert thumbnail images + else if (oAnchor=="thumbnail" || oAnchor=="thumbnailweb"){ + var sAltText = document.anchors[i].innerHTML; + gifwithin = true; + var sThumbnailText = document.anchors[i].title; + var oImg = document.anchors[i].href.toLowerCase(); + if (oAnchor=="thumbnail") + var sThumbnailImg= moniker + getURL(oImg); + else var sThumbnailImg = document.anchors[i].href.toLowerCase(); + + found = sAltText.indexOf("BACKGROUND-COLOR:") + if (found != -1) { + stop_p = sAltText.indexOf(">"); + sAltText = sAltText.substring(stop_p + 1, sAltText.length); + stop_p = sAltText.indexOf(""); + Highlighted = sAltText.substring(0,stop_p) + sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length); + } + + + document.anchors[i].outerHTML = "
"+document.anchors[i].outerHTML+"
"; + document.anchors[i].innerHTML = " " + sAltText + "

" +sThumbnailText+"

"; + + if (isRTL) thumbDiv.style.styleFloat= "right"; + } + + + + document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML; + if (isRTL) document.anchors[i].dir="rtl"; + } +} + + + +//***** onclickTriage **************************************************************************************** +// redirects to the appropriate function based on the ID of the clicked tag. + +function onclickTriage(){ +var e= window.event.srcElement; + +// if the innerHTML in the tag is encapsulated by a style tag or hightlighted in the word seach, +// the parentElement is called. + + if ((isIE55 || isIE6) && printing == true) { + printing = false; + reset_form(); + } + + for (var i=0; i < 5; i++) + if (e.tagName!="A" && e.parentElement!=null) e= e.parentElement; + eID= e.id.toLowerCase(); + + if (popupOpen) closePopup(); + +// expand image in a new window + if (eID=="thumbnail" || eID=="pophtm") popNewWindow(e); + else if (eID=="thumbnailweb") callThumbnailWeb(e); + else if (eID=="wpopup") callPopup(e); + else if (eID=="wpopupweb") callPopupWeb(e); + else if (eID=="shortcut") callShortcut(e); + else if (eID=="reltopics") callRelatedTopics(e); + else if (eID=="altloc") callAltLocation(e); + else if (eID=="expand") callExpand(e); +// added to support Randy's Quad method code + else QuadDocumentClick() +// ****************************** +} + + +//*** gettingHot **************************************************************************************** +// Makes all the required changes for mouseover. + +function gettingHot() { +var e = window.event.srcElement; + + + + if (e.id.toLowerCase()=="cold") e.id ="hot"; + else if (e.src== previousCold) e.src = previousHot; + else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousCold) e.children.tags("IMG")(0).src= previousHot; + else if (e.src== nextCold) e.src = nextHot; + else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextCold) e.children.tags("IMG")(0).src= nextHot; + + else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG") e.src = shortcutHot; // tags have a class + else if (e.id.toLowerCase()=="shortcut") e.children.tags("IMG")(0).src = shortcutHot; // tags have an ID + + else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG") e.src = popupHot; // tags have a class + else if (e.className.toLowerCase()=="popupicon") e.children.tags("IMG")(0).src = popupHot; // tags have an ID + + else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesHot(e); + + // Added to support Quad Method ************************** + if (e != null && e.firstChild != null && + e.firstChild.tagName != null && + e.firstChild.tagName.toLowerCase() == "input" && + e.firstChild.type.toLowerCase() == "radio" && + e.parentElement.className != "indentGray"){ + QuadDocumentMouseOver() + } + +// ***************************** +} + +//*** gettingCold ************************************************************************************** +// Initial state for mouseout. + +function gettingCold() { +var e = window.event.srcElement; + + + + if (e.id.toLowerCase()=="hot") e.id ="cold"; + else if (e.src== previousHot) e.src = previousCold; + else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousHot) e.children.tags("IMG")(0).src= previousCold; + else if (e.src== nextHot) e.src = nextCold; + else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextHot) e.children.tags("IMG")(0).src= nextCold; + + else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG") e.src = shortcutCold; // tags have a class + else if (e.id.toLowerCase()=="shortcut") e.children.tags("IMG")(0).src= shortcutCold; // tags have an ID + + else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG") e.src = popupCold; // tags have a class + else if (e.className.toLowerCase()=="popupicon") e.children.tags("IMG")(0).src= popupCold; // tags have an ID + + else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesCold(e); + + // Added to support Quad Method ************************** + if (e != null && e.firstChild != null && + e.firstChild.tagName != null && + e.firstChild.tagName.toLowerCase() == "input" && + e.firstChild.type.toLowerCase() == "radio" && + e.parentElement.className != "indentGray"){ + QuadDocumentMouseOver() + } + +// ***************************** +} + +//****************************************** OBJECT CONSTRUCTION ************************************** +//***************************************************************************************************** +// Uses an A tag to pass parameters between an HTML page and this script. +// Creates an ActiveX Object from these parameters, appends the Object to the end of the page, +// and clicks it. These objects relate to HTMLHelp environment and information about them can be found on the http://HTMLHelp site. + +// Object construction variables ********************************************************************* + +var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND; +var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' "; + + +//*** callPopup *************************************************************************************** +// creates an object from an tag HREF, the object inserts a winhelp popup +// called by: @@Popup text@@ + +var joker = false; +var blague = true; + +function callPopup(eventSrc) { +if (popupOpen) closePopup(); +var ntsharedAdded= false; // make sure the object is only added once +var CHMspecificAdded= false; // make sure the object is only added once +var coll = document.all.tags("SPAN"); +var sIndex,sText=" ",sFile,sFileID,dataBindingObject; + + var e= eventSrc; + var eH= unescape(e); + eH = eH.toLowerCase(); + var eH_= eH.toLowerCase(); + + if(event){ + event.returnValue = false; + } + found = false; + + var iTOPIC = eH.lastIndexOf("topic="); + if (iTOPIC==-1) return; + sParamTOPIC = eH.substring((iTOPIC+6),eH.length); + if (!isIE4){ + if (!joejoe){ + xmldom.load(moniker + path2glossary + "glossary.xml"); + joejoe = true; + } + + var o=0; + var node = ""; + node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sParamTOPIC + "']"); + + if(node!=null) + { + + found = true; + var ralf = ""; + ralf = node.getElementsByTagName("term") + sText = "
" + ralf.item(0).nodeTypedValue + "
"; + ralf = node.getElementsByTagName("para") + + if (ralf.length != 0){ + sText = sText + "
" + ralf.item(0).nodeTypedValue; + sText = sText + "
"; + } + seealsos = node.getElementsByTagName("seeAlso"); + var o=0; + + look_at = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'SeeAlso']"); + + while (o < seealsos.length){ + sIndex = seealsos.item(o).getAttribute("seeAlsoTermID"); + node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']"); + ralf = node.getElementsByTagName("term"); + sTerm = ralf.item(0).nodeTypedValue; + if (o == 0) { + sText = sText + "
" + look_at.item(0).nodeTypedValue + " " + // sIndex = "" + sIndex = "" + sTerm + "" + } + else + { + sIndex = ", " + sTerm + "" + } + o++; + sText = sText + sIndex + } + + definition = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'See']"); + + seeentrys = node.getElementsByTagName("seeEntry"); + + while (o < seeentrys.length){ + sIndex = seeentrys.item(o).getAttribute("seeTermID"); + node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']"); + ralf = node.getElementsByTagName("term"); + sTerm = ralf.item(0).nodeTypedValue; + if (o == 0) { + sText = sText + "
" + definition.item(0).nodeTypedValue + " " + // sIndex = "" + sIndex = "" + sTerm + "" + } + else + { + sIndex = ", " + sTerm + "" + } + o++; + sText = sText + sIndex + } + } + + if (o != 0) sText = sText + "
" + + if ((isIE55 || isIE6) && found){ + var oPopup = false + var oPopup = window.createPopup(); + var strScript = ""; + var strDoc = oPopup.document.body.outerHTML.toLowerCase() + + oPopup.document.write(strDoc.replace(">", " onclick=\"clickPopup()\">" + strScript + "")); + //oPopup.document.write(strDoc.replace(">", " onclick=\"clickPopup()\, onkeypress=\"process_closePopup()\">" + strScript + "")); + oPopup.document.createStyleSheet(sSharedCHM + "coUA.css"); // Apply the stylesheet. + var oPopBody = oPopup.document.body; + + //oPopBody.style.backgroundColor = '#FFFFCC'; + + // oPopBody.style.border = "solid black 1px"; + oPopBody.style.margin = "0 0 0 0"; + if (isRTL) oPopBody.innerHTML = "" + sText + "" // need to add the style class here. + else oPopBody.innerHTML = "" + sText + "" + // alert(oPopBody.innerHTML) + if (window.event){ + joker = window.event.srcElement; + } + oPopup.show(0, 0, 400, 8, joker); // Show the popup at an arbitrary size. + var textSize = oPopBody.createTextRange(); + var wPop = textSize.boundingWidth + oPopBody.offsetWidth - oPopBody.clientWidth; // Get the size of the text. + var hPop = oPopBody.scrollHeight; + oPopup.hide(); + oPopup.document.parentWindow.PopParent = window; + oPopup.document.parentWindow.PopObject = oPopup; + + oPopup.show(0, 1, wPop , hPop, joker); + //oPopup.document.focus(oPopup.document.body.JOKER); + return; + } + + if (found){ + if (blague){ + document.body.insertAdjacentHTML("beforeEnd", ""); + blague = false; + } + window.wPopupWeb.innerHTML = sText; + callPopupWeb(e); + return; + } + } // for support of IE4 disable xml popups + + var iTOPIC = eH_.lastIndexOf("topic="); + if (iTOPIC==-1) return; + sParamTOPIC = eH.substring((iTOPIC+6),eH.length); // extracts the topic for item2 + + var iHELP = eH_.lastIndexOf("help="); + if (iHELP==-1) return; + sParamHELP = eH.substring(iHELP+5,iTOPIC); // extracts the help file for item1 + + if (document.hhPopup) document.hhPopup.outerHTML = ""; // if hhPopup object exists, clears it + + + var h= ""; + h= h + ""; + + document.body.insertAdjacentHTML("beforeEnd", h); + document.hhPopup.hhclick(); +} + + +//*** callAltLocation****************************************************************************** +// creates an object from an tag HREF, the object will navigate to the alternate location if the first location is not found. +// called from: @@Link text here@@ + + +function callAltLocation(eventSrc) { +var e= eventSrc; +var eH= unescape(e.href); +var eH_= eH.toLowerCase(); +var sFILEarray,sCHMarray; + event.returnValue = false; + +// var sParamTXT= e.innerHTML; +// sParamTXT= sParamTXT.replace(semicolon,""); + + var sParamTXT= ""; + + var iFILE = eH_.lastIndexOf("file="); + if (iFILE==-1) return; + sParamFILE= eH.substring((iFILE+5),eH.length); // extracts the 2 HTM files + sParamFILE= sParamFILE.replace(spaces,""); + iSPLIT= sParamFILE.match(semicolon); + if (iSPLIT) + sFILEarray = sParamFILE.split(";"); // separates the 2 HTM files + else return; + + var iCHM = eH_.lastIndexOf("chm="); + if(iCHM==-1) return; + else sParamCHM = eH.substring(iCHM+4,iFILE); // extracts the 2 CHM's + sParamCHM= sParamCHM.replace(spaces,""); + iSPLIT= sParamCHM.match(semicolon); + if (iSPLIT) + sCHMarray= sParamCHM.split(";"); // separates the 2 CHM's + else return; + + sParamFILE= moniker + sCHMarray[0]+ "::/" + sFILEarray[0] + ";" + moniker + sCHMarray[1]+ "::/" + sFILEarray[1]; + + if (document.hhAlt) document.hhAlt.outerHTML = ""; // if hhAlt object exists, clears it + + + var h= ""; + h= h + ""; + + document.body.insertAdjacentHTML("beforeEnd", h); + document.hhAlt.hhclick(); +} + + +//*** callRelatedTopics****************************************************************************** +// creates an object from an tag HREF, the object inserts a popup of the related topics to select +// called from: Related Topics + + +function callRelatedTopics(eventSrc) { +var e= eventSrc; +var eH= unescape(e.href); +var eH_= eH.toLowerCase(); + event.returnValue = false; + + var iMETA = eH_.lastIndexOf("meta="); + if (iMETA==-1) return; + sParamMETA = eH.substring((iMETA+5),eH.length); // extracts the META keywords for item2 + + var iCHM = eH_.lastIndexOf("chm="); + if(iCHM==-1) sParamCHM = ""; + else sParamCHM = eH.substring(iCHM+4,iMETA); // extracts the CHM files for item1 + + if (document.hhRel) document.hhRel.outerHTML = ""; // if hhRel object exists, clears it + + + var h= ""; + h= h + ""; + + document.body.insertAdjacentHTML("beforeEnd", h); + document.hhRel.hhclick(); +} + +//*** popNewWindow*************************************************************************************** +// creates an object from an tag HREF, the object then opens a new window from the image URL found in the HREF +// called from: @@alt text here@@ +// the thumbnail image is loaded by loadPage(); + + +function popNewWindow(eventSrc) { +var eH= eventSrc.href; + event.returnValue = false; + + // extracts the thumbnail image URL from the tag HREF + sParamFILE = getURL(eH); + if (sParamFILE=="") return; + + // sParamFILE = moniker + sParamFILE; + // sParamFILE = moniker + sParamFILE; + //alert(sParamFILE) + // callThumbnailWeb(sParamFFILE) + + + // if the hhWindow object exists, clears it + if (document.hhWindow) document.hhWindow.outerHTML = ""; + +var h = ""; + + document.body.insertAdjacentHTML("beforeEnd", h); + document.hhWindow.hhclick(); +} + +//*** callShortcut *************************************************************************************** +// creates an object from an tag, the object then calls the executable code +// called from: @@Shortcut text@@ +// the shortcut image is loaded by loadInitialImg(); + +function callShortcut(eventSrc) { +var e= eventSrc; +var eH= unescape(e.href); +var eH_= eH.toLowerCase(); + +event.returnValue = false; + + // extracts the error file URL from the tag HREF +iEND= eH.length; +sParamFILE = getURL(eH); + +var iEXEC = eH_.lastIndexOf("exec="); +var endstr = eH.lastIndexOf(","); +var sstr = eH.substring(endstr + 1, iEND); +var matchstr = ""; +for(i=endstr + 1;i< iEND; i++) //added 3/25/2002 by marissam to compensate for extra comma in shortcut calls in snippet + matchstr = matchstr + " "; +if(sstr == matchstr) +{ + iEND = iEND - (iEND-endstr); +} + + if (iEXEC==-1) return; + else sParamEXEC = eH.substring(iEXEC+5,iEND); + + // alert("this is it-" + sParamEXEC + "-sParamExec"); // extracts the executable for item1 + if (document.hhShortcut) document.hhShortcut.outerHTML = ""; // if the hhShortcut object exists, clears it + +var h = ""; + + document.body.insertAdjacentHTML("beforeEnd", h); + document.hhShortcut.hhclick(); +} + + +//**************************************** EXPAND FUNCTIONS ********************************************************* +//******************************************************************************************************************** + +//** callExpand ************************************************************************************************** +// This expands & collapses (based on current state) "expandable" nodes as they are clicked. +// Called by: @@Hot text@@ +// Followed by:
+ +function callExpand(eventSrc) { + +var e= eventSrc; + event.returnValue = false; // prevents navigating for tag + +var oExpandable = getExpandable(e); +var oImg = getImage(e); + + if (oExpandable.style.display == "block") + doCollapse(oExpandable, oImg); + else doExpand(oExpandable, oImg); +} + +//** expandGoesHot ********************************************************************************************* +// Returns expand image to hot. + +function expandGoesHot(eventSrc){ +var e= eventSrc; +//alert(e.outerHTML); +var oExpandable = getExpandable(e); + +var oImg = getImage(e); +//alert (oImg.src) +if (oExpandable == false){ + plus_or_minus = oImg.src.indexOf("minus") + if (plus_or_minus == -1){ + //alert(plus_or_minus) + oImg.src = closedHot + } + else + { + oImg.src = expandHot; + //alert(plus_or_minus) + } + return; + } + +if (!isIE4){ + if (oExpandable.style.display == "block"){ + oImg.src = expandHot; + //alert(oImg.src) + } + else oImg.src = closedHot; +} +} + + +//** expandGoesCold ********************************************************************************************* +// Returns expand image to cold. + +function expandGoesCold(eventSrc){ +var e= eventSrc; + +var oExpandable = getExpandable(e); +var oImg = getImage(e); +// alert (oImg.src) + +if (oExpandable == false){ + plus_or_minus = oImg.src.indexOf("minus") + + if (plus_or_minus == -1){ + //alert(plus_or_minus) + oImg.src = closed + } + else + { + oImg.src = expand; + //alert(plus_or_minus) + } + return; + } + + +if (!isIE4){ + if (oExpandable.style.display == "block") oImg.src = expand; + else oImg.src = closed; +} +} + + +//** getExpandable *****************************[used by callExpand, expandGoesHot, expandGoesCold]******* +// Determine if the element is an expandable node or a child of one. + +function getExpandable(eventSrc){ +var e = eventSrc; +var iNextTag, oExpandable; + + for (var i=1;i<4; i++){ + iNextTag= e.sourceIndex+e.children.length+i; + oExpandable= document.all(iNextTag); + if (oExpandable.className.toLowerCase()=="expand" || iNextTag == document.all.length) + return oExpandable + break; + } + return false; + +} + +//** getImage ***********************************[used by callExpand, expandGoesHot, expandGoesCold]******* +// Find the first image in the children of the current srcElement. +// (allows the image to be placed anywhere inside the tag) + +function getImage(header) { +var oImg = header; + + if(oImg.tagName != "IMG") oImg=oImg.children.tags("IMG")(0); + return oImg; +} + + +//**** expandAll ******************************************************************************************************* +// Will expand or collapse all "expandable" nodes when clicked. [calls closeAll()] +// called by: expand all + +var stateExpand = false; //applies to the page + +//**** **************************************************************************************************************** + +function expandAll() { +var oExpandToggle, oImg; +var expandAllMsg = "expand all"; //message returned when CloseAll() is invoked +var closeAllMsg = "close all"; //message returned when ExpandAll() is invoked +var e= window.event.srcElement; + event.returnValue = false; + + for (var i=0; i< document.anchors.length; i++){ + oExpandToggle = document.anchors[i]; + + if (oExpandToggle.id.toLowerCase() == "expand"){ + oExpandable = getExpandable(oExpandToggle); + oImg = getImage(oExpandToggle); + + if (stateExpand == true) doCollapse(oExpandable, oImg); + else doExpand(oExpandable, oImg); + } + } + if (stateExpand == true) { + stateExpand = false; + e.innerText= expandAllMsg; + } + else { + stateExpand = true; + e.innerText= closeAllMsg; + } +} + + +//**** doExpand ******************************************************************************************************* +// Expands expandable block & changes image + +var redo = false; +function doExpand(oToExpand, oToChange) { +var oExpandable= oToExpand; +var oImg= oToChange; + +// if (printing == "TRUE") return; + + oImg.src = expand; + oExpandable.style.display = "block"; + + if (!redo && isIE4) { + // alert("what") + redo = true; + // focus(oToExpand); + doExpand(oToExpand, oToChange); + } + } + + +//**** doCollapse ***************************************************************************************************** +// Collapses expandable block & changes image + +function doCollapse(oToCollapse, oToChange) { +// if (printing == "TRUE") return; +var oExpandable= oToCollapse; +var oImg= oToChange; + + oExpandable.style.display = "none"; + oImg.src = closed; +} + +//******************************************************************************************************* +//******* WEB FUNCTIONS ************************************************************************** +//******************************************************************************************************* + +//**** callThumbnailWeb ************************************************************************************** + +function callThumbnailWeb(eventSrc) { +var e= eventSrc; + event.returnValue = false; + +var thumbnailWin= window.open (e.href, "height=450, width=600, left=10, top=10, dependent=yes, resizable=yes, status=no, directories=no, titlebar=no, toolbar=yes, menubar=no, location=no","true"); + +thumbnailWin.document.write ("Windows 2000"); + +return; +} + +//********************************************************************************************************* +//********************************************************************************************************* + +var popupOpen= false; //state of popups +var posX, posY; //coordinates of popups +var oPopup; //object to be used as popup content + +//**** callPopupWeb ************************************************************************************** +// the web popups have been converted from the object winHelp popup for the web. +// called by: @@Popup text@@ +// followed by: + + +function callPopupWeb(eventSrc) { +var e= eventSrc; + + // find the popup
that follows + findPopup(e); + if (!e.bite_me) positionPopup(e) + + oPopup.style.visibility = "visible"; + // document.focus(e) + popupOpen = true; + + return; +} + +//**** findPopup **************************************************************************************** + +function findPopup(oX){ +var e= oX; +var iNextTag; + + for (var i=1;i= document.body.clientWidth) + posX -= (rightlimit - document.body.clientWidth); + if (posX < 0) posX = 0; + +//position popup + oPopup.style.top = posY; + oPopup.style.left = posX; + +var pageBottom = document.body.scrollTop + document.body.clientHeight; +var popupHeight = oPopup.offsetHeight; + + if (popupHeight + posY >= pageBottom) { + if (popupHeight <= document.body.clientHeight) + oPopup.style.top = pageBottom - popupHeight; + else + oPopup.style.top = document.body.scrollTop; + } +} + +//**** closePopup **************************************************************************************** +// Close Popup +function closePopup() { + + oPopup.style.visibility = "hidden"; + popupOpen = false; + return; +} + + +//********************************************* GENERAL FUNCTIONS ************************************************ +//************************************************************************************************************************** + +//***ajustImg ************************************************************************************************************* +// expands an image to the with of the window or shrinks it to 90px + +function ajustImg(eventSrc) { +var e= eventSrc; +var fullWidth= document.body.offsetWidth; + + fullWidth = fullWidth - 50; + if (e.style.pixelWidth==90) + e.style.pixelWidth=fullWidth; + else e.style.pixelWidth=90; +} + + +//** getURL **************************************[used in callShortcut, popNewWindow& loadPage]******** +// extracts the file location (CHM::/HTM) URL + +function getURL(sHREF) { +var spaces= /\s/g +var eH = unescape(sHREF); + eH = eH.replace(spaces,""); + +var eH_= eH.toLowerCase(); +var sParamFILE= ""; +var sParamCHM= ""; + +var iFILE= eH_.lastIndexOf("file="); + if (iFILE!=-1){ + iEND= iFILE +1; + sParamFILE = eH.substring(iFILE+5,eH.length); + } + +var iCHM = eH_.lastIndexOf("chm="); + +gifwithin = false; +if (gifwithin){ + gifwithin = false; + var con_mmc; + var doc_mmc; + doc_mmc = " " + document.location; + doc_mmc = doc_mmc.toLowerCase(); + if (iCHM!=-1){ + iEND = iCHM +1; // iEND used by callShortcut + sParamCHM = eH.substring(iCHM+4, iFILE); + con_mmc = doc_mmc.indexOf(sParamCHM); + if (con_mmc != -1){ + sParamCHM = ""; + iCHM = -1; + sParamFILE= sParamCHM+sParamFILE; + } + } + } + + if (iCHM!=-1){ + iEND = iCHM +1; // iEND used by callShortcut + sParamCHM = eH.substring(iCHM+4, iFILE); + sParamFILE= sParamCHM+"::/"+sParamFILE; + } + return sParamFILE; +} +//**************************************************************************************************************************** +//******************************************** IE5 PERSISTENCE ************************************************************* +//**************************************************************************************************************************** + +var oTD,iTD; // persistence + +//****** Persistence for userData ********************************************************************************************* + +function getChecklistState(){ + + var pageID= addID(); + + if (checklist.all== "[object]") { + oTD=checklist.all.tags("INPUT"); + iTD= oTD.length; + } + else + { + printing = true; + isPersistent = false; + return; + } + + if (iTD == 0){ + printing = true; + isPersistent = false; + return; + } + +// routine added to fix a bug in the ocx 06/14/99 + lct = document.location + "."; + xax = 10; + xax = lct.indexOf("mk:@MSITStore"); + if (xax != -1) { + lct = "ms-its:" + lct.substring(14,lct.length-1); + // alert("before reload : " + document.location); + // alert("replace with : " + lct); + isPersistent = false; + document.location.replace(lct); + isPersistent = true; + // alert("after reload : " + document.location); + } + else + { + checklist.load("oXMLStore"); + } +// routine added to fix a bug in the ocx 06/14/99 + if (checklist.getAttribute("sPersist"+pageID+"0")) + for (i=0; i
&&
are found +function resizeDiv(){ +if (printing == true) return; +var oNav = document.all.item("nav"); +var oText= document.all.item("text"); + + if (popupOpen) closePopup(); + if (oText == null) return; + if (oNav != null){ + document.all.nav.style.width= document.body.offsetWidth; + document.all.text.style.width= document.body.offsetWidth-4; + document.all.text.style.top= document.all.nav.offsetHeight; + if (document.body.offsetHeight > document.all.nav.offsetHeight) + document.all.text.style.height= document.body.offsetHeight - document.all.nav.offsetHeight; + else document.all.text.style.height=0; + } +} +//** addID ************************************************************************************************************* +function addID(){ + +var locID = document.location.href; +var iHTM = locID.lastIndexOf(".htm"); +var iName=locID.lastIndexOf("/"); + locID = locID.substring(iName+1,iHTM); + + return locID; +} +//** set_to_print *************** +function set_to_print(){ + // alert(printing) + if (printing == true) return + var i; + + +var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4); +var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0); +if (isIE5 && isIE55) isIE5 = false; +var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0); +var isIE4 = (navigator.appVersion.indexOf("MSIE 4")>0); + +if (!isIE5 && !isIE55 && !isIE4 && !isIE6) { + isIE6 = true; + } + + +// trying + +printing = true; + + if (isIE55){ + addReusableText(); + insertImages_4_print(); + } +if (isIE6){ + addReusableText(); + insertImages_4_print(); + } + +// to fix printing + + + +isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6) || (isIE55)); + setPreviousNext(); + resizeDiv(); +// if (isPersistent) getChecklistState(); + + + if (window.text) { + if (!window.text.style){ + scroller = "FALSE"; + } + else + { + document.all.text.style.height = "auto"; + scroller = "TRUE"; + } + } + +var thisLoc= document.location.href; + thisLoc = thisLoc.indexOf("glossary.htm") + if (thisLoc != -1){ + return; + } + // alert("in print") + + // alert(isIE6) + for (i=0; i < document.all.length; i++){ + if (document.all[i].id == "expand") { + // callExpand(document.all[i]); // no longer needed since the coua_print.css does this now. + single = "TRUE"; + } + if (document.all[i].tagName == "BODY") { + document.all[i].scroll = "auto"; + } + if (document.all[i].tagName == "A" && scroller != "TRUE") { + joe = " " + document.all[i].outerHTML + joe = joe.toLowerCase(); + joe = joe.indexOf("href=") + if(joe == -1){ + document.all[i].outerHTML = "" + document.all[i].innerHTML + ""; + } + else + { + document.all[i].outerHTML = "" + document.all[i].innerHTML + ""; + } + } + } + +// reset_form(); + +} +//** used to reset a page if needed ******************** +function reset_form(){ + printing = false; + document.location.reload(); +} + + +//** on error routine ********************************* +function errorHandler() { + // alert("Error Handled"); + return true; +} + +// ******************************* this function is to help ie55 and ie6 to print these images ****** +booking = false; +function insertImages_4_print(){ + +window.onerror = errorHandler +// if (isIE6) return +// if (isIE55) return +if (!printing) booking = true; +if (printing == true && booking == true ) { + booking = false; + return; + } + + + var collP = document.all.tags("P"); + + for (var i=0; i " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="warning") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="caution") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="tip") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="important") collP[i].innerHTML =" " + collP[i].innerHTML; + else if (collP[i].className.toLowerCase()=="empty") collP[i].innerHTML =" " + collP[i].innerHTML; + if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes") { + collP[i].outerHTML =" " + collP[i].outerHTML; + } + } + +//alert(printing) +//alert(isIE55) +//indents for Navigation Tree +var collUL = document.all.tags("UL"); +if (!printing) { +for (var i=0; i" + imgSpace; + } + +// insert SHORTCUT icons + if (oAnchor=="shortcut") { + document.anchors[i].title= sShortcutTip; + if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut") + imgInsert= ""; // not to re-insert when persistent + else imgInsert= "" + imgSpace; + } + +// insert POPUP icons + else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip; + else if (document.anchors[i].className.toLowerCase()=="popupicon") + if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup") + imgInsert= ""; // not to re-insert when persistent + else imgInsert= "" + imgSpace; + +// insert EXPAND icons + else if (oAnchor=="expand") { + document.anchors[i].title= sExpandTip; + if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand") + imgInsert= ""; // not to re-insert when persistent + else{ + if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) { + imgSpace= ""; + if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em"; imgStyle=" style=margin-right:'-1.5em'";} + else { document.anchors[i].parentElement.style.marginLeft= "1.5em"; imgStyle=" style=margin-left:'-1.5em'";} + } + imgInsert= "" +imgSpace; + } + } + + + +// insert thumbnail images + else if (oAnchor=="thumbnail" || oAnchor=="thumbnailweb"){ + var sAltText = document.anchors[i].innerHTML; + gifwithin = true; + var sThumbnailText = document.anchors[i].title; + var oImg = document.anchors[i].href.toLowerCase(); + if (oAnchor=="thumbnail") + var sThumbnailImg= moniker + getURL(oImg); + else var sThumbnailImg = document.anchors[i].href.toLowerCase(); + + found = sAltText.indexOf("BACKGROUND-COLOR:") + if (found != -1) { + stop_p = sAltText.indexOf(">"); + sAltText = sAltText.substring(stop_p + 1, sAltText.length); + stop_p = sAltText.indexOf(""); + Highlighted = sAltText.substring(0,stop_p) + sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length); + } + + + document.anchors[i].outerHTML = "
"+document.anchors[i].outerHTML+"
"; + document.anchors[i].innerHTML = " " + sAltText + "

" +sThumbnailText+"

"; + + if (isRTL) thumbDiv.style.styleFloat= "right"; + } + + + + document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML; + if (isRTL) document.anchors[i].dir="rtl"; + } +} + +//** quad method code -- Witten by Randy Feinger, morphed to work inside of shared.js +function QuadDocumentMouseOver() +{ + var elem = event.srcElement; + + // If the first childe of the source element is a radio button and + // the parent element isn't grayed, change the cursor to a hand + // or back to the original as appropriate. + if (elem != null && elem.firstChild != null && + elem.firstChild.tagName != null && + elem.firstChild.tagName.toLowerCase() == "input" && + elem.firstChild.type.toLowerCase() == "radio" && + elem.parentElement.className != "indentGray") + { + if (elem.style.cursor == "hand") + elem.style.cursor = "auto"; + else + elem.style.cursor = "hand"; + } +} + +function QuadDocumentClick() +{ + // Don't process clicks on grayed text. + if (event.srcElement.parentElement.className == "indentGray") + return; + + // INPUT elements should be wrapped by another element such as a SPAN, DIV, or P. + var elem = event.srcElement.firstChild; + + // If this is a radio button... + if (elem != null && elem.tagName != null && elem.tagName.toLowerCase() == "input" && elem.type == "radio") + { + // check it. + elem.checked = true; + } + else + { + // Otherwise, set elem to the event's source element. + elem = event.srcElement; + } + + // Call OnElementClick() and pass in the source element, and the name token + // used to mark a top-level clickable element such as a radio button. + OnElementClick(elem, "row1"); +} + + + +function OnElementClick(srcElem, token) +{ + var elemTagName = srcElem.tagName; // Tag name of the source element. + var collElements1 = document.all.item(srcElem.name); // Collection of elements with the same name property as the source element. + var n = srcElem.sourceIndex; // The source index of the source element. + var elemGroup = srcElem.group; // The (dynamic) group property for the source element. + var elemID = srcElem.id; // The source element's ID. + var i, j, k; // Loop variables. + + // If there are no elements with the same name as the source element, or + // if the source element isn't part of a group, exit the function. + if (collElements1 == null || elemGroup == null || collElements1.length == null) + return; + + // Make sure the source element's name contains the designated token + // so we know it's top-level element that should be processed. + if (srcElem.name.toLowerCase().indexOf(token) != -1) + { + // Loop through the collection of + for (i = 0; i < collElements1.length; i++) + { + // Go up one level and then down a level in the element hierarchy to find + // the container (parent) element for the clickable sub-elements (radio buttons). + var oNextElement = collElements1(i).parentElement.nextSibling; + + // If there is no such element, get the next element in the collection. + if (oNextElement == null || oNextElement.tagName == null) + continue; + + // Get the collection of all the elements within the container element that + // have the same tag name as the source element. + var collElements2 = oNextElement.all.tags(elemTagName); + + // Make sure the collection is valid. + if (collElements2 == null || collElements2.length == 0) + continue; + + // Loop through the collection of sub-elements within the container element. + for (j = 0; j < collElements2.length; j++) + { + // If the current element in the collection is not the + // source element, disable it and make the text gray. + if (collElements1(i).sourceIndex != n) + { + oNextElement.className = "indentGray" + collElements2(j).disabled = true; + } + else // Otherwise, enable the element and make the text black. + { + oNextElement.className = "indentBlack" + collElements2(j).disabled = false; + + // Set the ID for the checked (selected) element for use below. + if (collElements2(j).tagName.toLowerCase() == "input" && + collElements2(j).type.toLowerCase() == "radio" && + collElements2(j).checked == true) + { + elemID = collElements2(j).id; + } + } + } + } + } + + // Get the collection of all of the elements with the same tag name as that + // of the source element. + var collElements2 = document.all.tags(elemTagName); + + // Make sure the collection is valid. + if (collElements2 == null || collElements2.length == 0) + return; + + // Loop through the collection of elements. + for (i = 0; i < collElements2.length; i++) + { + // Get the collection of all elements with the same ID as the + // current item in the collection. + var collAssocElems = document.all(collElements2(i).id); + + // Make sure the collection is valid. + if (collAssocElems == null || collAssocElems.length == 0) + continue; + + // Loop through the collection of same-named elements. + for (j = 0; j < collAssocElems.length; j++) + { + // If the tag name for the current element is different than that for the source element, + // and the current element is part of the same group as the source element, + // hide or display the element as appropriate. + if (collAssocElems(j).tagName != elemTagName && collAssocElems(j).group == elemGroup) + { + // Hide the element unless the current element's ID matches the ID of the element + // that has been checked (selected). + collAssocElems(j).style.display = ((collAssocElems(j).id == elemID) ? "block" : "none") + } + } + } +} + diff --git a/inetsrv/uddi/source/help/mmc/shortcutcold.gif b/inetsrv/uddi/source/help/mmc/shortcutcold.gif new file mode 100644 index 0000000..6317cc0 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/shortcutcold.gif differ diff --git a/inetsrv/uddi/source/help/mmc/shortcuthot.gif b/inetsrv/uddi/source/help/mmc/shortcuthot.gif new file mode 100644 index 0000000..ad123cb Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/shortcuthot.gif differ diff --git a/inetsrv/uddi/source/help/mmc/style/coua.css b/inetsrv/uddi/source/help/mmc/style/coua.css new file mode 100644 index 0000000..5c66fd1 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/style/coua.css @@ -0,0 +1,401 @@ +/* Style sheet optimized for IE4x - Last updated 01/16/01 RWF */ +/* Added Table.nested, TH, TD for nested tables -- 02/26/01 */ + +body { color: #000000; + background: #FFFFFF; + font-size: 70%; + font-family: Verdana, Arial, Sans Serif; + margin-left: 0em; + padding-left: 1.5em; } + + +a:link, a:visited { color: #0000FF; text-decoration:underline;} + +a:active, a:hover { color: #FF0000; cursor:hand; text-decoration:underline;} + +/* Puts a little more breathing room above related topics link. - AMS*/ +a.#reltopics { position:relative; top:1em; } + +h1 + { font-size: 125%; + margin-bottom: .5em; clear:both; width: 85%; } + +h2 + { font-size: 110%; + margin-top: 1.5em; + margin-bottom: .5em; clear:both; } + +h3 + { font-size: 100%; + margin-top: 1.2em; + margin-bottom: .5em; clear:both; } + +h4 + { font-size: 100%; + margin-top: 1.2em; + margin-bottom: .5em; clear:both; } + +h5 + { font-size: 100%; + margin-top: 1.2em; + margin-bottom: .5em; clear:both; } + +p + { margin-top: .6em; + margin-bottom: .6em; } + +ol + { margin-top: .5em; + margin-bottom: 0em; + margin-left: 2.1em; + padding-left: 0em; + margin-right:2.1em; } + +ul + { margin-top: .6em; + margin-bottom: 0em; + list-style-type: disc; + margin-left: 1.5em; + padding-left: 0em; + margin-right: 1.5em; } + +li + { margin-bottom: .7em; clear:both; } + +dd + { margin-bottom: 0em; + margin-left: 1.5em; } + +/* for defined terms, follow the Document Conventions listing in the Microsoft Manual of Style: */ +/* Keywords, functions, and anything else the user must enter exactly as shown are bold--add font-weight: bold; to the dt tag */ +/* Variables, book titles, and placeholders the user must provide are italic--add font-style: italic; to the dt tag */ +/* pre-defined arguments are bold and italic--add font-weight: bold; and font-style: italic; to the dt tag */ + +dt + { margin-top: 1em; } + +pre + { margin-top: .5em; + margin-bottom: .5em; } + +code + { font-family: Courier New; + font-size: 1.1em; } + +table + { font-size: 100%; + margin-top: 1em; + margin-bottom: 1em; } + +th + { text-align: left; + background: #DDDDDD; + vertical-align: bottom; + padding: .2em; + padding-left: .45em; + padding-right: .5em;} + +tr + { vertical-align: top; } + +td + { background: #EEEEEE; + vertical-align: top; + padding: .2em; + padding-left: .45em; + padding-right: .5em;} + + +/**** extended class styles ************************/ +/* */ +/* add comment tags to disable the style */ + +p.indent { margin-left: 1.3em; } /* used to indent text for notes and warnings; use this instead of the blockquote tag */ + +p.indent2 { margin-left: 3.5em; } /* used to indent text a second level under the first indent */ + +P.indentGray { color: #666666; } /* used in quad-method procedures */ + +p.procLabel { font-size: 100%; + font-weight: bold; clear: both; width: 85%; margin-top: 2em; } + +p.uatshoot { font-weight: bold; margin-bottom: -.5em; margin-top: 1em; } + +/***********************************************/ +/* these class styles are used for the expanding and collapsing text files (expand function in shared.js) */ + +#expand {margin-bottom: 0.6em; margin-left: 0em; margin-right: 0em;} + +a:link.expandToggle, a:visited.expandToggle {color:#000000; font-weight: bold; text-decoration:none;} + +a:hover.expandToggle, a:active.expandToggle {color:#0000FF;} + +img.expand { border: none; margin-right: 0.5em; width:.8em;} + +div.expand { margin-left: 1.5em; margin-right: 1.5em;margin-bottom: 1em; display:none;} + + + +/***********************************************/ +/* this class for expand collapse appearing in a table */ + +table.uatshoot {background-color: #FFFFFF; width: 90%; } + +table.uatshoot td { padding: 0px 0px 0px 5px; } + +a:link.uatshoot, a:visited.uatshoot {color:#000000; font-weight: normal; text-decoration:none;} + +a:hover.uatshoot, a:active.uatshoot {color:#0000FF; text-decoration: none; } + + +/*******************************************/ +/* these classes are for thumbnail art */ + +a:link img.thumbnail {border-color: #0000FF;} + +a:active img.thumbnail { border-color: #FF0000;} + +a:hover img.thumbnail {border-color: #FF0000;} + +img.thumbnail {vertical-align: top; margin-left: 0; + width:90; border-width:1;} + +div.thumbnail {float:left; width: 105; margin-top: 1em; margin-bottom: -0.3em; + clear: both; } + +/*********************************************/ +/* this class style is used for the navigation tree in MMC */ + +p.navTree { margin-top: .2em; } + +ul.navTree { list-style-type: none; } + +li.branch { margin-top: -.5em; margin-bottom: .6em;} + +a.where {} /* use for the expand tag */ + +/***************************************************************/ +/* these class styles are used for tags simulating buttons & their div */ + +#buttonMenu { padding: 0.5em 0.3em 0.1em 0.3em; + padding-left:6px; + border-bottom: thin solid #999999; + background: #BBBBBB; + vertical-align:top; + z-index:2; + visibility:visible; + left:0; top:0; + text-align:left; + margin:0 1em 0 0; + position:absolute; + width: 100%; + } + +a:link.button, a:visited.button, span.button { + border-top-color: #EEEEEE ; + border-left-color: #EEEEEE ; + border-bottom-color: #666666 ; + border-right-color: #666666 ; + background-color: #DDDDDD ; + color:#0000FF; + text-decoration: none; + text-align: center; + font-weight: bold ; + height:1.5em; width:17px; cursor:hand; + border-style: solid; border-width: 1; + } + +a:active.button, a:hover.button { + border-top-color: #666666 ; + border-left-color: #666666 ; + border-bottom-color: #EEEEEE ; + border-right-color: #EEEEEE; + background-color: #FFFFFF; + text-decoration: none; + text-align: center; + font-weight: bold ; + height:1.5em; width:17px; cursor:hand; + border-style: solid; border-width: 1; + } + +/* The following span is used to display +items that have no entries - AMS */ + +span.buttoninactive {background: #C0C0C0; + border: 1 solid #eeeeee; + height: 1.4em; + width: 1.4em; + text-align: center; + font-weight: bold; + color: #808080; + vertical-align:top; + cursor: default; + } + +#list { padding:.4em 0.3em 100% 0.3em; + overflow:auto; + line-height:0.4em; + height:100%; width: 100%; + z-index:1; + left:0; top:0; + text-align:left; + margin:0; + position:absolute; + margin-left:1em; line-height:100%; + } + +p.marker { font-weight:bold; + margin-top: 2em; + color:#000000; + font-size:110%; + } +/************************************************/ +/* class styles reserved for mouseover/mouseout DHTML */ + +.cold {} +.hot {} + +/**********************************************************************/ +/* ID styles reserved for tags calling OCX's within HTML Help by creating OBJECTS */ + + +#wPopup {} + +a:link#wPopup, a:visited#wPopup {color: #006600;} +a:hover#wPopup, a:active#wPopup {color: #FF0000;} + + +img.popup {border: none; margin-right: 0.5em; vertical-align:middle;} + +#shortcut {} + +img.shortcut {border: none; margin-right: 0.5em; vertical-align:middle;} + +#specLoc {} + +#altLoc {} + +p.note,p.tip, p.important, p.caution, p.warning + { font-weight:bold; clear:both; + margin-top:1em; + margin-bottom:-.25em; } + +img.alert {border:none;} /* for icon images - note, tip, important, caution, warning*/ + +/************************************************/ +/* styles used to modify the appearance of XML popups */ + +SPAN.XMLPopup {margin-bottom:.75em;height: 100%; width: 100%; border: solid; border-width:1px; background-color: #FFFFCC; } + + +DIV.PopTerm { font-weight: bold; margin-left: 1em; margin-top: .75em; margin-right: 1em; } +DIV.PopDef { line-height: 1.25em; margin-left: 1em; margin-top: .25em; margin-right: 1em;} +DIV.PopSeeAlso { margin-left: 1em; margin-top: .5em; margin-right: 1em;} +DIV.PopDef UL { margin-left: 1.45em; line-height: 1.25em; } + +/************************************************/ +/* Styles for listed-out/hard-coded links for Related Topics with page GIF */ + +p.#relTopics { font-weight:bold; margin-top: 2em;} +img.relTopics { border: none; } +p.relTopics { margin-left: 1.5em; margin-top: -1.7em; margin-bottom: .5em;} + +/***********************************/ +/* Style for print only functionality used with external URL link coUA_print.css*/ + +span.printonly {display:none } + +/***********************************/ +/* Styles for checklists */ + +.userData {behavior:url(#default#userdata); } /*sets persistance*/ + +#checklist {width:100%; text-align:left; margin:0.3em 0em;} + +#checklist li {text-indent:0.2em;} + +/*********************************/ +/* these classes are for previous next navigation */ + +a:hover.navbar, a:active.navbar {} /* text in nav */ +a:link.navbar, a:visited.navbar {} + +#nav { left:0; top:0px; + text-align:left; + margin:0; + position:absolute; + padding-bottom: 1px; padding-top: 3px; + padding-right:6px; padding-left:5px; + align:top; + visibility:hidden; + z-index:1; } + +#text { left:0; top:0px; + /*text-align:left;*/ /*Commented out because it was causing a problem with BI-DI. Remove style if no ill effects are found from commenting it out. - 5/28/99 AMS */ + margin:0; + position:absolute; + padding:10px; + overflow:auto; + height:100%; + z-index:1; + background-repeat:no-repeat; + background-position: bottom right; + background-attachment:fixed; } + +/***************************************************/ +/* STYLES USED IN THE WEB DELIVERABLE ONLY */ + + +/***********************************/ +/* links */ + +#wPopupWeb {} + +a:link#wPopupWeb {color: #006600;} +a:hover#wPopupWeb {color: #FF0000;} +a:active#wPopupWeb {color: #FF0000;} +a:visited#wPopupWeb {color: #006600;} + +#shortcutWeb {} + +#specLocWeb {} + +#relTopicsWeb {} + +#altLocWeb {} + + +/***********************************/ +/* popups */ + +div.popup { visibility:hidden; z-index:3; + position:absolute; + top:200; left:200; + width:250; padding:6px; + background-color:#FFFFCC; + border-style: solid; + border-width: 1; + border-color: #666666; + } +/***********************************/ +/* Added the following DIV 12/20/00 to incorporate branding GIF (currently Windows Flag) to designate material in HSS as Microsoft (as opposed to OEM material. This style also required WIDTH tags on H1 and WIDTH and Margin-Top tags on P.Proclabel. - AMS*/ + +DIV.UAbrand { direction: RTL; margin-top:-.25em; margin-right: -.25em; margin-bottom: -3em; } + + +TABLE.nested +{ + BACKGROUND-COLOR: #ffffff; +} + +TABLE.nested TH +{ + BACKGROUND-COLOR: #bbbbbb; +} + +TABLE.nested TD +{ + BACKGROUND-COLOR: #dddddd; +} + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/mmc/style/couaprint.css b/inetsrv/uddi/source/help/mmc/style/couaprint.css new file mode 100644 index 0000000..2256412 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/style/couaprint.css @@ -0,0 +1,79 @@ +/* last updated 01/16/01 - RWF */ +/* Added Table.nested margin nested tables -- 02/26/01 */ + + +body { font-size: 70%; + font-family: Verdana, Arial, MS Sans Serif; + margin-left: 0em; + padding-left: 1.5em; } + +H1 { font-size: 150%; } + +H2 { font-size: 125%; } + +H3 { font-size: 100%; } + +p { margin-top: .5em; margin-bottom: .75em; } + +p.procLabel { font-weight: bold; } + +p.note { margin-bottom: 0em; } +p.important { margin-bottom: 0em; } +p.caution { margin-bottom: 0em; } +p.warning { margin-bottom: 0em; } + +p.relTopics { margin-left: 1.5em; margin-top: -1.7em; margin-bottom: 1em; } + +ul { margin-top: 0em; margin-left: 1.5em; list-style-type: disc; } +ul li { margin-top: .25em; } + +ol { margin-top: 1em; margin-left: 2em; } + + +table { font-size: 100%; border-collapse: collapse; } +th { text-align:left; border-style: solid; border-width: 1px; border-bottom-width: 2px; } +td { border-style: solid; border-width: 1px; } + +dt { margin-top: 1em; } +dd { margin-left: 1.5em; } + +img.shortcut { border: none; margin-right: 0.5em; } + + +/* Styles used for expand/collapse information */ + +div.expand { margin-left: 1.5em; display: block !important; } +img.expand { margin-left: 1.5em; display: none !important; } + + +/* Styles used for (not) printing thumbnails */ + +span.webOnly {display:none !important; } +span.printonly { display:inline !important; } + + +/* Styles used for Previous/Next navigation */ + +#nav { display:none; } +#text { overflow:visible; } + +/* Testing to see if this removes underline and color from bookmarks */ + +H1 a:link { text-decoration: none; } +H2 a:link { text-decoration: none; } +H3 a:link { text-decoration: none; } +dt a:link { text-decoration: none; } + +a:link, a:visited { color: #000000; text-decoration: underline; } + +/* Indent this tag to match the online display */ +p.indent { margin-left: 1.3em; } +p.indent2 { margin-left: 3.5em; } + +TABLE.nested +{ + MARGIN-LEFT: .5em; + MARGIN-RIGHT: .5em; + MARGIN-TOP: .25em; + MARGIN-BOTTOM: .25em; +} \ No newline at end of file diff --git a/inetsrv/uddi/source/help/mmc/tip.gif b/inetsrv/uddi/source/help/mmc/tip.gif new file mode 100644 index 0000000..898e40c Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/tip.gif differ diff --git a/inetsrv/uddi/source/help/mmc/uabrand.gif b/inetsrv/uddi/source/help/mmc/uabrand.gif new file mode 100644 index 0000000..0bf9693 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/uabrand.gif differ diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.additionalresourcesontheweb.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.additionalresourcesontheweb.htm new file mode 100644 index 0000000..3819d69 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.additionalresourcesontheweb.htm @@ -0,0 +1,36 @@ + + + + + + + Resources + + + + + +
Microsoft Windows Graphic
+

Resources

+

+ For more information about UDDI and + UDDI Services, see the following resources: +

+

+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.addsite.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.addsite.htm new file mode 100644 index 0000000..0bcf50e --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.addsite.htm @@ -0,0 +1,49 @@ + + + + + + + Select Computer overview + + + + + +
Microsoft Windows Graphic
+

Select Computer Overview

+

+ Use Select Computer to select the computer that hosts the component you + want to connect to. +

    + + + + + + + + + + + + + +
    + To + Do this
    Manage a + UDDI Services + component on the computer on which this console is runningClick Local computer (the one this console is running on).
    Manage a + UDDI Services + component on a remote computerClick Another computer, and then type the name or IP address of the + remote computer hosting the + UDDI Services + component.
    +
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.admintools.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.admintools.htm new file mode 100644 index 0000000..28cc101 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.admintools.htm @@ -0,0 +1,280 @@ + + + + Managing UDDI Services from the Command Line + + + + + + + + +
Microsoft Windows Graphic
+

Managing UDDI Services from the Command-Line

+

+ You can invoke many UDDI Services administrative utilities from the + command line. For example, you can import categorization schemes or other XML + data, backup or restore a UDDI Services database, or reset the + cryptography key used to generate UDDI authentication tickets. The following + table lists the UDDI Services administrative utilities. +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
CommandFunction
bootstrapImports XML data into a UDDI Services site.
resetkeyResets the cryptography key used to generate UDDI authentication + tickets.
recalcstatsRecalculates statistics for a UDDI Services site.
uddi.database.backup.cmdCreates a backup of a local UDDI Services database.
uddi.database.restore.cmdRestores a database backup to a local UDDI Services + database.
+

+

bootstrap

+

Imports XML data into a UDDI Services site. Any information you import must + first be validated against the appropriate XML schema definition (XSD). For + more information about importing data and obtaining the appropriate XSDs for + validation, see + UDDI Resources.

+

Syntax

+

bootstrap /f [drive:][path]filename + [/u [user]]

+

Parameters

+
+
/f [drive:][path]filename +
+ Specifies the drive (optional), directory (optional), and file to import.
[/u + [user]] +
+ The user name (publisher) under which the data is imported and owned by. If + none is specified, defaults to System.
/? +
+ Displays help at the command prompt.
+
+

Remarks

+
    +
  • + By default, this command is installed to %systemdrive%\Inetpub\Uddi\Bin.  +
  • + This command is available only if the UDDI Services Database + Components + are installed. +
  • + This command must be run from the computer hosting the UDDI Services + database component for the site to which you want to import XML data. +
  • + Only administrators can use the bootstrap command. +
  • +
+

Examples

+

To import an XML file named mydata.xml under the System user, type:

+

bootstrap /f mydata.xml

+

To import an XML file named mydata.xml under a user named John, type:

+

bootstrap /f mydata.xml /u John

+

To import an XML file located in C:\Data named mydata.xml under a user named John, + type:

+

bootstrap /f C:\Data\mydata.xml /u John

+

Back to top

+

resetkey

+

Resets the cryptography key used to generate UDDI authentication tickets.

+

Syntax

+

resetkey [/now]

+

Parameters

+
+
[/now] +
+ Forces an immediate reset of the cryptography key.
/? +
+ Displays help at the command prompt.
+
+

Remarks

+
    +
  • + By default, this command is installed to %systemdrive% + \Inetpub\Uddi\Bin. +
  • + This command is available only if the UDDI Services Database + Components + are installed. +
  • + Only administrators can use the resetkey command. +
  • +
+

Examples

+

To view the current cryptography key timeout settings, type:

+

resetkey

+

To immediately reset the cryptography key, type:

+

resetkey /now

+

Back to top

+

recalcstats

+

Recalculates statistics for a UDDI Services site.

+

Syntax

+

recalcstats

+

Parameters

+
+
/? +
+ Displays help at the command prompt.
+
+

Remarks

+
    +
  • + By default, this command is installed to %systemdrive% + \Inetpub\Uddi\Bin. +
  • + This command is available only if the UDDI Services Database + Components + are installed. +
  • + This command must be run from the computer hosting the UDDI Services + database component for the site you want to recalculate statistics. +
  • + Only administrators can use the recalcstatscommand.  
+

Back to top

+

uddi.database.backup.cmd

+

Creates a backup of a local UDDI Services database to a file + (Uddi.Database.bak).

+

Syntax

+

uddi.database.backup.cmd [Database Instance Name]

+

Parameters

+
+
[Database Instance Name] +
+ The name of the local MSDE2000 or Microsoft SQL Server database instance where + the UDDI Services database component is installed. If none is specified, + the default database instance is used.
/? +
+ Displays help at the command prompt.
+
+

Remarks

+
    +
  • + By default, this command is installed to %systemdrive% + \Inetpub\Uddi\Bin. +
  • + This command is available only if the UDDI Services Database Components + are installed. +
  • + This command must be run from the computer hosting the UDDI Services + database component of which you want to create a backup. +
  • + Only administrators can use the uddi.database.backup.cmd + command. +
  • + Data is backed up to Inetpub\Uddi\Data\Uddi.Database.bak +
  • + Backups created using this tool contain physical paths and file names for UDDI + data files specific to the current installation. For this reason, you cannot + use this tool to migrate data from one UDDI Services site to another.
  • +
+

Examples

+

To back up a UDDI Services database hosted in the default database + instance, type:

+

uddi.database.backup.cmd

+

To back up a UDDI Services database hosted in a database instance named + "UDDI", type:

+

uddi.database.backup.cmd UDDI

+

Back to top

+

uddi.database.restore.cmd

+

Restores a UDDI Services database backup created with the + uddi.database.restore.cmd command.

+

Syntax

+

uddi.database.restore.cmd [Database Instance Name]

+

Parameters

+
+
[Database Instance Name] +
+ The name of the local MSDE2000 or Microsoft SQL Server database instance where + the UDDI Services database component is installed and to which you + want to restore the backup. If none is specified, the default database instance + is used.
/? +
+ Displays help at the command prompt.
+
+

Remarks

+
    +
  • + By default, this command is installed to %systemdrive% + \Inetpub\Uddi\Bin.  +
  • + This command is available only if the UDDI Services Database + Components + are installed. +
  • + This command must be run from the computer hosting the UDDI Services + database component to which you want to restore the data and from the same + directory where the database backup file (Uddi.Database.bak) is located. +
  • + Only administrators can use the uddi.database.restore.cmd + command. +
  • + Backups created using the uddi.database.backup.cmd tool contain physical paths + and file names for UDDI data files specific to the current installation. For + this reason, you cannot use this tool to migrate data from one + UDDI Services site to another.
  • +
+

Examples

+

To restore a UDDI Services database hosted in the default database + instance, type:

+

uddi.database.backup.cmd

+

To restore a UDDI Services database hosted in a database instance named + "UDDI", type:

+

uddi.database.restore.cmd UDDI

+

Back to top

+

Formatting legend

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Format + Meaning
ItalicInformation that the user must supply
BoldElements that the user must type exactly as shown
Ellipsis (...)Parameter that can be repeated several times in a command line
Between brackets ([])Optional items
Between braces ({}); choices separated by pipe (|). Example: {even|odd}Set of choices from which the user must choose only one
Courier fontCode or program output
+ +
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.advancedsettings.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.advancedsettings.htm new file mode 100644 index 0000000..baf9941 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.advancedsettings.htm @@ -0,0 +1,90 @@ + + + + Configure advanced settings + + + + + + + + + +
Microsoft Windows Graphic
+

To configure advanced settings

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, click the + UDDI Services + site you want to connect to. + +
    + +
    +
  3. + On the Action menu, click Properties. +
  4. + Click the Advanced + tab. +
  5. + The following configuration options are available: + + + + + + + + + + + + + + + + + +
    NameDescription
    OperatorThe value used to populate the Operator attribute in SOAP + API responses that include an operator attribute.
    Find.MaxRowsDefaultThe maximum number of rows returned on SOAP API find requests.
    DefaultDiscoveryURLThe prefix used for the default discovery URL attached to + providers published in this site.
    +
  6. +
+

Note

+
    +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + A + UDDI Services + Web server represents an instance of the + UDDI Services + Web component that provides an interface for querying and publishing in a UDDI + Services site. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a Site + to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.authenticationsslandcryptographysettings.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.authenticationsslandcryptographysettings.htm new file mode 100644 index 0000000..29b6e10 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.authenticationsslandcryptographysettings.htm @@ -0,0 +1,108 @@ + + + + Configure authentication, SSL, and cryptography + + + + + + + + +
Microsoft Windows Graphic
+

To configure authentication, SSL, and cryptography

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, click the + UDDI Services + site you want to configure. + +
    + +
    +
  3. + On the Action menu, click Properties. +
  4. + Click the Security tab, and select from the following configuration + options. +
      +
    • + Authenticated access.  View or change the type of authentication + used by this site. +
        +
      • + Windows Integrated and + UDDI Services + publisher authentication: This site supports authenticated publications + using Windows integrated authentication or UDDI Publisher authentication, as + described in section 4 of the UDDI Version 2.0 Programmer's API Specification. +
      • + + UDDI Services + publisher authentication: This site supports authenticated publications + using UDDI Publisher authentication only, as defined in section 4 of the UDDI + Version 2.0 Programmer's API Specification. +
      • + Windows integrated publisher authentication: This site supports + authenticated publications using Windows integrated authentication only. +
          +
        • + Authentication for read (inquiry) access: If checked, this + UDDI Services + site mandates the use of Windows integrated authentication for GET requests + into this site.
        • +
        +
      • +
      +
    • + Secure Communications.  View or change this site's use of + Secure Sockets Layer (SSL) encryption for publications. +
    • + Cryptography.  To view or modify the token expiration or + cryptography key time-out settings for UDDI-authenticated publications, click Change.
    • +
    +
  5. +
+

Important

+
    +
  • + If you use SSL-encryption with this site, you must obtain an SSL certificate + before + UDDI Services + will function. For more information, open IIS MMC Help, open Server + Administration Guide, click Security, click Secure Sockets Layer + (SSL), and then click + Configuring SSL on Your Server. +
  • +
+

Note

+
    +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a Site + to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.backupuddiservicesdatabase.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.backupuddiservicesdatabase.htm new file mode 100644 index 0000000..4de321c --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.backupuddiservicesdatabase.htm @@ -0,0 +1,88 @@ + + + + Back up a UDDI Services database + + + + + + + + +
Microsoft Windows Graphic
+

To back up a + UDDI Services + database

+

Important

+
    +
  • + Before proceeding to back up any data, it is highly recommended that you stop + all + UDDI Services + Web servers that are connected to the database instance of which you are + creating a backup. For more information, see + Start or Stop a Web Server. +
  • + This tool must be run by a user with Administrative credentials.
  • +
+
    +
  1. + From the computer hosting the + UDDI Services + database you want to back up, open + Command Prompt. +
  2. + At the command prompt, type: +

    + CD UDDI_Services_Installation_Directory\Data

    + The default + UDDI Services + installation directory is: +

    systemroot\Inetpub\UDDI\

    +
  3. + Type: +

    uddi.database.backup.cmd [Database_Instance_Name]

    + + + + + + + + + +
    + Value + Description
    Database_Instance_NameThe name of the local MSDE2000 or SQL Server database instance where the UDDI + Services database component is installed. If none is specified, the default + database instance is used.
    + For example, to back up a + UDDI Services + database hosted in a database instance named UDDI, type: +

    uddi.database.backup.cmd UDDI

    +
  4. +
+

A backup of your data is placed in UDDI_Services_Installation_Directory\Data\UDDI.Database.Bak. + Copy this file to another location or back it up for safekeeping.

+

Note

+
    +
  • + Backups created using this tool contain physical paths and file names for UDDI + data files that are specific to the current installation. For this reason, you + cannot use this tool to migrate data from one + UDDI Services + installation to another. +
  • + Use the runas command to perform administrative tasks with + Administrative credentials as necessary. You can use this command by typing runas + at the command prompt. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.checklistinstallinguddiservices.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.checklistinstallinguddiservices.htm new file mode 100644 index 0000000..a8e7c4f --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.checklistinstallinguddiservices.htm @@ -0,0 +1,54 @@ + + + + + Checklist: Installing UDDI Services + + + + + + + +
Microsoft Windows Graphic
+

Checklist: Installing UDDI Services

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Step + Reference
Review the deployment overviewDeploying + UDDI Services
Install UDDI ServicesInstall + UDDI Services
Configure UDDI ServicesPost-installation + Configuration
+ Interact with UDDI ServicesInteract with + UDDI Services
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.concepts.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.concepts.htm new file mode 100644 index 0000000..b08db46 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.concepts.htm @@ -0,0 +1,42 @@ + + + + Concepts + + + + + + + + +
Microsoft Windows Graphic
+

Concepts

+

+

+

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.configureroles.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.configureroles.htm new file mode 100644 index 0000000..a8298ff --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.configureroles.htm @@ -0,0 +1,126 @@ + + + + Configure roles and permissions + + + + + + + + + +
Microsoft Windows Graphic
+

To configure roles and permissions

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, click the + UDDI Services + site you want to configure. + +
    + +
    +
  3. + On the Action menu, click Properties and then click OK. +
  4. + Click the Roles + tab. +
  5. + To change the group used to define user roles for this + UDDI Services + site, click Select next to the role.

    +

    +
  6. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ActivityUserPublisherCoordinatorAdministrator
Search for providers, services, and tModelsXXXX
Publish providers, services, and tModelsXXX
View server statistics and manage entity ownershipsXX
Manage categorization schemesXX
Import data
+
X
Command line toolsX
+ Configure Web and database servers, assign groups to roles and configure + authenticationX
+

Note

+
    +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a + Site to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.configuresite.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.configuresite.htm new file mode 100644 index 0000000..262262f --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.configuresite.htm @@ -0,0 +1,39 @@ + + + + + + + + Configure UDDI Services Site + + + + + +
Microsoft Windows Graphic
+

Configure + UDDI Services + Site

+

+

+

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.configureuddiservices.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.configureuddiservices.htm new file mode 100644 index 0000000..c363f22 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.configureuddiservices.htm @@ -0,0 +1,54 @@ + + + + Configure UDDI Services + + + + + + + + + +
Microsoft Windows Graphic
+

Configure + UDDI Services

+

+

+

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.configurewebservers.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.configurewebservers.htm new file mode 100644 index 0000000..6c52ce8 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.configurewebservers.htm @@ -0,0 +1,34 @@ + + + + + + + + Configure a UDDI Services Web server + + + + + +
Microsoft Windows Graphic
+

Configure a UDDI Services Web server

+

+

+

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.connecttoasite.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.connecttoasite.htm new file mode 100644 index 0000000..bc2a788 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.connecttoasite.htm @@ -0,0 +1,65 @@ + + + + Add a site to the UDDI Services Snap-in + + + + + + + + + + +
Microsoft Windows Graphic
+

To add a site to the UDDI Services snap-in

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, click UDDI Services. +
  3. + On the Action menu, click Add Site. +
  4. + Select the computer that hosts the UDDI Services database component that + belongs to the site you want to add. + + + + + + + + + + + + + +
    + To + Do this
    Manage a UDDI Services site on the computer on which this console is + runningClick Local computer (the one this console is running on).
    Manage a UDDI Services site on a remote computerClick Another computer, and then type the name or IP address of the + remote UDDI Services database server.
    +
  5. + Click OK.
  6. +
+

Note

+
    +
  • + A UDDI Services site represents a complete installation of + UDDI Services. It includes a database server and one or more associated + Web servers. Add a site to connect to, and manage it and its associated Web + servers. +
  • + To open UDDI Services, click Start, point to Administrative Tools, + and then click UDDI Services. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.connecttoawebserver.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.connecttoawebserver.htm new file mode 100644 index 0000000..6560467 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.connecttoawebserver.htm @@ -0,0 +1,96 @@ + + + + Move a Web server from one site to another site + + + + + + + + +
Microsoft Windows Graphic
+

To move a Web server from one site to another site +

    +
  1. + Open + UDDI Services. +
  2. + In the console tree, select the + UDDI Services + site to which you want to move the Web server. + +
    + +
    +
  3. + On the Action menu, click Add Web Site. +
  4. + Select the computer that hosts the + UDDI Services + Web server component you want to move to this site. + + + + + + + + + + + + + +
    + To + Do this
    Manage a + UDDI Services + Web server on the computer on which this console is runningClick Local computer (the one this console is running on).
    Manage + UDDI Services + Web server on a remote computerClick Another computer, and then type the name or IP address of the + remote + UDDI Services + Web server.
    +
  5. + Click OK.
  6. +
+

Note

+
    +
  • + A + UDDI Services + Web server represents an instance of the + UDDI Services + Web component that provides an interface for querying and publishing in a UDDI + Services site. +
  • + You cannot move a Web server to or from a stand-alone site that is hosted on a + computer running Windows Server 2003, Standard Edition. +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a Site + to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.deleteasite.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.deleteasite.htm new file mode 100644 index 0000000..c17a5ff --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.deleteasite.htm @@ -0,0 +1,60 @@ + + + + Remove a site from the UDDI Services Snap-in + + + + + + + + + + +
Microsoft Windows Graphic
+

To remove a site from the UDDI Services snap-in

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, select the + UDDI Services + site you want to remove from the snap-in. + +
    + +
    +
  3. + On the Action menu, click Delete.
  4. +
+

Note

+
    +
  • + A + UDDI Services + site represents a complete installation of + UDDI Services. It includes a database server and one or + more associated Web servers. Add a site to connect to, and manage it and its + associated Web servers. +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.deleteawebserver.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.deleteawebserver.htm new file mode 100644 index 0000000..082fb91 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.deleteawebserver.htm @@ -0,0 +1,77 @@ + + + + Remove a Web server from a site + + + + + + + + +
Microsoft Windows Graphic
+

To remove a Web server from a site +

    +
  1. + Open + UDDI Services. +
  2. + In the console tree, select the + UDDI Services + Web server you want to remove. + +
    + +
    +
  3. + On the Action menu, click Delete.
  4. +
+ The selected UDDI Services Web server has now been removed from the site. The + Web server component has not been disabled nor has the Web server component + been uninstalled. To completely remove a UDDI Services component from a + computer, see Uninstalling UDDI + Services + . +

Note

+
    +
  • + A + UDDI Services + Web server represents an instance of the + UDDI Services + Web component that provides an interface for querying and publishing in a UDDI + Services site. +
  • + You cannot remove a Web server from a stand-alone site that is hosted on a + computer running + Windows Server 2003, Standard Edition. +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a + Site to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.deployandinstall.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.deployandinstall.htm new file mode 100644 index 0000000..a991071 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.deployandinstall.htm @@ -0,0 +1,35 @@ + + + + Install UDDI Services + + + + + + + + +
Microsoft Windows Graphic
+

Install UDDI Services

+ +

Note

+
    +
  • + UDDI Services can be deployed in either a stand-alone or distributed + environment. Before you begin installation, familiarize yourself with the + different types of installation configurations available. For more information, + see Deploying UDDI Services. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.deploymentscenarios.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.deploymentscenarios.htm new file mode 100644 index 0000000..5537bba --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.deploymentscenarios.htm @@ -0,0 +1,254 @@ + + + + Deploying UDDI Services + + + + + + + + +
Microsoft Windows Graphic
+

Deploying + UDDI Services

+

To deploy a + UDDI Services + site, you install + UDDI Services + components onto one or more computers, each running a supported member of the + Windows Server 2003 + family, and then define the groups of individuals that can access the site. A + UDDI Services site requires a complete installation of all + UDDI Services + components, including at least one Web server component that is connected to a + database component.

+

UDDI Services can be installed on any of following operating systems:

+
    +
  • + Windows Server 2003, Standard Edition. Supports a stand-alone installation + of UDDI Services only. +
  • + Windows Server 2003, Enterprise Edition. Supports stand-alone and + distributed installations of UDDI Services. +
  • + Windows Server 2003, Datacenter Edition. Supports stand-alone and + distributed installations of UDDI Services.
  • +
+

UDDI Services + Components

+
    +
  • + Database components.   Provides database services for a UDDI + Services site. Installs to a computer running a supported member of the + Windows Server 2003 family and Microsoft SQL Server 2000 or + Microsoft SQL Server Desktop Engine (MSDE2000). MSDE2000, included with + the + Windows Server 2003 + family, is a Microsoft SQL Server 2000-compatible local database + storage mechanism that is designed and optimized for use on smaller computer + systems. MSDE2000 does not include administrative tools, and it cannot + communicate across a network. For this reason, MSDE2000 can be used only in + stand-alone installations of + UDDI Services. +
  • + Web Server components.   Provides support for the UDDI + version 1.0 and 2.0 APIs and includes a Web user interface with + searching, publishing, and coordinating features that are compatible with + Microsoft Internet Explorer 4.0 or later and Netscape Navigator 4.5 + or later. It installs to a computer running a supported member of the + Windows Server 2003 family and uses Microsoft Internet Information + Services (IIS) 6.0. +
  • + Administration Console.   An MMC snap-in and set of + command-line tools that are used to administer local or remote + UDDI Services + sites and facilitate database backups. It installs on a computer running a + supported member of the Windows Server 2003 family.
  • +
+

Installation Options

+

+ UDDI Services + is designed around a scalable architecture that allows you to deploy a + UDDI Services + site in a stand-alone or distributed environment. A stand-alone installation is + useful for developer prototyping or other low-volume scenarios that involve a + limited number of simultaneous users. A distributed installation is recommended + for enterprise-wide implementations or other high-volume scenarios where access + times, availability, and reliability are of greater importance. +

+

Stand-alone installation

+

In a stand-alone installation of + UDDI Services, both the Web server and database components + are installed onto a single computer running a member of the + Windows Server 2003 + family. The database components are installed into Microsoft SQL + Server 2000 or a local MSDE2000 database instance, and the Web server + components are connected to that instance. If you want to use SQL + Server 2000 to host the database components, you must install it prior to + beginning installation of + UDDI Services. This is the only type of installation + available in + Windows Server 2003, Standard Edition.

+

Distributed installation

+

+ A distributed installation of + UDDI Services, available only with + Windows Server + 2003, Datacenter Edition + and + Windows Server 2003, Enterprise Edition, provides the + most fault-tolerant and responsive configuration available because it places + each of the + UDDI Services + components onto separate servers, a server cluster, or a Web farm. How you + decide to distribute + UDDI Services + components depends on how you choose to load balance your installation. +

+

Common distributed site configurations

+

One SQL Server and one Web server

+
+

+ The + UDDI Services + database components are installed onto a computer running a supported member of + the Windows Server 2003 family and Microsoft SQL + Server 2000. The + UDDI Services + Web server components are installed onto another computer running a supported + member of the Windows Server 2003 family and then configured to use + the instance to which the UDDI Services database components are installed. +

+

+

+
+

A SQL Server virtual server and one Web + server

+
+

+ The + UDDI Services + database components are installed to the same instance on each node of the SQL + Server 2000 virtual server hosted on a supported member of the + Windows Server 2003 family. The + UDDI Services + Web server components are installed onto another computer running a supported + member of the Windows Server 2003 family and then configured to + use the instance on the virtual server to which the UDDI Services database + components are installed.  +

+
+

One SQL Server and a Web farm

+
+

+ The + UDDI Services + database components are installed onto a computer running a supported member of + the Windows Server 2003 family and SQL Server 2000. The + UDDI Services + Web server components are installed onto each of the computers in a + Windows Server 2003 + family Web farm. During installation, each Web server is configured to use the + instance to which the UDDI Services database components are installed. +

+
+

A SQL Server virtual server and a Web + farm

+
+

+ The + UDDI Services + database component are installed to the same instance on each node of the SQL + Server 2000 virtual server hosted on a supported member of the + Windows Server 2003 family. The + UDDI Services + Web server components are installed onto each of the computers in a + Windows Server 2003 + family Web farm. During installation, each Web server is configured to use the + instance on the virtual server to which the UDDI Services database + components are installed. +

+
+

+

Roles and Permissions

+ After you install + UDDI Services, configure the groups that define the UDDI + Services roles. By default, the + UDDI Services + Publisher, Coordinator, and Administrator groups use the Builtin\Administrators + group and the + UDDI Services + User's group uses the Built-in\Users group in your network. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ActivityUserPublisherCoordinatorAdministrator
Search for providers, services, and tModelsXXXX
Publish providers, services, and tModelsXXX
View server statistics and manage entity ownershipsXX
Manage categorization schemesXX
Import data
+
X
+ Command-line toolsX
+ Configure Web and database servers, assign groups to roles and configure + authenticationX
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.editproperty.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.editproperty.htm new file mode 100644 index 0000000..ccfd821 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.editproperty.htm @@ -0,0 +1,29 @@ + + + + Edit Property Overview + + + + + + + + +
Microsoft Windows Graphic
+

Edit Property Overview

+

Use the Edit Property dialog box to modify the value assigned to + UDDI Services + settings. +

+

Name

+

Tha name of the current setting.

+

Value

+

The value assigned to the current setting.

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.eventlollogfilesettings.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.eventlollogfilesettings.htm new file mode 100644 index 0000000..b2df45f --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.eventlollogfilesettings.htm @@ -0,0 +1,126 @@ + + + + Configure Web server logging + + + + + + + + + +
Microsoft Windows Graphic
+

To configure Web server logging

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, click the + UDDI Services + Web server you want to configure. + +
    + +
    +
  3. + On the Action menu, click Properties. +
  4. + Click the Logging tab and select from the following configuration + options: +
      +
    • + Event Log Settings   Move the slider to specify the level of + information published to the event log by this + UDDI Services + Web server component. +
    • + Log File Settings   Move the slider to specify the level of + information published to the log file by this + UDDI Services + Web server component.
    • +
    +
  5. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Slider setting + Description
NoneNo information is logged.
ErrorRecords significant problems, such as loss of data or loss of functionality. + For example, if a service fails to load during startup, an error will be + logged.
Warning + + Records errors and events that are not necessarily significant, but may + indicate a possible future problem. For example, when disk space is low, a + warning will be logged.
Failure AuditRecords errors, warnings, and security access attempts that fail. For example, + if a user tries to access a network drive and fails, the attempt will be logged + as a Failure Audit event.
Success AuditRecords errors, warnings, and both failed and successful security attempts. For + example, a user's successful attempt to log on the system will be logged as a + Success Audit event.
InfoRecords errors, warnings, security audits, and events that describe the + successful operation of an application, driver, or service. For example, when a + network driver loads successfully, an Info event will be logged.
VerboseRecords all successful and failed events.
+ +

Note

+
    +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a Site + to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.glossary.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.glossary.htm new file mode 100644 index 0000000..2ceac19 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.glossary.htm @@ -0,0 +1,240 @@ + + + + Glossary + + + + + + + + +
Microsoft Windows Graphic
+

Glossary

+ +
    +

    + A  B  C  + D  E  F  G  H  + I  J  K  L  M  + N  O  P  Q  + R  S  T  + U  V  W  + X  Y  Z +

    +

    Select the first letter of the word from the list above to jump to appropriate + section of the glossary.

    +

    A

    +
  • + Administrator   An individual who can query, publish, + coordinate, and administer + UDDI Services. In addition to Coordinator user rights for + the Web-based user interface, an Administrator can administer service options, + manage security settings, perform backups, and carry out other administrative + tasks at the system level by using the + UDDI Services + Web user interface, Microsoft Management Console (MMC) snap-in and command line + tools. By default, the Administrator group uses the local computer group + BUILTIN\Administrators. +
    + +

    B

    +
  • + binding  + Binding   The point where a specific implementation of a + service can be accessed, such as the URL where an interface can be found. + Bindings may also include one or more instance info structures. +
    + +

    C

    +
  • + Categorization Scheme   A collection of categories and + subcategories used to describe and locate providers, services, and tModels. A + categorization scheme may contain public classifications, such as the North + American Industry Classification System (NAICS). It may also contain + company-defined categorizations. For example, useful categorization schemes + might be constructed around geographical locations, industry segments, or a + company's organizational structure. Categorization provides a consistent means + by which users can search for providers and services or locate interfaces of a + particular type, location, or other attribute. +
  • + contact  + Contact   A human or computer resource that can be + contacted for information about a provider or the XML Web services it offers. A + provider may have as many contacts as is necessary to identify each of its + available contact points. +
  • + Coordinator   An individual who can query, publish, and + configure data in the + UDDI Services + Web-based user interface. In addition to Publisher user rights, a Coordinator + can view and modify any data stored in + UDDI Services, change entity ownerships, import + categorization schemes, and generate and view statistical reports. By default, + the Coordinator group uses the local computer group + BUILTIN\Administrators. +
    + +

    D

    +
  • + Discovery URL   An HTTP-accessible resource that typically + responds to an HTTP-GET request with technical information describing a + provider. When a provider is created, + UDDI Services + automatically creates a discovery URL pointing to that provider's + businessEntity within that installation of + UDDI Services. +
    + +

    I

    +
  • + Identifier   An organization-wide identification scheme + used to logically group providers and tModels by a common form of + identification, such as a cost code or D-U-N-S® Number. Identifiers are + optional descriptions and are intended to enhance the discovery of providers + and tModels in search operations. +
  • + instance info  + Instance Info   A reference to a tModel that contains + relevant technical information about a binding, such as an interface + specification document or Web Services Description Language (WSDL) file. +
  • + Instance Parameters   The settings or parameters that are + supported by an instance of a binding. An instance parameter may be either a + list of settings and parameters or the URL of a file that contains a list of + supported settings and parameters. +
  • + Interface   The address or location where a service or + application can be invoked. For example, a weather report Web service might + publish a single interface: http://www.mycompany.com/weather.asmx +
    + +

    O

    +
  • + Overview Document URL   An address of an Hypertext Transfer + Protocol (HTTP)-accessible resource that hosts data or information you would + like to associate with an entity. For example, a tModel overview document might + provide the URL to an interface definition or Web Service Description Language + (WSDL) file that provides technical information that is required to invoke a + service through an interface. For an instance info, an overview document might + provide additional technical information that is only applicable to a specific + implementation of an interface. +
    + +

    P

    +
  • + provider  + Provider   A party—any business, or physical or conceptual + group—that offers one or more XML Web services. For example, a business, + business unit, organization, organizational department, person, computer, or an + application can be a provider in + UDDI Services. In the UDDI Services data + structure, a provider represents the "parent" entity under which all contact, + service, and interface information is stored and organized. +
  • + Publisher   An individual who can query and publish in UDDI + Services. A Publisher can add entities to + UDDI Services + or modify any of the entities that they own. By default, the Publisher + group uses the local computer group BUILTIN\Administrators. +
    + +

    R

    +
  • + Relationships   The identity, parent-child or peer-peer + relationships between providers. Relationships are useful, for example, when + describing an organizational structure or advertising business partnerships. +
    + +

    S

    +
  • + service  + Service   An entity in + UDDI Services + that describes and provides access to a function you would like to share with + other + UDDI Services + users. Services can perform any function across a network, from simple requests + to complicated business processes. A stock ticker feed and an online + procurement system are each examples of functions that can be published as a + service. Services may have one or more bindings. +
  • + Site   A complete installation of all + UDDI Services + components, including at least one Web server component connected to a database + component. +
  • + SOAP (Simple Object Access Protocol)   A World Wide Web + Consortium (W3C) standard, lightweight protocol for exchange of information in + a decentralized, distributed environment. SOAP is an Extensible Markup Language + (XML)-based protocol that consists of three parts: an envelope that defines a + framework for describing what is in a message and how to process it; a set of + encoding rules for expressing instances of application-defined data types; and + a convention for representing remote procedure calls and responses. +
    + +

    T

    +
  • + tModel  + tModel   tModels are typically used to provide technical + information about an interface, such as a Web Service Description Language + (WSDL) file, that describes the conventions that are supported by an interface. + tModels are also used to represent an organized unit of descriptive data, such + as an identification or categorization scheme. How tModels are used in your + implementation may vary, depending upon your organization's Web services + publishing data model. +
    + +

    U

    +
  • + Universal Description, Discovery and Integration (UDDI)   + An industry specification for publishing and locating information about Web + services. It provides a standards-based way to store and retrieve information + about services, service providers, binding information, and technical interface + definitions, all classified using a set of standard or custom classification + schemes. +
  • + User   An individual who can only query + UDDI Services + for Web service information. Any partner or organization with whom you would + like to share your Web services data must be part of, at minimum, the User + group. By default, the User group uses the local computer group + BUILTIN\Users. +
    + +

    W

    +
  • + Web Service   A unit of application logic that provides + data and services to other applications that can be invoked using standard + Internet transport protocols such as Hypertext Transfer Protocol (HTTP), Simple + Mail Transfer Protocol (SMTP), or File Transfer Protocol (FTP). Web services + can perform functions ranging from simple requests to complicated business + processes.. +
  • + WSDL (Web Service Description Language)   An Extensible Markup + Language (XML) grammar that developers and development tools use to represent + the capabilities of an XML Web service. +
    + +

    X

    +
  • + XML (Extensible Markup Language) +    A universal format for structured documents and data on the Web. + XML is an industry-standard protocol administered by the World Wide Web + Consortium (W3C). +
  • + XML Web Service   A unit of application logic that provides + data and services to other applications that can be invoked over standard + Internet transport protocols. Invocations of XML (Extensible Markup Language) + Web services are formatted in XML and often use protocols such as Simple Object + Access Protocol (SOAP) and the Hypertext Transfer Protocol (HTTP) transport. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.hhc b/inetsrv/uddi/source/help/mmc/uddi.mmc.hhc new file mode 100644 index 0000000..0591a7a --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.hhc @@ -0,0 +1,214 @@ + + + + + + + + + + +
    +
  • + + + +
      +
    • + + + +
    • + + + +
        +
      • + + + +
          +
        • + + + +
        • + + + +
        +
      • + + + + +
          +
        • + + + +
        • + + + +
        • + + + +
        • + + + +
        • + + + +
        • + + + +
        • + + + +
        • + + + + +
        • + + + +
        • + + + +
        +
      • + + + +
          +
        • + + + +
        • + + + +
        • + + + +
        • + + + +
        • + + + +
        +
      • + + + +
      +
    • + + + +
        +
      • + + + +
      • + + + +
      • + + + +
      • + + + +
      • + + + +
          +
        • + + + + +
            +
          • + + + +
          • + + + +
          • + + + +
          • + + + +
          • + + + +
          • + + + +
          +
        • + + + +
            +
          • + + + +
          • + + + +
          • + + + +
          +
        • + + + +
        • + + + +
        +
      +
    • + + + +
    • + + + +
    +
+ diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.hhk b/inetsrv/uddi/source/help/mmc/uddi.mmc.hhk new file mode 100644 index 0000000..6e12f58 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.hhk @@ -0,0 +1,206 @@ + + + + + + +
    +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + + + +
  • + + + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
+ diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.hhp b/inetsrv/uddi/source/help/mmc/uddi.mmc.hhp new file mode 100644 index 0000000..e6b9d07 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.hhp @@ -0,0 +1,90 @@ +[OPTIONS] +Auto Index=Yes +Binary Index=No +Binary TOC=Yes +Compatibility=1.1 or later +Compiled file=uddi.mmc.chm +Contents file=uddi.mmc.hhc +Default Window=windefault +Default topic=default.htm +Display compile progress=Yes +Error log file=uddi.mmc.log +Full text search stop list file=..\..\StopWord.List.stp +Full-text search=Yes +Index file=uddi.mmc.hhk +Language=0x409 English (United States) +Title=UDDI Services + +[WINDOWS] +windefault="UDDI Services","uddi.mmc.hhc","uddi.mmc.hhk","MS-ITS:uddi.mmc.chm::/default.htm","MS-ITS:NTDef.chm::/default.htm",,,,,0x60520,230,0x100e,[230,30,780,480],,,,,,,0 + + +[FILES] +compile.date.htm +colegal.htm +default.htm +uddi.mmc.additionalresourcesontheweb.htm +uddi.mmc.addsite.htm +uddi.mmc.admintools.htm +uddi.mmc.advancedsettings.htm +uddi.mmc.authenticationsslandcryptographysettings.htm +uddi.mmc.backupuddiservicesdatabase.htm +uddi.mmc.checklistinstallinguddiservices.htm +uddi.mmc.concepts.htm +uddi.mmc.configureroles.htm +uddi.mmc.configuresite.htm +uddi.mmc.configureuddiservices.htm +uddi.mmc.connecttoasite.htm +uddi.mmc.connecttoawebserver.htm +uddi.mmc.deleteasite.htm +uddi.mmc.deleteawebserver.htm +uddi.mmc.deployandinstall.htm +uddi.mmc.deploymentscenarios.htm +uddi.mmc.editproperty.htm +uddi.mmc.eventlollogfilesettings.htm +uddi.mmc.glossary.htm +uddi.mmc.howto.htm +uddi.mmc.installuddiservices.htm +uddi.mmc.integratingwithactivedirectory.htm +uddi.mmc.interact.htm +uddi.mmc.manageuddiservices.htm +uddi.mmc.perfcounters.htm +uddi.mmc.postinstallationconfiguration.htm +uddi.mmc.restoreuddiservicesdatabase.htm +uddi.mmc.site.htm +uddi.mmc.siteactivedirectorytab.htm +uddi.mmc.siteadvancedtab.htm +uddi.mmc.sitecryptography.htm +uddi.mmc.sitegeneraltab.htm +uddi.mmc.siterolestab.htm +uddi.mmc.sitesecuritytab.htm +uddi.mmc.specifythedatabaseserver.htm +uddi.mmc.startorstopasever.htm +uddi.mmc.troubleshooting.htm +uddi.mmc.uddiservicesoverview.htm +uddi.mmc.uddiservicessnapin.htm +uddi.mmc.uninstalluddiservices.htm +uddi.mmc.webdatabaseconnectiontab.htm +uddi.mmc.webgeneraltab.htm +uddi.mmc.webloggingtab.htm +uddi.mmc.webserver.htm + + +alttext.xml +caution.gif +important.gif +minusCold.gif +minusHot.GIF +nextCold.gif +nextHot.gif +note.gif +plusCold.gif +plusHot.GIF +shortcutCold.gif +shortcutHot.gif +tip.gif +UAbrand.gif +warning.gif + +[INFOTYPES] + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.howto.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.howto.htm new file mode 100644 index 0000000..947f8b7 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.howto.htm @@ -0,0 +1,30 @@ + + + + + + + + How to... + + + + + +
Microsoft Windows Graphic
+

How to...

+ +
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.installuddiservices.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.installuddiservices.htm new file mode 100644 index 0000000..218dd29 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.installuddiservices.htm @@ -0,0 +1,341 @@ + + + + Install UDDI Services + + + + + + + + +
Microsoft Windows Graphic
+

Select the type of installation you would like to perform

+

Stand-alone installation

+
+

+

    +
  1. + From the computer to which you want to install UDDI Services, open + Add or Remove Programs + in Control Panel. +
  2. + Click Add/Remove Windows Components. +
  3. + In the Windows Components Wizard dialog box, select UDDI Services, + and then click Next. +
  4. + You are prompted to select or create a local database instance for this site. + Do one of the following: +
      +
    • + To use Microsoft SQL Server Desktop Engine (MSDE2000) as the database server + for this site, select Create a new MSDE database instance for UDDI Services + named "UDDI", and then click Next. +
    • + To use an existing as the database server for this site, select the name of the + instance from the Use the following SQL Server 2000 database instance already + installed on this computer drop-down menu, and then click Next.
    • +
    +
  5. + Select whether or not this site requires Secure Sockets Layer (SSL) encryption. +
      +
    • + To require SSL-encryption for interaction with this site, select Require SSL + (Recommended). +
    • + To allow non-encrypted interaction with this site, select Do not require SSL.
    • +
    +
  6. + Select the location where the UDDI Services database files are installed. + Do one of the following: +
      +
    • + To use the default location, click Next. +
    • + To select a different location for all of the database files, click ... to + select the new location, and then click Next. +
    • + To select different locations for each of the database files, click More, + then click ... next each of the database files you want to install to a + different location, and then click Next. +
    • +
    +
  7. + Select the security credentials used by this site. Do one of the following: +
      +
    • + To use the Network Service security credentials, select Network Service, + and then click Next +
    • + To select different security credentials, select Domain account, type + the user name and password to be used by this site, and then click Next.
    • +
    +
  8. + Specify a name for this site. Type the name you want to use to uniquely + identify this UDDI Services site from other sites in the + UDDI Services snap-in. +
  9. + Enable or disable self-registration of this UDDI Services site, and then + click Next. Self-registration automatically publishes this site's + interfaces as services and bindings in this UDDI Services site and + attempts a silent-publication into Active Directory® using the current users' + credentials. You can later publish or revoke this site's Active Directory + publication using the UDDI Services snap-in. +
  10. + If prompted, insert your Windows Server 2003 family compact disc.
  11. +
+

+
+

Distributed installations

+
+

+ +

One SQL server and one Web server

+
+

+

Install the UDDI Services database + components onto the database server

+
+

+

    +
  1. + From the computer you want to host the UDDI Services database components, + open + Add or Remove Programs + in Control Panel. +
  2. + Click Add/Remove Windows Components. +
  3. + In the Windows Components Wizard dialog box, click UDDI Services, + and then click Details. +
  4. + In the UDDI Services dialog box, select UDDI Services Database + Components and clear UDDI Services Web server components and + UDDI Services Administration Console, click OK, and then + click Next. +
  5. + Select the name of the database instance to which you would like to install the + database components from the drop-down menu, and then click Next. +
  6. + Select whether or not this site requires Secure Sockets Layer (SSL) encryption. +
      +
    • + To require SSL-encryption for interaction with this site, select Require SSL + (Recommended). +
    • + To allow non-encrypted interaction with this site, select Do not requires SSL.
    • +
    +
  7. + Select the location where the UDDI Services database files are installed. + Do one of the following: +
      +
    • + To use the default location, click Next. +
    • + To select a different location for all of the database files, click ... to + select the new location, and then click Next. +
    • + To select different locations for each of the database files, click More, + then click ... next each of the database files you want to install to a + different location, and then click Next. +
    • +
    +
  8. + Select the security credentials used by this site. Do one of the following: +
      +
    • + To use the Network Service security credentials, select Network Service, + and then click Next +
    • + To select different security credentials, select Domain account, type + the user name and password to be used by this site, and then click Next.
    • +
    +
  9. + Specify a name for this site. Type the name you want to use to uniquely + identify this UDDI Services site from other sites in the + UDDI Services snap-in. +
  10. + Enable or disable self-registration of this UDDI Services site, and then + click Next. Self-registration automatically publishes this site's + interfaces as services and bindings in this UDDI Services site and + attempts a silent-publication into Active Directory® using the current users' + credentials. You can later publish or revoke this site's Active Directory + publication using the UDDI Services snap-in. +
  11. + If prompted, insert your Windows Server 2003 family compact disc.
  12. +
+

+
+

Install the UDDI Services Web + server components onto the Web server and connect it to the database component.

+
+

+
    +
  1. + From the computer you want to host the UDDI Services Web server + components, open + Add or Remove Programs + in Control Panel. +
  2. + Click Add/Remove Windows Components. +
  3. + In the Windows Components Wizard dialog box, click UDDI Services, + and then click Details. +
  4. + In the UDDI Services dialog box, select UDDI Services Web + server components and clear UDDI Services Database Components + and UDDI Services Administration Console, click OK, and then + click Next. +
  5. + Click Browse + and specify the name of the computer that hosts the UDDI Services database + components to which you want to connect this UDDI Services Web server. If + more than one database instance is hosted on the computer specified, select the + instance you want from the drop-down list. +
  6. + Specify the security credentials for this UDDI Services Web server. Click Browse + to locate the user name or type it in the User name field. Type the + password for the user name in the Password field, and then click Next. +
      +
    +
  7. + Enable or disable self-registration of this UDDI Services site, and then + click Next. Self-registration automatically publishes this site's + interfaces as services and bindings in this UDDI Services site and + attempts a silent-publication into Active Directory® using the current users' + credentials. You can later publish or revoke this site's Active Directory + publication using the UDDI Services snap-in. +
  8. + If prompted, insert your Windows Server 2003 family compact disc.
  9. +
+
+
+

A SQL Server virtual server and one Web + server

+
+

+
    +
  1. + Install the UDDI Services database components to the same instance on each + node of the virtual server hosted on a supported member of + the Windows Server 2003 family. +
  2. + Install the UDDI Services Web server components onto a computer running a + supported member of the Windows Server 2003 family and then configure + it to use the instance on the virtual server to which the UDDI Services + database components are installed.
  3. +
+

Note

+
    +
  • + Detailed instructions on this process can be found on the UDDI Services + Web site at the + Microsoft Web site(http://www.microsoft.com/). +
  • +
+
+

One SQL server and a Web farm

+
+

+
    +
  1. + Install the UDDI Services database components onto a computer running a + supported member of the Windows Server 2003 family and Microsoft SQL + Server 2000. +
  2. + Install the UDDI Services Web server components onto each of the + computers in a Windows Server 2003 family Web farm. During + installation, configure each to use the same instance to which the UDDI + Services database components are installed.
  3. +
+

Note

+
    +
  • + Detailed instructions on this process can be found on the UDDI Services + Web site at the + Microsoft Web site(http://www.microsoft.com/). +
  • +
+
+

A SQL Server vitual server and A Web + farm

+
+

+
    +
  1. + Install the UDDI Services database components to the same instance on each + node of the virtual server hosted on a supported member of the + Windows Server 2003 family. +
  2. + Install the UDDI Services Web server components onto each of the computers + in a Windows Server 2003 family Web farm. During installation, + configure each to use the same instance on the virtual server to which the UDDI + Services database components are installed. +
  3. +
+

Note

+
    +
  • + Detailed instructions on this process can be found on the UDDI Services + Web site at the + Microsoft Web site(http://www.microsoft.com/). +
  • +
+
+ +
+

Important

+
    +
  • + Windows Server 2003, Standard Edition supports stand-alone + installations only. Distributed installation support is available with + Windows Server 2003, Enterprise Edition and Windows Server + 2003, Datacenter Edition. +
  • + If you want to use Microsoft SQL Server 2000 to host the UDDI Services + database components, you must install it before + you install the UDDI Services database components. +
  • + In a distributed installation, you must install the database components before + installing the Web server components. +
  • + In a distributed installation with more than one Web server, only perform + self-registration from one of the Web servers. Repeating self-registration from + any of the other Web servers will result in the modification of any previously + configured parameters such as the site's UDDI discovery URL and Active + Directory® publication. For more information about self-registration and Active + Directory publication, see the UDDI Services Web site on the + Microsoft Web site (http://www.microsoft.com/). +
  • + Each computer that is a member of a Web farm must be configured to use the same ValidationKey + and DecryptionKey keys in the machine.config file. For more + information, see the + .NET Framework General Reference description of the machineKey element + on the Microsoft Web site. +
  • + To complete an installation you must perform the post-installation procedures. + For more information, see Post-installation + Configuration. +
  • + SSL-encryption requires a server certificate. For more information, see + Post-installation Configuration. +
  • +
+

Note

+
    +
  • + UDDI Services can be deployed in either a stand-alone or distributed + environment. Before you begin installation, familiarize yourself with the + different types of installation configurations available. For more information, + see Deploying UDDI Services. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.integratingwithactivedirectory.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.integratingwithactivedirectory.htm new file mode 100644 index 0000000..a83ff7a --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.integratingwithactivedirectory.htm @@ -0,0 +1,75 @@ + + + + Publish a site in Active Directory + + + + + + + + + +
Microsoft Windows Graphic
+

To publish a site in Active Directory

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, click the + UDDI Services + site you want to publish in Active Directory. + +
    + +
    +
  3. + On the Action menu, click Properties. +
  4. + Click OK. +
  5. + Click the Active Directory + tab. +
  6. + Click Publish.
  7. +
+

+ UDDI Services + attempts to publish this site into Active Directory using the current user's + credentials. +

+

Note

+
    +
  • + To open + UDDI Services, click Start, point to Administrative + tools, and then click + UDDI Services. +
  • + Publishing in Active Directory requires user credentials with Active Directory + Publish permissions. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a Site + to the UDDI Services Snap-in. +
  • + Use the runas command to perform administrative tasks with + Administrative rights as necessary. You can use this command by typing runas + at the command prompt or by right-clicking an .msc file, and then clicking Run + As.
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.interact.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.interact.htm new file mode 100644 index 0000000..7919809 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.interact.htm @@ -0,0 +1,95 @@ + + + + Interact with UDDI Services + + + + + + + + +
Microsoft Windows Graphic
+

Interact with UDDI Services

+

You can interact with a UDDI Services site through one or more of the following + interfaces: +

+
+

UDDI Services Web User Interface: Provides searching, publishing, and + coordination features that are compatible with Microsoft Internet Explorer 4.0 + or later and Netscape Navigator 4.5, or later. +

+
    +
      +
    • + Integrated Windows Authentication: https://<servername>/uddi/ or + http://<servername>/uddi/ +
    • + Unauthenticated interface with read (inquiry) access only: https://<servername>/uddipublic/ + or http://<servername>/uddipublic/ +
    • +
    +
+
+

Visual Studio .NET Add Web Reference Interface: Provides Web service + discovery and integration in Visual Studio .NET through UDDI Services. +

+
    +
      +
    • + Integrated Windows Authentication: https://<servername>/uddi/addwebreference/ or + http://<servername>/uddi/addwebreference/ +
    • + Unauthenticated interface: https://<servername>/uddipublic/addwebreference/ + or http://<servername>/uddipublic/addwebreference/ +
    • +
    +
+
+

UDDI API Interface: Supports the UDDI version 1.0 and 2.0 APIs, enabling + enterprise developers to publish, discover, share, and interact with Web + services directly through their development tools and business applications. +

+
    +

    + Publish +

    +
      +
        +
      • + Integrated Windows Authentication for publish API messages: https://<servername>/uddi/publish.asmx + or http://<servername>/uddi/publish.asmx +
      • + UDDI Specification-based Authentication for publish API messages: https://<servername>/uddipublic/publish.asmx + or http://<servername>/uddipublic/publish.asmx
      • +
      +
    + Inquire +
      +
        +
      • + Integrated Windows Authentication for inquire API messages: https://<servername>/uddi/inquire.asmx + or http://<servername>/uddi/inquire.asmx +
      • + UDDI Specification-based Authentication for inquire API messages: https://<servername>/uddipublic/inquire.asmx + or http://<servername>/uddipublic/inquire.asmx +
      • +
      +
    +
+

Note

+
    +
  • + The URL to an SSL-encrypted site begins with "https://", and the URL to + a non-SSL-encrypted site begins with "http://". SSL-encrypted + interfaces are only available on those sites that have been configured to + use SSL-encryption. For more information, see + Post-installation Configuration. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.log b/inetsrv/uddi/source/help/mmc/uddi.mmc.log new file mode 100644 index 0000000..e1d1639 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.log @@ -0,0 +1,95 @@ +Microsoft HTML Help Compiler 4.74.8702 + +Compiling d:\nt\inetsrv\uddi.dns\source\help\mmc\uddi.mmc.chm + +compile.date.htm +colegal.htm +default.htm +uddi.mmc.additionalresourcesontheweb.htm +uddi.mmc.addsite.htm +uddi.mmc.admintools.htm +uddi.mmc.advancedsettings.htm +uddi.mmc.authenticationsslandcryptographysettings.htm +uddi.mmc.backupuddiservicesdatabase.htm +uddi.mmc.checklistinstallinguddiservices.htm +uddi.mmc.concepts.htm +uddi.mmc.configureroles.htm +uddi.mmc.configuresite.htm +uddi.mmc.configureuddiservices.htm +uddi.mmc.connecttoasite.htm +uddi.mmc.connecttoawebserver.htm +uddi.mmc.deleteasite.htm +uddi.mmc.deleteawebserver.htm +uddi.mmc.deployandinstall.htm +uddi.mmc.deploymentscenarios.htm +uddi.mmc.editproperty.htm +uddi.mmc.eventlollogfilesettings.htm +uddi.mmc.glossary.htm +uddi.mmc.howto.htm +uddi.mmc.installuddiservices.htm +uddi.mmc.integratingwithactivedirectory.htm +uddi.mmc.interact.htm +uddi.mmc.manageuddiservices.htm +uddi.mmc.perfcounters.htm +uddi.mmc.postinstallationconfiguration.htm +uddi.mmc.restoreuddiservicesdatabase.htm +uddi.mmc.site.htm +uddi.mmc.siteactivedirectorytab.htm +uddi.mmc.siteadvancedtab.htm +uddi.mmc.sitecryptography.htm +uddi.mmc.sitegeneraltab.htm +uddi.mmc.siterolestab.htm +uddi.mmc.sitesecuritytab.htm +uddi.mmc.specifythedatabaseserver.htm +uddi.mmc.startorstopasever.htm +uddi.mmc.troubleshooting.htm +uddi.mmc.uddiservicesoverview.htm +uddi.mmc.uddiservicessnapin.htm +uddi.mmc.uninstalluddiservices.htm +uddi.mmc.webdatabaseconnectiontab.htm +uddi.mmc.webgeneraltab.htm +uddi.mmc.webloggingtab.htm +uddi.mmc.webserver.htm +alttext.xml +caution.gif +important.gif +minusCold.gif +minusHot.GIF +nextCold.gif +nextHot.gif +note.gif +plusCold.gif +plusHot.GIF +shortcutCold.gif +shortcutHot.gif +tip.gif +UAbrand.gif +warning.gif +uddi.mmc.hhc +uddi.mmc.hhk +images\uddi.gif +images\site.gif +images\webserver.gif +images\binding.gif +images\contact.gif +images\instance.gif +images\business.gif +images\service.gif +images\tmodel.gif +images\line-ns.gif +images\line-nes.gif +images\line-ne.gif +images\blank.gif +shared.js +coUA.css +coUAprint.css + +Compile time: 0 minutes, 3 seconds +50 Topics +312 Local links +11 Internet links +13 Graphics + + +Created d:\nt\inetsrv\uddi.dns\source\help\mmc\uddi.mmc.chm, 108,398 bytes +Compression decreased file by 210,674 bytes. diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.manageuddiservices.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.manageuddiservices.htm new file mode 100644 index 0000000..e92f2cd --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.manageuddiservices.htm @@ -0,0 +1,44 @@ + + + + Maintain UDDI Services + + + + + + + + +
Microsoft Windows Graphic
+

Maintain + UDDI Services

+

+

+

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.perfcounters.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.perfcounters.htm new file mode 100644 index 0000000..96ca805 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.perfcounters.htm @@ -0,0 +1,217 @@ + + + + + + + Performance Monitoring + + + + + +
Microsoft Windows Graphic
+

Performance Monitoring

+

+ You can use the performance-monitoring capability built into the + Windows Server 2003 + family to monitor + UDDI Services. For information about using System Monitor, + see Analyzing + performance data in Performance Logs and Alerts Help. +

+

UDDI Services-related performance counters

+

The following performance counters relate to inquire API messages to a UDDI + Services site:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Counter nameExplanation
find_bindingThe number of times the find_binding API message was executed + since the service was started.
find_businessThe number of times the find_business API message was executed + since the service was started.
find_bindingThe number of times the find_binding API message was executed + since the service was started.
find_serviceThe number of times the find_service API message was executed + since the service was started.
get_binding_detailThe number of times the get_binding_detail API message was + executed since the service was started.
get_business_detailThe number of times the get_business_detail API message was + executed since the service was started.
get_business_detail_extThe number of times the get_business_detail_ext API message was + executed since the service was started.
get_service_detailThe number of times the get_service_detail API message was + executed since the service was started.
get_tmodel_detailThe number of times the get_tmodel_detail API message was + executed since the service was started.
+

The following performance counters relate to publish API messages to a UDDI + Services site:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Counter nameExplanation
add_publisherAssertionsThe number of times the add_publisherAssertions API message was + executed since the service was started.
delete_bindingThe number of times the delete_binding API message was executed + since the service was started.
delete_businessThe number of times the delete_business API message was executed + since the service was started.
delete_publisherAssertionsThe number of times the delete_publisherAssertions API message + was executed since the service was started.
delete_serviceThe number of times the delete_service API message was executed + since the service was started.
delete_tmodelThe number of times the delete_tmodel API message was executed + since the service was started.
discard_authtokenThe number of times the discard_authtoken API message was + executed since the service was started.
get_publisherAssertionsThe number of times the get_publisherAssertions API message was + executed since the service was started.
get_authtokenThe number of times the get_authtoken API message was executed + since the service was started.
get_publisherAssertionsThe number of times the get_publisherAssertions API message was + executed since the service was started.
get_registeredInfoThe number of times the get_registeredInfo API message was + executed since the service was started.
save_bindingThe number of times the save_binding API message was executed + since the service was started.
save_businessThe number of times the save_business API message was executed + since the service was started.
save_serviceThe number of times the save_service API message was executed + since the service was started.
save_tmodelThe number of times the save_tmodel API message was executed + since the service was started.
set_publisherAssertionsThe number of times the set_publisherAssertions API message was + executed since the service was started.
validate_categorizationThe number of times the validate_categorization API message was + executed since the service was started.
validate_valuesThe number of times the validate_values API message was executed + since the service was started.
+

The following performance counters relate to replication and extension API + messages to a + UDDI Services + site:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Counter nameExplanation
get_changeRecordsThe number of times the get_changeRecords API message was + executed since the service was started.
notify_changeRecordsAvailableThe number of times the notify_changeRecordsAvailable API + message was executed since the service was started.
do_pingThe number of times the do_ping API message was executed since + the service was started.
get_highWaterMarksThe number of times the get_highWaterMarks API message was + executed since the service was started.
get_relatedCategoriesThe number of times the get_relatedCategories API message was + executed since the service was started.
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.postinstallationconfiguration.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.postinstallationconfiguration.htm new file mode 100644 index 0000000..050f4cd --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.postinstallationconfiguration.htm @@ -0,0 +1,52 @@ + + + + Post-installation Configuration + + + + + + + + +
Microsoft Windows Graphic
+

Important

+
    +
  • + The ASP.NET Web service extension is automatically enabled during installation + of the UDDI Services Web server component. If this Web service extension + is disabled, the UDDI Services Web server component will cease to + function. For more information about enabling Web service extensions, open + Internet Information Services (IIS) MMC Help, open Getting Started, + click Common Administrative Tasks, and then click + How to Enable Web Service Extensions. +

    +
  • +
+

For proper functionality of a site, perform the following + steps

+
    +
  1. + If you use SSL-encryption with this site, you must obtain an SSL certificate + before UDDI Services will function. For more information, open IIS MMC + Help, open Server Administration Guide, click Security, click Secure + Sockets Layer (SSL), and then click + Configuring SSL on Your Server. +
  2. +
  3. + Configure the groups of users that will interact with this site. For more + information, see Configure Roles + and Permissions. +
  4. +
  5. + Interact with the site through one or more of the available interfaces. For + more information, see Interacting with UDDI + Services. +
  6. +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.restoreuddiservicesdatabase.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.restoreuddiservicesdatabase.htm new file mode 100644 index 0000000..fb5bc6b --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.restoreuddiservicesdatabase.htm @@ -0,0 +1,93 @@ + + + + Restore a UDDI Services database + + + + + + + + +
Microsoft Windows Graphic
+

To restore a + UDDI Services + database

+

Important

+
    +
  • + Before restoring any data, it is highly recommended that you stop all + UDDI Services + Web servers that are connected to the database server to which you are + restoring data. For more information, see Start + or Stop a Web Server. +
  • + To perform this procedure, you must have administrative credentials. +
  • + When you restore a + UDDI Services + database, all existing data is destroyed. +
  • + If any of the paths referenced in the UDDI.Database.bak file do not exist on + the local computer, the restore operation will fail with a device activation + error.
  • +
+
    +
  1. + From the computer hosting the + UDDI Services + database you want to restore, open + Command Prompt. +
  2. + At the command prompt, type: +

    + CD UDDI_Services_Installation_Directory\Data

    + The default + UDDI Services + installation directory is: +

    systemroot\Inetpub\UDDI\

    +
  3. + If you have not already done so, copy the database backup file (UDDI.Database.bak) + that you want to restore into this directory. +
  4. + Type: +

    UDDI.database.restore.cmd [Database_Instance_Name]

    + + + + + + + + + +
    + Value + Description
    Database_Instance_NameThe name of the local MSDE2000 or SQL Server database instance where the UDDI + Services database component is installed. If none is specified, the default + database instance is used.
    + For example, to restore to a database instance named UDDI, type: +

    uddi.database.restore.cmd UDDI

    +
  5. +
+ The backup data replaces the existing data in this database instance. +

Note

+
    +
  • + You can only restore data from backups made from the same installation of + UDDI Services. You cannot use this tool to migrate data + from one installation to another. +
  • + Use the runas command to perform administrative tasks with + Administrative credentials as necessary. You can use this command by + typing runas at the command prompt. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.site.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.site.htm new file mode 100644 index 0000000..bb6b308 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.site.htm @@ -0,0 +1,48 @@ + + + + UDDI Services Site Overview + + + + + + + + +
Microsoft Windows Graphic
+

UDDI Services Site Overview

+

+ A + UDDI Services + site represents a complete installation of + UDDI Services. It includes a database server and one or + more associated Web servers. You can adjust a site's settings or connect to and + manage any of its associated Web servers.

+ +

Note

+
    +
  • + To modify a site's settings, select the site and, on the Action menu, + click Properties.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.siteactivedirectorytab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.siteactivedirectorytab.htm new file mode 100644 index 0000000..22cb7bf --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.siteactivedirectorytab.htm @@ -0,0 +1,41 @@ + + + + Active Directory Tab Overview + + + + + + + + +
Microsoft Windows Graphic
+

Active Directory Tab Overview

+

+ Use the Active Directory tab to manage this site's publication into + Active Directory.

+

Publish

+

Click Publish to publish this + UDDI Services + site in Active Directory using the current user's credentials.

+

Remove

+

Click Remove to remove this + UDDI Services + site's Active Directory publication using the current user's credentials.

+

Note

+
    +
  • + Use the runas command to perform administrative tasks with + Administrative rights as necessary. You can use this command by typing runas + at the command prompt or by right-clicking an .msc file, and then clicking Run + as. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.siteadvancedtab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.siteadvancedtab.htm new file mode 100644 index 0000000..28726dd --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.siteadvancedtab.htm @@ -0,0 +1,43 @@ + + + + Advanced Tab Overview + + + + + + + + +
Microsoft Windows Graphic
+

Advanced Tab Overview

+

+ Use the Advanced tab to view or modify the advanced configuration + options available for this site. + + + + + + + + + + + + + + + + + +
NameDescription
OperatorThe value used to populate the Operator attribute in SOAP + API responses that include an operator attribute.
Find.MaxRowsDefaultThe maximum number of rows returned on SOAP API find requests.
DefaultDiscoveryURLThe prefix used for the default discovery URL attached to + providers published in this site.
+

+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.sitecryptography.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.sitecryptography.htm new file mode 100644 index 0000000..ced3985 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.sitecryptography.htm @@ -0,0 +1,39 @@ + + + + Cryptography Settings Overview + + + + + + + + +
Microsoft Windows Graphic
+

Cryptography Settings Overview

+

Use Cryptography to view or modify the SOAP Authentication token + expiration and cryptography key time out settings for this UDDI Services + site.

+

SOAP Authentication Token Expiration

+ Specifies the amount of time, in minutes, that the SOAP authentication token + expires for UDDI Publisher authenticated publications. SOAP authentication + tokens are used to communicate publisher credentials during UDDI Publisher + authenticated publications. +

Cryptography Key Timeout

+ The creation date of the cryptography key used to generate SOAP authentication + tokens, and the amount of time, in days, that the key is automatically reset. +
    +
  • + To reset the cryptography key used to encrypt SOAP authentication tokens now, + click Reset Now. +
  • + To automatically reset the cryptography key after a certain number of days, + select the Automatically reset cryptography key box and then specify the + number of days in the field provided.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.sitegeneraltab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.sitegeneraltab.htm new file mode 100644 index 0000000..2b95789 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.sitegeneraltab.htm @@ -0,0 +1,56 @@ + + + + Site - General Tab Overview + + + + + + + + +
Microsoft Windows Graphic
+

Site - General Tab Overview

+

Use the General tab to view information about this + UDDI Services + site.

+

Site Key

+

The unique key associated with this site used during programmatic queries.

+

Version

+

The version number of this installation.

+

Language

+

The default language code of this installation.

+

Site Description

+

A description of this site.

+

Date

+

The date this site was installed.

+

Location

+

The path where this site was installed.

+

.NET Framework Version

+

The version number of the .NET Framework installed on this server.

+

Components

+

A list of the + UDDI Services + components installed on this system.

+
    +
  • + UDDI Administration Component: This server hosts a + UDDI Services + MMC snap-in and administrative command-line tools. +
  • + UDDI Database Component: The server hosts a + UDDI Services + database component. +
  • + UDDI Web Server Component: This server hosts a + UDDI Services + Web server component.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.siterolestab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.siterolestab.htm new file mode 100644 index 0000000..735c308 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.siterolestab.htm @@ -0,0 +1,68 @@ + + + + Roles Tab Overview + + + + + + + + +
Microsoft Windows Graphic
+

Roles Tab Overview

+

Use the Roles tab to view or modify the groups used by this site to + define user permissions.

+

Administrators' Group Name

+

+ The name of the user group that your organization uses to define those users + with administrator privileges over this + UDDI Services + site. An administrator is any individual who can query, publish, administer, + and configure + UDDI Services. In addition to Coordinator privileges for + the Web-based user interface, an Administrator can configure service options, + manage security settings, facilitate backups, and perform other administrative + tasks at the system level using the + UDDI Services + snap-in.

+

Coordinators' Group Name

+

+ The name of the user group that your organization uses to define those users + with coordinator privileges over this + UDDI Services + site. A coordinator is any individual who can query, publish, and administer + data in the + UDDI Services + Web-based user interface. In addition to Publisher privileges, a Coordinator + can view and modify any data stored in + UDDI Services, change entity ownerships, and view or + refresh statistical reports.

+

Publishers' Group Name

+

+ The name of the user group that your organization uses to define those users + with publishing privileges in this + UDDI Services + site. A publisher is any individual who can query and publish in + UDDI Services. A Publisher can add entities to + UDDI Services + or modify any of the entities that they own. +

+

Users' Group Name

+

+ The name of the user group that your organization uses to define those users + with search privileges in this + UDDI Services + site. A user is any individual who can only query + UDDI Services + for Web service information. Any partner or organization with whom you would + like to share your Web services data must be granted, at minimum, User + privileges.

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.sitesecuritytab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.sitesecuritytab.htm new file mode 100644 index 0000000..7ba9788 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.sitesecuritytab.htm @@ -0,0 +1,76 @@ + + + + Security Tab Overview + + + + + + + + +
Microsoft Windows Graphic
+

Security Tab Overview

+

+ Use the Security tab to view or modify the authentication, encryption, and + cryptography settings for this + UDDI Services + site. +

+

Authenticated Access

+

View or modify the type of authentication used by this + UDDI Services + site.

+
    +
  • + Windows Integrated and + UDDI Services + publisher authentication: This site supports authenticated publications + using Windows integrated authentication or UDDI Publisher authentication, as + described in section 4 of the UDDI Version 2.0 Programmer's API Specification. +
  • + + UDDI Services + publisher authentication: This site supports authenticated publications + using UDDI Publisher authentication only, as defined in section 4 of the UDDI + Version 2.0 Programmer's API Specification. +
  • + Windows integrated publisher authentication: This site supports + authenticated publications using Windows integrated authentication only. +
      +
    • + Authentication for read (inquiry) access: If checked, this + UDDI Services + site mandates the use of Windows integrated authentication for GET requests + into this site.
    • +
    +
  • +
+

Secure Communications

+

+ Enable or disable SSL-encryption for communication with this + UDDI Services + site.

+

Cryptography

+

Click Change to view or adjust the SOAP authentication token expiration + and cryptography key time out settings used for UDDI Publisher authenticated + publications, as defined in section 4 of the UDDI Version 2.0 Programmer's API + Specification.

+

Important

+
    +
  • + If you selected to use SSL-encryption for this site, you must obtain an SSL + authentication certificate or + UDDI Services + will not function. For more information, see + Post-installation Configuration. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.specifythedatabaseserver.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.specifythedatabaseserver.htm new file mode 100644 index 0000000..cf1faee --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.specifythedatabaseserver.htm @@ -0,0 +1,143 @@ + + + + Change a Web server's database + + + + + + + + + + +
Microsoft Windows Graphic
+

To change a Web server's database

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, select the + UDDI Services + Web server you want to configure. + +
    + +
    +
  3. + On the Action menu, click Properties. +
  4. + Click the Database Connection + tab. +
  5. + In Read operations computer , click Change. +
  6. + Select the computer that hosts the + UDDI Services + database component that this Web server will use for Read operations. + + + + + + + + + + + + + +
    + To + Do this
    Connect to a + UDDI Services + site on the computer on which this console is runningClick Local computer (the one this console is running on).
    Connect to a + UDDI Services + site on a remote computerClick Another computer, and then type the name or IP address of the + remote + UDDI Services + database server.
    +
  7. + In Write operations computer, click Change. +
  8. + Select the computer that hosts the + UDDI Services + database component that this Web server will use for write operations. + + + + + + + + + + + + + +
    + To + Do this
    Connect to a + UDDI Services + site on the computer on which this console is runningClick Local computer (the one this console is running on).
    Connect to a + UDDI Services + site on a remote computerClick Another computer, and then type the name or IP address of the + remote + UDDI Services + database server.
    +
      +
    +
  9. +
+

Important

+
    +
  • + If you change a Web server's database connection to a database server that is + part of a different site, then you change the site to which that Web server + belongs. +
  • +
+

Note

+
    +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + UDDI Services + database components must be installed on a computer before a + UDDI Services + Web server can be connected to it. +
  • + You cannot change the database connection on a Web server that is part of a + stand-alone site hosted on a computer running + Windows Server 2003, Standard Edition. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a Site + to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.startorstopasever.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.startorstopasever.htm new file mode 100644 index 0000000..98b43c3 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.startorstopasever.htm @@ -0,0 +1,65 @@ + + + + Start or stop a Web server + + + + + + + + +
Microsoft Windows Graphic
+

To start or stop a Web server

+
    +
  1. + Open + UDDI Services. +
  2. + In the console tree, click the + UDDI Services + Web server you want to start or stop. + +
    + +
    +
  3. + Do one of the following: +
      +
    • + To stop a server, on the Action menu, click Stop. +
    • + To start a server, on the Action menu, click Start.
    +
  4. +
+

Note

+
    +
  • + To open + UDDI Services, click Start, point to Administrative + Tools, and then click + UDDI Services. +
  • + Before you can configure a site or one of its Web servers, you may need to add + the site to the + UDDI Services + snap-in. For more information, see Add a Site + to the UDDI Services Snap-in.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.troubleshooting.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.troubleshooting.htm new file mode 100644 index 0000000..16b0322 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.troubleshooting.htm @@ -0,0 +1,125 @@ + + + + Troubleshooting + + + + + + + + +
Microsoft Windows graphic
+

Troubleshooting

+

What problem are you having?

+ + + + + + + + + + + + + +
+

During installation a message appears "UDDI + Services is not compatible with IIS 5.0 isolation mode. The UDDI Services Web + server component will not be installed."

+
+

Cause:  Internet Information Services (IIS) is operating in IIS + 5.0 isolation mode - possibly due to an upgrade installation over a + previous version of Windows.

+

Solution:  Configure ISS to operate in worker process isolation + mode and repeat installation.

+

See also:  IIS + Isolation Modes in IIS Help.

+
+
+

My Web browser fails to connect to a + UDDI Services site with "Cannot find server or DNS error" message.

+
+

Cause:  SSL-encryption has been enabled for this site, but an + SSL certificate has not been installed.

+

Solution:  Obtain an SSL certificate or disable SSL for this + site.

+

See also:  Configure + Authentication, SSL, and Cryptography.

+
+
+

My Web browser fails to connect to a + UDDI Services site with "The page cannot be found" or "HTTP 404 - File not + found" message.

+
+

Cause:  The ASP.NET request handler has been disabled.

+

Solution:  Enable the ASP.NET request handler.

+

See also:  How + to Enable Web Service Extensions in IIS Help.

+
+
+

My Web browser fails to connect to a + UDDI Services site with "The application cannot be started" message.

+
+

Cause:  A computer hosting a UDDI Services Web server + component for this site has been promoted to a domain controller.

+

Solution:  Do not host the UDDI Services Web component on + a computer that is also a domain controller or reconfigure IIS to function + properly on the domain controller computer.

+

See also:  The + Microsoft Knowledge Base article discussing this issue on the Microsoft + Support Web site + (http://support.microsoft.com/). +

+
+
+

Known Issues

+

The following issues are known to exist in this version of UDDI Services: +

+
    +
  • + UDDI Services requires Internet Information Services (IIS) to be running + in worker process isolation mode; switching to IIS 5.0 isolation mode + will cause UDDI Services to no longer function. For more information, see + IIS Isolation Modes + in IIS Help. +
  • + Each computer that is a member of a Web farm must be configured to use the same ValidationKey + and DecryptionKey keys in the machine.config file. For more + information, see the + .NET Framework General Reference description of the machineKey element + on the Microsoft Web site. +
  • + If a computer hosting a UDDI Services Web server component is promoted to + a domain controller using DCPROMO, IIS and the UDDI Services Web server + component will cease to function. For more information, see the + Microsoft Knowledge Base article + discussing this issue on the Microsoft Support Web site. +
  • + When installing UDDI Services from a Terminal Server session, a + dialog box appears requiring UDDI Services to be installed in Multi User + mode. UDDI Services does not support multi-user installations and will not + function correctly. To prevent Multi User mode errors, you must change your + current user session to Install Mode before you install + UDDI Services. +

    To change your current user session

    +
      +
        +
      1. + Before you install UDDI Services, type change user /Install + at the command prompt. +
      2. + When your UDDI Services installation is complete, type change user /Execute + at the command prompt.
      3. +
      +
    +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.uddiservicesoverview.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.uddiservicesoverview.htm new file mode 100644 index 0000000..22bb319 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.uddiservicesoverview.htm @@ -0,0 +1,259 @@ + + + + UDDI Services Overview + + + + + + + + + +
Microsoft Windows Graphic
+

UDDI Services + overview

+

What is UDDI?

+

+ Universal Description, Discovery and Integration (UDDI) is an industry + specification for publishing and locating information about Web services. It + defines an information framework that enables you to describe and classify your + organization, its services, and the technical details about the interfaces of + the Web services you expose. The framework also enables you to consistently + discover services, or interfaces of a particular type, classification, or + function. UDDI also defines a set of Application Programming Interfaces (APIs) + that can be used by applications and services to directly interact with UDDI + data. For example, you can develop services that automatically publish and + update their UDDI data, react dynamically to service availability, or + automatically discover interface details for other services with which they + interact.

+

+ The UDDI.org consortium of companies established the UDDI Business Registry + (UBR) where companies and organizations can share and discover Web services. + This public registry is maintained and replicated by its managing body, the UBR + Operator Council, and should not be confused with + UDDI Services, which is deployed and maintained by your + enterprise or organization. +

+ +

Understanding + UDDI Services + entities and organization

+

+ UDDI Services + provides UDDI capabilities for use within an enterprise or between business + partners. It includes a Web interface with searching, publishing, and + coordination features that are compatible with Microsoft Internet + Explorer 4.0 or later and Netscape Navigator 4.5 or later. + UDDI Services + supports the UDDI version 1.0 and 2.0 APIs, enabling enterprise + developers to publish, discover, share, and interact with Web services directly + through their development tools and business applications. +

+

+ Organizations and the products and services they provide are represented by the + following entities in + UDDI Services: +

+

+ + + + +
+ provider  + Provider
+ tree
+ tree + contact  + Contact
+ tree
+ tree + service  + Service
+ blank space tree
+ blank space tree + binding  + Binding
+ blank space blank space + tree
+ blank space blank space + tree + instance info  + Instance Info
+

+ tModel  + tModel
+

+
+

+

+ The following definitions describe each entity and its role in relation to + other entities: +

+

+ provider   + Provider   A party—any business, or physical or conceptual + group—that offers one or more XML Web services. For example, a business, + business unit, organization, organizational department, person, computer, or an + application can be a provider in + UDDI Services. In the + UDDI Services + data structure, a provider represents the "parent" entity under which all + contact, service, and interface information is stored and organized. +

+

+ contact   + Contact   A human or computer resource that can be contacted + for information about a provider or the XML Web services it offers. A provider + may have as many contacts as is necessary to identify each of its available + contact points. +

+

+ service   + Service   An entity in + UDDI Services + that describes and provides access to a function that you would like to share + with other + UDDI Services + users. Services can perform any function across a network, from simple requests + to complicated business processes. A stock ticker feed and an online + procurement system are each examples of functions that can be published as a + service. Services may have one or more bindings. +

+

+ binding   + Binding   The point where a specific implementation of a + service can be accessed, such as the URL where an interface can be found. + Bindings may also include one or more instance info structures. +

+

+ instance info   + Instance Info   A reference to a tModel that contains relevant + technical information about a binding, such as an interface specification + document or Web Services Description Language (WSDL) file. +

+

+ tModel   + tModel   tModels are typically used to provide technical + information about an interface, such as a Web Service Description Language + (WSDL) file, that describes the conventions that are supported by an interface. + tModels are also used to represent an organized unit of descriptive data, such + as an identification or categorization scheme. How tModels are used in your + implementation may vary, depending on your organization's Web services + publishing data model. +

+

+ Each entity is defined by one or more of the following attributes: +

+
    +
  • + Categorization Scheme +    A collection of categories and subcategories used to describe and + locate providers, services, and tModels. A categorization scheme may contain + public classifications, such as the North American Industry Classification + System (NAICS). It may also contain company-defined categorizations. For + example, useful categorization schemes might be constructed around geographical + locations, industry segments, or a company's organizational structure. + Categorization provides a consistent means by which users can search for + providers and services or locate interfaces of a particular type, location, or + other attribute. +
  • + Overview Document URL   An address of a Hypertext Transfer + Protocol (HTTP)-accessible resource that hosts data or information you would + like to associate with an entity. For example, a tModel overview document might + provide the URL to an interface definition or Web Service Description Language + (WSDL) file that provides technical information that is required to invoke a + service through an interface. For an instance info, an overview + document might provide additional technical information that is only applicable + to a specific implementation of an interface. +
  • + Discovery URL    An HTTP-accessible resource that typically + responds to an HTTP-GET request with technical information describing a + provider. When a provider is created, + UDDI Services + automatically creates a discovery URL pointing to that provider's + businessEntity within that installation of + UDDI Services. +
  • + Identifier   An organization-wide identification scheme + used to logically group providers and tModels by a common form of + identification, such as a cost code or D-U-N-S® Number. Identifiers are + optional descriptions and are intended to enhance the discovery of providers + and tModels in search operations. +
  • + Relationships   The identity, parent-child or peer-peer + relationships between providers. Relationships are useful, for example, when + describing an organizational structure or advertising business partnerships. +
  • + Instance Parameters   The settings or parameters that are + supported by an instance of a binding. An instance parameter may be either a + list of settings and parameters or the URL of a file that contains a list of + supported settings and parameters. +
  • +
+ +

UDDI Services + Roles

+

+ UDDI Services + contains four roles that define the level of interaction that each user is + allowed. +

+
    +
  • + User   An individual who can only query + UDDI Services + for Web service information. Any partner or organization with whom you would + like to share your Web services data must be part of, at minimum, the User + group. By default, the User group uses the local computer group + BUILTIN\Users. +
  • + Publisher   An individual who can query and publish in + UDDI Services. A Publisher can add entities to + UDDI Services + or modify any of the entities that they own. By default, the Publisher + group uses the local computer group BUILTIN\Administrators. +
  • + Coordinator   An individual who can query, publish, and + configure data in the + UDDI Services + Web-based user interface. In addition to Publisher user rights, a Coordinator + can view and modify any data stored in + UDDI Services + , change entity ownerships, import categorization schemes, and generate and + view statistical reports. By default, the Coordinator group uses the local + computer group BUILTIN\Administrators. +
  • + Administrator   An individual who can query, publish, + coordinate, and administer + UDDI Services. In addition to Coordinator user rights for + the Web-based user interface, an Administrator can administer service options, + manage security settings, perform backups, and carry out other administrative + tasks at the system level by using the + UDDI Services + Web user interface and Microsoft Management Console (MMC) snap-in and command + line tools. By default, the Administrator group uses the local computer + group BUILTIN\Administrators. +
  • +
+

+ The user name and role are displayed in the upper-right corner of the UDDI + Services Web interface. +

+ +

What’s Next

+

+ Now that you have reviewed entities, roles, and relationships in + UDDI Services, you are ready to deploy, configure, and use + UDDI Services + in your organization. +

+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.uddiservicessnapin.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.uddiservicessnapin.htm new file mode 100644 index 0000000..750aa84 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.uddiservicessnapin.htm @@ -0,0 +1,56 @@ + + + + Snap-in overview + + + + + + + + +
Microsoft Windows Graphic
+

Snap-in Overview

+

+ The + UDDI Services + snap-in allows you to connect to and manage local or remote + UDDI Services + sites. A site represents a complete installation of + UDDI Services + and is comprised of a database component and one or more Web server components + attached to that database component. The + UDDI Services + database component can be either a stand-alone installation of Microsoft SQL + Desktop Engine (MSDE2000) or a SQL Server 2000 server or SQL Server 2000 + virtual server. The + UDDI Services + Web server components provide an interface for querying and publishing within a + UDDI Services + site. +

+

Note

+
    +
  • + The names of any locally installed components are displayed automatically. +
  • + To connect to another site, from the Actions pull-down menu, select Add + Site. +
  • +
+

 

+

+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.uninstalluddiservices.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.uninstalluddiservices.htm new file mode 100644 index 0000000..f43d03f --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.uninstalluddiservices.htm @@ -0,0 +1,39 @@ + + + + Uninstall UDDI Services + + + + + + + + +
Microsoft Windows Graphic
+

To uninstall UDDI Services

+
    +
  1. + From the computer you want to uninstall UDDI Services, open + Add or Remove Programs + in Control Panel. +
  2. + Click Add/Remove Windows Components. +
  3. + In Components, clear the UDDI Services check box, click Next, + and then click Finish. +
  4. + If you selected to create an MSDE2000 database instance for this installation + of UDDI Services and would like to remove that database from this system, + in Currently installed programs, select Microsoft SQL Server Desktop + Engine (UDDI), and then click Remove. +
  5. + In Add or Remove Programs, click Yes.
  6. +
+ Repeat this procedure on any other systems from which you would like to + uninstall UDDI Services. +
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.webdatabaseconnectiontab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.webdatabaseconnectiontab.htm new file mode 100644 index 0000000..87a06f2 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.webdatabaseconnectiontab.htm @@ -0,0 +1,41 @@ + + + + + + + + Database Connection Tab Overview + + + + + +
Microsoft Windows Graphic
+

Database Connection Tab Overview

+

+ Use the Database Connection tab to view or modify the database used by + this UDDI Services Web server component for publishing and querying.

+

Read operations computer

+

The name of the server used for read (query) operations, followed by the name of + the MSDE2000 or SQL Server database instance. To select a different server or + database instance for read operations, click Change.

+

Write operations computer

+

The name of the server used for write (publish) operations, followed by the name + of the MSDE2000 or SQL Server database instance. To select a different server or + database instance for write operations, click Change.

+ +

Note

+
    +
  • + You cannot change the database connection on a Web server that is part of a stand-alone site hosted on a computer running Windows Server 2003, Standard Edition. +
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.webgeneraltab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.webgeneraltab.htm new file mode 100644 index 0000000..831b037 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.webgeneraltab.htm @@ -0,0 +1,55 @@ + + + + Web Server - General Tab Overview + + + + + + + + +
Microsoft Windows Graphic
+

Web Server - General Tab Overview

+

+

Use the General tab to view information about this + UDDI Services + Web component.

+

The name of the site of which this Web server component is a member is + followed by:

+

Version

+

The version number of this installation.

+

Language

+

The default language code of this installation.

+

Date

+

The date this Web server component was installed.

+

Location

+

The path where this Web server component was installed.

+

.NET Framework Version

+

The version number of the .NET Framework installed on this server.

+

Components

+

A list of the + UDDI Services + components installed on this system.

+
    +
  • + UDDI Administration Component: This server hosts a + UDDI Services + MMC snap-in and administrative command-line tools. +
  • + UDDI Database Component: The server hosts a + UDDI Services + database component. +
  • + UDDI Web Server Component: This server hosts a + UDDI Services + Web server component.
  • +
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.webloggingtab.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.webloggingtab.htm new file mode 100644 index 0000000..d5ced38 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.webloggingtab.htm @@ -0,0 +1,77 @@ + + + + Logging Tab Overview + + + + + + + + +
Microsoft Windows Graphic
+

Logging Tab Overview

+

+ Use the Logging tab to view or modify the logging settings for this UDDI + Services Web server component. +

Event Log Settings

+

The slider defines the level of information published to the event log by + this UDDI Services Web server component.

+

Log File Settings

+

The slider defines the level of information published to the log file by this + UDDI Services Web server component.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Slider setting + Description
NoneNo information is logged.
ErrorRecords significant problems, such as loss of data or loss of functionality. + For example, if a service fails to load during startup, an error will be + logged.
Warning + + Records errors and events that are not necessarily significant, but may + indicate a possible future problem. For example, when disk space is low, a + warning will be logged.
Failure AuditRecords errors, warnings, and security access attempts that fail. For example, + if a user tries to access a network drive and fails, the attempt will be logged + as a failure audit event.
Success AuditRecords errors, warnings, and both failed and successful security attempts. For + example, a user's successful attempt to log on the system will be logged as a + success audit event.
InfoRecords errors, warnings, security audits, and events that describe the + successful operation of an application, driver, or service. For example, when a + network driver loads successfully, an info event will be logged.
VerboseRecords all successful and failed events.
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.webserver.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.webserver.htm new file mode 100644 index 0000000..9048b16 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.webserver.htm @@ -0,0 +1,42 @@ + + + + UDDI Services Web Server Overview + + + + + + + + +
Microsoft Windows Graphic
+

UDDI Services Web Server Overview

+

+ A + UDDI Services + Web server provides an interface for querying and publishing a + UDDI Services + site. +

+ +

Note

+
    +
  • + To modify a Web server's settings, select the Web server and, on the Action + menu, click Properties.
  • +
+
+

© 1997-2002 Microsoft Corporation. All + rights reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/uddi.mmc.webserverevents.htm b/inetsrv/uddi/source/help/mmc/uddi.mmc.webserverevents.htm new file mode 100644 index 0000000..d5c91d2 --- /dev/null +++ b/inetsrv/uddi/source/help/mmc/uddi.mmc.webserverevents.htm @@ -0,0 +1,87 @@ + + + + + + + + Web Server Events + + + + + +

[This is preliminary documentation and subject to change]
+

+
Microsoft Windows Graphic
+

UDDI Services Web Server Events

+

This topic describes the following types of events generated from a UDDI + Services Web server:

+ +

Note

+
    +
  • + When messages appear in the event log or Web browser, the symbols that appear + in the documentation (such as %s, %X, %1, %2, and so on) are replaced with + details about the error at the time that the error actually occurred. +
  • +
+ +

Authentication

+ + + + + + + +
+ Event IDDescription
###.. +
+

Authorization

+ + + + + + + +
+ Event IDDescription
###.. +
+

Configuration

+ + + + + + + +
+ Event IDDescription
###...
+

Other

+ + + + + + + +
+ Event IDDescription
####...
+
+

© 1997-2002 Microsoft Corporation. All rights + reserved.

+ + + + diff --git a/inetsrv/uddi/source/help/mmc/warning.gif b/inetsrv/uddi/source/help/mmc/warning.gif new file mode 100644 index 0000000..76dcd23 Binary files /dev/null and b/inetsrv/uddi/source/help/mmc/warning.gif differ diff --git a/inetsrv/uddi/source/help/sdk/uddi.net.sdk.chm b/inetsrv/uddi/source/help/sdk/uddi.net.sdk.chm new file mode 100644 index 0000000..aa81b00 Binary files /dev/null and b/inetsrv/uddi/source/help/sdk/uddi.net.sdk.chm differ diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.categorizationschemes.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.categorizationschemes.aspx new file mode 100644 index 0000000..6a6de39 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.categorizationschemes.aspx @@ -0,0 +1,43 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Categorization Schemes

+ Use the Categorization Schemes tab to view the available categorization schemes, show or hide them from the Browse by Category tab in search, or delete them from UDDI Services. +
    +
  • Categorization Scheme: Lists the name of each categorization scheme and its current status.

    +

      + Checked: Indicates whether UDDI Services checks and validates the keyValue attribute of any categorization that is associated with a checked categorization scheme. +

      + Browsable: Indicates whether or not a categorization scheme is available for browsing from the Browse by Category tab in Search. +

    +
      +
    • Click Show or Hide to make a categorization scheme browsable or hidden on the Browse by Category tab in Search. + +
    • Click Delete to delete a categorization scheme. +
    + +
+

More Information

+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.changeowner.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.changeowner.aspx new file mode 100644 index 0000000..cf259ca --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.changeowner.aspx @@ -0,0 +1,37 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Change Owner - Change Owner

+

As a UDDI Services coordinator, you can transfer the +ownership of any provider or tModel from one publisher to another. The transferred entity appears within the Publish area of the new owner, and no longer appears in the Publish area of the previous owner.

+
    +
  • Provider: or tModel: Lists the name of the provider or tModel that you are changing the ownership of. +
  • Current Owner: Lists the user name of the current owner of this tModel or provider. +
  • Search for publisher names containing: Provides a space for you to type all or part of the name of the publisher to whom you want to transfer the ownership of this entity. +
      +
    • Click Search to search for provider names. +
    • Click Cancel to cancel this process. +
    +
+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.coordinate.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.coordinate.aspx new file mode 100644 index 0000000..631499b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.coordinate.aspx @@ -0,0 +1,32 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Coordinate

+ Use the Coordinate section to view and manage categorization schemes; view and refresh statistical data; and import data into UDDI Services. +
    +
  • Categorization Schemes: Click to manage the available categorization schemes. +
  • Statistics: Click to view statistics for UDDI Services. +
  • Data Import: Click to import data or categorization schemes. +
+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.impersonateuser.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.impersonateuser.aspx new file mode 100644 index 0000000..a79af9a --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.impersonateuser.aspx @@ -0,0 +1,29 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

View Data Owned By ...

+ Use the View data owned by tab to locate other publishers and view or modify their data. +
    +
  • Search for publisher names containing: Type the name of the publisher that owns the data you want to modify and then click Search. If you only know part of the name, you can use % as a wildcard.

    For example, to search for a publisher name starting with "an," type an. To search for a publisher name containing the letters "an", type %an%.

    +
  • Publisher: Lists publisher names that match your search criteria. Select a publisher name from the list and then click Apply to view and modify their data. +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.importdata.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.importdata.aspx new file mode 100644 index 0000000..18db54a --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.importdata.aspx @@ -0,0 +1,37 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Import Data

+ Use the Import tab to import a categorization scheme or other Extensible Markup Language (XML) data into UDDI Services. Any information you import must first be validated against the appropriate XML schema definition (XSD). For more information about importing data and obtaining the appropriate XSDs for validation, see UDDI Resources. + +
    +
  • Data File: Lists the location of the XML file that contains the information you want to import. +
      +
    • Click Browse to specify the file that contains the data you want to import. +
    • Click Import to import the data contained in the file you have specified. +
    +
+ + NOTE: To import large data files, see the UDDI Services Microsoft Management Console (MMC) Snap-in Help for information on using the command line import tool. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.statisticscategorization.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.statisticscategorization.aspx new file mode 100644 index 0000000..b5c24e0 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.statisticscategorization.aspx @@ -0,0 +1,32 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Statistics - Categorization Statistics

+ Use the Categorization Statistics tab to view the available categorization schemes and the number of categories they contain. The statistics displayed are based upon data accumulated on the date displayed at the bottom of the screen next to Last recalculated on and are not refreshed automatically. +
    +
  • Top 10 Categorization Schemes Lists the names of the 10 most-frequently referenced categories or subcategories and the number of references to each.
  • +
      +
    • Click Recalculate to refresh all of the statistics. +
    +
+
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.statisticsentity.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.statisticsentity.aspx new file mode 100644 index 0000000..46bf096 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.statisticsentity.aspx @@ -0,0 +1,36 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Statistics - Entity Counts

+ Use the Entity Counts tab to view the number of providers, services, bindings, or tModels that are published in this installation of UDDI Services. The statistics displayed are based upon data accumulated on the date displayed at the bottom of the screen next to Last recalculated on and are not refreshed automatically. +
    +
  • Entity Type: Lists the number of providers, services, bindings, or +tModels that are currently published in UDDI Services.
  • +
      +
    • Click Recalculate to refresh all of the statistics. +
    +
+

More Information

+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.context.statisticspublisher.aspx b/inetsrv/uddi/source/help/ui/coordinate.context.statisticspublisher.aspx new file mode 100644 index 0000000..883fc7f --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.context.statisticspublisher.aspx @@ -0,0 +1,36 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Statistics - Publisher Statistics

+ Use the Publisher Statistics tab to view the total number of publishers, the number of publishers with active publications, and the top publishers of each different type of entity. The statistics displayed are based upon data accumulated on the date displayed at the bottom of the screen next to Last recalculated on and are not refreshed automatically. + +
    +
  • Statistic   Lists the total number of publishers and the number of publisers with active publications in this installation of UDDI Services. A publisher with active publications is any publisher that has published at least one provider or (unhidden) tModel. +
  • Entity Type   The top publishers of each different entity type, with a maximum of 10 per type, listed in descending order.
  • +
+
    +
  • Click Recalculate to refresh all of the statistics. +
+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.deletecategorizationscheme.aspx b/inetsrv/uddi/source/help/ui/coordinate.deletecategorizationscheme.aspx new file mode 100644 index 0000000..7358ae6 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.deletecategorizationscheme.aspx @@ -0,0 +1,38 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Show, Hide, or Delete a Categorization Scheme

+

As a UDDI Services coordinator, you can show, hide, or delete any categorization scheme. Showing or hiding a categorization scheme shows or hides that categorization scheme from the Browse by Category tab in Search. Deleting a categorization scheme removes it from the list of schemes that users may select from to search for or categorize their providers and tModels. Providers or tModels that already contain a reference to the categorization scheme that you delete will not be affected.

+

To show, hide, or delete a categorization scheme

+
    +
  1. + On the UDDI Services menu, click Coordinate. +
  2. + Click Categorization Schemes. +
  3. + Locate the categorization scheme you want to delete and, next to the name, + click Show, Hide, or Delete. + +
+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.footer.htm b/inetsrv/uddi/source/help/ui/coordinate.footer.htm new file mode 100644 index 0000000..6a8171e --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.footer.htm @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + +

+
+ Help Home  | + Coordinator's Guide +
©2002 Microsoft Corporation +
+ All rights reserved.

+
diff --git a/inetsrv/uddi/source/help/ui/coordinate.gettingstarted.aspx b/inetsrv/uddi/source/help/ui/coordinate.gettingstarted.aspx new file mode 100644 index 0000000..df56d2d --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.gettingstarted.aspx @@ -0,0 +1,27 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Coordinating UDDI Services

+

+

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.glossary.aspx b/inetsrv/uddi/source/help/ui/coordinate.glossary.aspx new file mode 100644 index 0000000..516d6c6 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.glossary.aspx @@ -0,0 +1,25 @@ + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/coordinate.header.htm b/inetsrv/uddi/source/help/ui/coordinate.header.htm new file mode 100644 index 0000000..4c19d90 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.header.htm @@ -0,0 +1,11 @@ + + +Coordinating UDDI Services + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.heading.htm b/inetsrv/uddi/source/help/ui/coordinate.heading.htm new file mode 100644 index 0000000..f728612 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.heading.htm @@ -0,0 +1,23 @@ + + + + + + + + + + +
+ + + + +
+ Help Home
+ Coordinator's Guide
+ Glossary +
+
+
+
diff --git a/inetsrv/uddi/source/help/ui/coordinate.impersonateuser.aspx b/inetsrv/uddi/source/help/ui/coordinate.impersonateuser.aspx new file mode 100644 index 0000000..9363c9f --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.impersonateuser.aspx @@ -0,0 +1,38 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Modify Data Owned By Another Publisher

+

As a UDDI Services coordinator you can view, add, modify, and delete entities that are owned by other publishers. To locate and select the publisher whos data you want to modify, on the My UDDI tab, click View data owned by .

+

To view or modify data owned by another publisher +

    +
  1. On the UDDI Services menu, click Publish. +
  2. Click View data owned by. +
  3. Type all or part of the name of the publisher you want to locate.
    +
  4. In the list of publisher names, click the name of the publisher that owns the data you want to modify. +
  5. Verify that you have selected the correct publisher, and then click Apply.
    + The top-right corner of the UDDI Services Web interface displays Viewing data owned by: Publisher Name". +
  6. View, add, modify, or delete data as needed. +
  7. To return to your data, on the UDDI Services menu, click Publish. +
  8. Click View my data. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.importcategorizationscheme.aspx b/inetsrv/uddi/source/help/ui/coordinate.importcategorizationscheme.aspx new file mode 100644 index 0000000..d8b91cf --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.importcategorizationscheme.aspx @@ -0,0 +1,37 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Import Data

+

NOTE: You must be a UDDI Services Administrator to import data into UDDI Services.

+ + You can import a categorization scheme or other appropriate data into UDDI Services using Data Import. Any information you import must first be validated against the appropriate XML schema definition (XSD). For more information about importing data and obtaining the appropriate XSDs for validation, see UDDI Resources. +

To import XML data

+
    +
  1. On the UDDI Services menu, click Coordinate. +
  2. Click Data Import. +
  3. Click Browse and then locate the XML file that contains the data you want to import. +
  4. Click Open, then click Import +
+ NOTE: To import large data files, see the UDDI Services MMC Snap-in Help for information on using the command line import tool. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.manageownerships.aspx b/inetsrv/uddi/source/help/ui/coordinate.manageownerships.aspx new file mode 100644 index 0000000..fdc0020 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.manageownerships.aspx @@ -0,0 +1,47 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Transfer Ownership

+

As a UDDI Services coordinator, you can transfer the ownership of any provider + or tModel from one publisher to another. The transferred entity then appears within the Publish area of the new + owner, and no longer appears in the Publish area of the previous owner. +

+ Note: Before you can transfer ownership to a publisher, he or she must have published entities in UDDI Services. +

Transfer ownership to another publisher

+
    +
  1. + On the UDDI Services menu, click Search. +
  2. + Use Search to locate the provider or tModel you want to transfer the ownership of. + +
  3. + In the Details tab of the entity you want to transfer the ownership of, click Change Owner. +
  4. + Type all or part of the name of the publisher to whom you want to transfer + the ownership of this entity to, and click Search.
    +
  5. In the list of publisher names, select the publisher to whom you want to transfer ownership. +
  6. + Verify that you have selected the correct publisher and then click Update. +
+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.toc.aspx b/inetsrv/uddi/source/help/ui/coordinate.toc.aspx new file mode 100644 index 0000000..7237e78 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.toc.aspx @@ -0,0 +1,48 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+

Coordinator's Guide

+ +
 How To ... +
+ + +

See also

+ + + +
bullet Additional Resources on the UDDI Services Web page on the Microsoft Web site
+ +
+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.troubleshooting.aspx b/inetsrv/uddi/source/help/ui/coordinate.troubleshooting.aspx new file mode 100644 index 0000000..977a312 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.troubleshooting.aspx @@ -0,0 +1,26 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Troubleshooting UDDI Services

+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/coordinate.viewstatisticreports.aspx b/inetsrv/uddi/source/help/ui/coordinate.viewstatisticreports.aspx new file mode 100644 index 0000000..9ad683e --- /dev/null +++ b/inetsrv/uddi/source/help/ui/coordinate.viewstatisticreports.aspx @@ -0,0 +1,51 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

View Statistic Reports

+

As a UDDI Services coordinator, you can view statistics about the information published in this implementation of UDDI Services. +

To view statistics

+
    +
  1. On the UDDI Services menu, click Coordinate.
  2. +
  3. Click Statistics.
  4. +
  5. Click the tab that represents the type of statistics you want to view. The statistics displayed are based upon data accumulated on the date displayed at the bottom of the screen next to Last recalculated on and are not refreshed automatically. +

    Entity Counts

    + +

    Lists the number of providers, services, bindings, or tModels published in this installation of UDDI Services.

    + + +

    Publisher Statistics

    + +

    Lists the total number of publishers, the number of publishers with active publications, and the top publishers of each different type of entity.

    + + + +

    Categorization Statistics

    + +

    Lists the available categorization schemes and the number of categories they contain.

    + +
+
    +
  • Click Recalculate to refresh all of the statistics. +
+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/glossary.administrator.htm b/inetsrv/uddi/source/help/ui/glossary.administrator.htm new file mode 100644 index 0000000..aed629a --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.administrator.htm @@ -0,0 +1,14 @@ + + +Administrator   An individual who can query, publish, +coordinate, and administer +UDDI Services. In addition to Coordinator user rights for +the Web-based user interface, an Administrator can administer service options, +manage security settings, perform backups, and carry out other administrative +tasks at the system level by using the +UDDI Services +Web user interface and Microsoft Management Console (MMC) snap-in and command +line tools. + By default, the Administrator group is assigned to the local machine group BUILTIN\Administrators. + + diff --git a/inetsrv/uddi/source/help/ui/glossary.binding.htm b/inetsrv/uddi/source/help/ui/glossary.binding.htm new file mode 100644 index 0000000..1598d79 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.binding.htm @@ -0,0 +1,5 @@ + + +Binding   The point where a specific implementation of a +service can be accessed, such as the URL where an interface can be found. +Bindings may also include one or more instance infos structures. diff --git a/inetsrv/uddi/source/help/ui/glossary.categorization.htm b/inetsrv/uddi/source/help/ui/glossary.categorization.htm new file mode 100644 index 0000000..df8b9ff --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.categorization.htm @@ -0,0 +1,11 @@ + + +Categorization Scheme   A collection of categories and +subcategories used to describe and locate providers, services, and tModels. A +categorization scheme may contain public classifications, such as the North +American Industry Classification System (NAICS). It may also contain +company-defined categorizations. For example, useful categorization schemes +might be constructed around geographical locations, industry segments, or a +company's organizational structure. Categorization provides a consistent means +by which users may search for providers and services or locate interfaces of a +particular type, location, or other attribute. diff --git a/inetsrv/uddi/source/help/ui/glossary.contact.htm b/inetsrv/uddi/source/help/ui/glossary.contact.htm new file mode 100644 index 0000000..93d061b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.contact.htm @@ -0,0 +1,6 @@ + + +Contact   A human or computer resource that can be contacted +for information about a provider or the XML Web services it offers. A provider +may have as many contacts as is necessary to identify each of its available +contact points. diff --git a/inetsrv/uddi/source/help/ui/glossary.coordinator.htm b/inetsrv/uddi/source/help/ui/glossary.coordinator.htm new file mode 100644 index 0000000..7a18ae2 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.coordinator.htm @@ -0,0 +1,14 @@ + + +Coordinator   An individual who can query, publish, and +configure data in the +UDDI Services +Web-based user interface. In addition to Publisher user rights, a Coordinator +can view and modify any data stored in +UDDI Services, change entity ownerships, import +categorization schemes, and generate and view statistical reports. + By default, +the Coordinatore group is assigned to the local machine group +BUILTIN\Administrators. + + diff --git a/inetsrv/uddi/source/help/ui/glossary.discoveryurl.htm b/inetsrv/uddi/source/help/ui/glossary.discoveryurl.htm new file mode 100644 index 0000000..384ab0c --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.discoveryurl.htm @@ -0,0 +1,13 @@ + + +Discovery URL   An HTTP accessible resource that typically +responds to an HTTP-GET request with technical information describing a +provider. + When a provider is created, +UDDI Services +automatically creates a discovery URL pointing to that provider's +businessEntity within that installation of +UDDI Services. + + + diff --git a/inetsrv/uddi/source/help/ui/glossary.htm b/inetsrv/uddi/source/help/ui/glossary.htm new file mode 100644 index 0000000..48ff0da --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.htm @@ -0,0 +1,250 @@ + + + +

Glossary

+ diff --git a/inetsrv/uddi/source/help/ui/glossary.identifier.htm b/inetsrv/uddi/source/help/ui/glossary.identifier.htm new file mode 100644 index 0000000..4079138 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.identifier.htm @@ -0,0 +1,7 @@ + + +Identifier   An organization-wide identification scheme used +to logically group providers and tModels by a common form of identification, +such as a cost code or D-U-N-S® Number. Identifiers are optional descriptions +and are intended to enhance the discovery of providers and tModels in search +operations. diff --git a/inetsrv/uddi/source/help/ui/glossary.instanceinfo.htm b/inetsrv/uddi/source/help/ui/glossary.instanceinfo.htm new file mode 100644 index 0000000..8953a7e --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.instanceinfo.htm @@ -0,0 +1,5 @@ + + +Instance Info   A reference to a tModel that contains relevant +technical information about a binding, such as an interface specification +document or Web Services Description Language (WSDL) file. diff --git a/inetsrv/uddi/source/help/ui/glossary.instanceparameter.htm b/inetsrv/uddi/source/help/ui/glossary.instanceparameter.htm new file mode 100644 index 0000000..1d3153a --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.instanceparameter.htm @@ -0,0 +1,6 @@ + + +Instance Parameters   The settings or parameters that are +supported by an instance of a binding. An instance parameter may be either a +list of settings and parameters or the URL of a file that contains a list of +supported settings and parameters. diff --git a/inetsrv/uddi/source/help/ui/glossary.interface.htm b/inetsrv/uddi/source/help/ui/glossary.interface.htm new file mode 100644 index 0000000..5b10d10 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.interface.htm @@ -0,0 +1,5 @@ + + +Interface   The address or location where a service or +application can be invoked. For example, a weather report Web service might +publish a single interface: http://www.mycompany.com/weather.asmx diff --git a/inetsrv/uddi/source/help/ui/glossary.overviewdocument.htm b/inetsrv/uddi/source/help/ui/glossary.overviewdocument.htm new file mode 100644 index 0000000..52c627b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.overviewdocument.htm @@ -0,0 +1,10 @@ + + +Overview Document URL   An address of an Hypertext Transfer +Protocol (HTTP)-accessible resource that hosts data or information you would +like to associate with an entity. For example, a tModel overview document might +provide the URL to an interface definition or Web Service Description Language +(WSDL) file that provides technical information that is required to invoke a +service through an interface. For an instance info, an overview document +might provide additional technical information that is only applicable to a +specific implementation of an interface. diff --git a/inetsrv/uddi/source/help/ui/glossary.provider.htm b/inetsrv/uddi/source/help/ui/glossary.provider.htm new file mode 100644 index 0000000..fe6c659 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.provider.htm @@ -0,0 +1,12 @@ + + +Provider   A party—any business, or physical or conceptual +group—that offers one or more XML Web services. For example, a business, +business unit, organization, organizational department, person, computer, or an +application can be a provider + in +UDDI Services. A provider +represents the "parent" entity under which all contact, service, and interface +information is stored and organized. + + diff --git a/inetsrv/uddi/source/help/ui/glossary.publisher.htm b/inetsrv/uddi/source/help/ui/glossary.publisher.htm new file mode 100644 index 0000000..492e0e2 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.publisher.htm @@ -0,0 +1,14 @@ + + +Publisher   An individual who can query and publish in + + UDDI Services +UDDI. +A Publisher can add entities to +UDDI Services +or modify any of the entities that they own. + + By default, the Publisher group is +assigned to the local machine group BUILTIN\Administrators. + + diff --git a/inetsrv/uddi/source/help/ui/glossary.relationship.htm b/inetsrv/uddi/source/help/ui/glossary.relationship.htm new file mode 100644 index 0000000..88d688e --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.relationship.htm @@ -0,0 +1,5 @@ + + +Relationships   The identity, parent-child or peer-peer +relationships between providers. Relationships are useful, for example, when +describing an organizational structure or advertising business partnerships. diff --git a/inetsrv/uddi/source/help/ui/glossary.service.htm b/inetsrv/uddi/source/help/ui/glossary.service.htm new file mode 100644 index 0000000..08596c1 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.service.htm @@ -0,0 +1,8 @@ + + +Service   An entity that describes and provides access to a +function you would like to share with other users. Services can perform any +function across a network, from simple requests to complicated business +processes. A stock ticker feed and an online procurement system are each +examples of functions that can be published as a service. Services may have one +or more bindings. diff --git a/inetsrv/uddi/source/help/ui/glossary.soap.htm b/inetsrv/uddi/source/help/ui/glossary.soap.htm new file mode 100644 index 0000000..f7817ee --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.soap.htm @@ -0,0 +1,9 @@ + + +SOAP (Simple Object Access Protocol)   A World Wide Web +Consortium (W3C) standard, lightweight protocol for exchange of information in +a decentralized, distributed environment. SOAP is an Extensible Markup Language +(XML)-based protocol that consists of three parts: an envelope that defines a +framework for describing what is in a message and how to process it; a set of +encoding rules for expressing instances of application-defined data types; and +a convention for representing remote procedure calls and responses. diff --git a/inetsrv/uddi/source/help/ui/glossary.tmodel.htm b/inetsrv/uddi/source/help/ui/glossary.tmodel.htm new file mode 100644 index 0000000..4c67ddf --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.tmodel.htm @@ -0,0 +1,9 @@ + + +tModel   tModels are typically used to provide technical +information about an interface, such as a Web Service Description Language +(WSDL) file, that describes the conventions that are supported by an interface. +tModels are also used to represent an organized unit of descriptive data, such +as an identification or categorization scheme. How tModels are used in your +implementation may vary, depending upon your organization's Web services +publishing data model. diff --git a/inetsrv/uddi/source/help/ui/glossary.uddi.htm b/inetsrv/uddi/source/help/ui/glossary.uddi.htm new file mode 100644 index 0000000..9d63227 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.uddi.htm @@ -0,0 +1,8 @@ + + +Universal Description, Discovery and Integration (UDDI)   An +industry specification for publishing and locating information about Web +services. It defines a standards-based way to store and retrieve information +about services, service providers, binding information and technical interface +definitions, all classified using a set of standard or custom classification +schemes. diff --git a/inetsrv/uddi/source/help/ui/glossary.user.htm b/inetsrv/uddi/source/help/ui/glossary.user.htm new file mode 100644 index 0000000..d9865c7 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.user.htm @@ -0,0 +1,13 @@ + + +User   An individual who can only query + + UDDI Services +for Web service information. +Any partner or organization with whom you would +like to share your Web services data must be part of, at minimum, the User +group. + By default, the User group is assigned to the local machine group +BUILTIN\Users. + + diff --git a/inetsrv/uddi/source/help/ui/glossary.webservice.htm b/inetsrv/uddi/source/help/ui/glossary.webservice.htm new file mode 100644 index 0000000..b0407e4 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.webservice.htm @@ -0,0 +1,8 @@ + + +Web Service   A unit of application logic that provides data +and services to other applications that can be invoked using standard Internet +transport protocols such as Hypertext Transfer Protocol (HTTP), Simple Mail +Transfer Protocol (SMTP), or File Transfer Protocol (FTP). Web services can +perform functions ranging from simple requests to complicated business +processes. diff --git a/inetsrv/uddi/source/help/ui/glossary.wsdl.htm b/inetsrv/uddi/source/help/ui/glossary.wsdl.htm new file mode 100644 index 0000000..9eaf37e --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.wsdl.htm @@ -0,0 +1,5 @@ + + +WSDL (Web Service Description Language)   An Extensible Markup +Language (XML) grammar that developers and development tools use to represent +the capabilities of an XML Web service. diff --git a/inetsrv/uddi/source/help/ui/glossary.xml.htm b/inetsrv/uddi/source/help/ui/glossary.xml.htm new file mode 100644 index 0000000..eef1e0f --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.xml.htm @@ -0,0 +1,5 @@ + + +XML (Extensible Markup Language)    A universal format for +structured documents and data on the Web. XML is an industry-standard protocol +administered by the World Wide Web Consortium (W3C). diff --git a/inetsrv/uddi/source/help/ui/glossary.xmlwebservice.htm b/inetsrv/uddi/source/help/ui/glossary.xmlwebservice.htm new file mode 100644 index 0000000..336ba32 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/glossary.xmlwebservice.htm @@ -0,0 +1,7 @@ + + +XML Web Service   A unit of application logic that provides +data and services to other applications that can be invoked over standard +Internet transport protocols. Invocations of XML (Extensible Markup Language) +Web services are formatted in XML and often use protocols such as Simple Object +Access Protocol (SOAP) and the Hypertext Transfer Protocol (HTTP) transport. diff --git a/inetsrv/uddi/source/help/ui/home.footer.htm b/inetsrv/uddi/source/help/ui/home.footer.htm new file mode 100644 index 0000000..c5eefe8 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/home.footer.htm @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + +

+
+ Help Home +
©2002 Microsoft Corporation +
+ All rights reserved.

+
diff --git a/inetsrv/uddi/source/help/ui/home.glossary.aspx b/inetsrv/uddi/source/help/ui/home.glossary.aspx new file mode 100644 index 0000000..5c46f58 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/home.glossary.aspx @@ -0,0 +1,26 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/home.header.htm b/inetsrv/uddi/source/help/ui/home.header.htm new file mode 100644 index 0000000..7287698 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/home.header.htm @@ -0,0 +1,18 @@ + + + +Welcome to UDDI Services Help + + + +Welcome to Microsoft UDDI Help + + + + + diff --git a/inetsrv/uddi/source/help/ui/home.heading.htm b/inetsrv/uddi/source/help/ui/home.heading.htm new file mode 100644 index 0000000..dd6df40 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/home.heading.htm @@ -0,0 +1,24 @@ + + + + + + + + + + +
UDDI Services Logo + + + + + + + +
+ Help Home
+
+
+
+
diff --git a/inetsrv/uddi/source/help/ui/home.toc.aspx b/inetsrv/uddi/source/help/ui/home.toc.aspx new file mode 100644 index 0000000..b595513 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/home.toc.aspx @@ -0,0 +1,156 @@ + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+ +

UDDI Services Help

+
+ + +

UDDI Help

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +

See also

+
+ Glossary +
+ Additional Resources on the UDDI Services Web page on the Microsoft Web site +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/home.tou.aspx b/inetsrv/uddi/source/help/ui/home.tou.aspx new file mode 100644 index 0000000..a52f1d4 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/home.tou.aspx @@ -0,0 +1,21 @@ +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+ +
+ + + diff --git a/inetsrv/uddi/source/help/ui/home.troubleshooting.aspx b/inetsrv/uddi/source/help/ui/home.troubleshooting.aspx new file mode 100644 index 0000000..69e3d5b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/home.troubleshooting.aspx @@ -0,0 +1,26 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Troubleshooting UDDI Services

+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/images/additional.gif b/inetsrv/uddi/source/help/ui/images/additional.gif new file mode 100644 index 0000000..8a8bcdd Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/additional.gif differ diff --git a/inetsrv/uddi/source/help/ui/images/bullet.gif b/inetsrv/uddi/source/help/ui/images/bullet.gif new file mode 100644 index 0000000..ae0054c Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/bullet.gif differ diff --git a/inetsrv/uddi/source/help/ui/images/coord.guide.gif b/inetsrv/uddi/source/help/ui/images/coord.guide.gif new file mode 100644 index 0000000..7093b03 Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/coord.guide.gif differ diff --git a/inetsrv/uddi/source/help/ui/images/home.gif b/inetsrv/uddi/source/help/ui/images/home.gif new file mode 100644 index 0000000..347f7d9 Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/home.gif differ diff --git a/inetsrv/uddi/source/help/ui/images/publish.guide.gif b/inetsrv/uddi/source/help/ui/images/publish.guide.gif new file mode 100644 index 0000000..8cdcb5d Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/publish.guide.gif differ diff --git a/inetsrv/uddi/source/help/ui/images/search.guide.gif b/inetsrv/uddi/source/help/ui/images/search.guide.gif new file mode 100644 index 0000000..15c5b1a Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/search.guide.gif differ diff --git a/inetsrv/uddi/source/help/ui/images/stepbystep.guide.gif b/inetsrv/uddi/source/help/ui/images/stepbystep.guide.gif new file mode 100644 index 0000000..3bf90b3 Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/stepbystep.guide.gif differ diff --git a/inetsrv/uddi/source/help/ui/images/uddi_logo.gif b/inetsrv/uddi/source/help/ui/images/uddi_logo.gif new file mode 100644 index 0000000..17f4610 Binary files /dev/null and b/inetsrv/uddi/source/help/ui/images/uddi_logo.gif differ diff --git a/inetsrv/uddi/source/help/ui/intro.footer.htm b/inetsrv/uddi/source/help/ui/intro.footer.htm new file mode 100644 index 0000000..8e78742 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.footer.htm @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + +

+
+ Help Home  | + Introduction +
©2002 Microsoft Corporation +
+ All rights reserved.

+
diff --git a/inetsrv/uddi/source/help/ui/intro.glossary.aspx b/inetsrv/uddi/source/help/ui/intro.glossary.aspx new file mode 100644 index 0000000..a5b6f83 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.glossary.aspx @@ -0,0 +1,24 @@ +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/intro.header.htm b/inetsrv/uddi/source/help/ui/intro.header.htm new file mode 100644 index 0000000..c37e2b4 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.header.htm @@ -0,0 +1,18 @@ + + + +Introduction to UDDI Services + + + +Introduction to UDDI + + + + + diff --git a/inetsrv/uddi/source/help/ui/intro.heading.htm b/inetsrv/uddi/source/help/ui/intro.heading.htm new file mode 100644 index 0000000..8f59be4 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.heading.htm @@ -0,0 +1,23 @@ + + + + + + + + + + +
+ + + + +
+ Help Home
+ Introduction
+ Glossary +
+
+
+
diff --git a/inetsrv/uddi/source/help/ui/intro.toc.aspx b/inetsrv/uddi/source/help/ui/intro.toc.aspx new file mode 100644 index 0000000..1dc2f89 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.toc.aspx @@ -0,0 +1,58 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+

Introduction

+
 Introduction to UDDI Services +
+ +
 Step-by-Step +
+ +

See also +

+ + +
bullet Additional Resources on the UDDI Services Web page on the Microsoft Web site
+ +
+ Introduction +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/intro.tou.aspx b/inetsrv/uddi/source/help/ui/intro.tou.aspx new file mode 100644 index 0000000..aa2ada6 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.tou.aspx @@ -0,0 +1,21 @@ +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+ +
+ + + diff --git a/inetsrv/uddi/source/help/ui/intro.troubleshooting.aspx b/inetsrv/uddi/source/help/ui/intro.troubleshooting.aspx new file mode 100644 index 0000000..cb73eba --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.troubleshooting.aspx @@ -0,0 +1,26 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Troubleshooting UDDI Services

+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/intro.whatisuddi.aspx b/inetsrv/uddi/source/help/ui/intro.whatisuddi.aspx new file mode 100644 index 0000000..81d6727 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/intro.whatisuddi.aspx @@ -0,0 +1,197 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Introduction to UDDI Services

+

+ In order to get the most out of this introduction to the basic concepts in UDDI Services, it is strongly recommended that you first become familiar with Web services, Web service interfaces, and the services you are describing. For more information, see Additional Resources on the UDDI Services page on the Microsoft Web site. +

+

+ Jump to: What is UDDI?, Understanding UDDI Services Entities and Organization, UDDI Services Roles. +

+ + +

What is UDDI?

+

+ Universal Description, Discovery and Integration (UDDI) is an industry + specification for publishing and locating information about Web services. It + defines an information framework that enables you to describe and classify your + organization, its services, and the technical details about the + interfaces of the Web services you expose. The framework also enables you to consistently + discover services, or interfaces of a particular type, + classification, or function. UDDI also defines a set of Application Programming Interfaces (APIs) that can be used + by applications and services to interact with UDDI data directly. For example, + you can develop services that publish and update their UDDI data automatically, + react dynamically to service availability, or automatically discover interface + details for other services with which they interact.

+

+ The UDDI.org consortium of companies established the UDDI Business Registry (UBR) where companies and organizations can share and discover Web services. This public registry is maintained and replicated by its managing body, the UBR Operator Council, and should not be confused with UDDI Services, which is deployed and maintained by your enterprise or organization. +

+ +

Understanding UDDI Services Entities and Organization

+

+ UDDI Services provides UDDI capabilities for + use within an enterprise or between business partners. It includes a Web + interface with searching, publishing, and coordination features that are + compatible with Microsoft Internet Explorer 4.0 or later and Netscape Navigator 4.5, or later. + UDDI Services supports the UDDI version 1.0 and 2.0 APIs, enabling enterprise + developers to publish, discover, share, and interact with Web services directly through + their development tools and business applications. +

+

+ Organizations and the products and services they provide are represented by the following entities in UDDI Services. +

+
+ + + + +
+ provider  Provider
+ tree
+ tree + contact Contact
+ tree
+ tree + service Service
+ blank space + tree
+ blank space + tree + binding Binding
+ blank space + blank space + tree
+ blank space + blank space + tree + instance info Instance Info
+

+ tModel tModel
+

+ Figure A +
+

+ The following definitions describe each entity and its role in relation to other entities. +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ provider + + +
+ contact + + +
+ service + + +
+ binding + + +
+ instance info + + +
+ tModel + + +
+ + Each entity is defined by one or more of the following attributes. +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • + +
+ +

UDDI Services Roles

+

+ UDDI Services contains four roles that define the level of interaction that each user is allowed. +

+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+

+ Your user name and role are displayed in the upper-right corner of the UDDI + Services Web interface. +

+ +

What’s Next

+

Now that you have reviewed entities, roles, and relationships in UDDI Services, you are ready to begin querying, publishing, or coordinating Web service information. For an + overview on locating or publishing data, see + Introduction to Searching or Introduction to Publishing.

+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.addbindings.aspx b/inetsrv/uddi/source/help/ui/publish.addbindings.aspx new file mode 100644 index 0000000..d76194d --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.addbindings.aspx @@ -0,0 +1,61 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Add a Binding - Binding

+ A binding represents a point where an implementation of a service can be accessed. If your service has multiple access points, add a binding for each. A binding always includes an access point and a description of how the service can be used. It may also include one or more instance infos, which are references to tModels that contain relevant technical information about the binding + +

Add a binding

+
    +
  1. On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Click the Providers tab. +
  4. Locate the provider that contains the service to which you want to add a binding and, next to its name, click View. +
  5. Click the Services tab. +
  6. Locate the service to which you want to add a binding and, next to its name, click View. +
  7. Click the Bindings tab. +
  8. Click Add Binding.
    + Binding http:// appears. +
  9. + In the Details tab, click Edit. +
  10. + In Access Point, type the access point URL.
  11. +
  12. + In the URL Type list, click the protocol that is supported by the access point.
  13. +
  14. + Click Update.
  15. +
  16. + Click Add Description. +
  17. + In the Language + list, click a language for this description. +
  18. + In Description, type a brief description.
  19. +
  20. + Click Update.
  21. +
  22. + To add additional descriptions in other languages, repeat steps 12 through 15.
  23. +
+

+ You have now added a binding to your service. Repeat these + procedures to publish additional bindings, or add instance infos to your bindings. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.addcontacts.aspx b/inetsrv/uddi/source/help/ui/publish.addcontacts.aspx new file mode 100644 index 0000000..0628e91 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.addcontacts.aspx @@ -0,0 +1,152 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Add a Contact - Contact

+

Contacts are any contact point within your organization that can provide support or assistance about a provider or the services the provider offers. +

+ + Jump to: Add a contact, Add an e-mail + address, Add a phone number, Add an + address. +

Add a contact

+
    +
  1. On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Click the Providers tab. +
  4. Locate the provider to which you want to add a contact and, next to its name, click View. +
  5. Click the Contacts tab. +
  6. Click Add Contact.
    + + (New Contact) appears.
  7. +
  8. + In the details area, click Edit.
  9. +
  10. + In Contact Name field, type a name.
  11. +
  12. + In Use Type, enter the purpose of this contact, such as "Technical inquiries" or "Customer service inquiries."
  13. +
  14. + Click Update.
  15. +
  16. + Click Add Description.
  17. +
  18. + In Language, select a language for this description.
  19. +
  20. + In Description, type a brief description.
  21. +
  22. + Click Update.
  23. +
  24. + To add additional descriptions in other languages, repeat steps 8 through 11.
  25. +
+ +

Add an e-mail address

+
    +
  1. On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Click the Providers tab. +
  4. Locate the provider that contains the contact to which you want to add an e-mail address and, next to its name, click View. +
  5. Click the Contacts tab. +
  6. Locate the contact to which you want to add an e-mail address and, next to its name, click View. +
  7. + Click the E-mail tab.
  8. +
  9. + Click Add E-mail.
  10. +
  11. + In E-mail field, type an e-mail address.
  12. +
  13. + In Use Type, enter the purpose of this e-mail contact, such as + "Customer service inquries."
  14. +
  15. + Click Update.
  16. +
  17. + To add additional e-mail addresses, repeat steps 2 through 5.
  18. +
  19. + Click Add Description.
  20. +
  21. + In Language, select a language for this description.
  22. +
  23. + In Description, type a brief description.
  24. +
  25. + Click Update.
  26. +
  27. + To add additional descriptions in other languages, repeat steps 7 through 10. +
+ +

Add a phone number

+ Provide one or more phone numbers for this contact. +
    +
  1. On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Click the Providers tab. +
  4. Locate the provider that contains the contact to which you want to add a phone number and, next to its name, click View. +
  5. Click the Contacts tab. +
  6. Locate the contact to which you want to add a phone number and, next to its name, click View. +
  7. + Click the Phone tab.
  8. +
  9. + Click Add Phone.
  10. +
  11. + In Phone, type a phone number.
  12. +
  13. + In Use Type, type the purpose of this phone number, such as "FAX," + "TTY," or "Voice."
  14. +
  15. + Click Update.
  16. +
  17. + To add additional phone numbers, repeat steps 2 through 5.
  18. +
  19. + Click Add Description.
  20. +
  21. + In the Language list, select a language for this description.
  22. +
  23. + In Description, type a brief description.
  24. +
  25. + Click Update.
  26. +
  27. + To add additional descriptions in other languages, repeat steps 7 through 10.
  28. +
+ +

Add an address

+ Provide one or more addresses for this contact, such as physical locations, + mailing addresses, or post office boxes. +
    +
  1. On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Click the Providers tab. +
  4. Locate the provider that contains the contact to which you want to add an address and, next to its name, click View. +
  5. Click the Contacts tab. +
  6. Locate the contact to which you want to add an address and, next to its name, click View. +
  7. + Click the Address tab.
  8. +
  9. + Click Add Address.
  10. +
  11. + In Address, type an address. +
  12. +
  13. + In Use Type, type a purpose for this address, such as "Shipping" or "Written Technical Correspondence."
  14. +
  15. + Click Update.
  16. +
  17. + To add additional addresses, repeat steps 2 through 5.
  18. +
+

+ You have now added and defined a contact for a provider. Repeat + these procedures to add and define additional contacts. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.addinstances.aspx b/inetsrv/uddi/source/help/ui/publish.addinstances.aspx new file mode 100644 index 0000000..b03b6b9 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.addinstances.aspx @@ -0,0 +1,114 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Add an Instance Info - instance info

+ An instance info is a reference to a tModel that contains relevant technical +information about a binding. For example, you might create a reference to a tModel that represents an interface specification document or Web Services Description Language (WSDL) file that describes the conventions or functions supported by a binding.

+ + + Jump to: Add an Instance Info, Add + Instance Parameters, Add the Overview Document URL. +

Add an instance info

+
    +
  1. On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Click the Providers tab. +
  4. Locate the provider that owns the service that contains the binding to which you want to add an instance info and, next to its name, click View. +
  5. Click the Services tab. +
  6. Locate the service that contains the binding to which you want to add an instance info and, next to its name, click View. +
  7. Click the Bindings tab. +
  8. Locate the binding to which you want to add an instance info and, next to its name, click View. +
  9. Click the Instance Infos tab. +
  10. Click Add Instance Info.
  11. +
  12. + Type all or part of the name of the tModel you want to refer to and click Search.
    + A list of tModels matching your criteria appears.
  13. +
  14. + Select the tModel you want to create an instance of. +
  15. + Click Add Description. +
  16. + In the Language + list, select a language for this description. +
  17. + In Description, enter a description of this instance info.
  18. +
  19. + Click Update.
  20. +
  21. + To add additional descriptions in other languages, repeat steps 12 through 15.
  22. +
+ +

Add instance parameters

+ Instance parameters are the unique parameters that this instance of this tModel + supports. +
    +
  1. + Click the Instance Details + tab. +
  2. + Click Edit. +
  3. + In Instance Parameter, type the parameters supported by this instance or the URL of a document that describes the parameters supported by this instance info. +
  4. + Click Update.
  5. +
  6. + Click Add Description. +
  7. + In the Language + list, select a language for this description. +
  8. + In Description, type a description of this instance parameter.
  9. +
  10. + Click Update.
  11. +
  12. + To add additional descriptions in other languages, repeat steps 5 through 8.
  13. +
+ +

Add the overview document URL

+ The overview document URL identifies the location of a file that contains + technical details about this instance—for example, a WSDL (Web Services Description Language) or XML (Extensible Markup Language) Web service + definitions file. +
    +
  1. + Click the Overview Document URL + tab. +
  2. + Click Edit. +
  3. + Specify the URL where the overview document for this instance can be found.
  4. +
  5. + Click Update.
  6. +
  7. + Click Add Description. +
  8. + In the Language + list, select a language for this description. +
  9. + In Description, type a description for this overview document.
  10. +
  11. + Click Update.
  12. +
  13. + To add additional descriptions in other languages, repeat steps 5 through 8.
  14. +
+

To publish additional instance infos, repeat these procedures. +

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.addproviders.aspx b/inetsrv/uddi/source/help/ui/publish.addproviders.aspx new file mode 100644 index 0000000..6c3eecf --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.addproviders.aspx @@ -0,0 +1,158 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Publish a Provider -

+

+ A provider represents any group or entity that offers one or more services. Valid examples of a provider might include a + business, a business unit, an organization, an organizational department, a + person, a computer, or an application that offers a service.

+ + + Jump to: Add a provider, Add + an identifier, Add a category, + Add a discovery URL, Add a relationship. +

Add a Provider

+
    +
  1. On the UDDI Services UDDI menu, click Publish. +
  2. Click the Providers tab. +
  3. Click Add Provider.
    + (New Provider Name) appears. +
  4. + In the details area, click Edit. +
  5. + In the Language list, select a language for this name. +
  6. + In Name, type a name for this provider.
  7. +
  8. + Click Update.
  9. +
  10. + To add names in other languages, click Add Name and repeat steps 5 + through 7.
  11. +
  12. + Click Add Description. +
  13. + In the Language list, select a language for this description. +
  14. + In Description, type a brief description for this provider.
  15. +
  16. + Click Update.
  17. +
  18. + To add descriptions in other languages, repeat steps 9 through 12. +
+ +

Add an identifier

+ Use identifiers to define the logical groupings that this provider is a member of. +
    +
  1. + Click the Identifiers tab
  2. . +
  3. + Click Add Identifier. +
  4. + Select the tModel that represents the identification scheme that you are associating with this provider, if available. +
  5. + In Key Name, type a name for this identifier.
  6. +
  7. + In Key Value, type a value for this identifier.
  8. +
  9. + Click Update.
  10. +
  11. + To add additional identifiers, repeat steps 2 through 6.
  12. +
+ +

Add a category

+ Categories provide descriptive information about this provider, such as its geographical location, the services it provides, or any other appropriate classification. Searches and queries use categories to locate providers of a particular type, classification, or attribute. Assign the appropriate classifications to this provider so that it can be discovered logically and intuitively by either human search or programmatic query. +
    +
  1. + Click the Categories + tab. +
  2. + Click Add Category.
  3. +
  4. + Select an appropriate Categorization Scheme and subcategory.
    +
  5. +
  6. + Click Add Category.
  7. +
  8. + To add additional categories, repeat steps 2 through 5.
  9. +
+ +

Add a Discovery URL

+ A Discovery URL provides a link to additional technical or descriptive information about a provider. When a provider is created, UDDI Services automatically creates a Discovery URL pointing to this provider's businessEntity within this installation of UDDI Services. +
    +
  1. + Click the Discovery URLs tab.
  2. +
  3. + Click Add URL.
  4. +
  5. + In Discovery URL, enter the URL that contains the data you want to publish.
  6. +
  7. + In Use Type, type the use type of this Discovery URL.
  8. +
  9. + Click Update.
  10. +
  11. + To add additional Discovery URLs, repeat steps 2 through 5.
  12. +
+ +

Add a relationship

+ Relationships define the relationships between providers that you want to make known. They are useful when describing an organizational structure or advertising partnerships between providers. +
    +
  1. + Click the Relationships tab.
  2. +
  3. + Click Add Relationship.
  4. +
  5. + Select the provider with whom you want to publish a relationship.
  6. +
  7. + In Relationship type, select the type of relationship you want to establish. + +
      +
    • + Identity: Both providers represent the same organization. +
    • +
    • + Parent-child: One provider is a parent of the other provider, such as a subsidiary. +
    • +
    • + Peer-peer: One provider is a peer of the other provider. +
    • +
    +
  8. + Select the direction of the relationship. +
      +
    • + (Your Provider) to Other Provider: A relationship where your provider represents the parent or peer entity.
    • +
    • + Other Provider to (Your Provider): A relationship where the other provider represents the parent or peer entity.
    • +
    +
  9. +
  10. + Click Add. +
  11. +
  12. + To create additional relationships, repeat steps 2 through 6. +
  13. +
+ Any relationship that you define is not published until the other provider approves it. A relationship that has not yet been approved displays as "Pending" in your Relationships tab, and appears as "Pending Approval" in the other provider's Relationships tab.

+ You have now added and defined a provider and are ready to add contacts and services to it. For more information, see How to Add a Contact or How to Add a Service. +

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.addservices.aspx b/inetsrv/uddi/source/help/ui/publish.addservices.aspx new file mode 100644 index 0000000..f3c189c --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.addservices.aspx @@ -0,0 +1,90 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Publish a Service - Service

+

+ A service represents an XML (Extensible Markup Language) Web service that you want to publish in UDDI + Services. A service can have multiple implementations, and each implementation + is represented by a binding.

+ + Jump to: Add a service, Add + categories. +

Add a service

+ This entry represents the service you are publishing in UDDI Services. +
    +
  1. On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Click the Providers tab. +
  4. Locate the provider to which you want to add a service and, next to its name, click View. +
  5. Click the Services tab. +
  6. Click Add Service.
    + Service (New Service) appears. +
  7. + In the details area, click Edit. +
  8. + In the Language list, select a language for this name.
  9. +
  10. + In Name, type a name for this service.
  11. +
  12. + Click Update.
  13. +
  14. + To add additional names in other languages, click Add Name and repeat + steps 7 through 9.
  15. +
  16. + Click Add Description. +
  17. + In the Language + list, select a language for this description. +
  18. + In Description, type a brief description.
  19. +
  20. + Click Update.
  21. +
  22. + To add additional languages in other languages, repeat steps 11 through 14.
  23. +
+ +

Add categories

+ Categories describe this service, such as the functions it serves, + geographical location, standard business classifications, or any other + appropriate categorization. For optimal discovery within UDDI Services, + describe your service using categories that you expect others to use when + searching for services like yours. +
    +
  1. + Click the Categories + tab. +
  2. + Click Add Category.
  3. +
  4. + Select an appropriate categorization scheme and subcategory.
    +
  5. +
  6. + Click Add Category.
  7. +
  8. + To add additional categories, repeat steps 2 through 5.
  9. +
+

+ You have now added and described a service and are ready to + add bindings + to the service. +

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.addtmodels.aspx b/inetsrv/uddi/source/help/ui/publish.addtmodels.aspx new file mode 100644 index 0000000..ed78f04 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.addtmodels.aspx @@ -0,0 +1,120 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to add a tModel

+

A tModel can represent a categorization scheme, namespace, protocol, signature component, + Web specification, in WSDL (Web Services Description Language) or XML (Extensible Markup Language), or an identification scheme. You can use tModels to + describe or classify the entity—provider, tModel, service, binding or Instance + Info—that you want to publish.

+

To add a tModel, you must first create a tModel entry and then assign a unique + name and description in all appropriate languages. You then add one or more + identifiers and specify categories that describe the function of the tModel, + for example: geographical location, types of services provided, a business + classification, or other appropriate categorizations. When you finish defining the tModel, specify an + overview document URL which is the location of a file containing descriptive + information about this tModel. +

+ Jump to: Add a tModel, Add + Categories, Specify the Overview Document URL. + +

Add a tModel

+
    +
  1. + On the UDDI Services UDDI menu, click Publish. +
  2. + Click the tModels tab.
  3. + Click Add tModel.
    + A new tModel entry, + (New tModel) + appears. +
  4. + In the details area, click Edit. +
  5. + In tModel Name, type a unique name for this tModel. +
  6. +
  7. + Click Update.
  8. +
  9. + Click Add Description. +
  10. + In the Language + list, select a language for this description. +
  11. + In Description, type a brief description for this tModel. +
  12. +
  13. + Click Update.
  14. +
  15. + To add additional descriptions in other languages, repeat steps 6 through 9.
  16. +
+ +

Add categories

+ Categories describe this tModel and the functions it identifies, such + as a categorization scheme or interface type. +
    +
  1. + Click the Categories + tab. +
  2. + Click Add Category.
  3. +
  4. + Select an appropriate categorization scheme and subcategory.
    +
  5. +
  6. + Click Add Category.
  7. +
  8. + To add additional categories, repeat steps 2 through 5.
  9. +
+ +

Specify the Overview Document URL

+ The overview document URL provides the location of a file that contains additional + information or resources that are associated with this tModel. For example, it may contain a + WDSL (Web Services Description Language) file or other interface description. +
    +
  1. + Click the Overview Document URL + tab. +
  2. + Click Edit. +
  3. + Specify the URL where the overview document for this tModel can be found.
    + For example: http://www.wideworldimporters.com/SampleWebService.asmx
  4. +
  5. + Click Update.
  6. +
  7. + Click Add Description. +
  8. + In the Language + list, select a language for this description. +
  9. + In Description, type a description for this overview document.
  10. +
  11. + Click Update.
  12. +
  13. + To add additional descriptions in other languages, repeat steps 5 through 8.
  14. +
+

+ You have now published a tModel in UDDI Services. Repeat these + procedures to publish additional tModels. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.context.bindingaddinstance.aspx b/inetsrv/uddi/source/help/ui/publish.context.bindingaddinstance.aspx new file mode 100644 index 0000000..a16e6e3 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.bindingaddinstance.aspx @@ -0,0 +1,48 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Binding Binding - Instance Add Instance

+

+ Use this tab to locate a tModel and associate it with a binding. For example, you may want to create a reference to a tModel that contains an interface definition file that describes interfaces supported by a binding. + +

    +
  • + Search for tModel names containing: Provides a space for you to type all or part of the name of the tModel you want to reference. +
  • + +
      +
    • + Click Search to search for tModels by name. +
    • +
    • + Click Cancel to cancel this process. +
    • +
    +
+ + +

More Information

+ +

+ +

+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.bindinginstanceinfo.aspx b/inetsrv/uddi/source/help/ui/publish.context.bindinginstanceinfo.aspx new file mode 100644 index 0000000..ef09b9f --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.bindinginstanceinfo.aspx @@ -0,0 +1,38 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Binding Binding - instance info Instance Info

+ Use the Instance Info tab to view, edit, or delete the instance infos that are associated with a service. +
    +
  • + Instance Infos: Lists the instance infos that are associated with this binding. +
      +
    • Click View to view an instance info.
    • +
    • Click Delete to permanently delete an instance info.
    • +
    • Click Add Service to add an instance info to this binding..
    • +
    +
+

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.providercontacts.aspx b/inetsrv/uddi/source/help/ui/publish.context.providercontacts.aspx new file mode 100644 index 0000000..dade6a7 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.providercontacts.aspx @@ -0,0 +1,38 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Contact Contacts

+ Use the Contacts tab to view and modify the contacts associated with this provider. +
    +
  • + Contacts: Lists the contacts associated with this provider. +
      +
    • Click Add Contact to add a contact to this provider.
    • +
    • Click View to view a contact.
    • +
    • Click Delete to permanently delete a contact.
    • +
    +
+

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.providerservices.aspx b/inetsrv/uddi/source/help/ui/publish.context.providerservices.aspx new file mode 100644 index 0000000..22e2566 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.providerservices.aspx @@ -0,0 +1,38 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Service Services

+ Use the Services tab to view or modify the services published by this provider. +
    +
  • + Services: Lists the services that are published by this provider. +
      +
    • Click Add Service to add a service to this provider.
    • +
    • Click View to view a service.
    • +
    • Click Delete to permanently delete a service.
    • +
    +
+

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publish.aspx b/inetsrv/uddi/source/help/ui/publish.context.publish.aspx new file mode 100644 index 0000000..6728ecd --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publish.aspx @@ -0,0 +1,33 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

My UDDI My UDDI

+ The My UDDI tab is your starting point in + UDDI Services. + UDDI. + Select either the Providers or tModels tab to manage and view your providers or tModels. + +

+ If you are not yet familiar with publishing in UDDI Services, see the Introduction to Publishing in UDDI Services. +

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishbindingdetails.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishbindingdetails.aspx new file mode 100644 index 0000000..4dde4f5 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishbindingdetails.aspx @@ -0,0 +1,55 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Binding Binding - Details

+ Use the Details tab to view or modify the access point and descriptions of + this binding. +
    +
  • + Access Point: Lists the Uniform Resource Locator (URL) where you can access this binding and the + protocol it supports. +
      +
    • + Click Edit to modify the access point or URL type of this binding. +
    • +
    +
  • +
  • + Description: Lists descriptions of this binding and the language for + which each description is written. +
      +
    • + Click Add Description to add a description. +
    • +
    • + Click Edit to edit a description. +
    • +
    • + Click Delete to delete a description. +
    • +
    +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishcontactaddress.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishcontactaddress.aspx new file mode 100644 index 0000000..e2dba80 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishcontactaddress.aspx @@ -0,0 +1,46 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Contact Contact - Address

+ Use the Address tab to manage the physical or mailing addresses that are + available for this contact. +
    +
  • + Address: Contains the addresses and respective Use Types for this + contact. +
      +
    • + Click Add Address to add an address and Use Type to this contact. +
    • +
    • + Click Edit to modify an address or Use Type. +
    • +
    • + Click Delete to remove an address from this contact. +
    • +
    +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishcontactdetails.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishcontactdetails.aspx new file mode 100644 index 0000000..67b6bd9 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishcontactdetails.aspx @@ -0,0 +1,57 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Contact Contact - Details

+ Use the Details tab to manage the name and descriptions of this contact. +
    +
  • + Name: Lists the name and Use Type of this contact. A name typically + includes the title of an individual or a group, such as "John Smith, Sales + Lead" or "IT Department, Support Requests." +
      +
    • + Click Edit to modify the name and Use Type of this contact. +
    • +
    +
  • +
  • + Description: Gives descriptions for this contact and the language for + which each description is written. A description provides detailed + information about this contact, such as an area of expertise or usage + conditions. +
  • +
      +
    • + Click Add Description to add a description. +
    • +
    • + Click Edit to edit a description. +
    • +
    • + Click Delete to delete a description. +
    • +
    +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishcontactemail.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishcontactemail.aspx new file mode 100644 index 0000000..920b22a --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishcontactemail.aspx @@ -0,0 +1,46 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Contact - E-mail

+ Use the E-mail tab to manage the e-mail addresses available for this + contact. +
    +
  • + E-mail: Lists the e-mail addresses and respective Use Types for this + contact. +
      +
    • + Click Add E-mail to add an e-mail address and Use Type to this contact. +
    • +
    • + Click Edit to modify an e-mail address and Use Type to this contact. +
    • +
    • + Click Delete to remove an e-mail address from this contact. +
    • +
    +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishcontactphone.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishcontactphone.aspx new file mode 100644 index 0000000..91f36aa --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishcontactphone.aspx @@ -0,0 +1,46 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

contact Contact - Phone

+ Use the Phone tab to manage the phone numbers available for this + contact. +
    +
  • + Phone: Lists the phone numbers and respective Use Types for this + contact. +
      +
    • + Click Add Phone to add a phone number and Use Type to this contact. +
    • +
    • + Click Edit to modify a phone number or Use Type. +
    • +
    • + Click Delete to remove a phone number from this contact. +
    • +
    +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinfodetails.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinfodetails.aspx new file mode 100644 index 0000000..45a81e3 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinfodetails.aspx @@ -0,0 +1,54 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

instance infoInstance Info - Details

+ Use the Details tab to view or modify the name and descriptions of this + instance info. +
    +
  • + Interface tModel: The name of the tModel this instance info refers to. +
  • +
  • + tModel Key: Displays the unique key that is associated with the tModel that is referenced by this instance info. It is used during programmatic queries. +
  • +
  • + Description: Lists descriptions of this instance info and the + language for which each description is written. +
  • +
      +
    • + Click Add Description to add a description. +
    • +
    • + Click Edit to modify a description. +
    • +
    • + Click Delete to delete a description. +
    • +
    +
+

More Information

+ + + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinfooverviewdocument.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinfooverviewdocument.aspx new file mode 100644 index 0000000..2867eb0 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinfooverviewdocument.aspx @@ -0,0 +1,56 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Instance Info - Overview Document

+ Use the Overview Document tab to view or modify the overview document Uniform Resource Locator (URL) +and its descriptions. +
    +
  • + Overview Document URL: Displays the URL where the overview document that is used for this instance info is located. For +example, it may display the URL where an interface definition document or Web Services Description Language (WSDL) file is located. +
      +
    • + Click Edit to modify the URL of the overview document. +
    • +
    +
  • + Description: Contains descriptions for this overview document and the + language for which each description is written. +
      +
    • + Click Add Description to add a description to this overview document. +
    • +
    • + Click Edit to modify a description of this overview document. +
    • +
    • + Click Delete to delete a description of this overview document. +
    • +
    +
  • +
+

More Information

+ + + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinstanceinfodetails.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinstanceinfodetails.aspx new file mode 100644 index 0000000..dcc7f70 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishinstanceinstanceinfodetails.aspx @@ -0,0 +1,55 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

instance info Instance Info - Instance Details

+ Use the Instance Details tab to view or modify the parameters you want to publish for this instance info. +
    +
  • + Instance Parameters: Lists the parameters that are supported by this instance info. +
      +
    • + Click Edit to edit the instance parameters for this instance info. +
    • +
    +
  • +
  • + Description: Lists descriptions of this instance parameter and the + language for which each description is written. +
  • +
      +
    • + Click Add Description to add a description. +
    • +
    • + Click Edit to modify a description. +
    • +
    • + Click Delete to delete a description. +
    • +
    +
+

More Information

+ + + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishprovidercategories.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishprovidercategories.aspx new file mode 100644 index 0000000..4422a1b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishprovidercategories.aspx @@ -0,0 +1,39 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Categories

+ Use the Categories tab to view and manage the categories that describe and classify this provider. +
    +
  • + Categories: Lists the categories that describe this provider. A categorization includes the name of categorization scheme, followed by the category name (or key name) and value (key value). +
      +
    • + Click Add Category to add a categorization to this provider.
    • +
    • + Click Delete to delete a categorization.
    • +
    +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishproviderdetails.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishproviderdetails.aspx new file mode 100644 index 0000000..d58635b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishproviderdetails.aspx @@ -0,0 +1,66 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Details

+ Use the Details tab to manage the name and descriptions of this + provider. +
    +
  • + Owner: Displays the name of the user that owns this provider. +
  • +
  • + Provider Key: Displays the unique key that is assigned to this provider which is used during programmatic queries. +
  • +
  • + Name: Lists the names of this provider. If more than one name is provided, the default name appears at the top of the list. +
      +
    • + Click Add Name to add a name in a different language. +
    • +
    • + Click Edit to modify a name. +
    • +
    • + Click Delete to delete a name. +
    • +
    +
  • +
  • + Description: Lists descriptions for this provider and the language + for which each description is written. +
  • +
      +
    • + Click Add Description to add a description. +
    • +
    • + Click Edit to modify a description. +
    • +
    • + Click Delete to delete a description. +
    • +
    +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishproviderdiscoveryurls.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishproviderdiscoveryurls.aspx new file mode 100644 index 0000000..7281ce5 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishproviderdiscoveryurls.aspx @@ -0,0 +1,45 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider - Discovery URLs

+ Use the Discovery URLs tab to view and manage the discovery Uniform Resource Locators (URLs) associated with this provider. Add discovery URLs for any additional information that you would like to associate with this provider and make available to others. +
    +
  • + Discovery URLs: Lists the URLs of any additional information that you would like to associate with this provider. The URL and Use Type are listed for each entry. +
  • +
      +
    • + Click Add URL to add a discovery URL. +
    • +
    • + Click Edit to modify a discovery URL. +
    • +
    • + Click Delete to delete a discovery URL. +
    • + +
    +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishprovideridentifiers.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishprovideridentifiers.aspx new file mode 100644 index 0000000..4fe0f56 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishprovideridentifiers.aspx @@ -0,0 +1,45 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + +
+

Provider Provider - Identifiers

+ Use the Identifiers tab to manage the identification schemes associated with this provider. +
    +
  • Identifiers: Lists the identification schemes that are associated with this provider. The name of each identification scheme is followed by its unique name (or key name) and value (or key value). +
      +
    • + Click Add Identifier to add an identifier. +
    • +
    • + Click Edit to modify an identifier. +
    • +
    • + Click Delete to delete an identifier. +
    • + +
    +
  • +
+

+

More Information

+ +

+
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishproviderrelationships.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishproviderrelationships.aspx new file mode 100644 index 0000000..8aab891 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishproviderrelationships.aspx @@ -0,0 +1,69 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Relationships

+ Use the Relationships tab to view and manage relationships with other providers. +
    +
  • + Relationships: Lists the published relationships with other providers. The provider names, direction, status, and type are listed for each entry. +
      +
    • + Click Add Relationship to add a new relationship to this provider. + +
    • +
    • + Click Delete to permanently delete a relationship. +
    • + +
    + +
  • +
  • + Pending Relationships Lists the relationships that are pending your approval. +
  • +
      +
    • + Click Accept to accept a relationship that is submitted by another provider. +
    • +
    +
  • Types of relationships + +
      +
    • + Identity: Both providers represent the same organization. +
    • +
    • + Parent-child: One provider is a parent of the other provider, such as a subsidiary. +
    • +
    • + Peer-peer: One provider is a peer of the other provider. +
    • + +
    +
  • +
+ +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishproviders.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishproviders.aspx new file mode 100644 index 0000000..3daa722 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishproviders.aspx @@ -0,0 +1,47 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Providers

+ Use the Providers tab to manage your existing providers or add new ones. +
    +
  • + Providers Lists the names of the providers you have published in UDDI Services +. +
      + +
    • + Click Add Provider to add a new provider. +
    • +
    • + Click View to view the attributes of a provider. +
    • +
    • + Click Delete to permanently delete a provider. +
    • +
    +
  • +
+

More Information

+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishservicecategories.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishservicecategories.aspx new file mode 100644 index 0000000..41049d0 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishservicecategories.aspx @@ -0,0 +1,41 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Service Service - Categories

+ Use the Categories tab to view and manage the categorizations of this service. +
    +
  • + Categories: Lists the categories that are associated with this service. The name of each categorization scheme is followed by the category name (key name) and value (key value) +
      +
    • + Click Add Category to add a categorization to this service.
    • +
    • + Click Delete to delete a categorization.
    • +
    +
  • +
+ +

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishservicedetails.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishservicedetails.aspx new file mode 100644 index 0000000..6ecb1af --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishservicedetails.aspx @@ -0,0 +1,65 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Service Service - Details

+ Use the Details tab to view and manage the names and descriptions of this service. +
    +
  • + Service Key Displays the unique key associated with this service used during programmatic queries. +
  • + +
  • + Name: Displays the names of this service and the language for which each + name is written. +
      +
    • + Click Edit to modify a name of this service. +
    • +
    • + Click Add Name to add a name in a different language to this service. +
    • +
    • + Click Delete to delete a name of this service. You cannot delete the last name of a service. +
    • + +
    +
  • +
  • + Description: Lists descriptions for this service and the language for + which each description is written. +
  • +
      +
    • + Click Add Description to add a description to this service. +
    • +
    • + Click Edit to modify a description of this service. +
    • +
    • + Click Delete to delete a description of this service. +
    • +
    +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishtmodelcategories.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishtmodelcategories.aspx new file mode 100644 index 0000000..6ea57ed --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishtmodelcategories.aspx @@ -0,0 +1,41 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Categories

+ Use the Categories tab to manage the categorizations of this tModel. +
    +
  • + + Categories: Lists the categories that describe this tModel and the function they serve. The name of each categorization scheme is followed by the category name (or key name) and value (or key value). +
      +
    • + Click Add Category to add a categorization to this tModel.
    • +
    • + Click Delete to delete a categorization.
    • +
    +
  • +
+

More Information

+ + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishtmodeldetails.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishtmodeldetails.aspx new file mode 100644 index 0000000..f1d2d06 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishtmodeldetails.aspx @@ -0,0 +1,60 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Details

+ Use the Details tab to view and manage the name and descriptions of this tModel. +
    +
  • + Owner: Displays the name of the user that owns this entity. +
  • +
  • + tModel Key: Displays the unique key associated with this tModel used during programmatic queries. +
  • + +
  • + Name: Displays the name of this tModel. +
      +
    • + Click Edit to modify the name of this tModel. +
    • +
    +
  • +
  • + Description: Lists the descriptions for this tModel and the language for + which each description is written. +
  • +
      +
    • + Click Add Description to add a description to this binding. +
    • +
    • + Click Edit to modify a description of this binding. +
    • +
    • + Click Delete to delete a description of this binding. +
    • +
    +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishtmodelidentifiers.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishtmodelidentifiers.aspx new file mode 100644 index 0000000..3261771 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishtmodelidentifiers.aspx @@ -0,0 +1,45 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Identifiers

+ Use the Identifiers tab to view and manage the identification schemes associated with this tModel. +
    +
  • + Identifiers: Lists the identification schemes associated with this tModel. The + name of the associated identification scheme is followed by its unique name (or key name) and value (or key value). +
      +
    • + Click Add Identifier to add an identifier. +
    • +
    • + Click Edit to modify an identifier. +
    • +
    • + Click Delete to delete an identifier. +
    • +
    +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishtmodeloverviewdocument.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishtmodeloverviewdocument.aspx new file mode 100644 index 0000000..2983ff3 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishtmodeloverviewdocument.aspx @@ -0,0 +1,54 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Overview Document

+ Use the Overview Document tab to view or modify the overview document + URL (Uniform Resource Locator) and its descriptions for this tModel. +
    +
  • + Overview Document URL: Displays the URL where the overview document + for this tModel is located. For example, it may give the URL where an interface definition document or Web Services Description Language (WSDL) file is kept. +
      +
    • + Click Edit to modify the URL of the overview document. +
    • +
    +
  • + Description: Lists descriptions for this overview document and the + language for which each description is written. +
      +
    • + Click Add Description + to add a description to this overview document. +
    • + Click Edit + to modify a description of this overview document. +
    • + Click Delete to delete a description of this overview document. +
    • +
    +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.context.publishtmodels.aspx b/inetsrv/uddi/source/help/ui/publish.context.publishtmodels.aspx new file mode 100644 index 0000000..bf0f7dd --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.publishtmodels.aspx @@ -0,0 +1,46 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModels

+ Use the tModels tab to manage your existing tModels or add new ones. +
    +
  • + tModel: Lists the names of the tModels you have published in UDDI Services. +
      +
    • + Click Add tModel to add a new tModel. +
    • +
    • + Click View to view the attributes of a tModel. +
    • +
    • + Click Delete to permanently delete a tModel. +
    • + +
    +
  • +
+

More Information

+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.context.serviceeditbinding.aspx b/inetsrv/uddi/source/help/ui/publish.context.serviceeditbinding.aspx new file mode 100644 index 0000000..c0a4571 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.context.serviceeditbinding.aspx @@ -0,0 +1,45 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Service Service - Binding Bindings

+ Use the Bindings tab to view or modify the bindings for this service. +
    +
  • Binding Lists the bindings associated with this service. +
      +
    • + Click Add Binding to add a binding to this service. +
    • +
    • + Click View to view a binding. +
    • +
    • + Click Delete to permanently delete a binding from this service. +
    • + +
    +
+

More Information

+ +

+ +

+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.delete.aspx b/inetsrv/uddi/source/help/ui/publish.delete.aspx new file mode 100644 index 0000000..44ec4a0 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.delete.aspx @@ -0,0 +1,43 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Delete Entities

+

+ You can delete any provider, contact, service, binding, instance info, or tModel that you have published; + you cannot delete entities owned by other publishers.

+ + +

To delete information from another publisher, contact a UDDI Services Coordinator.

+
+ + +

To delete an entity

+
    +
  1. + On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Locate the entity you want to delete and, next to their name, click Delete, and then click OK.
  4. +
+

To delete additional providers, contacts, services, bindings, instance infos, or + tModels, repeat this procedure. +

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.footer.htm b/inetsrv/uddi/source/help/ui/publish.footer.htm new file mode 100644 index 0000000..61334c4 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.footer.htm @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + +

+
+ Help Home  | + Publishing in UDDI Services  +
©2002 Microsoft Corporation +
+ All rights reserved.

+
+ + diff --git a/inetsrv/uddi/source/help/ui/publish.gettingstarted.aspx b/inetsrv/uddi/source/help/ui/publish.gettingstarted.aspx new file mode 100644 index 0000000..ed32a75 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.gettingstarted.aspx @@ -0,0 +1,127 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Step-by-Step Guide to Publishing a Web Service

+

+ UDDI Services enables you to publish and share information about XML Web services with other users and applications. Before you begin publishing, you should first become familiar with your organization's publishing guidelines. Publishing guidelines help to ensure consistent and complete publications by all UDDI Services publishers. Typical guidelines include suggested entity structures—who or what a provider is—typical contacts, naming conventions, service publication structures, standard interface definitions to use, and the categorization and identification schemes available to describe and group your entities.

+

Before you begin, it is recommended that you collect all of the technical information about the service you want to publish in UDDI Services. If you are not yet familiar with how information is organized in UDDI Services or want to learn more about publishing guidelines, you should review the Introduction to UDDI Services before proceeding.

+ + Jump to: Publish a Service Provider, Add Contact InformationPublish a Service, Publish a Binding, Add Instance Information. + + +

Publish a Service Provider - Provider

+ Before you can publish a Web service, you must first create its provider. This provider represents the group or organization that is responsible for the service you are ready to publish and should be defined in accordance with your publishing guidelines. +
    +
  1. On the UDDI Services menu, click Publish.
  2. +
  3. Click the Providers tab.
  4. +
  5. Click Add Provider.
  6. +
+
    +
  • On the Details tab, assign this provider a name and description in the languages appropriate for your organization. Names and descriptions provide a means of searching for this provider, identifying who or what it is, and understanding the types of services it provides. If this provider shares services with users in different languages, you can provide additional names and descriptions for each language as needed. +
  • (Optional) On the Identifiers tab, add and define the identification schemes that are appropriate to this provider. Identification schemes provide an additional means of grouping entities together and enable the discovery of logically-grouped entities when searching. +
  • On the Categories tab, add the categories that describe and classify this provider. Categories provide descriptive information about this provider, such as its geographical location, the services it provides, or any other appropriate classification. They are used during searches and queries to locate providers of a particular type, classification, or attribute. Assign the appropriate classifications to this provider so that it can be discovered logically and intuitively by either human search or programmatic query. +
  • (Optional) On the Discovery URLs tab, add any additional discovery URLs, if necessary. If you have additional information about this provider you want make available, add a discovery URL pointing to the location where this information can be located. +
  • (Optional) On the Relationships tab, publish any relevant relationships with this provider, if appropriate. Relationships are useful when describing an organizational structure or advertising partnerships between providers. If you create a relationship with a provider owned by another publisher, that relationship will not be published until it is approved by the other publisher. +
+

After adding and defining a provider, you may proceed to publish the contacts available for support or assistance with your services.

+ +

Add Contact Information - Contact

+ Add a contact for each contact point within your organization that can be contacted for support or assistance about a provider or the services it provides. +
    +
  1. On the UDDI Services menu, click Publish.
  2. +
  3. Click the Providers tab.
  4. +
  5. Locate the provider that to which you want to add a contact and, next to its name, click View.
  6. +
  7. Click the Contacts tab.
  8. +
  9. Click Add Contact.
  10. +
+
    +
  • On the Details tab, assign this contact a name, use type, and description in all appropriate languages. Names, use types, and descriptions provide a means of identifying who or what this contact is and the type of assistance or support they provide. +
  • (Optional) On the E-mail tab, add the e-mail addresses available for this contact. +
  • (Optional) On the Phone tab, add the phone numbers available for this contact. +
  • (Optional) On the Address tab, add the addresses available for this contanct. +
+ After adding and defining the contacts for this provider, you may proceed to publish your service. + +

Publish a Service - Service

+

+ Create a new service entity within its provider. This service represents the XML Web service you want to publish in UDDI Services and should be defined in accordance with your publishing guidelines. +

    +
  1. On the UDDI Services menu, click Publish.
  2. +
  3. Click the Providers tab.
  4. +
  5. Locate the provider to which you would like to add a service and, next to its name, click View.
  6. +
  7. Click the Services tab.
  8. +
  9. Click Add Service.
  10. +
+

+

    +
  • On the Details tab, assign this service a name and description in all appropriate languages. Names and descriptions provide a means of searching for this service, identifying what it is, and understanding the types of functions it serves. +
  • On the Categories tab, add the categories that describe this service and the functions it provides. Categories are used during searches and queries to locate services of a particular type, classification, or attribute. Assign the classifications that are appropriate to this service so that it can be discovered by either searching or programmatic inquiry. +
+ After you have created and defined your service, you may proceed to publish its bindings. +

+ +

Publish a Binding - Binding

+ Create a binding for each of the access points to your service that you want to publish and expose. An access point is any point within your application or Web service where a function can be invoked. The number of bindings you publish will depend upon the number of access points you want to expose through UDDI Services and should be defined in accordance with your publishing guidelines. +
    +
  1. On the UDDI Services menu, click Publish.
  2. +
  3. Click the Providers tab.
  4. +
  5. Locate the provider that contains the service to which you want to add a binding and, next to its name, click View.
  6. +
  7. Click the Services tab.
  8. +
  9. Select the service to which you want to add a binding.
  10. +
  11. Click the Bindings tab.
  12. +
  13. Click Add Binding.
  14. +
+
    +
  • On the Details tab, define the access point where this interface can be invoked and provide descriptions about it in all appropriate languages. The access point describes the URL where this interface can be accessed and the protocol it supports, such as:
    http://www.contoso.com/mywebservice.asmx
    (http). +
+ After creating and defining a binding for each access point you want to share, you may proceed to add an instance info for each of the interfaces to those access points you want to expose. +

+

Add Instance Information - instance info

+ Create an instance info for each interface to a binding you want to publish. An instance info is a reference to a tModel that contains relevant technical information, such as a standard interface definition of its supported functions or calls. +
    +
  1. On the UDDI Services menu, click Publish.
  2. +
  3. Click the Providers tab.
  4. +
  5. Locate the provider that contains the service that contains the binding to which you want to add an instance info and, next to its name, click View.
  6. +
  7. Click the Services tab.
  8. +
  9. Locate the service that contains the binding to which you want to add an instance info and, next to its name, click View.
  10. +
  11. Click the Bindings tab.
  12. +
  13. Locate the binding to which you want to add an instance info and, next to its name, click View.
  14. +
  15. Click the Instance Info tab.
  16. +
  17. Click Add Instance Info.
  18. +
+
    +
  • Locate any tModels that contains relevant technical information and create an instance info of each. For example, create an instance info of a tModel that contains a definition for a standard interface that is used by your group and supported by this binding. If no appropriate tModels exist, create and define new ones with the information you require, then create instance infos of them on the appropriate bindings. +
+
    +
  1. Define the attributes for each instance info you associate with this binding. +
+
    +
  • On the Details tab, provide a description for this instance info in all appropriate languages.
  • +
  • (Optional) On the Instance Details tab, add and describe the parameters supported by this instance info.
  • +
  • (Optional) On the Overview Document tab, add the URL where the overview document for this instance info is located, if necessary. This information supplements the information already associated with the tModel referenced by this instance info.
  • +

    +

+

+ When you are done adding instance infos to each binding, go back through your entire publication and verify that the information is accurate. Search for your service and its provider using the various search mechanisms available and verify that you can locate all of your information intuitively.

+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.glossary.aspx b/inetsrv/uddi/source/help/ui/publish.glossary.aspx new file mode 100644 index 0000000..78eb5c7 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.glossary.aspx @@ -0,0 +1,26 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/publish.header.htm b/inetsrv/uddi/source/help/ui/publish.header.htm new file mode 100644 index 0000000..4b0ab7b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.header.htm @@ -0,0 +1,18 @@ + + + +Publishing in UDDI Services + + + +Publishing in UDDI + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.heading.htm b/inetsrv/uddi/source/help/ui/publish.heading.htm new file mode 100644 index 0000000..313eab8 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.heading.htm @@ -0,0 +1,26 @@ + + + + + + + + + + +
+ + + + + +
+ Help Home
+ Publishing in UDDI Services
+ Glossary +
+
+
+
+ + diff --git a/inetsrv/uddi/source/help/ui/publish.modify.aspx b/inetsrv/uddi/source/help/ui/publish.modify.aspx new file mode 100644 index 0000000..bc8a4c7 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.modify.aspx @@ -0,0 +1,48 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to modify data

+

+ You can modify any provider, contact, service, binding, instance info, or tModel that you have published; + you cannot modify data owned by other publishers.

+ + +

To modify information from another publisher, contact a UDDI Services Coordinator.

+
+ + +

To modify an entity

+
    +
  1. + On the UDDI Services UDDI menu, click Publish.
  2. +
  3. Locate and select the entity you want to modify.
  4. +
  5. + In the details area, click an appropriate tab and then click the appropriate action - Add, Edit or Delete - + next to the attribute you want to modify.
  6. + +
+

To modify additional providers, contacts, services, bindings, instance infos, or + tModels, repeat this procedure. + +

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.publishinuddiservices.aspx b/inetsrv/uddi/source/help/ui/publish.publishinuddiservices.aspx new file mode 100644 index 0000000..464d261 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.publishinuddiservices.aspx @@ -0,0 +1,45 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Introduction to Publishing

+

+ The information presented in this introduction relies upon your understanding of how information is organized in UDDI Services. If you are not yet familiar with this, please review the Introduction to UDDI Services before proceeding.

+

+ With UDDI Services, you can publish and share information about XML Web services with other users and applications. When you publish a Web service using UDDI Services, you are providing the information that is necessary for these users and applications to locate and interact with your service. While you are adding, editing, and deleting information in UDDI Services, always ensure that your modifications are accurate and will not affect any other service publications adversely. Additions, modifications, and deletions to data are immediate and permanent. + +

Publishing Guidelines

+ Before you begin publishing, you should identify how your Web service publications are going to be organized. A consistent organization and modeling of data will help to ensure that all participants can locate and interact with your services quickly and efficiently. Your UDDI Services coordinator should have additional information about your organization's publishing guidelines.

+

Publishing guidelines should include:

+
    +
  • A description and example of the type of organization or grouping that a provider represents.
  • +
  • A naming convetion for your providers, services, and tModels.
  • +
  • A description of the modeling and example of a service publication structure.
  • +
  • The names and descriptions of any tModels representing standard interface definitions available.
  • +
  • The names and descriptions of any categorization schemes or identifications schemes that should be used.
  • +
+ + The purpose of your publications is to provide others with a means of discovering and interacting with your services. Name, describe, categorize, and give details about each entity that you publish to help ensure that they are discovered and used as intended. For additional publication and information regarding best practices, see Additional Resources on the UDDI Services page on the Microsoft Web site. +

+ Now that you understand how information is published in UDDI Services, you should read the Step-by-Step-Guide to Publishing a Web Service. +

+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.toc.aspx b/inetsrv/uddi/source/help/ui/publish.toc.aspx new file mode 100644 index 0000000..03203b7 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.toc.aspx @@ -0,0 +1,82 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + + + +
+ + +

Publishing in UDDI Services

+
+ + +

Publishing in UDDI

+
+ + +

+ + +

 Getting Started +
+ + + +
 How to ... +
+ +
+ + + +
+

See also +

+ + +
bullet Additional Resources on the UDDI Services Web page on the Microsoft Web site
+ +
+ Publishing Guide +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/publish.troubleshooting.aspx b/inetsrv/uddi/source/help/ui/publish.troubleshooting.aspx new file mode 100644 index 0000000..34fb2aa --- /dev/null +++ b/inetsrv/uddi/source/help/ui/publish.troubleshooting.aspx @@ -0,0 +1,25 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Troubleshooting

+
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.bindingdetails.aspx b/inetsrv/uddi/source/help/ui/search.context.bindingdetails.aspx new file mode 100644 index 0000000..307fd4f --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.bindingdetails.aspx @@ -0,0 +1,40 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Binding Binding - Details

+ + Use the Details tab to view the access point and descriptions of + this binding. +
    +
  • + Access Point: Displays the Uniform Resource Locator (URL) where this binding can be accessed and the + protocol it supports. +
  • +
  • + Description: Contains descriptions of this binding and the language for + which each description is written. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.bindinginstanceinfos.aspx b/inetsrv/uddi/source/help/ui/search.context.bindinginstanceinfos.aspx new file mode 100644 index 0000000..4dad7c4 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.bindinginstanceinfos.aspx @@ -0,0 +1,33 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Binding Binding - instance info Instance Info

+ Use the Instance Info tab to view the instance infos that are associated with a service. +
    +
  • + Instance Infos: Lists the instance infos associated with this binding. +
+

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.contactaddress.aspx b/inetsrv/uddi/source/help/ui/search.context.contactaddress.aspx new file mode 100644 index 0000000..3af7777 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.contactaddress.aspx @@ -0,0 +1,35 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Contact Contact - Address

+ Use the Address tab to view the mailing addresses + that are available for this contact. +
    +
  • + Address: Lists the addresses and respective Use Types for this + contact. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.contactdetails.aspx b/inetsrv/uddi/source/help/ui/search.context.contactdetails.aspx new file mode 100644 index 0000000..8624780 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.contactdetails.aspx @@ -0,0 +1,40 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Contact Contact - Details

+ Use the Details tab to view the name and descriptions of this contact. +
    +
  • + Contact: Displays the name of this contact. +
  • +
  • + Use Type: Displays the intended use type of this contact. +
  • +
  • + Description: Lists the descriptions of this contact and the language for + which each description is written. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.contactemails.aspx b/inetsrv/uddi/source/help/ui/search.context.contactemails.aspx new file mode 100644 index 0000000..0ea19b8 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.contactemails.aspx @@ -0,0 +1,35 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Contact - E-mail

+ Use the E-mail tab to view the e-mail addresses that are available for this + contact. +
    +
  • + E-mail: Lists the e-mail addresses and respective Use Types for this + contact. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.contactphones.aspx b/inetsrv/uddi/source/help/ui/search.context.contactphones.aspx new file mode 100644 index 0000000..3a3a81b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.contactphones.aspx @@ -0,0 +1,35 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

contact Contact - Phone

+ Use the Phone tab to view the phone numbers that are available for this + contact. +
    +
  • + Phone: Lists the phone numbers and respective Use Types for this + contact. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.instanceinfodetails.aspx b/inetsrv/uddi/source/help/ui/search.context.instanceinfodetails.aspx new file mode 100644 index 0000000..34d62fc --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.instanceinfodetails.aspx @@ -0,0 +1,39 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

instance infoInstance Info - Details

+ Use the Details tab to view the name and descriptions of this + instance info. +
    +
  • + Interface tModel: Displays the name of the tModel that this instance info refers to and its unique key for programmatic queries. +
  • +
  • + Description: Lists descriptions of this instance info and the + language for which each description is written. +
  • +
+

More Information

+ + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.instanceinfoinstancedetails.aspx b/inetsrv/uddi/source/help/ui/search.context.instanceinfoinstancedetails.aspx new file mode 100644 index 0000000..4d4ab5b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.instanceinfoinstancedetails.aspx @@ -0,0 +1,39 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

instance info Instance Info - Instance Details

+ Use the Instance Details tab to view the published parameters for this instance info. +
    +
  • + Instance Parameters: Lists the parameters that are supported by this instance info. +
  • +
  • + Description: Lists descriptions of this instance parameter and the + language for which each description is written. +
  • + +
+

More Information

+ + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.instanceinfooverviewdocument.aspx b/inetsrv/uddi/source/help/ui/search.context.instanceinfooverviewdocument.aspx new file mode 100644 index 0000000..dbe0514 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.instanceinfooverviewdocument.aspx @@ -0,0 +1,38 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Instance Info - Overview Document

+ Use the Overview Document tab to view the overview document URL for this instance info and its descriptions. +
    +
  • + Overview Document URL: Displays the Uniform Resource Locator (URL) where the overview document for this instance info is located. For +example, it may display the URL where an interface definition document or Web Services Description Language (WSDL) file is hosted. +
  • + Description: Lists descriptions for this overview document and the + language for which each description is written. +
  • +
+

More Information

+ + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.providercategories.aspx b/inetsrv/uddi/source/help/ui/search.context.providercategories.aspx new file mode 100644 index 0000000..ab2b687 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.providercategories.aspx @@ -0,0 +1,33 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Categories

+ Use the Categories tab to view the categories that describe and classify this provider. +
    +
  • + Categories: Lists the categories that describe this provider. A categorization includes the name of the categorization scheme followed by the category name (or key name) and value (or key value). +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.providercontacts.aspx b/inetsrv/uddi/source/help/ui/search.context.providercontacts.aspx new file mode 100644 index 0000000..5fa960b --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.providercontacts.aspx @@ -0,0 +1,33 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Contact Contacts

+ Use the Contacts tab to view the contacts that are associated with this provider. +
    +
  • + Contacts: Lists the contacts that are associated with this provider. Click any contact to view more information about it. +
+

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.providerdetails.aspx b/inetsrv/uddi/source/help/ui/search.context.providerdetails.aspx new file mode 100644 index 0000000..586b674 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.providerdetails.aspx @@ -0,0 +1,44 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Details

+ Use the Details tab to manage the name and descriptions of this + provider. +
    +
  • + Owner: Displays the name of the user that owns this provider. +
  • +
  • + Provider Key: Displays the unique key that is assigned to this provider. It is used during programmatic queries. +
  • +
  • + Name: Lists the names of this provider. If more than one name is provided, the default name appears at the top of the list. +
  • +
  • + Description: Lists descriptions for this provider and the language + for which each description is written. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.providerdiscoveryurls.aspx b/inetsrv/uddi/source/help/ui/search.context.providerdiscoveryurls.aspx new file mode 100644 index 0000000..62337cf --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.providerdiscoveryurls.aspx @@ -0,0 +1,33 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider - Discovery URLs

+ Use the Discovery URLs tab to view the discovery Uniform Resource Locators (URLs) associated with this provider. +
    +
  • + Discovery URLs: Lists the URLs of any information that is associated with this provider. A URL and Use Type are listed for each. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.provideridentifiers.aspx b/inetsrv/uddi/source/help/ui/search.context.provideridentifiers.aspx new file mode 100644 index 0000000..6d347fc --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.provideridentifiers.aspx @@ -0,0 +1,33 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Identifiers

+ Use the Identifiers tab to view the identification schemes associated with this provider. +
    +
  • Identifiers: Displays a list of the identification schemes associated with this provider. The name of each identification scheme is followed by its unique name (or key name) and value (or key value). +
  • +
+

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.providerrelationships.aspx b/inetsrv/uddi/source/help/ui/search.context.providerrelationships.aspx new file mode 100644 index 0000000..7229a5f --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.providerrelationships.aspx @@ -0,0 +1,35 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Relationships

+ Use the Relationships tab to view the published relationships between this provider and other UDDI Services providers. +
    +
  • + Relationships: Lists the published relationships with other providers. The provider names, direction of relationship, and type of relationship are listed for each entry. +
  • +
+
+

More Information

+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.context.providerservices.aspx b/inetsrv/uddi/source/help/ui/search.context.providerservices.aspx new file mode 100644 index 0000000..9946a2d --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.providerservices.aspx @@ -0,0 +1,33 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Provider Provider - Service Services

+ Use the Services tab to view the services that are published by this provider. +
    +
  • + Services: Displays the services that are published by this provider. Click any service to view more information about it. +
+

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.searchbrowsecategory.aspx b/inetsrv/uddi/source/help/ui/search.context.searchbrowsecategory.aspx new file mode 100644 index 0000000..9f4fbf3 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.searchbrowsecategory.aspx @@ -0,0 +1,36 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Browse by Category

+ Use the Browse by Category tab to locate services, providers, or tModels that have been classified by a specific categorization. +
    +
  • + Categories: To find providers, services, or tModels that fit the specific categorization, locate the category you would like to search by, then click Find Providers, Find Services, or Find tModels. +
  • +
+

More Information

+
    +
  • +
+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.searchproviders.aspx b/inetsrv/uddi/source/help/ui/search.context.searchproviders.aspx new file mode 100644 index 0000000..645ffac --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.searchproviders.aspx @@ -0,0 +1,63 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Search for Provider Providers

+ Use the Providers tab to locate providers by name, categorization, identification scheme, or the tModels that they refer to. You may use any or all of the fields to refine your search. When you are ready to perform your search, click Search. +
    +
  • + Provider Name: Type the name of the provider you want to find. + If you only know part of the name, you can use % as a wildcard. +

    + For example, to search for a provider with a name starting with "an," type an . + To search for a provider name that contains the letters "an," type %an%. +

  • +
  • + Categorizations: Add one or more categories that define and describe the type of provider you want to find. Search returns only those providers that are defined under all of the categories you have specified. +
      +
    • Click Add Category to add a categorization to your search criteria.
    • +
    • Click Delete to remove a categorization from your search criteria.
    • +
    +
  • +
  • + Identifiers: Add one or more identification schemesthat are associated with the provider you are looking for. Search returns only those providers that have published all of the identifiers that you have specified. +
      +
    • Click Add Identifier to add an identifier to your search criteria.
    • +
    • Click Delete to remove an identifier from your search criteria.
    • +
    +
  • +
  • + tModels: Add one or more of the tModels that is referenced by the provider that you want to find. + Search returns only those providers that publish all of the tModels you have specified. +
      +
    • Click Add tModel to add a tModel to your search criteria.
    • +
    • Click Delete to remove a tModel from your search criteria.
    • +
    +
  • +
+

More Information

+
    +
  • +
  • +
  • +
+
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.searchservices.aspx b/inetsrv/uddi/source/help/ui/search.context.searchservices.aspx new file mode 100644 index 0000000..64a5e21 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.searchservices.aspx @@ -0,0 +1,55 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Search for Service Services

+ Use the Services tab to search for services by name, categorization or the tModels they refer to. You may use any or all of the fields to refine your search. When you are ready to perform your search, click Search. +
    +
  • + Service Name: Type the name of the service you want to find. If you only know a part of the name, you can use % as a wildcard. +

    + For example, to search for a service with a name starting with "an," type an. + To search for a service name containing the letters "an," type %an%. +

  • +
  • + Categorizations: Add one or more categories that define and describe the type of service you want to find. Search returns only those services that are defined under all of the categories you have specified. +
      +
    • Click Add Category to add a categorization to your search criteria.
    • +
    • Click Delete to remove a categorization from your search criteria.
    • +
    +
  • +
  • + tModels: Add one or more of the tModels that are referenced by the service you want to find. + Search returns only those services that publish all of the tModels that you have specified. +
      +
    • Click Add tModel to add a tModel to your search criteria.
    • +
    • Click Delete to remove a tModel from your search criteria.
    • +
    +
  • +
+ +

More Information

+
    +
  • +
  • +
+
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.searchtmodels.aspx b/inetsrv/uddi/source/help/ui/search.context.searchtmodels.aspx new file mode 100644 index 0000000..c7a1bc2 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.searchtmodels.aspx @@ -0,0 +1,56 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Search for tModel tModels

+ Use the tModels tab to search for tModels by name, categorization, or identification scheme. You may use any or all of the fields to refine your search. When you are ready to perform your search, click Search. +
    +
  • + tModel Name: Type the name of the tModel you want to + find. If you only know part of the name, you can use % as a wildcard. +

    + For example, to search for a tModel with a name starting with "an," type An. + To search for a tModel name containing the letters "an," type %an%. +

  • +
  • + Categorizations: Add one or more categories that define and describe the type of tModel that you want to find. Search returns only those tModels that are defined under all of the categories you have specified. +
      +
    • Click Add Category to add a categorization to your search criteria.
    • +
    • Click Delete to remove a categorization from your search criteria.
    • +
    +
  • +
  • + Identifiers: Add one or more identification schemes that are associated with the tModel you are looking for. Search returns only those tModels that have published all of the identifiers you have specified. +
      +
    • Click Add Identifier to add an identifier to your search criteria.
    • +
    • Click Delete to remove an identifier from your search criteria.
    • +
    +
  • +
+

More Information

+ + +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.servicebindings.aspx b/inetsrv/uddi/source/help/ui/search.context.servicebindings.aspx new file mode 100644 index 0000000..745cc1c --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.servicebindings.aspx @@ -0,0 +1,34 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Service Service - Binding Bindings

+ Use the Bindings tab to view the bindings for this service. +
    +
  • Binding Displays the bindings that are associated with this service. Click any binding to view more information about it. + +
+

More Information

+ +

+ +

+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.servicecategories.aspx b/inetsrv/uddi/source/help/ui/search.context.servicecategories.aspx new file mode 100644 index 0000000..9e05eab --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.servicecategories.aspx @@ -0,0 +1,36 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Service Service - Categories

+ Use the Categories tab to view the categorizations of this service. +
    +
  • + Categories: Displays the categories that are associated with this service. The name of each categorization scheme is followed by the category name (or key name) and value (or key value). + +
  • +
+ +

+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.servicedetails.aspx b/inetsrv/uddi/source/help/ui/search.context.servicedetails.aspx new file mode 100644 index 0000000..17f7035 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.servicedetails.aspx @@ -0,0 +1,42 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Service Service - Details

+ Use the Details tab to view the names and descriptions of this service. +
    +
  • + Service Key Displays the unique key that is associated with this service. It is used during programmatic queries. +
  • + +
  • + Name: Lists the names of this service and the language for which each + name is written. +
  • +
  • + Description: Lists descriptions for this service and the language for + which each description is written. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.tmodelcategories.aspx b/inetsrv/uddi/source/help/ui/search.context.tmodelcategories.aspx new file mode 100644 index 0000000..a2c5de7 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.tmodelcategories.aspx @@ -0,0 +1,34 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Categories

+ Use the Categories tab to view the categorizations of this tModel. +
    +
  • + + Categories: Lists the categories that describe this tModel and the function it serves. The name of each categorization scheme is followed by the category name (key name) and value (key value). +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.tmodeldetails.aspx b/inetsrv/uddi/source/help/ui/search.context.tmodeldetails.aspx new file mode 100644 index 0000000..62a7624 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.tmodeldetails.aspx @@ -0,0 +1,44 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Details

+ Use the Details tab to view the name and descriptions of this tModel. +
    + +
  • + tModel Name: Displays the name of this tModel. +
  • +
  • + Owner: Displays the name of the user that owns this entity. +
  • +
  • + tModel Key: Displays the unique key that is associated with this tModel. It is used during programmatic queries. +
  • +
  • + Description: Lists descriptions for this tModel and the language for + which each description is written. +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.tmodelidentifiers.aspx b/inetsrv/uddi/source/help/ui/search.context.tmodelidentifiers.aspx new file mode 100644 index 0000000..60eb3cd --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.tmodelidentifiers.aspx @@ -0,0 +1,35 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Identifiers

+ Use the Identifiers tab to view the identification schemes associated with this tModel. +
    +
  • + Identifiers: Lists the identification schemes that are associated with this tModel. The + name of the associated identification scheme is followed by its unique name (key name) and value (key value). + +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.context.tmodeloverviewdocument.aspx b/inetsrv/uddi/source/help/ui/search.context.tmodeloverviewdocument.aspx new file mode 100644 index 0000000..de86e91 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.context.tmodeloverviewdocument.aspx @@ -0,0 +1,39 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

tModel tModel - Overview Document

+ Use the Overview Document tab to view the overview document + Uniform Resource Locator (URL) and its descriptions for this tModel. +
    +
  • + Overview Document URL: Displays the URL where the overview document + for this tModel is located. For example, it might display the URL where an interface definition document or Web Services Description Language (WSDL) file is hosted. +
  • + Description: Contains descriptions for this overview document and the + language for which each description is written. + +
  • +
+

More Information

+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.footer.htm b/inetsrv/uddi/source/help/ui/search.footer.htm new file mode 100644 index 0000000..905a808 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.footer.htm @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + +

+
+ Help Home  | + Searching + UDDI Services + +
©2002 Microsoft Corporation +
+ All rights reserved.

+
+ + diff --git a/inetsrv/uddi/source/help/ui/search.gettingstarted.aspx b/inetsrv/uddi/source/help/ui/search.gettingstarted.aspx new file mode 100644 index 0000000..7e670eb --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.gettingstarted.aspx @@ -0,0 +1,81 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Introduction to Searching

+

+ Search provides four tabs—Browse by Category, Services, Providers, and tModels—that you can use to locate Web service information. You can search for services, providers, or tModels by categorization, name, identification scheme, or tModel references. If you do not know the complete name of the entity you want to search for, you can use % as a wild card.

+

+ When you perform a search, the list of entities that matches your search criteria appears on the screen. To view the details of an entity, click its name in the list. View and browse the attributes of that entity and any associated entities. For example, if you search for a service, you can also view the service provider or bindings and instance infos for that service. To perform a new search, on the UDDI Services UDDI menu, click Search and start again. + +

+ +

Browse by Category tab

+ Use this tab to locate services, providers, or tModels that have been classified by a specific categorization. Search only returns those services, providers, or tModels that have been defined with the category you specify.

+ For example, to locate services of a particular classification: +

    +
  1. On the UDDI Services UDDI menu, click Search +
  2. Click the Browse by Category tab. +
  3. Select the categorization schemes and category or classification you want to search by, and then click Find Services. +
+ +

Services tab

+ Use this tab to locate services by name, the categories they have been classified with, or the tModels they reference. You may use any or all of the fields to refine your search.

+ For example, to locate a service that supports a particular interface or protocol: +

    +
  1. On the UDDI Services UDDI menu, click Search +
  2. Click the Services tab. +
  3. Click Add tModel. +
  4. Type all or part of the name of the tModel that represents the interface or protocol you want to search by and then click Search. +
  5. Select the tModel you want to search by from the list. +
  6. Click Search. +
+ +

Providers tab

+ Use this tab to search for providers by name, the categories they have been classified with, an identification scheme, or the tModels they refer to. You may use any or all of the fields to refine your search.

+ For example, to locate all of the providers with names that contain the letters "WS" and belong to a particular implementation or group: +

    +
  1. On the UDDI Services UDDI menu, click Search +
  2. Click the Providers tab. +
  3. Type %WS% in the Provider Name field. +
  4. Click Add Identifier. +
  5. Specify the identification scheme values that describe the implementation or group you are looking for, and then click Update. +
  6. Click Search. +
+ +

tModels tab

+ Use this tab to search for tModels by name, the categories they have been classified with, or an identification scheme. You may use any or all of the fields to refine your search.

+ For example, to locate any tModels that have been categorized as Web Services Description Language (WSDL) descriptions: +

    +
  1. On the UDDI Services UDDI menu, click Search +
  2. Click the tModels tab. +
  3. Click Add Categories. +
  4. Select the uddi.org:types categorization scheme. +
  5. Select These types are for tModels, then select Specification for a Web service, and then select Specification for a web service described in WSDL. +
  6. Click Add Category. +
  7. Click Search. +
+ Now that you understand how to search for information in UDDI Services, if you like, review How to search using Browse by Category, How to search for services, How to search for providers, or How to search for tModels. + +

+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.glossary.aspx b/inetsrv/uddi/source/help/ui/search.glossary.aspx new file mode 100644 index 0000000..f0cfc20 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.glossary.aspx @@ -0,0 +1,25 @@ + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/search.header.htm b/inetsrv/uddi/source/help/ui/search.header.htm new file mode 100644 index 0000000..360c239 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.header.htm @@ -0,0 +1,18 @@ + + + +Searching UDDI Services + + + +Searching UDDI + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.heading.htm b/inetsrv/uddi/source/help/ui/search.heading.htm new file mode 100644 index 0000000..5f846b7 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.heading.htm @@ -0,0 +1,27 @@ + + + + + + + + + + +
+ + + + +
+ Help Home
+ Searching + UDDI Services +
+ Glossary +
+
+
+
+ + diff --git a/inetsrv/uddi/source/help/ui/search.searchbycategory.aspx b/inetsrv/uddi/source/help/ui/search.searchbycategory.aspx new file mode 100644 index 0000000..429fb3f --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.searchbycategory.aspx @@ -0,0 +1,40 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Search Using Browse by Category

+

+ You can search UDDI Services for services, providers, or tModels by category or classification using the Browse by Category tab in Search. Search returns only the Providers, Services, or tModels associated with the categorization you specify. +

To locate entities using Browse by Category

+
    +
  1. On the UDDI Services UDDI menu, click Search +
  2. On the Browse by Category tab, navigate the available categorization schemes and locate the category or classification that you want to search by, and then click Find Providers, Find Services, or Find tModels. +
  3. To view the details of an entity, click its name in the list. View and browse the attributes of that entity and any associated entities. For example, if you searched for a service, you can also view the service provider or bindings and instance infos for that services. + +
  4. +

    +
  5. +To perform a new search, on the UDDI Services UDDI menu, click Search and start again.
  6. + +
+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.searchforproviders.aspx b/inetsrv/uddi/source/help/ui/search.searchforproviders.aspx new file mode 100644 index 0000000..0f60de3 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.searchforproviders.aspx @@ -0,0 +1,86 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Search for Providers - Provider

+

+ By using the Providers tab in Search, you can search for providers by name, categorization, identifiers, or by + associated tModels. +

To search for providers

+

+
    +
  1. + On the UDDI Services UDDI menu, click Search.
  2. +
  3. + Click the Providers + tab. +
  4. + Complete one or more search options as follows: +
      +
    • + Provider Name: In Provider Name, type the name of the provider you want to find. If you only know part of the name, you can + use % as a wildcard. +
      + For example, to search for provider names starting with "an," type an. + To search for provider names containing the letters "an," type %an%. +
    • +
    • + Categories: Add categories that define the type of provider you want to + find. Search returns only those providers classified by the categories you + specify. +
        +
      1. Click Add Category
      2. +
      3. Select the categorization that defines the type of provider you are + searching for and then click Add Category +
      +
    • +
    • + Identifiers: Add the identifiers that are associated with the provider you + are searching for. Search only returns those providers that publish all of the + identifiers specified. + +
        +
      1. Click Add Identifier. +
      2. Select the tModel that represents the identification scheme you want to search by. +
      3. In Key Name, type the name of the identifier you want to search by. +
      4. In Key Value, type the value for the identifier you want to search by. +
      5. Click Update. +
      +
    • +
    • + tModels: Add the tModels that are used by the provider you are searching for. Search only returns those providers that publish all of the tModels specified. +
        +
      1. Click Add tModels.
      2. +
      3. Type all or part of the name of the tModel you want to add and then click Search.
      4. +
      5. Select the tModel you want to add.
      6. +
      + +
    • +
    +
  5. +
  6. + Once you have defined your search criteria and are ready to perform your + search, click Search.
    +
  7. +
  8. To view the details of an entity, click its name in the list. Then, you can view and browse the attributes of that entity and any associated entities. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.searchforservices.aspx b/inetsrv/uddi/source/help/ui/search.searchforservices.aspx new file mode 100644 index 0000000..5dfa086 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.searchforservices.aspx @@ -0,0 +1,69 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Search for Services - Service

+

+ By using the Services tab in Search, you can search UDDI Services for services by name, categorization, or associated tModels.

+

To search for services

+
    +
  1. + On the UDDI Services UDDI menu, click Search.
  2. +
  3. + Click the Services tab.
  4. +
  5. + Use the fields that are provided to refine your search. Search results only include + those services that match all of the criteria specified. +
      +
    • + Service Name: In Service Name, type the name of the service you are + searching for. If you only know part of the name, you can use % as a wildcard. +
      + For example, to search for service names starting with "an," type an. + To search for service names containing the letters "an," type %an%. +
    • +
    • + Categories: Add categories that define the type of service you are searching for. Search only returns those services that are defined under all of the categories you have specified. +
        +
      1. Click Add Category
      2. +
      3. Select the categorization that defines the type of service you are + searching for and then click Add Category +
      +
    • +
    • + tModels: Add the tModels that are used by the service you are searching for. Search only returns those services that publish all of the tModels specified. +
        +
      1. Click Add tModels.
      2. +
      3. Type all or part of the name of the tModel you want to add and then click Search.
      4. +
      5. Select the tModel you want to add.
      6. +
      +
    • +
    +
  6. +
  7. + After you have defined your search criteria and are ready to perform your + search, click Search.
    +
  8. +
  9. To view the details of an entity, click its name in the list. View and browse the attributes of that entity and any associated entities.
  10. +
+
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.searchfortmodels.aspx b/inetsrv/uddi/source/help/ui/search.searchfortmodels.aspx new file mode 100644 index 0000000..2e7e7cd --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.searchfortmodels.aspx @@ -0,0 +1,75 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

How to Search for tModels - tModel

+

+ By using the tModels tab in Search, you can search UDDI Services for tModels by name, categorization, and their + unique identifiers.

+

To search for tModels

+
    +
  1. + On the UDDI Services UDDI menu, click Search.
  2. +
  3. + Click the tModels tab.
  4. +
  5. + Use the fields provided to refine your search. Search results only include + those tModels that match all of the criteria specified. +
      +
    • + tModel Name: In tModel Name, type the name of the tModels you are + searching for. If you only know part of the name, you can use % as a wildcard. +
      + For example, to search for tModel names starting with "an," type an. + To search for tModel names containing the letters "an," type %an%. +
    • +
    • + Categories: Add categories that define the type of tModel you are searching for. Search returns only those providers classified by the categories you specify. +
        +
      1. Click Add Category
      2. +
      3. Select the categorization that defines the type of tModel you are + searching for and then click Add Category +
      + +
    • +
    • + Identifiers: Add the identifiers that are associated with the tModel you + are searching for. Search only returns those tModels associated with all of the + identifiers specified. +
        +
      1. Click Add Identifier. +
      2. Select the tModel that represents the identification scheme you want to search by. +
      3. In Key Name, type the name of the identifier you want to search by. +
      4. In Key Value, type the value for the identifier you want to search by. +
      5. Click Update. +
      + +
    • +
    +
  6. +
  7. + Once you have defined your search criteria and are ready to perform your + search, click Search.
    +
  8. +
  9. To view the details of an entity, click its name in the list. View and browse the attributes of that entity and any associated entities. +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.toc.aspx b/inetsrv/uddi/source/help/ui/search.toc.aspx new file mode 100644 index 0000000..d43f73c --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.toc.aspx @@ -0,0 +1,59 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + + +
+ + +

Searching UDDI Services

+
+ + +

Searching UDDI

+
+ + +
 Getting Started +
+ +
 How to search ... +
+ +

See also +

+ + +
bullet Additional Resources on the UDDI Services Web page on the Microsoft Web site
+ +
+ +
+ + + + + + diff --git a/inetsrv/uddi/source/help/ui/search.troubleshooting.aspx b/inetsrv/uddi/source/help/ui/search.troubleshooting.aspx new file mode 100644 index 0000000..cf54cde --- /dev/null +++ b/inetsrv/uddi/source/help/ui/search.troubleshooting.aspx @@ -0,0 +1,25 @@ + + +<%@ Page %> +<%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %> + + + + + + + + + + + + + +
+

Troubleshooting

+
+ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/help/ui/tou.htm b/inetsrv/uddi/source/help/ui/tou.htm new file mode 100644 index 0000000..6faf2bb --- /dev/null +++ b/inetsrv/uddi/source/help/ui/tou.htm @@ -0,0 +1,3 @@ + + +

Terms of Use

diff --git a/inetsrv/uddi/source/help/ui/troubleshooting.htm b/inetsrv/uddi/source/help/ui/troubleshooting.htm new file mode 100644 index 0000000..653d136 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/troubleshooting.htm @@ -0,0 +1,3 @@ + + +

Troubleshooting

diff --git a/inetsrv/uddi/source/help/ui/warning.changestouddi.htm b/inetsrv/uddi/source/help/ui/warning.changestouddi.htm new file mode 100644 index 0000000..2e7a17d --- /dev/null +++ b/inetsrv/uddi/source/help/ui/warning.changestouddi.htm @@ -0,0 +1,5 @@ + + +

Warning    Changes to data are + immediate and cannot be undone or recovered. To correct errors, you must + manually change each error back to its original state.

diff --git a/inetsrv/uddi/source/help/ui/wsdlinfo.htm b/inetsrv/uddi/source/help/ui/wsdlinfo.htm new file mode 100644 index 0000000..ce398f9 --- /dev/null +++ b/inetsrv/uddi/source/help/ui/wsdlinfo.htm @@ -0,0 +1,57 @@ + + + Accessing UDDI API and Microsoft API Extensions Interfaces + + + + + + + + +
UDDI ServicesAccessing UDDI API and Microsoft API Extensions Interfaces
+
+
+

UDDI Services supports the UDDI version 1.0 and 2.0 API specifications, as well + as an extensions API for browsing categorization schemes.

+

It is recommended that you use the Microsoft® UDDI .NET Software Development Kit + (SDK) to access these interfaces as it provides a superior programming + experience over using the proxies generated directly from the Web Service + Description Language (WSDL) files. To download the SDK and access additional + UDDI information, see the UDDI Services Web site on the + Microsoft Web site.

+

+

+

+
+ + diff --git a/inetsrv/uddi/source/mmc/about.cpp b/inetsrv/uddi/source/mmc/about.cpp new file mode 100644 index 0000000..00e1f7a --- /dev/null +++ b/inetsrv/uddi/source/mmc/about.cpp @@ -0,0 +1,261 @@ +#include "about.h" +#include "resource.h" +#include "globals.h" +#include "uddi.h" + +#include +#include + +CSnapinAbout::CSnapinAbout() + : m_cref(0) +{ + OBJECT_CREATED + + m_hSmallImage = (HBITMAP) LoadImage( g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT ); + m_hLargeImage = (HBITMAP) LoadImage( g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT ); + + m_hSmallImageOpen = (HBITMAP)LoadImage( g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT ); + m_hAppIcon = LoadIcon( g_hinst, MAKEINTRESOURCE( IDI_UDDIMMC ) ); +} + +CSnapinAbout::~CSnapinAbout() +{ + if( m_hSmallImage != NULL ) + FreeResource( m_hSmallImage ); + + if( m_hLargeImage != NULL ) + FreeResource( m_hLargeImage ); + + if( m_hSmallImageOpen != NULL ) + FreeResource( m_hSmallImageOpen ); + + if( m_hAppIcon != NULL ) + FreeResource( m_hAppIcon ); + + m_hSmallImage = NULL; + m_hLargeImage = NULL; + m_hSmallImageOpen = NULL; + m_hAppIcon = NULL; + + OBJECT_DESTROYED +} + +/////////////////////// +// IUnknown implementation +/////////////////////// +STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv) +{ + if( !ppv ) + return E_FAIL; + + *ppv = NULL; + + if( IsEqualIID( riid, IID_IUnknown ) ) + *ppv = static_cast(this); + else if( IsEqualIID( riid, IID_ISnapinAbout ) ) + *ppv = static_cast(this); + + if( *ppv ) + { + reinterpret_cast(*ppv)->AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) CSnapinAbout::AddRef() +{ + return InterlockedIncrement( (LONG *)&m_cref ); +} + +STDMETHODIMP_(ULONG) CSnapinAbout::Release() +{ + if( 0 == InterlockedDecrement( (LONG *)&m_cref ) ) + { + // + // we need to decrement our object count in the DLL + // + delete this; + return 0; + } + + return m_cref; +} + +/////////////////////////////// +// Interface ISnapinAbout +/////////////////////////////// +STDMETHODIMP CSnapinAbout::GetSnapinDescription( /* [out] */ LPOLESTR *lpDescription ) +{ + if( NULL == lpDescription ) + { + return E_INVALIDARG; + } + + _TCHAR szDesc[MAX_PATH]; + memset( szDesc, 0, MAX_PATH * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_UDDIMMC_SNAPINDESC, szDesc, ARRAYLEN( szDesc ) ); + + return AllocOleStr( lpDescription, szDesc ); +} + + +STDMETHODIMP CSnapinAbout::GetProvider( /* [out] */ LPOLESTR *lpName ) +{ + if( NULL == lpName ) + { + return E_INVALIDARG; + } + + _TCHAR szProvider[ MAX_PATH ]; + memset( szProvider, 0, MAX_PATH * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_UDDIMMC_PROVIDER, szProvider, ARRAYLEN( szProvider ) ); + + return AllocOleStr( lpName, szProvider );; +} + + +STDMETHODIMP CSnapinAbout::GetSnapinVersion( /* [out] */ LPOLESTR *lpVersion ) +{ + if( NULL == lpVersion ) + { + return E_INVALIDARG; + } + + USES_CONVERSION; + + TCHAR szBuf[ MAX_PATH + 1 ] = {0}; + DWORD dwLen = GetModuleFileName( g_hinst, szBuf, MAX_PATH + 1 ); + szBuf[ MAX_PATH ] = NULL; + + if( dwLen < MAX_PATH ) + { + LPDWORD pTranslation = NULL; + UINT uNumTranslation = 0; + DWORD dwHandle = NULL; + DWORD dwSize = GetFileVersionInfoSize( szBuf, &dwHandle ); + if( !dwSize ) + return E_FAIL; + + BYTE* pVersionInfo = new BYTE[dwSize]; + if( !pVersionInfo ) + return E_OUTOFMEMORY; + + if( !GetFileVersionInfo( szBuf, dwHandle, dwSize, pVersionInfo ) || + !VerQueryValue( (const LPVOID)pVersionInfo, _T("\\VarFileInfo\\Translation"), (LPVOID*)&pTranslation, &uNumTranslation ) || + !pTranslation ) + { + delete [] pVersionInfo; + + pVersionInfo = NULL; + pTranslation = NULL; + uNumTranslation = 0; + + return E_FAIL; + } + + uNumTranslation /= sizeof(DWORD); + + tstring strQuery = _T("\\StringFileInfo\\"); + + // + // 8 characters for the language/char-set, + // 1 for the slash, + // 1 for terminating NULL + // + TCHAR szTranslation[ 128 ] = {0}; + _sntprintf( szTranslation, 127, _T("%04x%04x\\"), LOWORD(*pTranslation), HIWORD(*pTranslation) ); + + try + { + strQuery += szTranslation; + strQuery += _T("FileVersion"); + } + catch( ... ) + { + delete [] pVersionInfo; + return E_OUTOFMEMORY; + } + + LPBYTE lpVerValue = NULL; + UINT uSize = 0; + + if( !VerQueryValue(pVersionInfo, (LPTSTR)strQuery.c_str(), (LPVOID *)&lpVerValue, &uSize) ) + { + delete [] pVersionInfo; + return E_FAIL; + } + + // + // Check the version + // + _tcsncpy( szBuf, (LPTSTR)lpVerValue, MAX_PATH-1 ); + + delete [] pVersionInfo; + } + + *lpVersion = (LPOLESTR)CoTaskMemAlloc( (lstrlen(szBuf) + 1) * sizeof(OLECHAR) ); + if( NULL == *lpVersion ) + return E_OUTOFMEMORY; + + ocscpy( *lpVersion, T2OLE(szBuf) ); + + return S_OK; +} + + +STDMETHODIMP CSnapinAbout::GetSnapinImage( /* [out] */ HICON *hAppIcon ) +{ + *hAppIcon = m_hAppIcon; + + if( NULL == *hAppIcon ) + return E_FAIL; + else + return S_OK; +} + +STDMETHODIMP CSnapinAbout::GetStaticFolderImage( + /* [out] */ HBITMAP *hSmallImage, + /* [out] */ HBITMAP *hSmallImageOpen, + /* [out] */ HBITMAP *hLargeImage, + /* [out] */ COLORREF *cMask ) +{ + *hSmallImage = m_hSmallImage; + *hLargeImage = m_hLargeImage; + + *hSmallImageOpen = m_hSmallImageOpen; + + *cMask = RGB(255, 255, 255); + + if( ( NULL == *hSmallImage ) || ( NULL == *hLargeImage ) || ( NULL == *hSmallImageOpen ) ) + return E_FAIL; + else + return S_OK; +} + +// +// This allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it +// +HRESULT CSnapinAbout::AllocOleStr( LPOLESTR *lpDest, _TCHAR *szBuffer ) +{ + if( ( NULL == lpDest ) || ( NULL == szBuffer ) ) + { + return E_INVALIDARG; + } + + int iLen = _tcslen( szBuffer ); + + *lpDest = reinterpret_cast( ::CoTaskMemAlloc( ( iLen + 1 ) * sizeof( _TCHAR ) ) ); + if( NULL == *lpDest ) + { + return E_OUTOFMEMORY; + } + + _tcsncpy( *lpDest, szBuffer, iLen ); + (*lpDest)[iLen] = NULL; + + return S_OK; +} \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/about.h b/inetsrv/uddi/source/mmc/about.h new file mode 100644 index 0000000..7304dbd --- /dev/null +++ b/inetsrv/uddi/source/mmc/about.h @@ -0,0 +1,44 @@ +#ifndef _SAMPABOUT_H_ +#define _SAMPABOUT_H_ + +#include +#include + +class CSnapinAbout : public ISnapinAbout +{ +private: + ULONG m_cref; + HBITMAP m_hSmallImage; + HBITMAP m_hLargeImage; + HBITMAP m_hSmallImageOpen; + HICON m_hAppIcon; + +public: + CSnapinAbout(); + ~CSnapinAbout(); + + /////////////////////////////// + // Interface IUnknown + /////////////////////////////// + STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + + /////////////////////////////// + // Interface ISnapinAbout + /////////////////////////////// + STDMETHODIMP GetSnapinDescription( /* [out] */ LPOLESTR *lpDescription ); + STDMETHODIMP GetProvider( /* [out] */ LPOLESTR *lpName ); + STDMETHODIMP GetSnapinVersion( /* [out] */ LPOLESTR *lpVersion ); + STDMETHODIMP GetSnapinImage( /* [out] */ HICON *hAppIcon ); + STDMETHODIMP GetStaticFolderImage( + /* [out] */ HBITMAP *hSmallImage, + /* [out] */ HBITMAP *hSmallImageOpen, + /* [out] */ HBITMAP *hLargeImage, + /* [out] */ COLORREF *cMask); + +private: + HRESULT CSnapinAbout::AllocOleStr( LPOLESTR *lpDest, _TCHAR *szBuffer ); +}; + +#endif _SAMPABOUT_H_ diff --git a/inetsrv/uddi/source/mmc/adm_execresetkeyimmediate.h b/inetsrv/uddi/source/mmc/adm_execresetkeyimmediate.h new file mode 100644 index 0000000..897726c --- /dev/null +++ b/inetsrv/uddi/source/mmc/adm_execresetkeyimmediate.h @@ -0,0 +1,62 @@ +// adm_execresetkeyimmediate.h : Declaration of the ADM_execResetKeyImmediate class + +#ifndef __ADM_EXECRESETKEYIMMEDIATE_H_ +#define __ADM_EXECRESETKEYIMMEDIATE_H_ + +class ADM_execResetKeyImmediateAccessor +{ +public: + LONG m_RETURNVALUE; + TCHAR m_keyLastResetDate[4001]; + CComBSTR m_connectionString; + +BEGIN_PARAM_MAP(ADM_execResetKeyImmediateAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURNVALUE) + SET_PARAM_TYPE(DBPARAMIO_INPUT | DBPARAMIO_OUTPUT) + COLUMN_ENTRY(2, m_keyLastResetDate) +END_PARAM_MAP() + +DEFINE_COMMAND(ADM_execResetKeyImmediateAccessor, _T("{ ? = CALL dbo.ADM_execResetKeyImmediate;1 (?) }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class ADM_execResetKeyImmediate : public CCommand > +{ +public: + HRESULT Open() + { + HRESULT hr; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + m_keyLastResetDate[ 0 ] = NULL; + + hr = db.OpenFromInitializationString( m_connectionString ); + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + HRESULT OpenRowset() + { + return CCommand >::Open(m_session); + } + CSession m_session; +}; + +#endif // __ADM_EXECRESETKEYIMMEDIATE_H_ diff --git a/inetsrv/uddi/source/mmc/adm_setadminaccount.h b/inetsrv/uddi/source/mmc/adm_setadminaccount.h new file mode 100644 index 0000000..06b33c8 --- /dev/null +++ b/inetsrv/uddi/source/mmc/adm_setadminaccount.h @@ -0,0 +1,64 @@ +// ADM_setAdminAccount.h : Declaration of the ADM_setAdminAccount class + +#ifndef __ADM_SETADMINACCOUNT_H_ +#define __ADM_SETADMINACCOUNT_H_ + +class ADM_setAdminAccountAccessor +{ +public: + LONG m_RETURNVALUE; + TCHAR m_accountName[129]; + CComBSTR m_connectionString; + +BEGIN_PARAM_MAP(ADM_setAdminAccountAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURNVALUE) + SET_PARAM_TYPE(DBPARAMIO_INPUT) + COLUMN_ENTRY(2, m_accountName) +END_PARAM_MAP() + +DEFINE_COMMAND(ADM_setAdminAccountAccessor, _T("{ ? = CALL dbo.ADM_setAdminAccount;1 (?) }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class ADM_setAdminAccount : public CCommand > +{ +public: + HRESULT Open() + { + HRESULT hr; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + + hr = db.OpenFromInitializationString( m_connectionString ); + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + + HRESULT OpenRowset() + { + return CCommand >::Open(m_session); + } + + CSession m_session; +}; + +#endif // __ADM_SETADMINACCOUNT_H_ diff --git a/inetsrv/uddi/source/mmc/basesnap.cpp b/inetsrv/uddi/source/mmc/basesnap.cpp new file mode 100644 index 0000000..6182a19 --- /dev/null +++ b/inetsrv/uddi/source/mmc/basesnap.cpp @@ -0,0 +1,477 @@ +#include +#include +#include +#include "guids.h" +#include "basesnap.h" +#include "comp.h" +#include "compdata.h" +#include "about.h" +#include "uddi.h" +#include + +LONG UnRegisterServer( const CLSID& clsid ); + +// +// Globals Variables +// +HINSTANCE g_hinst; + +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD fdwReason, void* lpvReserved ) +{ + if( DLL_PROCESS_ATTACH == fdwReason ) + { + g_hinst = hinst; + } + + return TRUE; +} + + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj) +{ + if( ( rclsid != CLSID_CUDDIServices ) && ( rclsid != CLSID_CSnapinAbout ) ) + return CLASS_E_CLASSNOTAVAILABLE; + + if( !ppvObj ) + return E_FAIL; + + *ppvObj = NULL; + + // + // We can only hand out IUnknown and IClassFactory pointers. Fail + // if they ask for anything else. + // + if( !IsEqualIID(riid, IID_IUnknown) && !IsEqualIID( riid, IID_IClassFactory ) ) + return E_NOINTERFACE; + + CClassFactory *pFactory = NULL; + + // + // make the factory passing in the creation function for the type of object they want + // + if( CLSID_CUDDIServices == rclsid ) + pFactory = new CClassFactory( CClassFactory::COMPONENT ); + else if( CLSID_CSnapinAbout == rclsid ) + pFactory = new CClassFactory( CClassFactory::ABOUT ); + + if( NULL == pFactory ) + return E_OUTOFMEMORY; + + HRESULT hr = pFactory->QueryInterface( riid, ppvObj ); + + return hr; +} + +STDAPI DllCanUnloadNow(void) +{ + if( ( 0 == g_uObjects ) && ( 0 == g_uSrvLock ) ) + return S_OK; + else + return S_FALSE; +} + + +CClassFactory::CClassFactory(FACTORY_TYPE factoryType) + : m_cref(0) + , m_factoryType(factoryType) +{ + OBJECT_CREATED +} + +CClassFactory::~CClassFactory() +{ + OBJECT_DESTROYED +} + +STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv) +{ + if( !ppv ) + return E_FAIL; + + *ppv = NULL; + + if( IsEqualIID( riid, IID_IUnknown ) ) + *ppv = static_cast(this); + else + if( IsEqualIID(riid, IID_IClassFactory ) ) + *ppv = static_cast(this); + + if( *ppv ) + { + reinterpret_cast(*ppv)->AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) CClassFactory::AddRef() +{ + return InterlockedIncrement( (LONG*)&m_cref ); +} + +STDMETHODIMP_(ULONG) CClassFactory::Release() +{ + if( 0 == InterlockedDecrement( (LONG *)&m_cref ) ) + { + delete this; + return 0; + } + return m_cref; +} + +STDMETHODIMP CClassFactory::CreateInstance( LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj ) +{ + HRESULT hr; + void* pObj; + + if( !ppvObj ) + return E_FAIL; + + *ppvObj = NULL; + + // + // Our object does does not support aggregation, so we need to + // fail if they ask us to do aggregation. + // + if( pUnkOuter ) + return CLASS_E_NOAGGREGATION; + + if( COMPONENT == m_factoryType ) + { + pObj = new CComponentData(); + } + else + { + pObj = new CSnapinAbout(); + } + + if( !pObj ) + return E_OUTOFMEMORY; + + // + // QueryInterface will do the AddRef() for us, so we do not + // do it in this function + // + hr = ( (LPUNKNOWN) pObj )->QueryInterface( riid, ppvObj ); + + if( FAILED(hr) ) + delete pObj; + + return hr; +} + +STDMETHODIMP CClassFactory::LockServer( BOOL fLock ) +{ + if( fLock ) + InterlockedIncrement( (LONG *) &g_uSrvLock ); + else + InterlockedDecrement( (LONG *) &g_uSrvLock); + + return S_OK; +} + +// +// Register the component in the registry. +// +HRESULT RegisterServer( HMODULE hModule, // DLL module handle + const CLSID& clsid, // Class ID + const _TCHAR* szFriendlyName ) // IDs +{ + LPOLESTR wszCLSID = NULL; + try + { + // + // Get server location. + // + _TCHAR szModule[ MAX_PATH + 1]; + + DWORD dwResult = + ::GetModuleFileName( hModule, + szModule, + sizeof(szModule)/sizeof(_TCHAR) ); + szModule[ MAX_PATH ] = NULL; + + assert( 0 != dwResult ); + + // + // Get CLSID + // + HRESULT hr = StringFromCLSID( clsid, &wszCLSID ); + if( FAILED(hr) || ( NULL == wszCLSID ) ) + { + return hr; + } + + // + // Build the key CLSID\\{...} + // + tstring strKey( _T("CLSID\\") ); + strKey += wszCLSID; + + CUDDIRegistryKey::Create( HKEY_CLASSES_ROOT, strKey ); + CUDDIRegistryKey key( HKEY_CLASSES_ROOT, strKey ); + key.SetValue( _T(""), szFriendlyName ); + key.Close(); + + strKey += _T( "\\InprocServer32" ); + CUDDIRegistryKey::Create( HKEY_CLASSES_ROOT, strKey ); + CUDDIRegistryKey keyInprocServer32( HKEY_CLASSES_ROOT, strKey ); + keyInprocServer32.SetValue( _T(""), szModule ); + keyInprocServer32.SetValue( _T("ThreadingModel"), _T("Apartment") ); + keyInprocServer32.Close(); + + // + // Free memory. + // + CoTaskMemFree( wszCLSID ); + return S_OK; + } + catch( ... ) + { + CoTaskMemFree( wszCLSID ); + return E_OUTOFMEMORY; + } +} + + +////////////////////////////////////////////////////////// +// +// Exported functions +// + + +// +// Server registration +// +STDAPI DllRegisterServer() +{ + try + { + HRESULT hr = S_OK; + _TCHAR szName[ 256 ]; + _TCHAR szSnapInName[ 256 ]; + _TCHAR szAboutName[ 256 ]; + _TCHAR szProvider[ 256 ]; + // + // TODO: Fix the version thing here + // + //_TCHAR szVersion[ 100 ]; + + LoadString( g_hinst, IDS_UDDIMMC_NAME, szName, ARRAYLEN( szName ) ); + LoadString( g_hinst, IDS_UDDIMMC_SNAPINNAME, szSnapInName, ARRAYLEN( szSnapInName ) ); + LoadString( g_hinst, IDS_UDDIMMC_ABOUTNAME, szAboutName, ARRAYLEN( szAboutName ) ); + LoadString( g_hinst, IDS_UDDIMMC_PROVIDER, szProvider, ARRAYLEN( szProvider ) ); + + // + // TODO: Fix the version thing here + // + //LoadString( g_hinst, IDS_UDDIMMC_VERSION, szVersion, ARRAYLEN( szVersion ) ); + + // + // Register our Components + // + hr = RegisterServer( g_hinst, CLSID_CUDDIServices, szName ); + if( FAILED(hr) ) + return hr; + + hr = RegisterServer( g_hinst, CLSID_CSnapinAbout, szAboutName ); + if( FAILED(hr) ) + return hr; + + // + // Create the primary snapin nodes + // + LPOLESTR wszCLSID = NULL; + hr = StringFromCLSID( CLSID_CUDDIServices, &wszCLSID ); + if( FAILED(hr) ) + { + return hr; + } + + LPOLESTR wszCLSIDAbout = NULL; + hr = StringFromCLSID( CLSID_CSnapinAbout, &wszCLSIDAbout ); + if( FAILED(hr) ) + { + CoTaskMemFree( wszCLSID ); + return hr; + } + + TCHAR szPath[ MAX_PATH + 1 ]; + GetModuleFileName( g_hinst, szPath, MAX_PATH ); + + tstring strNameStringIndirect( _T("@") ); + strNameStringIndirect += szPath; + strNameStringIndirect += _T(",-"); + + _TCHAR szNameResourceIndex[ 10 ]; + strNameStringIndirect += _itot( IDS_UDDIMMC_NAME, szNameResourceIndex, 10 ); + + tstring strMMCKey( g_szMMCBasePath ); + strMMCKey += _T("\\SnapIns\\"); + strMMCKey += wszCLSID; + + CUDDIRegistryKey::Create( HKEY_LOCAL_MACHINE, strMMCKey ); + CUDDIRegistryKey keyMMC( strMMCKey ); + keyMMC.SetValue( _T("About"), wszCLSIDAbout ); + keyMMC.SetValue( _T("NameString"), szName ); + keyMMC.SetValue( _T("NameStringIndirect"), strNameStringIndirect.c_str() ); + keyMMC.SetValue( _T("Provider"), szProvider ); + // + // TODO: Fix the version thing here + // + keyMMC.SetValue( _T("Version" ), _T("1.0") ); + keyMMC.Close(); + + tstring strStandAlone( strMMCKey ); + strStandAlone += _T("\\StandAlone"); + CUDDIRegistryKey::Create( HKEY_LOCAL_MACHINE, strStandAlone ); + + tstring strNodeTypes( strMMCKey ); + strNodeTypes += _T("\\NodeTypes"); + CUDDIRegistryKey::Create( HKEY_LOCAL_MACHINE, strNodeTypes ); + // + // No NodeTypes to register + // We do not allow extensions of our nodes + // + + // + // Register as a dynamic extension to computer management + // + tstring strExtKey( g_szMMCBasePath ); + strExtKey += _T("\\NodeTypes\\"); + strExtKey += g_szServerAppsGuid; + strExtKey += _T("\\Dynamic Extensions"); + CUDDIRegistryKey dynamicExtensions( strExtKey ); + dynamicExtensions.SetValue( wszCLSID, szSnapInName ); + dynamicExtensions.Close(); + + // + // Register as a namespace extension to computer management + // + tstring strNameSpaceExtensionKey( g_szMMCBasePath ); + strNameSpaceExtensionKey += _T("\\NodeTypes\\"); + strNameSpaceExtensionKey += g_szServerAppsGuid; + strNameSpaceExtensionKey += _T("\\Extensions\\NameSpace"); + + CUDDIRegistryKey hkeyNameSpace( strNameSpaceExtensionKey ); + hkeyNameSpace.SetValue( wszCLSID, szSnapInName ); + hkeyNameSpace.Close(); + + CoTaskMemFree( wszCLSID ); + CoTaskMemFree( wszCLSIDAbout ); + return hr; + } + catch( ... ) + { + return E_FAIL; + } +} + +STDAPI DllUnregisterServer() +{ + LPOLESTR wszCLSID = NULL; + try + { + HRESULT hr = S_OK; + + UnRegisterServer( CLSID_CUDDIServices ); + if( FAILED(hr) ) + return hr; + + UnRegisterServer( CLSID_CSnapinAbout ); + if( FAILED(hr) ) + return hr; + + // + // Remove \\SnapIns\\ entry + // + hr = StringFromCLSID( CLSID_CUDDIServices, &wszCLSID ); + if( FAILED( hr) || ( NULL == wszCLSID ) ) + { + return hr; + } + + tstring strMMCKey( g_szMMCBasePath ); + strMMCKey += _T("\\SnapIns\\"); + strMMCKey += wszCLSID; + + CUDDIRegistryKey::DeleteKey( HKEY_LOCAL_MACHINE, strMMCKey ); + + // + // Remove \\Dynamic Extensions key + // + tstring strExtKey( g_szMMCBasePath ); + strExtKey += _T("\\NodeTypes\\"); + strExtKey += g_szServerAppsGuid; + strExtKey += _T("\\Dynamic Extensions"); + CUDDIRegistryKey dynamicExtensions( strExtKey ); + dynamicExtensions.DeleteValue( wszCLSID ); + dynamicExtensions.Close(); + + // + // Delete \\NodeTypes\\...\\Extensions\\Namespace Value + // + tstring strNameSpaceExtensionKey( g_szMMCBasePath ); + strNameSpaceExtensionKey += _T("\\NodeTypes\\"); + strNameSpaceExtensionKey += g_szServerAppsGuid; + strNameSpaceExtensionKey += _T("\\Extensions\\NameSpace"); + + CUDDIRegistryKey hkeyNameSpace( strNameSpaceExtensionKey ); + hkeyNameSpace.DeleteValue( wszCLSID ); + hkeyNameSpace.Close(); + + CoTaskMemFree( wszCLSID ); + return S_OK; + } + catch(...) + { + CoTaskMemFree( wszCLSID ); + return E_FAIL; + } + +} + +// +// Remove the component from the registry. +// +LONG UnRegisterServer( const CLSID& clsid ) +{ + LPOLESTR wszCLSID = NULL; + try + { + // + // Get CLSID + // + HRESULT hr = StringFromCLSID( clsid, &wszCLSID ); + if( FAILED(hr) || ( NULL == wszCLSID ) ) + { + return hr; + } + + // + // Build the key CLSID\\{...} + // + wstring wstrKey( L"CLSID\\" ); + wstrKey += wszCLSID; + + // + // Delete the CLSID Key - CLSID\{...} + // + CUDDIRegistryKey::DeleteKey( HKEY_CLASSES_ROOT, wstrKey ); + } + catch( ... ) + { + // + // Free memory. + // + CoTaskMemFree( wszCLSID ); + return E_OUTOFMEMORY; + } + + // + // Free memory. + // + CoTaskMemFree( wszCLSID ); + return S_OK ; +} diff --git a/inetsrv/uddi/source/mmc/basesnap.h b/inetsrv/uddi/source/mmc/basesnap.h new file mode 100644 index 0000000..892691a --- /dev/null +++ b/inetsrv/uddi/source/mmc/basesnap.h @@ -0,0 +1,32 @@ +#ifndef _BASESNAP_H_ +#define _BASESNAP_H_ + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj); +STDAPI DllCanUnloadNow(void); + +ULONG g_uObjects = 0; +ULONG g_uSrvLock = 0; + +class CClassFactory : public IClassFactory +{ +private: + ULONG m_cref; + +public: + enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1}; + + CClassFactory(FACTORY_TYPE factoryType); + ~CClassFactory(); + + STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + + STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *); + STDMETHODIMP LockServer(BOOL); + +private: + FACTORY_TYPE m_factoryType; +}; + +#endif _BASESNAP_H_ diff --git a/inetsrv/uddi/source/mmc/comp.cpp b/inetsrv/uddi/source/mmc/comp.cpp new file mode 100644 index 0000000..32016bd --- /dev/null +++ b/inetsrv/uddi/source/mmc/comp.cpp @@ -0,0 +1,697 @@ +#include "comp.h" +#include "dataobj.h" +#include +#include "resource.h" +#include "delebase.h" +#include "compdata.h" +#include "globals.h" +#include + + +CComponent::CComponent( CComponentData *parent ) + : m_pComponentData( parent ) + , m_cref( 0 ) + , m_ipConsole( NULL ) + , m_ipControlBar( NULL ) + , m_ipToolbar( NULL ) +{ + OBJECT_CREATED + + m_hBMapSm = LoadBitmap( g_hinst, MAKEINTRESOURCE(IDR_SMICONS) ); + m_hBMapLg = LoadBitmap( g_hinst, MAKEINTRESOURCE(IDR_LGICONS) ); +} + +CComponent::~CComponent() +{ + OBJECT_DESTROYED + + if( NULL != m_hBMapSm ) + { + DeleteObject( m_hBMapSm ); + } + + if( NULL != m_hBMapLg ) + { + DeleteObject( m_hBMapLg ); + } +} + +STDMETHODIMP CComponent::QueryInterface( REFIID riid, LPVOID *ppv ) +{ + if( !ppv ) + return E_FAIL; + + *ppv = NULL; + + if( IsEqualIID( riid, IID_IUnknown ) ) + *ppv = static_cast(this); + else if( IsEqualIID(riid, IID_IComponent) ) + *ppv = static_cast(this); + else if( IsEqualIID( riid, IID_IExtendPropertySheet ) ) + *ppv = static_cast(this); + else if( IsEqualIID(riid, IID_IExtendPropertySheet2 ) ) + *ppv = static_cast(this); + else if( IsEqualIID(riid, IID_IExtendControlbar ) ) + *ppv = static_cast(this); + else if( IsEqualIID(riid, IID_IExtendContextMenu ) ) + *ppv = static_cast(this); + + if( *ppv ) + { + reinterpret_cast(*ppv)->AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) CComponent::AddRef() +{ + return InterlockedIncrement( (LONG *)&m_cref ); +} + +STDMETHODIMP_(ULONG) CComponent::Release() +{ + if( 0 == InterlockedDecrement( (LONG *)&m_cref ) ) + { + delete this; + return 0; + } + + return m_cref; +} + +/////////////////////////////// +// Interface IComponent +/////////////////////////////// +STDMETHODIMP CComponent::Initialize( /* [in] */ LPCONSOLE lpConsole ) +{ + HRESULT hr = S_OK; + + // + // Save away all the interfaces we'll need. + // Fail if we can't QI the required interfaces. + // + m_ipConsole = lpConsole; + m_ipConsole->AddRef(); + + hr = m_ipConsole->QueryInterface(IID_IDisplayHelp, (void **)&m_ipDisplayHelp); + + return hr; +} + +STDMETHODIMP CComponent::Notify( + /* [in] */ LPDATAOBJECT lpDataObject, + /* [in] */ MMC_NOTIFY_TYPE event, + /* [in] */ LPARAM arg, + /* [in] */ LPARAM param ) +{ + MMCN_Crack( FALSE, lpDataObject, NULL, this, event, arg, param ); + + HRESULT hr = S_FALSE; + CDelegationBase *base = NULL; + + // + // We need to watch for property change and delegate it + // a little differently, we're actually going to send + // the CDelegationBase object pointer in the property page + // PSN_APPLY handler via MMCPropPageNotify() + // + if( MMCN_PROPERTY_CHANGE != event && MMCN_VIEW_CHANGE != event ) + { + if( NULL == lpDataObject ) + return S_FALSE; + + CDataObject *pDataObject = GetOurDataObject( lpDataObject ); + if( NULL != pDataObject ) + { + base = pDataObject->GetBaseNodeObject(); + } + + if( ( NULL == base ) && ( MMCN_ADD_IMAGES != event ) ) + { + return S_FALSE; + } + } + else if( MMCN_PROPERTY_CHANGE == event ) + { + base = (CDelegationBase *) param; + } + + + // + // MMCN_VIEW_CHANGE + // + + if( MMCN_VIEW_CHANGE == event ) + { + // + // Arg holds the data. For a scope item, this is the + // item's myhscopeitem. For a result item, this is + // the item's nId value, but we don't use it + // param holds the hint passed to IConsole::UpdateAllViews. + // hint is a value of the UPDATE_VIEWS_HINT enumeration + // + CDataObject *pDataObject = GetOurDataObject(lpDataObject); + if( NULL == pDataObject ) + { + return S_FALSE; + } + else + { + base = pDataObject->GetBaseNodeObject(); + + if( NULL == base ) + { + return S_FALSE; + } + } + + switch( param ) + { + case UPDATE_SCOPEITEM: + { + hr = base->OnUpdateItem( m_ipConsole, (long)arg, SCOPE ); + break; + } + case UPDATE_RESULTITEM: + { + hr = base->OnUpdateItem( m_ipConsole, (long)arg, RESULT ); + break; + } + } + + return S_OK; + } + + // + // The remaining notifications + // + switch( event ) + { + case MMCN_SHOW: + { + hr = base->OnShow( m_ipConsole, (BOOL) arg, (HSCOPEITEM) param ); + break; + } + + case MMCN_ADD_IMAGES: + { + if( NULL == base ) + { + IImageList *pResultImageList = (IImageList *)arg; + + if( ( NULL != pResultImageList ) && ( NULL != m_hBMapSm ) && ( NULL != m_hBMapLg ) ) + { + hr = pResultImageList->ImageListSetStrip( + (LONG_PTR *)m_hBMapSm, + (LONG_PTR *)m_hBMapLg, + 0, + RGB(0, 128, 128)); + } + } + else + { + hr = base->OnAddImages( (IImageList *) arg, (HSCOPEITEM) param ); + } + break; + } + case MMCN_SELECT: + { + hr = base->OnSelect( this, m_ipConsole, (BOOL) LOWORD(arg), (BOOL) HIWORD(arg) ); + break; + } + + case MMCN_RENAME: + { + hr = base->OnRename( (LPOLESTR) param ); + + // + // Now call IConsole::UpdateAllViews to redraw the item in all views. + // + hr = m_pComponentData->m_ipConsole->UpdateAllViews( lpDataObject, 0, UPDATE_RESULTITEM ); + _ASSERT( S_OK == hr); + + break; + } + case MMCN_REFRESH: + { + // + // We pass CComponentData's stored IConsole pointer here, + // so that the IConsole::UpdateAllViews can be called in OnRefresh + // + hr = base->OnRefresh( m_pComponentData->m_ipConsole ); + break; + } + case MMCN_DELETE: + { + // + // First delete the selected result item + // + hr = base->OnDelete( m_pComponentData->m_ipConsoleNameSpace, m_ipConsole ); + + // + // Now call IConsole::UpdateAllViews to redraw all views + // owned by the parent scope item. OnRefresh already does + // this for us, so use it. + // + hr = base->OnRefresh( m_pComponentData->m_ipConsole ); + break; + } + + // + // Handle the property change notification if we need to do anything + // special with it + // + case MMCN_PROPERTY_CHANGE: + { + // + // We pass CComponentData's stored IConsole pointer here, + // so that the IConsole::UpdateAllViews can be called in OnPropertyChange + // + hr = base->OnPropertyChange( m_pComponentData->m_ipConsole, this ); + break; + } + case MMCN_CONTEXTHELP: + { + hr = base->OnShowContextHelp( m_ipDisplayHelp, (LPOLESTR) base->GetHelpFile().c_str() ); + break; + } + } + + return hr; +} + +STDMETHODIMP CComponent::Destroy( MMC_COOKIE cookie ) +{ + if( m_ipConsole ) + { + m_ipConsole->Release(); + m_ipConsole = NULL; + } + + if( m_ipDisplayHelp ) + { + m_ipDisplayHelp->Release(); + m_ipDisplayHelp = NULL; + } + + return S_OK; +} + +STDMETHODIMP CComponent::QueryDataObject( + /* [in] */ MMC_COOKIE cookie, + /* [in] */ DATA_OBJECT_TYPES type, + /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject ) +{ + CDataObject *pObj = NULL; + + if( 0 == cookie ) + pObj = new CDataObject( (MMC_COOKIE) m_pComponentData->m_pStaticNode, type ); + else + pObj = new CDataObject( cookie, type ); + + if( !pObj ) + return E_OUTOFMEMORY; + + pObj->QueryInterface( IID_IDataObject, (void **)ppDataObject ); + + return S_OK; +} + +STDMETHODIMP CComponent::GetResultViewType( + /* [in] */ MMC_COOKIE cookie, + /* [out] */ LPOLESTR __RPC_FAR *ppViewType, + /* [out] */ long __RPC_FAR *pViewOptions ) +{ + CDelegationBase *base = (CDelegationBase*) cookie; + + // + // Ask for default listview. + // + if( NULL == base ) + { + *pViewOptions = MMC_VIEW_OPTIONS_NONE; + *ppViewType = NULL; + } + else + return base->GetResultViewType( ppViewType, pViewOptions ); + + return S_OK; +} + +STDMETHODIMP CComponent::GetDisplayInfo( RESULTDATAITEM __RPC_FAR *pResultDataItem ) +{ + if( NULL == pResultDataItem ) + { + return E_INVALIDARG; + } + + HRESULT hr = S_OK; + CDelegationBase *base = NULL; + + // + // If they are asking for the RDI_STR we have one of those to give + // + if( pResultDataItem->lParam ) + { + base = (CDelegationBase*) pResultDataItem->lParam; + if( NULL == base ) + { + return E_INVALIDARG; + } + + if( pResultDataItem->mask & RDI_STR ) + { + LPCTSTR pszT = base->GetDisplayName( pResultDataItem->nCol ); + if( NULL == pszT ) + { + return E_OUTOFMEMORY; + } + + pResultDataItem->str = const_cast( pszT ); + } + + if( pResultDataItem->mask & RDI_IMAGE ) + { + pResultDataItem->nImage = base->GetBitmapIndex(); + } + } + + return hr; +} + + +STDMETHODIMP CComponent::CompareObjects( + /* [in] */ LPDATAOBJECT lpDataObjectA, + /* [in] */ LPDATAOBJECT lpDataObjectB ) +{ + if( ( NULL == lpDataObjectA ) || ( NULL == lpDataObjectB ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObjectA = GetOurDataObject( lpDataObjectA ); + if( NULL == pDataObjectA ) + { + return E_FAIL; + } + + CDataObject *pDataObjectB = GetOurDataObject( lpDataObjectB ); + if( NULL == pDataObjectB ) + { + return E_FAIL; + } + + CDelegationBase *baseA = pDataObjectA->GetBaseNodeObject(); + if( NULL == baseA ) + { + return E_FAIL; + } + + CDelegationBase *baseB = pDataObjectB->GetBaseNodeObject(); + if( NULL == baseB ) + { + return E_FAIL; + } + + // + // compare the object pointers + // + if( baseA->GetCookie() == baseB->GetCookie() ) + { + return S_OK; + } + else + { + return S_FALSE; + } +} + +/////////////////////////////////// +// Interface IExtendPropertySheet2 +/////////////////////////////////// +HRESULT CComponent::CreatePropertyPages( + /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider, + /* [in] */ LONG_PTR handle, + /* [in] */ LPDATAOBJECT piDataObject ) +{ + if( ( NULL == lpProvider ) || ( NULL == handle ) || ( NULL == piDataObject ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->CreatePropertyPages( lpProvider, handle ); +} + +HRESULT CComponent::QueryPagesFor(/* [in] */ LPDATAOBJECT piDataObject ) +{ + if( NULL == piDataObject ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->HasPropertySheets(); +} + +HRESULT CComponent::GetWatermarks( + /* [in] */ LPDATAOBJECT piDataObject, + /* [out] */ HBITMAP __RPC_FAR *lphWatermark, + /* [out] */ HBITMAP __RPC_FAR *lphHeader, + /* [out] */ HPALETTE __RPC_FAR *lphPalette, + /* [out] */ BOOL __RPC_FAR *bStretch) +{ + if( ( NULL == piDataObject ) || ( NULL == lphWatermark ) || ( NULL == lphHeader ) || ( NULL == lphPalette ) || ( NULL == bStretch ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->GetWatermarks( lphWatermark, lphHeader, lphPalette, bStretch ); +} + +/////////////////////////////// +// Interface IExtendControlBar +/////////////////////////////// + +HRESULT CComponent::SetControlbar( /* [in] */ LPCONTROLBAR pControlbar ) +{ + HRESULT hr = S_OK; + + // + // Clean up + // + + // + // If we've got a cached toolbar, release it + // + if( m_ipToolbar ) + { + m_ipToolbar->Release(); + m_ipToolbar = NULL; + } + + // + // If we've got a cached control bar, release it + // + if( m_ipControlBar ) + { + m_ipControlBar->Release(); + m_ipControlBar = NULL; + } + + // + // Install new pieces if necessary + // + + // + // if a new one came in, cache and AddRef + // + if( pControlbar ) + { + m_ipControlBar = pControlbar; + m_ipControlBar->AddRef(); + + hr = m_ipControlBar->Create( + TOOLBAR, // type of control to be created + dynamic_cast(this), + reinterpret_cast(&m_ipToolbar) ); + + _ASSERT(SUCCEEDED(hr)); + + WCHAR szStart[ 100 ], szStop[ 100 ]; + WCHAR szStartDescription[ 256 ], szStopDescription[ 256 ]; + + MMCBUTTON SnapinButtons1[] = + { + { 0, ID_BUTTONSTART, TBSTATE_ENABLED, TBSTYLE_GROUP, szStart, szStartDescription }, + { 1, ID_BUTTONSTOP, TBSTATE_ENABLED, TBSTYLE_GROUP, szStop, szStopDescription}, + }; + + ::LoadStringW( g_hinst, IDS_WEBSERVER_START, szStart, ARRAYLEN( szStart ) ); + ::LoadStringW( g_hinst, IDS_WEBSERVER_START_DESCRIPTION, szStartDescription, ARRAYLEN( szStartDescription ) ); + ::LoadStringW( g_hinst, IDS_WEBSERVER_STOP, szStop, ARRAYLEN( szStop ) ); + ::LoadStringW( g_hinst, IDS_WEBSERVER_STOP_DESCRIPTION, szStopDescription, ARRAYLEN( szStopDescription ) ); + + // + // The IControlbar::Create AddRefs the toolbar object it created + // so no need to do any addref on the interface. + // + + // + // Add the bitmap to the toolbar + // + HBITMAP hbmp = LoadBitmap( g_hinst, MAKEINTRESOURCE( IDR_TOOLBAR1 ) ); + hr = m_ipToolbar->AddBitmap( ARRAYLEN( SnapinButtons1 ), hbmp, 16, 16, RGB( 0, 128, 128 ) ); + _ASSERT( SUCCEEDED(hr) ); + + // + // Add the buttons to the toolbar + // + hr = m_ipToolbar->AddButtons( ARRAYLEN(SnapinButtons1), SnapinButtons1 ); + _ASSERT( SUCCEEDED(hr) ); + } + + return hr; +} + +HRESULT CComponent::ControlbarNotify( + /* [in] */ MMC_NOTIFY_TYPE event, + /* [in] */ LPARAM arg, + /* [in] */ LPARAM param ) +{ + HRESULT hr = S_OK; + + if( MMCN_SELECT == event ) + { + BOOL bScope = (BOOL) LOWORD(arg); + BOOL bSelect = (BOOL) HIWORD(arg); + + if( NULL == param ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( reinterpret_cast( param ) ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + hr = base->OnSetToolbar( m_ipControlBar, m_ipToolbar, bScope, bSelect ); + } + else if( MMCN_BTN_CLICK == event ) + { + if( NULL == arg ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( reinterpret_cast( arg ) ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + hr = base->OnToolbarCommand( m_pComponentData->m_ipConsole, (MMC_CONSOLE_VERB)param, reinterpret_cast(arg) ); + } + + return hr; +} + +/////////////////////////////// +// Interface IExtendContextMenu +/////////////////////////////// +HRESULT CComponent::AddMenuItems( + LPDATAOBJECT piDataObject, + LPCONTEXTMENUCALLBACK piCallback, + long __RPC_FAR *pInsertionAllowed ) +{ + if( ( NULL == piDataObject ) || ( NULL == piCallback ) || ( NULL == pInsertionAllowed ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->OnAddMenuItems( piCallback, pInsertionAllowed ); +} + +HRESULT CComponent::Command( long lCommandID, LPDATAOBJECT piDataObject ) +{ + if( NULL == piDataObject ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->OnMenuCommand( m_ipConsole, NULL, lCommandID, piDataObject ); +} diff --git a/inetsrv/uddi/source/mmc/comp.h b/inetsrv/uddi/source/mmc/comp.h new file mode 100644 index 0000000..f57f956 --- /dev/null +++ b/inetsrv/uddi/source/mmc/comp.h @@ -0,0 +1,104 @@ +#ifndef _SAMPCOMP_H_ +#define _SAMPCOMP_H_ + +#include + +class CComponent : public IComponent, IExtendPropertySheet2, IExtendControlbar, IExtendContextMenu +{ +private: + ULONG m_cref; + + IConsole* m_ipConsole; + IControlbar* m_ipControlBar; + IToolbar* m_ipToolbar; + IDisplayHelp* m_ipDisplayHelp; + + HBITMAP m_hBMapSm; + HBITMAP m_hBMapLg; + + class CComponentData *m_pComponentData; + + public: + CComponent( CComponentData *parent ); + ~CComponent(); + + /////////////////////////////// + // Interface IUnknown + /////////////////////////////// + STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + + /////////////////////////////// + // Interface IComponent + /////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE Initialize( /* [in] */ LPCONSOLE lpConsole ); + + virtual HRESULT STDMETHODCALLTYPE Notify( + /* [in] */ LPDATAOBJECT lpDataObject, + /* [in] */ MMC_NOTIFY_TYPE event, + /* [in] */ LPARAM arg, + /* [in] */ LPARAM param ); + + virtual HRESULT STDMETHODCALLTYPE Destroy(/* [in] */ MMC_COOKIE cookie ); + + virtual HRESULT STDMETHODCALLTYPE QueryDataObject( + /* [in] */ MMC_COOKIE cookie, + /* [in] */ DATA_OBJECT_TYPES type, + /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject ); + + virtual HRESULT STDMETHODCALLTYPE GetResultViewType( + /* [in] */ MMC_COOKIE cookie, + /* [out] */ LPOLESTR __RPC_FAR *ppViewType, + /* [out] */ long __RPC_FAR *pViewOptions ); + + virtual HRESULT STDMETHODCALLTYPE GetDisplayInfo( /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem ); + + virtual HRESULT STDMETHODCALLTYPE CompareObjects( + /* [in] */ LPDATAOBJECT lpDataObjectA, + /* [in] */ LPDATAOBJECT lpDataObjectB); + + ////////////////////////////////// + // Interface IExtendPropertySheet2 + ////////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE CreatePropertyPages( + /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider, + /* [in] */ LONG_PTR handle, + /* [in] */ LPDATAOBJECT lpIDataObject); + + virtual HRESULT STDMETHODCALLTYPE QueryPagesFor( /* [in] */ LPDATAOBJECT lpDataObject ); + + virtual HRESULT STDMETHODCALLTYPE GetWatermarks( + /* [in] */ LPDATAOBJECT lpIDataObject, + /* [out] */ HBITMAP __RPC_FAR *lphWatermark, + /* [out] */ HBITMAP __RPC_FAR *lphHeader, + /* [out] */ HPALETTE __RPC_FAR *lphPalette, + /* [out] */ BOOL __RPC_FAR *bStretch ); + + /////////////////////////////// + // Interface IExtendControlBar + /////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE SetControlbar( /* [in] */ LPCONTROLBAR pControlbar ); + + virtual HRESULT STDMETHODCALLTYPE ControlbarNotify( + /* [in] */ MMC_NOTIFY_TYPE event, + /* [in] */ LPARAM arg, + /* [in] */ LPARAM param ); + + /////////////////////////////// + // Interface IExtendContextMenu + /////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE AddMenuItems( + /* [in] */ LPDATAOBJECT piDataObject, + /* [in] */ LPCONTEXTMENUCALLBACK piCallback, + /* [out][in] */ long __RPC_FAR *pInsertionAllowed ); + + virtual HRESULT STDMETHODCALLTYPE Command( + /* [in] */ long lCommandID, + /* [in] */ LPDATAOBJECT piDataObject ); + + public: + IToolbar *getToolbar() { return m_ipToolbar; } +}; + +#endif _SAMPCOMP_H_ diff --git a/inetsrv/uddi/source/mmc/compdata.cpp b/inetsrv/uddi/source/mmc/compdata.cpp new file mode 100644 index 0000000..48c7f16 --- /dev/null +++ b/inetsrv/uddi/source/mmc/compdata.cpp @@ -0,0 +1,744 @@ +#include "comp.h" +#include "compdata.h" +#include "dataobj.h" +#include "resource.h" +#include +#include "globals.h" +#include "guids.h" +#include "uddi.h" + +CComponentData::CComponentData() + : m_cref(0) + , m_ipConsoleNameSpace(NULL) + , m_ipConsole(NULL) + , m_bExpanded( false ) +{ + OBJECT_CREATED + m_pStaticNode = new CUDDIServicesNode; +} + +CComponentData::~CComponentData() +{ + if( m_pStaticNode ) + { + delete m_pStaticNode; + } + + OBJECT_DESTROYED +} + +/////////////////////// +// IUnknown implementation +/////////////////////// +STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv) +{ + if( !ppv ) + return E_FAIL; + + *ppv = NULL; + + if( IsEqualIID( riid, IID_IUnknown ) ) + *ppv = static_cast(this); + else if( IsEqualIID( riid, IID_IComponentData ) ) + *ppv = static_cast(this); + else if( IsEqualIID( riid, IID_IExtendPropertySheet ) || + IsEqualIID( riid, IID_IExtendPropertySheet2 ) ) + *ppv = static_cast(this); + else if( IsEqualIID(riid, IID_IExtendContextMenu ) ) + *ppv = static_cast(this); + else if( IsEqualIID( riid, IID_IPersistStream ) ) + *ppv = static_cast(this); + else if( IsEqualIID( riid, IID_ISnapinHelp ) ) + *ppv = static_cast(this); + + if( *ppv ) + { + reinterpret_cast(*ppv)->AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) CComponentData::AddRef() +{ + return InterlockedIncrement(( LONG *)&m_cref ); +} + +STDMETHODIMP_(ULONG) CComponentData::Release() +{ + if( 0 == InterlockedDecrement( (LONG *)&m_cref ) ) + { + // + // We need to decrement our object count in the DLL + // + delete this; + return 0; + } + + return m_cref; +} + +/////////////////////////////// +// Interface IComponentData +/////////////////////////////// +HRESULT CComponentData::Initialize( LPUNKNOWN pUnknown ) +{ + HRESULT hr; + + // + // Get pointer to name space interface + // + hr = pUnknown->QueryInterface( IID_IConsoleNameSpace, (void **) &m_ipConsoleNameSpace ); + _ASSERT( S_OK == hr ); + + // + // Get pointer to console interface + // + hr = pUnknown->QueryInterface( IID_IConsole, (void **) &m_ipConsole ); + _ASSERT( S_OK == hr ); + + IImageList *pImageList; + m_ipConsole->QueryScopeImageList( &pImageList ); + _ASSERT( S_OK == hr ); + + hr = pImageList->ImageListSetStrip( + (long *) m_pStaticNode->m_pBMapSm, // pointer to a handle + (long *) m_pStaticNode->m_pBMapLg, // pointer to a handle + 0, // index of the first image in the strip + RGB(0, 128, 128) // color of the icon mask + ); + + pImageList->Release(); + + return S_OK; +} + +HRESULT CComponentData::CreateComponent( LPCOMPONENT __RPC_FAR *ppComponent ) +{ + *ppComponent = NULL; + + CComponent *pComponent = new CComponent(this); + + if( NULL == pComponent ) + return E_OUTOFMEMORY; + + return pComponent->QueryInterface( IID_IComponent, (void **)ppComponent ); +} + +HRESULT CComponentData::ExtractData( IDataObject* piDataObject, + CLIPFORMAT cfClipFormat, + BYTE* pbData, + DWORD cbData ) +{ + HRESULT hr = S_OK; + + FORMATETC formatetc = {cfClipFormat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + STGMEDIUM stgmedium = {TYMED_HGLOBAL, NULL}; + + stgmedium.hGlobal = ::GlobalAlloc(GPTR, cbData); + do // false loop + { + if( NULL == stgmedium.hGlobal ) + { + hr = E_OUTOFMEMORY; + break; + } + hr = piDataObject->GetDataHere( &formatetc, &stgmedium ); + if( FAILED(hr) ) + { + break; + } + + BYTE* pbNewData = reinterpret_cast(stgmedium.hGlobal); + if( NULL == pbNewData ) + { + hr = E_UNEXPECTED; + break; + } + ::memcpy( pbData, pbNewData, cbData ); + } + while( FALSE ); // false loop + + if( NULL != stgmedium.hGlobal ) + { + ::GlobalFree(stgmedium.hGlobal); + } + return hr; +} // ExtractData() + +HRESULT CComponentData::ExtractString( IDataObject *piDataObject, + CLIPFORMAT cfClipFormat, + WCHAR *pstr, + DWORD cchMaxLength ) +{ + return ExtractData( piDataObject, cfClipFormat, (PBYTE)pstr, cchMaxLength ); +} + +HRESULT CComponentData::ExtractSnapInCLSID( IDataObject* piDataObject, CLSID* pclsidSnapin ) +{ + return ExtractData( piDataObject, static_cast(CDataObject::s_cfSnapinClsid), (PBYTE)pclsidSnapin, sizeof(CLSID) ); +} + +HRESULT CComponentData::ExtractComputerNameExt( IDataObject * pDataObject, tstring& strComputer ) +{ + // + // Find the computer name from the ComputerManagement snapin + // + CLIPFORMAT CCF_MyComputMachineName = (CLIPFORMAT) RegisterClipboardFormat( _T("MMC_SNAPIN_MACHINE_NAME") ); + STGMEDIUM stgmedium = { TYMED_HGLOBAL, NULL }; + FORMATETC formatetc = { + CCF_MyComputMachineName, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL + }; + + // + // Allocate memory for the stream + // + int len = MAX_PATH; + stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, len ); + + if( NULL == stgmedium.hGlobal ) + { + return ERROR_NOT_ENOUGH_MEMORY; + } + + HRESULT hr = pDataObject->GetDataHere( &formatetc, &stgmedium ); + _ASSERT( SUCCEEDED(hr) ); + + // + // Get the computer name + // + strComputer = (LPTSTR) stgmedium.hGlobal; + + GlobalFree( stgmedium.hGlobal ); + + return hr; +} + +HRESULT CComponentData::ExtractObjectTypeGUID( IDataObject* piDataObject, GUID* pguidObjectType ) +{ + return ExtractData( piDataObject, static_cast(CDataObject::s_cfNodeType), (PBYTE)pguidObjectType, sizeof(GUID) ); +} + +HRESULT CComponentData::Notify( LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param ) +{ + MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param); + + HRESULT hr = S_FALSE; + + if( NULL == lpDataObject ) + { + if( MMCN_PROPERTY_CHANGE == event ) + { + CDelegationBase* pNode = (CDelegationBase*) param; + if( NULL == pNode ) + { + return E_INVALIDARG; + } + else + { + return pNode->OnPropertyChange( this->m_ipConsole, NULL ); + } + } + return S_FALSE; + } + + switch( event ) + { + case MMCN_EXPAND: + { + GUID guid; + + // + // Extract GUID of the currently selected node type + // from the data object + // + memset( &guid, 0, sizeof( GUID ) ); + hr = ExtractObjectTypeGUID( lpDataObject, &guid ); + if( FAILED( hr ) ) + { + return E_INVALIDARG; + } + + // + // Check to see if the "Services and Applications" node + // is being expanded. If so add our stuff. + // + if( IsEqualGUID( guid, CLSID_CServicesAndApplications ) ) + { + m_pStaticNode->SetExtension( true ); + + // + // Turn on Extension mode + // + tstring strComputerName; + hr = ExtractComputerNameExt( lpDataObject, strComputerName ); + OutputDebugString( _T("Computer Name is: ") ); + OutputDebugString( strComputerName.c_str() ); + OutputDebugString( _T("\n") ); + m_pStaticNode->SetRemoteComputerName( strComputerName.c_str() ); + + OnExpand( m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM) param ); + } + else + { + // + // Get our data object. If it is NULL, we return with S_FALSE. + // See implementation of GetOurDataObject() to see how to + // handle special data objects. + // + CDataObject *pDataObject = GetOurDataObject( lpDataObject ); + if( NULL == pDataObject ) + { + return S_FALSE; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return S_FALSE; + } + + hr = base->OnExpand( m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM) param ); + } + break; + } + + case MMCN_PROPERTY_CHANGE: + { + // + // Get our data object. If it is NULL, we return with S_FALSE. + // See implementation of GetOurDataObject() to see how to + // handle special data objects. + // + CDataObject *pDataObject = GetOurDataObject( lpDataObject ); + if( NULL == pDataObject ) + { + return S_FALSE; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return S_FALSE; + } + + // + // We pass CComponentData's stored IConsole pointer here, + // so that the IConsole::UpdateAllViews can be called in OnPropertyChange + // + hr = base->OnPropertyChange( m_ipConsole, NULL ); + break; + } + + case MMCN_DELETE: + { + // + // Get our data object. If it is NULL, we return with S_FALSE. + // See implementation of GetOurDataObject() to see how to + // handle special data objects. + // + CDataObject *pDataObject = GetOurDataObject( lpDataObject ); + if( NULL == pDataObject ) + { + return S_FALSE; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return S_FALSE; + } + + hr = base->OnDelete( m_ipConsoleNameSpace, m_ipConsole ); + break; + } + + case MMCN_REMOVE_CHILDREN: + { + OutputDebugString( _T( "inside MMCN_REMOVE_CHILDREN handler.\r\n" ) ); + + HSCOPEITEM hToBeDeleted = (HSCOPEITEM)arg; + HSCOPEITEM hStaticNodesParent = m_pStaticNode->GetParentScopeItem(); + if( hToBeDeleted == hStaticNodesParent ) + { + hr = m_pStaticNode->RemoveChildren( m_ipConsoleNameSpace ); + } + break; + } + + } + + return hr; +} + +HRESULT CComponentData::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) +{ + // + // Now fill an SCOPEDATAITEM for each item and then insert it + // + SCOPEDATAITEM sdi; + + if( !m_bExpanded ) + { + // + // Create the child nodes, then expand them + // + ZeroMemory( &sdi, sizeof(SCOPEDATAITEM) ); + sdi.mask = SDI_STR | // Displayname is valid + SDI_PARAM | // lParam is valid + SDI_IMAGE | // nImage is valid + SDI_PARENT | // relativeID is valid + SDI_OPENIMAGE | + SDI_CHILDREN; // cChildren is valid + + sdi.relativeID = (HSCOPEITEM)parent; + sdi.nImage = m_pStaticNode->GetBitmapIndex(); + sdi.nOpenImage = m_pStaticNode->GetBitmapIndex(); + sdi.displayname = MMC_CALLBACK; + sdi.lParam = (LPARAM) m_pStaticNode; + sdi.cChildren = 1; + + HRESULT hr = pConsoleNameSpace->InsertItem( &sdi ); + m_pStaticNode->SetScopeItemValue( sdi.ID ); + m_pStaticNode->SetParentScopeItem( sdi.relativeID ); + + _ASSERT( SUCCEEDED(hr) ); + } + + return S_OK; +} + +HRESULT CComponentData::Destroy( void ) +{ + // + // Free interfaces + // + if( m_ipConsoleNameSpace ) + { + m_ipConsoleNameSpace->Release(); + m_ipConsoleNameSpace = NULL; + } + + if( m_ipConsole ) + { + m_ipConsole->Release(); + m_ipConsole = NULL; + } + + return S_OK; +} + +HRESULT CComponentData::QueryDataObject( + /* [in] */ MMC_COOKIE cookie, + /* [in] */ DATA_OBJECT_TYPES type, + /* [out] */LPDATAOBJECT *ppDataObject ) +{ + CDataObject *pObj = NULL; + + if( 0 == cookie ) + pObj = new CDataObject( (MMC_COOKIE) m_pStaticNode, type ); + else + pObj = new CDataObject( cookie, type ); + + if( !pObj ) + return E_OUTOFMEMORY; + + pObj->QueryInterface( IID_IDataObject, (void **) ppDataObject ); + + return S_OK; +} + +HRESULT CComponentData::GetDisplayInfo( SCOPEDATAITEM *pScopeDataItem ) +{ + HRESULT hr = S_FALSE; + + // + // If they are asking for the SDI_STR we have one of those to give + // + if( pScopeDataItem->lParam ) + { + CDelegationBase *base = (CDelegationBase *) pScopeDataItem->lParam; + if( NULL == base ) + { + return hr; + } + + if( pScopeDataItem->mask & SDI_STR ) + { + LPCTSTR pszT = base->GetDisplayName(); + if( NULL == pszT ) + { + return E_OUTOFMEMORY; + } + + pScopeDataItem->displayname = const_cast( pszT ); + } + + if( pScopeDataItem->mask & SDI_IMAGE ) + { + pScopeDataItem->nImage = base->GetBitmapIndex(); + } + } + + return hr; +} + +HRESULT CComponentData::CompareObjects( LPDATAOBJECT piDataObjectA, LPDATAOBJECT piDataObjectB ) +{ + if( ( NULL == piDataObjectA ) || ( NULL == piDataObjectB ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObjectA = GetOurDataObject( piDataObjectA ); + if( NULL == pDataObjectA ) + { + return E_FAIL; + } + + CDataObject *pDataObjectB = GetOurDataObject( piDataObjectB ); + if( NULL == pDataObjectB ) + { + return E_FAIL; + } + + + CDelegationBase *baseA = pDataObjectA->GetBaseNodeObject(); + if( NULL == baseA ) + { + return E_FAIL; + } + + CDelegationBase *baseB = pDataObjectB->GetBaseNodeObject(); + if( NULL == baseB ) + { + return E_FAIL; + } + + // + // Compare the object pointers + // + if( baseA->GetCookie() == baseB->GetCookie() ) + { + return S_OK; + } + else + { + return S_FALSE; + } +} + +/////////////////////////////////// +// Interface IExtendPropertySheet2 +/////////////////////////////////// +HRESULT CComponentData::CreatePropertyPages( + /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider, + /* [in] */ LONG_PTR handle, + /* [in] */ LPDATAOBJECT piDataObject ) +{ + if( ( NULL == lpProvider ) || ( NULL == handle ) || ( NULL == piDataObject ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->CreatePropertyPages( lpProvider, handle ); +} + +HRESULT CComponentData::QueryPagesFor( LPDATAOBJECT piDataObject ) +{ + if( NULL == piDataObject ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->HasPropertySheets(); +} + +HRESULT CComponentData::GetWatermarks( + /* [in] */ LPDATAOBJECT piDataObject, + /* [out] */ HBITMAP __RPC_FAR *lphWatermark, + /* [out] */ HBITMAP __RPC_FAR *lphHeader, + /* [out] */ HPALETTE __RPC_FAR *lphPalette, + /* [out] */ BOOL __RPC_FAR *bStretch) +{ + if( ( NULL == piDataObject ) || ( NULL == lphWatermark ) || ( NULL == lphHeader ) || ( NULL == lphPalette ) || ( NULL == bStretch ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->GetWatermarks( lphWatermark, lphHeader, lphPalette, bStretch ); +} + +/////////////////////////////// +// Interface IExtendContextMenu +/////////////////////////////// +HRESULT CComponentData::AddMenuItems( + /* [in] */ LPDATAOBJECT piDataObject, + /* [in] */ LPCONTEXTMENUCALLBACK piCallback, + /* [out][in] */ long __RPC_FAR *pInsertionAllowed) +{ + if( ( NULL == piDataObject ) || ( NULL == piCallback ) || ( NULL == pInsertionAllowed ) ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->OnAddMenuItems( piCallback, pInsertionAllowed ); +} + +HRESULT CComponentData::Command( long lCommandID, LPDATAOBJECT piDataObject ) +{ + if( NULL == piDataObject ) + { + return E_INVALIDARG; + } + + CDataObject *pDataObject = GetOurDataObject( piDataObject ); + if( NULL == pDataObject ) + { + return E_FAIL; + } + + CDelegationBase *base = pDataObject->GetBaseNodeObject(); + if( NULL == base ) + { + return E_FAIL; + } + + return base->OnMenuCommand( m_ipConsole, m_ipConsoleNameSpace, lCommandID, piDataObject ); +} + +/////////////////////////////// +// Interface IPersistStream +/////////////////////////////// +HRESULT CComponentData::GetClassID( /*[out]*/ CLSID *pClassID ) +{ + *pClassID = m_pStaticNode->getNodeType(); + return S_OK; +} + +HRESULT CComponentData::IsDirty() +{ + return m_pStaticNode->IsDirty() ? S_OK : S_FALSE; +} + +HRESULT CComponentData::Load( /*[unique][in]*/ IStream *pStm ) +{ + return m_pStaticNode->Load( pStm ); +} + +HRESULT CComponentData::Save( /*[unique][in]*/ IStream *pStm, /*[in]*/ BOOL fClearDirty ) +{ + return m_pStaticNode->Save( pStm, fClearDirty ); +} + +HRESULT CComponentData::GetSizeMax( /*[out]*/ ULARGE_INTEGER *pcbSize ) +{ + ULARGE_INTEGER cbSize = { m_pStaticNode->GetSizeMax(), 0 }; + *pcbSize = cbSize; + + return S_OK; +} + +/////////////////////////////// +// Interface ISnapinHelp +/////////////////////////////// +HRESULT CComponentData::GetHelpTopic( LPOLESTR* lpCompiledHelpFile ) +{ + try + { + if( NULL == lpCompiledHelpFile ) + { + return E_INVALIDARG; + } + + // + // Determine the help file location based + // on the install root + // + WCHAR szWindowsDir[ MAX_PATH ]; + szWindowsDir[ 0 ] = 0x00; + UINT nSize = GetWindowsDirectoryW( szWindowsDir, MAX_PATH ); + if( 0 == nSize || nSize > MAX_PATH ) + return E_FAIL; + + wstring strHelpFile = szWindowsDir; + strHelpFile += L"\\Help\\"; + + WCHAR szHelpFileName[ 100 ]; + szHelpFileName[ 0 ] = 0x00; + LoadString( g_hinst, IDS_UDDIMMC_HELPFILE, szHelpFileName, ARRAYLEN( szHelpFileName ) ); + + strHelpFile += szHelpFileName; + + UINT nBytes = ( strHelpFile.length() + 1 ) * sizeof(WCHAR); + *lpCompiledHelpFile = (LPOLESTR) CoTaskMemAlloc( nBytes ); + if( NULL == *lpCompiledHelpFile ) + { + return E_OUTOFMEMORY; + } + + memcpy( *lpCompiledHelpFile, strHelpFile.c_str(), nBytes ); + + return S_OK; + } + catch( ... ) + { + return E_OUTOFMEMORY; + } +} + +HRESULT CComponentData::GetLinkedTopics( LPOLESTR* lpCompiledHelpFiles ) +{ + return E_NOTIMPL; +} + + diff --git a/inetsrv/uddi/source/mmc/compdata.h b/inetsrv/uddi/source/mmc/compdata.h new file mode 100644 index 0000000..f899bc6 --- /dev/null +++ b/inetsrv/uddi/source/mmc/compdata.h @@ -0,0 +1,114 @@ +#pragma once + +#include +#include "delebase.h" +#include "uddiservicesnode.h" +#include "comp.h" +#include "objidl.h" + +class CComponentData + : public IComponentData + , IExtendPropertySheet2 + , IExtendContextMenu + , IPersistStream + , ISnapinHelp2 +{ + friend class CComponent; + +private: + ULONG m_cref; + LPCONSOLE m_ipConsole; + LPCONSOLENAMESPACE m_ipConsoleNameSpace; + BOOL m_bExpanded; + + CUDDIServicesNode *m_pStaticNode; + +public: + CComponentData(); + ~CComponentData(); + + HRESULT ExtractObjectTypeGUID( IDataObject* piDataObject, GUID* pguidObjectType ); + HRESULT ExtractSnapInCLSID( IDataObject* piDataObject, CLSID* pclsidSnapin ); + HRESULT ExtractString( IDataObject *piDataObject, CLIPFORMAT cfClipFormat, _TCHAR *pstr, DWORD cchMaxLength); + HRESULT ExtractData( IDataObject* piDataObject, CLIPFORMAT cfClipFormat, BYTE* pbData, DWORD cbData ); + HRESULT ExtractComputerNameExt( IDataObject * pDataObject, tstring& strComputer ); + HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent); + + + /////////////////////////////// + // Interface IUnknown + /////////////////////////////// + STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + + /////////////////////////////// + // Interface IComponentData + /////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE Initialize( /* [in] */ LPUNKNOWN pUnknown ); + virtual HRESULT STDMETHODCALLTYPE CreateComponent( /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent); + + virtual HRESULT STDMETHODCALLTYPE Notify( + /* [in] */ LPDATAOBJECT lpDataObject, + /* [in] */ MMC_NOTIFY_TYPE event, + /* [in] */ LPARAM arg, + /* [in] */ LPARAM param); + + virtual HRESULT STDMETHODCALLTYPE Destroy( void ); + + virtual HRESULT STDMETHODCALLTYPE QueryDataObject( + /* [in] */ MMC_COOKIE cookie, + /* [in] */ DATA_OBJECT_TYPES type, + /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject); + + virtual HRESULT STDMETHODCALLTYPE GetDisplayInfo( /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem ); + + virtual HRESULT STDMETHODCALLTYPE CompareObjects( + /* [in] */ LPDATAOBJECT lpDataObjectA, + /* [in] */ LPDATAOBJECT lpDataObjectB ); + + ////////////////////////////////// + // Interface IExtendPropertySheet2 + ////////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE CreatePropertyPages( + /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider, + /* [in] */ LONG_PTR handle, + /* [in] */ LPDATAOBJECT lpIDataObject ); + + virtual HRESULT STDMETHODCALLTYPE QueryPagesFor( + /* [in] */ LPDATAOBJECT lpDataObject ); + + virtual HRESULT STDMETHODCALLTYPE GetWatermarks( + /* [in] */ LPDATAOBJECT lpIDataObject, + /* [out] */ HBITMAP __RPC_FAR *lphWatermark, + /* [out] */ HBITMAP __RPC_FAR *lphHeader, + /* [out] */ HPALETTE __RPC_FAR *lphPalette, + /* [out] */ BOOL __RPC_FAR *bStretch ); + + /////////////////////////////// + // Interface IExtendContextMenu + /////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE AddMenuItems( + /* [in] */ LPDATAOBJECT piDataObject, + /* [in] */ LPCONTEXTMENUCALLBACK piCallback, + /* [out][in] */ long __RPC_FAR *pInsertionAllowed ); + + virtual HRESULT STDMETHODCALLTYPE Command( + /* [in] */ long lCommandID, + /* [in] */ LPDATAOBJECT piDataObject ); + + /////////////////////////////// + // Interface IPersistStream + /////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE GetClassID( /*[out]*/ CLSID *pClassID ); + virtual HRESULT STDMETHODCALLTYPE IsDirty(); + virtual HRESULT STDMETHODCALLTYPE Load( /*[unique][in]*/ IStream *pStm ); + virtual HRESULT STDMETHODCALLTYPE Save( /*[unique][in]*/ IStream *pStm, /*[in]*/ BOOL fClearDirty ); + virtual HRESULT STDMETHODCALLTYPE GetSizeMax( /*[out]*/ ULARGE_INTEGER *pcbSize ); + + /////////////////////////////// + // Interface ISnapinHelp + /////////////////////////////// + virtual HRESULT STDMETHODCALLTYPE GetHelpTopic( LPOLESTR* lpCompiledHelpFile); + virtual HRESULT STDMETHODCALLTYPE GetLinkedTopics( LPOLESTR* lpCompiledHelpFiles ); +}; diff --git a/inetsrv/uddi/source/mmc/dataobj.cpp b/inetsrv/uddi/source/mmc/dataobj.cpp new file mode 100644 index 0000000..90754f7 --- /dev/null +++ b/inetsrv/uddi/source/mmc/dataobj.cpp @@ -0,0 +1,239 @@ +#include "dataobj.h" +#include "guids.h" +#include "delebase.h" + +// +// This is the minimum set of clipboard formats we must implement. +// MMC uses these to get necessary information from our snapin about +// our nodes. +// + +// +// We need to do this to get around MMC.IDL - it explicitly defines +// the clipboard formats as WCHAR types... +// +#define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME") +#define _T_CCF_NODETYPE _T("CCF_NODETYPE") +#define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE") +#define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID") + +#define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}") + +// +// These are the clipboard formats that we must supply at a minimum. +// mmc.h actually defined these. We can make up our own to use for +// other reasons. We don't need any others at this time. +// +UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME); +UINT CDataObject::s_cfNodeType = RegisterClipboardFormat(_T_CCF_NODETYPE); +UINT CDataObject::s_cfSZNodeType = RegisterClipboardFormat(_T_CCF_SZNODETYPE); +UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID); +UINT CDataObject::s_cfInternal = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN); + +CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) + : m_lCookie(cookie) + , m_context(context) + , m_cref(0) +{ +} + +CDataObject::~CDataObject() +{ +} + +/////////////////////// +// IUnknown implementation +/////////////////////// +STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv) +{ + if( !ppv ) + return E_FAIL; + + *ppv = NULL; + + if( IsEqualIID(riid, IID_IUnknown) ) + *ppv = static_cast(this); + else if( IsEqualIID( riid, IID_IDataObject ) ) + *ppv = static_cast(this); + + if( *ppv ) + { + reinterpret_cast(*ppv)->AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) CDataObject::AddRef() +{ + return InterlockedIncrement( (LONG *)&m_cref ); +} + +STDMETHODIMP_(ULONG) CDataObject::Release() +{ + if( 0 == InterlockedDecrement( (LONG *) &m_cref ) ) + { + delete this; + return 0; + } + + return m_cref; +} + +///////////////////////////////////////////////////////////////////////////// +// IDataObject implementation +// +HRESULT CDataObject::GetDataHere( + FORMATETC *pFormatEtc, // [in] Pointer to the FORMATETC structure + STGMEDIUM *pMedium // [out] Pointer to the STGMEDIUM structure + ) +{ + if( ( NULL == pFormatEtc ) || ( NULL == pMedium ) ) + { + return E_INVALIDARG; + } + + const CLIPFORMAT cf = pFormatEtc->cfFormat; + IStream *pStream = NULL; + + HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream ); + if( FAILED(hr) ) + return hr; // Minimal error checking + + hr = DV_E_FORMATETC; // Unknown format + + CDelegationBase *base = GetBaseNodeObject(); + if( NULL == base ) + { + pStream->Release(); + return E_FAIL; + } + + if( s_cfDisplayName == cf ) + { + const _TCHAR *pszName = base->GetDisplayName(); + if( NULL == pszName ) + { + pStream->Release(); + return E_OUTOFMEMORY; + } + + // + // Get length of original string and convert it accordingly + // + ULONG ulSizeofName = lstrlen( pszName ); + + // + // Count null character + // + ulSizeofName++; + ulSizeofName *= sizeof(WCHAR); + + hr = pStream->Write(pszName, ulSizeofName, NULL); + } + else if( s_cfNodeType == cf ) + { + const GUID *pGUID = (const GUID *)&base->getNodeType(); + + hr = pStream->Write(pGUID, sizeof(GUID), NULL); + } + else if( s_cfSZNodeType == cf ) + { + LPOLESTR pszGuid = NULL; + hr = StringFromCLSID( base->getNodeType(), &pszGuid ); + + if( SUCCEEDED(hr) ) + { + hr = pStream->Write( pszGuid, wcslen(pszGuid), NULL ); + CoTaskMemFree( pszGuid ); + } + } + else if( s_cfSnapinClsid == cf ) + { + const GUID *pGUID = NULL; + pGUID = &CLSID_CUDDIServices; + hr = pStream->Write( pGUID, sizeof(GUID), NULL ); + } + else if( s_cfInternal == cf ) + { + // + // We are being asked to get our this pointer from the IDataObject interface + // only our own snap-in objects will know how to do this. + // + CDataObject *pThis = this; + hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL ); + } + + pStream->Release(); + + return hr; +} + +///////////////////////////////////////////////////////////////////////////// +// Global helper functions to help work with dataobjects and +// clipboard formats + + +//--------------------------------------------------------------------------- +// Returns the current object based on the s_cfInternal clipboard format +// +CDataObject* GetOurDataObject( LPDATAOBJECT lpDataObject ) +{ + HRESULT hr = S_OK; + CDataObject *pSDO = NULL; + + // + // Check to see if the data object is a special data object. + // + if( IS_SPECIAL_DATAOBJECT( lpDataObject ) ) + { + // + //Code for handling a special data object goes here. + // + + // + // We do not handle special data objects, so we exit if we get one. + // + return NULL; + } + + STGMEDIUM stgmedium = { TYMED_HGLOBAL, NULL }; + FORMATETC formatetc = { ( CLIPFORMAT ) CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + + // + // Allocate memory for the stream + // + stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *) ); + + if( !stgmedium.hGlobal ) + { + hr = E_OUTOFMEMORY; + } + + if( SUCCEEDED(hr) ) + { + // + // Attempt to get data from the object + // + hr = lpDataObject->GetDataHere( &formatetc, &stgmedium ); + } + + // + // stgmedium now has the data we need + // + if( SUCCEEDED(hr) ) + { + pSDO = *(CDataObject **)(stgmedium.hGlobal); + } + + // + // If we have memory free it + // + if( stgmedium.hGlobal ) + GlobalFree(stgmedium.hGlobal); + + return pSDO; + +} // end GetOurDataObject() + diff --git a/inetsrv/uddi/source/mmc/dataobj.h b/inetsrv/uddi/source/mmc/dataobj.h new file mode 100644 index 0000000..d492630 --- /dev/null +++ b/inetsrv/uddi/source/mmc/dataobj.h @@ -0,0 +1,88 @@ +#ifndef _SAMPDATAOBJECT_H_ +#define _SAMPDATAOBJECT_H_ + +#include +#include "delebase.h" + +class CDataObject : public IDataObject +{ +private: + ULONG m_cref; + MMC_COOKIE m_lCookie; + DATA_OBJECT_TYPES m_context; + +public: + CDataObject( MMC_COOKIE cookie, DATA_OBJECT_TYPES context ); + ~CDataObject(); + + /////////////////////////////// + // Interface IUnknown + /////////////////////////////// + STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + + /////////////////////////////// + // IDataObject methods + /////////////////////////////// + STDMETHODIMP GetDataHere ( FORMATETC *pformatetc, STGMEDIUM *pmedium ); + + // + // The rest are not implemented + // + STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) + { return E_NOTIMPL; }; + + STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc) + { return E_NOTIMPL; }; + + STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc) + { return E_NOTIMPL; }; + + STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) + { return E_NOTIMPL; }; + + STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) + { return E_NOTIMPL; }; + + STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) + { return E_NOTIMPL; }; + + STDMETHODIMP DUnadvise (DWORD dwConnection) + { return E_NOTIMPL; }; + + STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise) + { return E_NOTIMPL; }; + + /////////////////////////////// + // Custom Methods + /////////////////////////////// + + CDelegationBase *GetBaseNodeObject() + { + return (CDelegationBase *)m_lCookie; + } + + DATA_OBJECT_TYPES GetContext() + { + return m_context; + } + +public: + + // + // Clipboard formats + // + static UINT s_cfSZNodeType; + static UINT s_cfDisplayName; + static UINT s_cfNodeType; + static UINT s_cfSnapinClsid; + static UINT s_cfInternal; + +}; + +HRESULT ExtractFromDataObject( IDataObject *lpDataObject, UINT cf, ULONG cb, HGLOBAL *phGlobal ); +CDataObject* GetOurDataObject( IDataObject *lpDataObject ); +BOOL IsMMCMultiSelectDataObject( IDataObject *lpDataObject ); + +#endif _SAMPDATAOBJECT_H_ diff --git a/inetsrv/uddi/source/mmc/delebase.cpp b/inetsrv/uddi/source/mmc/delebase.cpp new file mode 100644 index 0000000..976d53a --- /dev/null +++ b/inetsrv/uddi/source/mmc/delebase.cpp @@ -0,0 +1,42 @@ +#include "delebase.h" + +const GUID CDelegationBase::thisGuid = { 0x786c6f77, 0x6be7, 0x11d3, {0x91, 0x56, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} }; +// {786C6F77-6BE7-11d3-9156-00C04F65B3F9} +//DEFINE_GUID(<>, +//0x786c6f77, 0x6be7, 0x11d3, 0x91, 0x56, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9); + +HBITMAP CDelegationBase::m_pBMapSm = NULL; +HBITMAP CDelegationBase::m_pBMapLg = NULL; + +//============================================================== +// +// CDelegationBase implementation +// +// +CDelegationBase::CDelegationBase() +: m_bExpanded(FALSE) +, m_wstrHelpFile(L"") +, m_bIsExtension(FALSE) +, m_hsiParent( 0 ) +, m_hsiThis( 0 ) +{ + if( ( NULL == m_pBMapSm ) || ( NULL == m_pBMapLg ) ) + LoadBitmaps(); +} + +CDelegationBase::~CDelegationBase() +{ +} + +// +// CDelegationBase::AddImages sets up the collection of images to be displayed +// by the IComponent in the result pane as a result of its MMCN_SHOW handler +// +HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) +{ + return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle + (long *)m_pBMapLg, // pointer to a handle + 0, // index of the first image in the strip + RGB(0, 128, 128) // color of the icon mask + ); +} diff --git a/inetsrv/uddi/source/mmc/delebase.h b/inetsrv/uddi/source/mmc/delebase.h new file mode 100644 index 0000000..ab9ce29 --- /dev/null +++ b/inetsrv/uddi/source/mmc/delebase.h @@ -0,0 +1,99 @@ +#ifndef _BRANCHES_H +#define _BRANCHES_H + +#include +#include +#include "globals.h" +#include "resource.h" +#include "localres.h" +#include "uddi.h" + +class CComponent; +class CComponentData; + +class CDelegationBase +{ +public: + CDelegationBase(); + virtual ~CDelegationBase(); + + virtual const _TCHAR *GetDisplayName( int nCol = 0 ) = 0; + virtual const GUID & getNodeType(){ _ASSERT(FALSE); return IID_NULL; } + + virtual const LPARAM GetCookie(){ return reinterpret_cast(this); } + virtual const int GetBitmapIndex() = 0; + virtual HRESULT GetResultViewType( LPOLESTR *ppViewType, long *pViewOptions ) { return S_FALSE; } + virtual void SetScopeItemValue( HSCOPEITEM hscopeitem ) { m_hsiThis = hscopeitem; } + virtual HSCOPEITEM GetScopeItemValue() { return m_hsiThis; } + virtual HSCOPEITEM GetParentScopeItem() { return m_hsiParent; } + virtual void SetParentScopeItem( HSCOPEITEM hscopeitem ) { m_hsiParent = hscopeitem; } + virtual BOOL IsDirty() { return FALSE; } + virtual HRESULT Load( IStream *pStm ){ return S_OK; } + virtual HRESULT Save( IStream *pStm, BOOL fClearDirty ){ return S_OK; } + virtual ULONG GetSizeMax(){ return 0UL; } + virtual const wstring& GetHelpFile() + { + if( 0 == m_wstrHelpFile.length() ) + { + WCHAR szWindowsDir[ MAX_PATH ]; + if( 0 == GetWindowsDirectoryW( szWindowsDir, MAX_PATH ) ) + return m_wstrHelpFile; + + m_wstrHelpFile = szWindowsDir; + m_wstrHelpFile += L"\\Help\\uddi.mmc.chm"; + } + + return m_wstrHelpFile; + } + + virtual BOOL IsExtension(){ return m_bIsExtension; } + virtual void SetExtension( BOOL bExtension ){ m_bIsExtension = bExtension; } + virtual BOOL HasChildren() { return TRUE; } + virtual BOOL ChildExists( const WCHAR *pwszName ) { return FALSE; } + virtual HRESULT RemoveChildren( IConsoleNameSpace *pNS ) { return S_FALSE; } + +public: + // + // Virtual functions go here (for MMCN_*) + // + virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; } + virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; } + virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi); + virtual HRESULT OnRename(LPOLESTR pszNewName) { return S_FALSE; } + virtual HRESULT OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) { return S_FALSE; } + virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) { return S_FALSE; } + virtual HRESULT OnRefresh(IConsole *pConsole) { return S_FALSE; } + virtual HRESULT OnDelete(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsoleComp) { return S_FALSE; } + virtual HRESULT OnPropertyChange(IConsole *pConsole, CComponent *pComponent) { return S_OK; } + virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) { return S_FALSE; } + virtual HRESULT OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) { return S_FALSE; } + virtual HRESULT OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) { return S_FALSE; } + virtual HRESULT OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) { return S_FALSE; } + virtual HRESULT OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) { return S_FALSE; } + virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle){ return S_FALSE; } + virtual HRESULT HasPropertySheets() { return S_FALSE; } + virtual HRESULT GetWatermarks( HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch ) { return S_FALSE; } + +public: + static HBITMAP m_pBMapSm; + static HBITMAP m_pBMapLg; + +protected: + static void LoadBitmaps() + { + m_pBMapSm = LoadBitmap( g_hinst, MAKEINTRESOURCE(IDR_SMICONS) ); + m_pBMapLg = LoadBitmap( g_hinst, MAKEINTRESOURCE(IDR_LGICONS) ); + } + + BOOL m_bExpanded; + wstring m_wstrHelpFile; + BOOL m_bIsExtension; + + HSCOPEITEM m_hsiParent; + HSCOPEITEM m_hsiThis; + +private: + static const GUID thisGuid; +}; + +#endif // _BRANCHES_H \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/globals.h b/inetsrv/uddi/source/mmc/globals.h new file mode 100644 index 0000000..47bb96d --- /dev/null +++ b/inetsrv/uddi/source/mmc/globals.h @@ -0,0 +1,162 @@ +#pragma once + +//#include +#include +#include +#include +#include + +#ifndef STRINGS_ONLY + +enum UPDATE_VIEWS_HINT {UPDATE_SCOPEITEM = 1000, DELETE_SCOPEITEM, UPDATE_RESULTITEM, DELETE_RESULTITEM}; +enum ITEM_TYPE {SCOPE = 10, RESULT}; + +#define IDM_BUTTON1 0x100 +#define IDM_BUTTON2 0x101 + +extern HINSTANCE g_hinst; +extern ULONG g_uObjects; + +#define OBJECT_CREATED InterlockedIncrement( (long *) &g_uObjects ); +#define OBJECT_DESTROYED InterlockedDecrement( (long *) &g_uObjects ); + +// +// Uncomment the following #define to enable message cracking +// +//#define MMC_CRACK_MESSAGES + +void MMCN_Crack( + BOOL bComponentData, + IDataObject *pDataObject, + IComponentData *pCompData, + IComponent *pComp, + MMC_NOTIFY_TYPE event, + LPARAM arg, + LPARAM param ); + + +#endif + +#define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0])) + +#define DEBUG_ENTER \ + OutputDebugString( _T("Entering ") ); \ + OutputDebugString( _T(__FUNCTION__) ); \ + OutputDebugString( _T("...\n") ); + +#define DEBUG_LEAVE \ + OutputDebugString( _T("...Leaving ") ); \ + OutputDebugString( _T(__FUNCTION__) ); \ + OutputDebugString( _T("\n") ); + +#ifdef UNICODE +#define tstring wstring +#define tstringstream wstringstream +#else +#define tstring string +#define tstringstream stringstream +#endif + +// +// Convert wszBuf to upper case in-place (ie, modify the existing string). +// +void ToUpper( WCHAR *wszBuf ); + +// +// Convert wszBuf to lower case in-place (ie, modify the existing string). +// +void ToLower( WCHAR *wszBuf ); + +struct PropertyPages +{ + DWORD id; + DLGPROC dlgproc; +}; + +class CDelegationBase; + +struct DatabaseData +{ + CDelegationBase* pBase; + TCHAR szServerName[ 256 ]; + TCHAR szInstanceName[ 256 ]; +}; + +LPCTSTR InstanceDisplayName( LPCTSTR szName ); +LPCTSTR InstanceRealName( LPCTSTR szName ); +_TCHAR* DefaultInstanceDisplayName(); + +HRESULT IsStandardServer( LPCTSTR szRemoteServer, BOOL *bResult ); + +#define UDDI_SNAPIN_VERSION _T( "1.0" ) + +#define UDDI_RUN _T( "Run" ) +#define UDDI_AUTHENTICATION_MODE _T( "Security.AuthenticationMode" ) +#define UDDI_REQUIRE_SSL _T( "Security.HTTPS" ) +#define UDDI_ADMIN_GROUP _T( "GroupName.Administrators" ) +#define UDDI_COORDINATOR_GROUP _T( "GroupName.Coordinators" ) +#define UDDI_PUBLISHER_GROUP _T( "GroupName.Publishers" ) +#define UDDI_USER_GROUP _T( "GroupName.Users" ) +#define UDDI_TICKET_TIMEOUT _T( "Security.Timeout" ) +#define UDDI_KEY_TIMEOUT _T( "Security.KeyTimeout" ) +#define UDDI_KEY_RESET_DATE _T( "Security.KeyLastResetDate" ) +#define UDDI_KEY_AUTORESET _T( "Security.KeyAutoReset" ) +#define UDDI_DISCOVERY_URL _T( "DefaultDiscoveryURL" ) +#define UDDI_FIND_MAXROWS _T( "Find.MaxRowsDefault" ) +#define UDDI_READER_CXN _T( "Database.ReaderConnectionString" ) +#define UDDI_WRITER_CXN _T( "Database.WriterConnectionString" ) +#define UDDI_EVENTLOG_LEVEL _T( "Debug.EventLogLevel" ) +#define UDDI_FILELOG_LEVEL _T( "Debug.FileLogLevel" ) +#define UDDI_LOG_FILENAME _T( "Debug.LogFilename" ) +#define UDDI_SETUP_DB _T( "Setup.DBServer" ) +#define UDDI_SETUP_WEB _T( "Setup.WebServer" ) +#define UDDI_SETUP_ADMIN _T( "Setup.Admin" ) +#define UDDI_SETUP_DATE _T( "Setup.Date" ) +#define UDDI_SETUP_LANGUAGE _T( "Setup.Language" ) +#define UDDI_SETUP_NAME _T( "Setup.Name" ) +#define UDDI_SETUP_FRAMEWORK_VERSION _T( "Setup.FrameworkVersion" ) +#define UDDI_SETUP_MANUFACTURER _T( "Setup.Manufacturer" ) +#define UDDI_SETUP_VERSION _T( "Setup.Version" ) +#define UDDI_SETUP_LOCATION _T( "Setup.TargetDir" ) +#define UDDI_SITE_KEY _T( "Site.Key" ) +#define UDDI_SITE_NAME _T( "Site.Name" ) +#define UDDI_SITE_DESCRIPTION _T( "Site.Description" ) +#define UDDI_DBSCHEMA_VERSION _T( "Database.Version" ) +#define UDDI_SITE_WEBSERVERS _T( "Site.WebServers" ) +//#define UDDI_SITE_WEBSERVERS _T( "Site.Readers" ) +//#define UDDI_SITE_WEBSERVERS _T( "Site.Writers" ) + + +const LPCTSTR UDDI_OPERATOR_NAME = _T("Operator"); +const LPCTSTR g_szMMCBasePath = _T("Software\\Microsoft\\MMC"); +const LPCTSTR g_szSnapins = _T("Snapins"); +const LPCTSTR g_szNameString = _T("NameString"); +const LPCTSTR g_szNameStringInd = _T("NameStringIndirect"); +const LPCTSTR g_szProvider = _T("Provider"); +const LPCTSTR g_szVersion = _T("Version"); +const LPCTSTR g_szStandAlone = _T("StandAlone"); +const LPCTSTR g_szNodeTypes = _T("NodeTypes"); +const LPCTSTR g_szAbout = _T("About"); +const LPCTSTR g_szExtensions = _T("Extensions"); +const LPCTSTR g_szExtensionsView = _T("Extensions\\View"); +const LPCTSTR g_szNameSpace = _T("NameSpace"); +const LPCTSTR g_szServerAppsGuid = _T("{476e6449-aaff-11d0-b944-00c04fd8d5b0}"); +const LPCTSTR g_szUDDIAdminSites = _T( "Software\\Microsoft\\UDDI\\Admin\\Sites" ); +// const LPCTSTR g_szServerAppsLoc = _T("System\\CurrentControlSet\\Control\\Server Applications"); + +const LPWSTR g_wszUddiServicesNodeHelp= L"::/default.htm"; +const LPWSTR g_wszUddiSiteNodeHelp = L"::/uddi.mmc.site.htm"; +const LPWSTR g_wszUddiWebServerNodeHelp = L"::/uddi.mmc.webserver.htm"; +const LPWSTR g_wszUddiSiteGeneralPageHelp = L"::/uddi.mmc.sitegeneraltab.htm"; +const LPWSTR g_wszUddiRolesPageHelp = L"::/uddi.mmc.siterolestab.htm"; +const LPWSTR g_wszUddiSecurityPageHelp = L"::/uddi.mmc.sitesecuritytab.htm"; +const LPWSTR g_wszUddiCryptographyHelp = L"::/uddi.mmc.sitecryptography.htm"; +const LPWSTR g_wszUddiActiveDirectoryPageHelp = L"::/uddi.mmc.siteactivedirectorytab.htm"; +const LPWSTR g_wszUddiAdvancedPageHelp = L"::/uddi.mmc.siteadvancedtab.htm"; +const LPWSTR g_wszUddiEditPropertyHelp = L"::/uddi.mmc.editproperty.htm"; +const LPWSTR g_wszUddiWebGeneralPageHelp = L"::/uddi.mmc.webgeneraltab.htm"; +const LPWSTR g_wszUddiLoggingPageHelp = L"::/uddi.mmc.webloggingtab.htm"; +const LPWSTR g_wszUddiDatabaseConnectionPageHelp = L"::/uddi.mmc.webdatabaseconnectiontab.htm"; +const LPWSTR g_wszUddiAddSiteHelp = L"::/uddi.mmc.addsite.htm"; +const LPWSTR g_wszUddiAddWebServerHelp = L"::/uddi.mmc.addsite.htm"; + diff --git a/inetsrv/uddi/source/mmc/guids.h b/inetsrv/uddi/source/mmc/guids.h new file mode 100644 index 0000000..6368f74 --- /dev/null +++ b/inetsrv/uddi/source/mmc/guids.h @@ -0,0 +1,10 @@ +// {7503DD53-4B8C-4192-8A63-8679F35D933A} +DEFINE_GUID(CLSID_CUDDIServices, +0x7503dd53, 0x4b8c, 0x4192, 0x8a, 0x63, 0x86, 0x79, 0xf3, 0x5d, 0x93, 0x3a); + +// {EBDA171E-D0C6-41df-BFB3-1DC27786E8DA} +DEFINE_GUID(CLSID_CSnapinAbout, +0xebda171e, 0xd0c6, 0x41df, 0xbf, 0xb3, 0x1d, 0xc2, 0x77, 0x86, 0xe8, 0xda); + +DEFINE_GUID(CLSID_CServicesAndApplications, +0x476e6449, 0xaaff, 0x11d0, 0xb9, 0x44, 0x00, 0xc0, 0x4f, 0xd8, 0xd5, 0xb0); diff --git a/inetsrv/uddi/source/mmc/localres.h b/inetsrv/uddi/source/mmc/localres.h new file mode 100644 index 0000000..fceebec --- /dev/null +++ b/inetsrv/uddi/source/mmc/localres.h @@ -0,0 +1,10 @@ +#ifndef __LocalResource_H__ +#define __LocalResource_H__ + +#define INDEX_NONE -1 +#define INDEX_WEBSERVER 0 +#define INDEX_DBSERVER 1 +#define INDEX_UDDISERVICES 2 +#define INDEX_OPENFOLDER 5 + +#endif // __LocalResource_H__ \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/makefile b/inetsrv/uddi/source/mmc/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/mmc/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/mmc/mmc.vcproj b/inetsrv/uddi/source/mmc/mmc.vcproj new file mode 100644 index 0000000..b0ba95b --- /dev/null +++ b/inetsrv/uddi/source/mmc/mmc.vcproj @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/mmc/mmc.vcxproj b/inetsrv/uddi/source/mmc/mmc.vcxproj new file mode 100644 index 0000000..74fc307 --- /dev/null +++ b/inetsrv/uddi/source/mmc/mmc.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + 18.0 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593} + Win32Proj + + + + DynamicLibrary + v145 + Unicode + + + DynamicLibrary + v145 + false + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>18.0.11304.63 + + + Debug\ + Debug\ + true + + + Release\ + Release\ + false + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;MMC_EXPORTS;ISOLATION_AWARE_ENABLED;_ATL_ATTRIBUTES;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + Level3 + EditAndContinue + + + mmc.lib;comctl32.lib;uuid.lib;secur32.lib;htmlhelp.lib;msdasc.lib;wbemuuid.lib;version.lib;rpcrt4.lib;adsiid.lib;activeds.lib;%(AdditionalDependencies) + $(OutDir)uddi.mmc.dll + uddi.mmc.def + true + $(OutDir)uddi.mmc.pdb + Windows + $(OutDir)uddi.mmc.lib + MachineX86 + + + Registering the UDDI snapin + regsvr32 /s $(TargetPath) + + + + + MaxSpeed + OnlyExplicitInline + true + WIN32;_WINDOWS;_USRDLL;MMC_EXPORTS;ISOLATION_AWARE_ENABLED;_ATL_ATTRIBUTES;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + Level3 + ProgramDatabase + + + mmc.lib;comctl32.lib;uuid.lib;secur32.lib;htmlhelp.lib;msdasc.lib;%(AdditionalDependencies) + $(OutDir)uddi.mmc.dll + true + Windows + true + true + $(OutDir)mmc.lib + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/mmc.vcxproj.filters b/inetsrv/uddi/source/mmc/mmc.vcxproj.filters new file mode 100644 index 0000000..81f1191 --- /dev/null +++ b/inetsrv/uddi/source/mmc/mmc.vcxproj.filters @@ -0,0 +1,213 @@ + + + + + {92421baf-f049-4efb-8347-d7373a91471b} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {bb532de5-a5fe-4ec8-bc5f-ea7176bdaeff} + h;hpp;hxx;hm;inl;inc + + + {25f57581-8b96-40d7-ad02-6fb3b287c441} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/mmc.vcxproj.user b/inetsrv/uddi/source/mmc/mmc.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/inetsrv/uddi/source/mmc/mmc.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/mmccrack.cpp b/inetsrv/uddi/source/mmc/mmccrack.cpp new file mode 100644 index 0000000..55fd95e --- /dev/null +++ b/inetsrv/uddi/source/mmc/mmccrack.cpp @@ -0,0 +1,207 @@ +#include +#include +#include + +#include "globals.h" + +#define MMC_CRACK_MESSAGES 1 + +static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb) +{ + static TCHAR error[64]; + + switch( verb ) + { + case MMC_VERB_NONE: + return _T("NONE"); + case MMC_VERB_OPEN: + return _T("OPEN"); + case MMC_VERB_COPY: + return _T("COPY"); + case MMC_VERB_PASTE: + return _T("PASTE"); + case MMC_VERB_DELETE: + return _T("DELETE"); + case MMC_VERB_PROPERTIES: + return _T("PROPERTIES"); + case MMC_VERB_RENAME: + return _T("RENAME"); + case MMC_VERB_REFRESH: + return _T("REFRESH"); + case MMC_VERB_PRINT: + return _T("PRINT"); + case MMC_VERB_CUT: + return _T("CUT"); + default: + _sntprintf( error, ARRAYLEN(error) - 1, _T("Unknown verb id %d"), verb ); + error[ ARRAYLEN(error) - 1 ] = NULL; + return error; + } +} + +void MMCN_Crack( + BOOL bComponentData, + IDataObject *pDataObject, + IComponentData *pCompData, + IComponent *pComp, + MMC_NOTIFY_TYPE event, + LPARAM arg, + LPARAM param ) +{ + +#ifdef MMC_CRACK_MESSAGES + + TCHAR message[256] = {0}; + + if( TRUE == bComponentData ) + OutputDebugString(_T("IComponentData::Notify( ")); + else + OutputDebugString(_T("IComponent::Notify( ")); + + _sntprintf( message, ARRAYLEN( message ), _T( "DataObject: %08p, CompData: %08p, Comp: %08p ) - "), pDataObject, pCompData, pComp ); + message[ ARRAYLEN(message) - 1 ] = NULL; + OutputDebugString( message ); + + switch( event ) + { + case MMCN_ACTIVATE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg); + break; + + case MMCN_ADD_IMAGES: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param); + break; + + case MMCN_BTN_CLICK: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param)); + break; + + case MMCN_COLUMN_CLICK: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg, param); + break; + + case MMCN_COLUMNS_CHANGED: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_COLUMNS_CHANGED\n")); + break; + + case MMCN_CONTEXTHELP: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_CONTEXTHELP\n")); + break; + + case MMCN_CONTEXTMENU: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_CONTEXTMENU\n")); + break; + + case MMCN_CUTORMOVE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_CUTORMOVE\n")); + break; + + case MMCN_DBLCLICK: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_DBLCLICK\n")); + break; + + case MMCN_DELETE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_DELETE\n")); + break; + + case MMCN_DESELECT_ALL: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_DESELECT_ALL\n")); + break; + + case MMCN_EXPAND: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param); + break; + + case MMCN_EXPANDSYNC: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_EXPANDSYNC\n")); + break; + + case MMCN_FILTERBTN_CLICK: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg); + break; + + case MMCN_FILTER_CHANGE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param); + break; + + case MMCN_HELP: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_HELP\n")); + break; + + case MMCN_INITOCX: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param); + break; + + case MMCN_LISTPAD: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg); + break; + + case MMCN_MENU_BTNCLICK: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_MENU_BTNCLICK\n")); + break; + + case MMCN_MINIMIZED: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg); + break; + + case MMCN_PASTE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_PASTE\n\tCopy: %d\n"), NULL == param ); + break; + + case MMCN_PRELOAD: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg); + break; + + case MMCN_PRINT: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_PRINT\n")); + break; + + case MMCN_PROPERTY_CHANGE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param); + break; + + case MMCN_QUERY_PASTE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_QUERY_PASTE\n")); + break; + + case MMCN_REFRESH: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_REFRESH\n")); + break; + + case MMCN_REMOVE_CHILDREN: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg); + break; + + case MMCN_RENAME: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param); + break; + + case MMCN_RESTORE_VIEW: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_RESTORE_VIEW\n")); + break; + + case MMCN_SELECT: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg)); + break; + + case MMCN_SHOW: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param); + break; + + case MMCN_SNAPINHELP: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_SNAPINHELP\n")); + break; + + case MMCN_VIEW_CHANGE: + _sntprintf( message, ARRAYLEN(message) - 1, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param); + break; + } + + message[ ARRAYLEN(message) - 1 ] = NULL; + + if( message[0] != 0 ) + OutputDebugString(message); + else + OutputDebugString(_T("unknown event\n")); +#endif +} diff --git a/inetsrv/uddi/source/mmc/net_bindingtemplate_tmodelinstanceinfos_get.h b/inetsrv/uddi/source/mmc/net_bindingtemplate_tmodelinstanceinfos_get.h new file mode 100644 index 0000000..9431dd1 --- /dev/null +++ b/inetsrv/uddi/source/mmc/net_bindingtemplate_tmodelinstanceinfos_get.h @@ -0,0 +1,72 @@ +// net_bindingTemplate_tModelInstanceInfos_get.h : Declaration of the net_bindingTemplate_tModelInstanceInfos_get class + +#ifndef __NET_BINDINGTEMPLATE_TMODELINSTANCEINFOS_GET_H_ +#define __NET_BINDINGTEMPLATE_TMODELINSTANCEINFOS_GET_H_ + +class net_bindingTemplate_tModelInstanceInfos_getAccessor +{ +public: + LONG m_RETURNVALUE; + TCHAR m_bindingKey[ 100 ]; + LARGE_INTEGER m_colinstanceID; + TCHAR m_coltModelKey[ 100 ]; + TCHAR m_coloverviewURL[4001]; + TCHAR m_colinstanceParms[4001]; + CComBSTR m_connectionString; + +BEGIN_PARAM_MAP(net_bindingTemplate_tModelInstanceInfos_getAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURNVALUE) + SET_PARAM_TYPE(DBPARAMIO_INPUT) + COLUMN_ENTRY(2, m_bindingKey) +END_PARAM_MAP() + +BEGIN_COLUMN_MAP(net_bindingTemplate_tModelInstanceInfos_getAccessor) + COLUMN_ENTRY(1, m_colinstanceID) + COLUMN_ENTRY(2, m_coltModelKey) + COLUMN_ENTRY(3, m_coloverviewURL) + COLUMN_ENTRY(4, m_colinstanceParms) +END_COLUMN_MAP() + +DEFINE_COMMAND(net_bindingTemplate_tModelInstanceInfos_getAccessor, _T("{ ? = CALL dbo.net_bindingTemplate_tModelInstanceInfos_get;1 (?) }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class net_bindingTemplate_tModelInstanceInfos_get : public CCommand, CRowset, CMultipleResults > +{ +public: + HRESULT Open() + { + HRESULT hr; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + + hr = db.OpenFromInitializationString( m_connectionString ); + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + HRESULT OpenRowset() + { + return __super::Open(m_session, NULL, NULL, 0, DBGUID_DBSQL, false); + } + CSession m_session; +}; + +#endif // __NET_BINDINGTEMPLATE_TMODELINSTANCEINFOS_GET_H_ diff --git a/inetsrv/uddi/source/mmc/net_businessentity_bindingtemplates_get.h b/inetsrv/uddi/source/mmc/net_businessentity_bindingtemplates_get.h new file mode 100644 index 0000000..faa734f --- /dev/null +++ b/inetsrv/uddi/source/mmc/net_businessentity_bindingtemplates_get.h @@ -0,0 +1,73 @@ +// net_bindings_get.h : Declaration of the net_businessEntity_bindingTemplates_get class + +#ifndef __NET_BINDINGS_GET_H_ +#define __NET_BINDINGS_GET_H_ + +class net_businessEntity_bindingTemplates_getAccessor +{ +public: + LONG m_RETURNVALUE; + TCHAR m_businessKey[ 50 ]; + TCHAR m_colbindingKey[ 50 ]; + TCHAR m_colserviceKey[ 50 ]; + TCHAR m_colURLType[451]; + TCHAR m_colaccessPoint[4001]; + TCHAR m_colhostingRedirector[ 50 ]; + CComBSTR m_connectionString; + +BEGIN_PARAM_MAP(net_businessEntity_bindingTemplates_getAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURNVALUE) + SET_PARAM_TYPE(DBPARAMIO_INPUT) + COLUMN_ENTRY(2, m_businessKey) +END_PARAM_MAP() + +BEGIN_COLUMN_MAP(net_businessEntity_bindingTemplates_getAccessor) + COLUMN_ENTRY(1, m_colbindingKey) + COLUMN_ENTRY(2, m_colserviceKey) + COLUMN_ENTRY(3, m_colURLType) + COLUMN_ENTRY(4, m_colaccessPoint) + COLUMN_ENTRY(5, m_colhostingRedirector) +END_COLUMN_MAP() + +DEFINE_COMMAND(net_businessEntity_bindingTemplates_getAccessor, _T("{ ? = CALL dbo.net_businessEntity_bindingTemplates_get;1 (?) }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class net_businessEntity_bindingTemplates_get : public CCommand, CRowset, CMultipleResults > +{ +public: + HRESULT Open() + { + HRESULT hr; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + hr = db.OpenFromInitializationString( m_connectionString ); + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + HRESULT OpenRowset() + { + return __super::Open(m_session, NULL, NULL, 0, DBGUID_DBSQL, false); + } + CSession m_session; +}; + +#endif // __NET_BINDINGS_GET_H_ diff --git a/inetsrv/uddi/source/mmc/net_config_get.h b/inetsrv/uddi/source/mmc/net_config_get.h new file mode 100644 index 0000000..c2a3dd4 --- /dev/null +++ b/inetsrv/uddi/source/mmc/net_config_get.h @@ -0,0 +1,72 @@ +// net_config_get.h : Declaration of the net_config_get class + +#ifndef __NET_CONFIG_GET_H_ +#define __NET_CONFIG_GET_H_ + +class net_config_getAccessor +{ +public: + TCHAR m_configName[257]; + TCHAR m_configValue[8001]; + DBSTATUS m_dwconfigNameStatus; + DBSTATUS m_dwconfigValueStatus; + DBLENGTH m_dwconfigNameLength; + DBLENGTH m_dwconfigValueLength; + CComBSTR m_connectionString; + LONG m_RETURN_VALUE; + +BEGIN_COLUMN_MAP(net_config_getAccessor) + COLUMN_ENTRY_LENGTH_STATUS(1, m_configName, m_dwconfigNameLength, m_dwconfigNameStatus) + COLUMN_ENTRY_LENGTH_STATUS(2, m_configValue, m_dwconfigValueLength, m_dwconfigValueStatus) +END_COLUMN_MAP() + +BEGIN_PARAM_MAP(net_config_getAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURN_VALUE) +END_PARAM_MAP() + + +DEFINE_COMMAND(net_config_getAccessor, _T("{ ? = CALL dbo.net_config_get }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class net_config_get : public CCommand, CRowset, CMultipleResults > +{ +public: + HRESULT Open() + { + HRESULT hr; + m_configName[ 0 ] = 0x00; + m_configValue[ 0 ] = 0x00; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + hr = db.OpenFromInitializationString( m_connectionString ); + + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + HRESULT OpenRowset() + { + return __super::Open(m_session, NULL, NULL, 0, DBGUID_DBSQL, false); + } + CSession m_session; +}; + +#endif // __NET_CONFIG_GET_H_ diff --git a/inetsrv/uddi/source/mmc/net_config_save.h b/inetsrv/uddi/source/mmc/net_config_save.h new file mode 100644 index 0000000..c00f0fc --- /dev/null +++ b/inetsrv/uddi/source/mmc/net_config_save.h @@ -0,0 +1,62 @@ +// net_config_save.h : Declaration of the net_config_save class + +#ifndef __NET_CONFIG_SAVE_H_ +#define __NET_CONFIG_SAVE_H_ + +class net_config_saveAccessor +{ +public: + LONG m_RETURNVALUE; + TCHAR m_configName[257]; + TCHAR m_configValue[8001]; + CComBSTR m_connectionString; + +BEGIN_PARAM_MAP(net_config_saveAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURNVALUE) + SET_PARAM_TYPE(DBPARAMIO_INPUT) + COLUMN_ENTRY(2, m_configName) + COLUMN_ENTRY(3, m_configValue) +END_PARAM_MAP() + +DEFINE_COMMAND(net_config_saveAccessor, _T("{ ? = CALL dbo.net_config_save;1 (?,?) }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class net_config_save : public CCommand > +{ +public: + HRESULT Open() + { + HRESULT hr; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + hr = db.OpenFromInitializationString(m_connectionString); + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + HRESULT OpenRowset() + { + return __super::Open(m_session); + } + CSession m_session; +}; + +#endif // __NET_CONFIG_SAVE_H_ diff --git a/inetsrv/uddi/source/mmc/obj/_objects.mac b/inetsrv/uddi/source/mmc/obj/_objects.mac new file mode 100644 index 0000000..12f1ad4 --- /dev/null +++ b/inetsrv/uddi/source/mmc/obj/_objects.mac @@ -0,0 +1,84 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\resource.res \ + $(_OBJ_DIR)\i386\about.obj \ + $(_OBJ_DIR)\i386\basesnap.obj \ + $(_OBJ_DIR)\i386\comp.obj \ + $(_OBJ_DIR)\i386\compdata.obj \ + $(_OBJ_DIR)\i386\dataobj.obj \ + $(_OBJ_DIR)\i386\delebase.obj \ + $(_OBJ_DIR)\i386\mmccrack.obj \ + $(_OBJ_DIR)\i386\objectpicker.obj \ + $(_OBJ_DIR)\i386\scp.obj \ + $(_OBJ_DIR)\i386\scppublisher.obj \ + $(_OBJ_DIR)\i386\uddi.obj \ + $(_OBJ_DIR)\i386\uddiservicesnode.obj \ + $(_OBJ_DIR)\i386\uddisitenode.obj \ + $(_OBJ_DIR)\i386\webservernode.obj \ + $(_OBJ_DIR)\i386\servercheck.obj \ + $(_OBJ_DIR)\i386\stringutil.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\resource.res \ + $(_OBJ_DIR)\ia64\about.obj \ + $(_OBJ_DIR)\ia64\basesnap.obj \ + $(_OBJ_DIR)\ia64\comp.obj \ + $(_OBJ_DIR)\ia64\compdata.obj \ + $(_OBJ_DIR)\ia64\dataobj.obj \ + $(_OBJ_DIR)\ia64\delebase.obj \ + $(_OBJ_DIR)\ia64\mmccrack.obj \ + $(_OBJ_DIR)\ia64\objectpicker.obj \ + $(_OBJ_DIR)\ia64\scp.obj \ + $(_OBJ_DIR)\ia64\scppublisher.obj \ + $(_OBJ_DIR)\ia64\uddi.obj \ + $(_OBJ_DIR)\ia64\uddiservicesnode.obj \ + $(_OBJ_DIR)\ia64\uddisitenode.obj \ + $(_OBJ_DIR)\ia64\webservernode.obj \ + $(_OBJ_DIR)\ia64\servercheck.obj \ + $(_OBJ_DIR)\ia64\stringutil.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\resource.res \ + $(_OBJ_DIR)\amd64\about.obj \ + $(_OBJ_DIR)\amd64\basesnap.obj \ + $(_OBJ_DIR)\amd64\comp.obj \ + $(_OBJ_DIR)\amd64\compdata.obj \ + $(_OBJ_DIR)\amd64\dataobj.obj \ + $(_OBJ_DIR)\amd64\delebase.obj \ + $(_OBJ_DIR)\amd64\mmccrack.obj \ + $(_OBJ_DIR)\amd64\objectpicker.obj \ + $(_OBJ_DIR)\amd64\scp.obj \ + $(_OBJ_DIR)\amd64\scppublisher.obj \ + $(_OBJ_DIR)\amd64\uddi.obj \ + $(_OBJ_DIR)\amd64\uddiservicesnode.obj \ + $(_OBJ_DIR)\amd64\uddisitenode.obj \ + $(_OBJ_DIR)\amd64\webservernode.obj \ + $(_OBJ_DIR)\amd64\servercheck.obj \ + $(_OBJ_DIR)\amd64\stringutil.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\resource.res \ + $(_OBJ_DIR)\arm\about.obj \ + $(_OBJ_DIR)\arm\basesnap.obj \ + $(_OBJ_DIR)\arm\comp.obj \ + $(_OBJ_DIR)\arm\compdata.obj \ + $(_OBJ_DIR)\arm\dataobj.obj \ + $(_OBJ_DIR)\arm\delebase.obj \ + $(_OBJ_DIR)\arm\mmccrack.obj \ + $(_OBJ_DIR)\arm\objectpicker.obj \ + $(_OBJ_DIR)\arm\scp.obj \ + $(_OBJ_DIR)\arm\scppublisher.obj \ + $(_OBJ_DIR)\arm\uddi.obj \ + $(_OBJ_DIR)\arm\uddiservicesnode.obj \ + $(_OBJ_DIR)\arm\uddisitenode.obj \ + $(_OBJ_DIR)\arm\webservernode.obj \ + $(_OBJ_DIR)\arm\servercheck.obj \ + $(_OBJ_DIR)\arm\stringutil.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/mmc/obj/i386/about.obj b/inetsrv/uddi/source/mmc/obj/i386/about.obj new file mode 100644 index 0000000..e414ba0 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/about.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/basesnap.obj b/inetsrv/uddi/source/mmc/obj/i386/basesnap.obj new file mode 100644 index 0000000..9be6280 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/basesnap.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/comp.obj b/inetsrv/uddi/source/mmc/obj/i386/comp.obj new file mode 100644 index 0000000..22745a0 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/comp.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/compdata.obj b/inetsrv/uddi/source/mmc/obj/i386/compdata.obj new file mode 100644 index 0000000..0991ede Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/compdata.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/dataobj.obj b/inetsrv/uddi/source/mmc/obj/i386/dataobj.obj new file mode 100644 index 0000000..2586d2f Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/dataobj.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/delebase.obj b/inetsrv/uddi/source/mmc/obj/i386/delebase.obj new file mode 100644 index 0000000..29362d2 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/delebase.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/mmccrack.obj b/inetsrv/uddi/source/mmc/obj/i386/mmccrack.obj new file mode 100644 index 0000000..5b20e6f Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/mmccrack.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/objectpicker.obj b/inetsrv/uddi/source/mmc/obj/i386/objectpicker.obj new file mode 100644 index 0000000..708a30c Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/objectpicker.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/resource.rc_temp2 b/inetsrv/uddi/source/mmc/obj/i386/resource.rc_temp2 new file mode 100644 index 0000000..cdbccf1 --- /dev/null +++ b/inetsrv/uddi/source/mmc/obj/i386/resource.rc_temp2 @@ -0,0 +1,769 @@ + +#include "windows.h" +/* RT_MANIFEST is in winuser.h and winuser.rh */ +2 RT_MANIFEST SXS_MANIFEST_OBJ1 +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +// Generated Help ID header file +#define APSTUDIO_HIDDEN_SYMBOLS +#include "resource.hm" +#undef APSTUDIO_HIDDEN_SYMBOLS + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include \r\n" + "\r\n" + "#define VER_FILETYPE\t\t VFT_DLL\r\n" + "#define VER_FILESUBTYPE\t\t VFT2_UNKNOWN\r\n" + "#define VER_FILEDESCRIPTION_STR ""UDDI Services MMC Snap-in Module""\r\n" + "#define VER_INTERNALNAME_STR\t ""UDDI.MMC.DLL""\r\n" + "#define VER_ORIGINALFILENAME_STR ""UDDI.MMC.DLL""\r\n" + "\r\n" + "#include ""common.ver""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDR_SMICONS BITMAP "res\\smicons.bmp" +IDR_LGICONS BITMAP "res\\lgicons.bmp" +IDR_TOOLBAR1 BITMAP "res\\toolbar1.bmp" +IDB_SMBMP BITMAP "res\\logo.bmp" +IDB_LGBMP BITMAP "res\\logolarge.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Toolbar +// + +IDR_TOOLBAR1 TOOLBAR 16, 16 +BEGIN + BUTTON ID_BUTTONSTART + BUTTON ID_BUTTONSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_UDDIMMC ICON "res\\uddi.ico" +IDI_SECURITY_AUTHENTICATION ICON "res\\authentication.ico" +IDI_SECURITY_REQUIRESSL ICON "res\\requiressl.ico" +IDI_ROLES ICON "res\\roles.ico" +IDI_ACTIVEDIRECTORY ICON "res\\activedirectory.ico" +IDI_SECURITY_CRYPTOGRAPHY ICON "res\\cryptography.ico" +IDI_DATABASE_SERVER ICON "res\\site.ico" +IDI_WEBSERVER ICON "res\\webserver.ico" +IDI_DB_CONNECTION ICON "res\\dbconnection.ico" +IDI_ADVANCED ICON "res\\advancededit.ico" +IDI_LOGGING_FILELOG ICON "res\\logging.ico" +IDI_LOGGING_EVENTLOG ICON "res\\logging_eventlog.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ROLES_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Roles" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Publishers' Group Name",IDC_STATIC,7,150,247,40 + GROUPBOX "Administrators' Group Name",IDC_STATIC,7,46,247,40 + GROUPBOX "Coordinators' Group Name",IDC_STATIC,7,98,247,40 + GROUPBOX "Users' Group Name",IDC_STATIC,7,202,247,40 + EDITTEXT IDC_ROLES_EDIT_ADMIN_GROUP_NAME,16,62,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "&Select...",IDC_ROLES_BTN_ADMINISTRATOR_SELECT,194,62, + 50,14 + EDITTEXT IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME,16,113,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "S&elect...",IDC_ROLES_BTN_COORDINATOR_SELECT,194,113,50, + 14 + EDITTEXT IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME,16,164,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "Se&lect...",IDC_ROLES_BTN_PUBLISHER_SELECT,194,164,50, + 14 + EDITTEXT IDC_ROLES_EDIT_USER_GROUP_NAME,16,217,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "Selec&t...",IDC_ROLES_BTN_USER_SELECT,194,217,50,14 + LTEXT "Select the group to associated with each level of permission.", + IDC_STATIC,54,16,188,26 + ICON IDI_ROLES,IDC_STATIC,18,15,20,20 +END + +IDD_SECURITY_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Security" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Authenticated access",IDC_STATIC,7,14,247,104 + GROUPBOX "Secure Communications",IDC_STATIC,7,125,247,51 + GROUPBOX "Cryptography",IDC_STATIC,7,183,247,62 + CONTROL "&Windows Integrated and UDDI publisher authentication", + IDC_SECURITY_RADIO_AUTHENTICATION_BOTH,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE | WS_GROUP,38,48,208, + 20 + CONTROL "&UDDI publisher authentication", + IDC_SECURITY_RADIO_AUTHENTICATION_UDDI,"Button", + BS_AUTORADIOBUTTON,38,72,208,10 + CONTROL "Windows &Integrated publisher authentication", + IDC_SECURITY_RADIO_AUTHENTICATION_WINDOWS,"Button", + BS_AUTORADIOBUTTON,38,91,209,10 + CONTROL "Authentication &for read (inquiry) access", + IDC_SECURITY_CHECK_AUTHENTICATED_READS,"Button", + BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,50,102,190,10 + CONTROL "Require &SSL for publication requests to this site.", + IDC_SECURITY_CHECK_REQUIRE_SSL,"Button",BS_AUTOCHECKBOX | + BS_TOP | BS_MULTILINE | WS_TABSTOP,65,142,142,22 + LTEXT "Change the key settings used for UDDI publisher authentication.", + IDC_STATIC,65,197,179,20 + PUSHBUTTON "&Change...",IDC_CRYPTOGRAPHY_BTN_CHANGE,167,221,50,14 + ICON IDI_SECURITY_AUTHENTICATION,IDC_STATIC,27,27,20,20 + LTEXT "Select an authentication type for this site:", + IDC_STATIC,65,30,180,18 + ICON IDI_SECURITY_REQUIRESSL,IDC_STATIC,24,140,20,20 + ICON IDI_SECURITY_CRYPTOGRAPHY,IDC_STATIC,25,195,20,20 +END + +IDD_DB_CONNECTION_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Database Connection" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Read operations computer",IDC_STATIC,6,122,248,61 + PUSHBUTTON "C&hange...",IDC_DB_CONNECTION_BTN_READER_SELECT,189,162, + 50,14 + LTEXT "",IDC_DB_CONNECTION_TXT_READER_SERVER,52,62,181,8 + GROUPBOX "Write operations computer",IDC_STATIC,6,48,248,61 + ICON IDI_DB_CONNECTION,IDC_STATIC,15,16,20,20 + LTEXT "Select the computers hosting the UDDI Services database components that will be used for read (inquiry) and write (publish) operations.", + IDC_STATIC,46,15,190,26 + PUSHBUTTON "&Change...",IDC_DB_CONNECTION_BTN_WRITER_SELECT,189,87, + 50,14 + LTEXT "",IDC_DB_CONNECTION_TXT_WRITER_SERVER,52,138,181,8 + LTEXT "Server:",IDC_STATIC,18,62,25,8 + LTEXT "UDDI Services",IDC_DB_CONNECTION_TXT_WRITER_INSTANCE,52, + 74,181,8 + LTEXT "Instance:",IDC_STATIC,18,74,32,8 + LTEXT "UDDI Services",IDC_DB_CONNECTION_TXT_READER_INSTANCE,52, + 150,181,8 + LTEXT "Instance:",IDC_STATIC,17,150,32,8 + LTEXT "Server:",IDC_STATIC,17,138,25,8 +END + +IDD_ACTIVEDIRECTORY_PROPPAGE DIALOGEX 0, 0, 247, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Active Directory" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Publish",IDC_STATIC,6,20,234,47 + LTEXT "Publishes this instance of UDDI Services to Active Directory.", + IDC_STATIC,49,34,117,20 + PUSHBUTTON "&Publish",IDC_ACTIVEDIRECTORY_BTN_ADD,179,36,50,14 + GROUPBOX "Remove",IDC_STATIC,6,76,234,47 + LTEXT "Removes this instance of UDDI Services from Active Directory.", + IDC_STATIC,13,89,147,20 + PUSHBUTTON "Re&move",IDC_ACTIVEDIRECTORY_BTN_REMOVE,179,91,50,14 + ICON IDI_ACTIVEDIRECTORY,IDC_STATIC,17,35,20,20 +END + +IDD_ADVANCED_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Advanced" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "",IDC_ACTIVEDIRECTORY_LIST_ADVANCED,"SysListView32", + LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | + LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_TABSTOP,7,56,247, + 153 + PUSHBUTTON "&Edit Property...",IDC_ADVANCED_BTN_EDIT,174,222,80,14, + WS_DISABLED + LTEXT "To modify an advanced property, double-click the property name or select it and then click Edit Property.", + IDC_STATIC,53,18,193,34 + ICON IDI_ADVANCED,IDC_STATIC,19,16,20,20 +END + +IDD_GENERAL_SITE_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +EXSTYLE WS_EX_TRANSPARENT +CAPTION "General" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "UDDI Services site for at ", + IDC_GENERAL_SITE_TXT_DISPLAYNAME,39,19,208,8, + SS_WORDELLIPSIS + LTEXT "2.0.000.1",IDC_GENERAL_SITE_TXT_UDDI_VERSION,103,57,118, + 9 + LTEXT "Date:",IDC_STATIC,17,149,64,8 + LTEXT "c:\\inetpub\\uddi", + IDC_GENERAL_SITE_TXT_INSTALL_LOCATION,103,162,137,8, + SS_WORDELLIPSIS + LTEXT "Language:",IDC_STATIC,15,71,68,8 + LTEXT "Location:",IDC_STATIC,17,162,73,8 + LTEXT "Version:",IDC_STATIC,15,57,67,11 + LTEXT "April 10th, 2002",IDC_GENERAL_SITE_TXT_INSTALL_DATE,103, + 149,139,8 + LTEXT "English",IDC_GENERAL_SITE_TXT_UDDI_LANGUAGE,103,71,135, + 9 + LTEXT "Components:",IDC_STATIC,17,193,209,8 + LTEXT ".NET Framework Version:",IDC_STATIC,16,176,82,8 + LISTBOX IDC_GENERAL_SITE_LIST_SERVICES,14,204,233,36,LBS_SORT | + LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_DISABLED | + WS_VSCROLL | WS_TABSTOP + ICON IDI_DATABASE_SERVER,IDC_STATIC,13,13,20,20 + CONTROL "79684fb0-fd0b-44e9-b2b4-7c19863150c7", + IDC_GENERAL_SITE_TXT_PROVIDER_KEY,"Static", + SS_LEFTNOWORDWRAP | WS_GROUP,103,43,144,9 + LTEXT "Site key:",IDC_STATIC,15,43,56,11 + GROUPBOX "Site Description",IDC_STATIC,7,86,247,46 + GROUPBOX "Installation",IDC_STATIC,7,136,247,110 + LTEXT "",IDC_GENERAL_SITE_TXT_DESCRIPTION,17,97,229,27 + LTEXT "2.0.3705.1",IDC_GENERAL_SITE_TXT_FRAMEWORK_VERSION,103, + 176,84,8 + CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,12,36, + 239,1 +END + +IDD_SITE_CONNECT DIALOGEX 0, 0, 346, 146 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Select Computer" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "&Local computer: (the computer this console is running on)", + IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,17,54,199,10 + CONTROL "&Another computer:", + IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER,"Button", + BS_AUTORADIOBUTTON,17,72,77,10 + EDITTEXT IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER,100,70,170,14, + ES_AUTOHSCROLL | WS_DISABLED + PUSHBUTTON "&Browse...",IDC_SITE_CONNECT_BTN_BROWSE,277,70,50,14, + WS_DISABLED + DEFPUSHBUTTON "OK",IDOK,184,125,50,14 + PUSHBUTTON "Cancel",IDCANCEL,237,125,50,14 + PUSHBUTTON "&Help",IDHELP,289,125,50,14,0,0,HIDHELP + LTEXT "Select a computer hosting UDDI Services database components.", + IDC_STATIC,49,19,282,8 + ICON IDI_DATABASE_SERVER,IDC_STATIC,19,13,20,20 + GROUPBOX "Connect to UDDI Services on:",IDC_STATIC,7,39,332,79 + LTEXT "A UDDI Services site is hosted on this computer using the database instance \\(default).", + IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE,29,92,299,19 +END + +IDD_WEBSERVER_NEW DIALOGEX 0, 0, 346, 132 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Select Web Server" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "&Local computer: (the computer this console is running on)", + IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,17,52,199,10 + CONTROL "&Another computer:", + IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER,"Button", + BS_AUTORADIOBUTTON,17,70,77,10 + EDITTEXT IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER,100,68,170,14, + ES_AUTOHSCROLL | WS_DISABLED + PUSHBUTTON "&Browse...",IDC_SITE_CONNECT_BTN_BROWSE,277,68,50,14, + WS_DISABLED + DEFPUSHBUTTON "OK",IDOK,184,111,50,14 + PUSHBUTTON "Cancel",IDCANCEL,236,111,50,14 + PUSHBUTTON "&Help",IDHELP,288,111,50,14 + GROUPBOX "Select the Web server's host computer:",-1,7,37,332,66 + ICON IDI_WEBSERVER,-1,19,11,20,20 + LTEXT "Select a UDDI Services Web server to add to this UDDI Services site.", + -1,49,17,193,8 +END + +IDD_CRYPTOGRAPHY DIALOGEX 0, 0, 220, 198 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "UDDI Services Cryptography" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + EDITTEXT IDC_CRYPTOGRAPHY_EDIT_TICKET_TIMEOUT,55,32,47,14, + ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT,"msctls_updown32", + UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | + UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,92,32,11,14 + PUSHBUTTON "&Reset Now",IDC_CRYPTOGRAPHY_BTN_RESET_NOW,41,102,50,14 + CONTROL "Automatically reset cryptography key", + IDC_CRYPTOGRAPHY_CHECK_AUTO_RESET,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,21,126,182,10 + EDITTEXT IDC_CRYPTOGRAPHY_EDIT_TIMEOUT,56,140,47,14, + ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_CRYPTOGRAPHY_SPIN_TIMEOUT,"msctls_updown32", + UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | + UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,90,140,11, + 14 + DEFPUSHBUTTON "OK",IDOK,59,176,50,14 + PUSHBUTTON "Cancel",IDCANCEL,111,176,50,14 + LTEXT "The current key was created:",IDC_STATIC,21,74,174,11 + GROUPBOX "Cryptography Key Timeout",IDC_STATIC,7,61,206,102 + LTEXT "every",IDC_STATIC,33,143,20,8 + LTEXT "days.",IDC_STATIC,107,143,43,8 + LTEXT "December 23rd, 2001",IDC_CRYPTOGRAPHY_TXT_RESET_DATE,41, + 88,148,8 + GROUPBOX "SOAP Authentication Token Expiration",IDC_STATIC,7,7, + 206,48 + LTEXT "after",IDC_STATIC,33,35,17,8 + LTEXT "minutes.",IDC_STATIC,108,35,60,8 + LTEXT "Tokens issued for publication will expire",IDC_STATIC, + 21,21,171,8 + PUSHBUTTON "&Help",IDHELP,163,176,50,14,0,0,HIDHELP +END + +IDD_LOGGING_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Logging" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Event Log Settings",IDC_STATIC,7,16,247,80 + CONTROL "",IDC_LOGGING_SLIDER_EVENTLOG,"msctls_trackbar32", + TBS_AUTOTICKS | TBS_TOOLTIPS | WS_TABSTOP,20,54,220,18 + CTEXT "None",IDC_STATIC,21,73,18,19 + CTEXT "Verbose",IDC_STATIC,218,73,27,18 + CTEXT "Error",IDC_STATIC,55,73,17,18 + CTEXT "Warning",IDC_STATIC,82,73,28,19 + CTEXT "FailAudit",IDC_STATIC,117,73,30,17 + CTEXT "PassAudit",IDC_STATIC,151,73,32,18 + CTEXT "Info",IDC_STATIC,193,73,14,20 + LTEXT "Select the level of information reported to the Event Log.", + IDC_STATIC,59,31,178,23 + ICON IDI_LOGGING_EVENTLOG,IDC_STATIC,25,29,20,20 + GROUPBOX "Log File Settings",IDC_STATIC,7,102,247,91 + CONTROL "",IDC_LOGGING_SLIDER_FILELOG,"msctls_trackbar32", + TBS_AUTOTICKS | TBS_TOOLTIPS | WS_TABSTOP,18,152,220,18 + LTEXT "Select the level of information reported to the UDDI Services log file.", + IDC_STATIC,59,116,178,23 + ICON IDI_LOGGING_FILELOG,IDC_STATIC,25,115,20,20 + LTEXT "Location:",IDC_STATIC,25,139,30,8 + LTEXT "c:\\inetpub\\uddi\\uddi.log", + IDC_LOGGING_TXT_LOGFILE_LOCATION,59,139,174,8, + SS_WORDELLIPSIS + CTEXT "None",IDC_STATIC,19,171,18,18 + CTEXT "Verbose",IDC_STATIC,216,171,27,18 + CTEXT "Error",IDC_STATIC,53,171,17,19 + CTEXT "Warning",IDC_STATIC,80,171,28,17 + CTEXT "FailAudit",IDC_STATIC,115,171,28,18 + CTEXT "PassAudit",IDC_STATIC,149,171,32,18 + CTEXT "Info",IDC_STATIC,191,171,14,18 +END + +IDD_ADVANCED_EDIT DIALOGEX 0, 0, 277, 91 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Edit Property" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + EDITTEXT IDC_ADVANCED_EDIT_VALUE,47,40,201,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,114,70,50,14 + PUSHBUTTON "Cancel",IDCANCEL,167,70,50,14 + PUSHBUTTON "&Help",IDHELP,220,70,50,14,0,0,HIDHELP + LTEXT "Name:",IDC_STATIC,20,20,22,8 + LTEXT "DefaultDiscoveryURL",IDC_ADVANCED_EDIT_TXT_NAME,47,21, + 169,8 + LTEXT "Value:",IDC_STATIC,20,42,21,8 +END + +IDD_GENERAL_WEB_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +EXSTYLE WS_EX_TRANSPARENT +CAPTION "General" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "UDDI Services Web Server Component", + IDC_GENERAL_SITE_TXT_DISPLAYNAME,46,19,193,8 + LTEXT "2.0.000.1",IDC_GENERAL_SITE_TXT_UDDI_VERSION,113,43,124, + 9 + LTEXT "Language:",IDC_STATIC,17,55,35,8 + LTEXT "Version:",IDC_STATIC,17,43,28,11 + LTEXT "English",IDC_GENERAL_SITE_TXT_UDDI_LANGUAGE,113,55,120, + 9 + ICON IDI_WEBSERVER,IDC_STATIC,19,13,20,20 + CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,13,38, + 237,1 + LTEXT "Date:",IDC_STATIC,17,151,19,8 + LTEXT "c:\\inetpub\\uddi", + IDC_GENERAL_SITE_TXT_INSTALL_LOCATION,113,164,131,8, + SS_PATHELLIPSIS + LTEXT "Location:",IDC_STATIC,17,164,30,8 + LTEXT "April 10th, 2002",IDC_GENERAL_SITE_TXT_INSTALL_DATE,113, + 151,129,8 + LTEXT "Components:",IDC_STATIC,17,195,209,8 + LTEXT ".NET Framework Version:",IDC_STATIC,17,178,95,8 + LISTBOX IDC_GENERAL_SITE_LIST_SERVICES,14,206,233,36,LBS_SORT | + LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_DISABLED | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "Installation:",IDC_STATIC,7,138,247,110 + LTEXT "2.0.3705.1",IDC_GENERAL_SITE_TXT_FRAMEWORK_VERSION,113, + 178,129,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_ROLES_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_SECURITY_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 254 + END + + IDD_DB_CONNECTION_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_ACTIVEDIRECTORY_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 240 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_ADVANCED_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_GENERAL_SITE_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 254 + END + + IDD_SITE_CONNECT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 339 + TOPMARGIN, 7 + BOTTOMMARGIN, 139 + END + + IDD_WEBSERVER_NEW, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 339 + TOPMARGIN, 7 + BOTTOMMARGIN, 125 + END + + IDD_CRYPTOGRAPHY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 190 + END + + IDD_LOGGING_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_ADVANCED_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 270 + TOPMARGIN, 7 + BOTTOMMARGIN, 84 + END + + IDD_GENERAL_WEB_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_DATABASE_SERVER_ADD "Add Site..." + IDS_DATABASE_SERVER_DEFAULT_INSTANCE "(default)" + IDS_DATABASE_SERVER_COMPONENT_DESCRIPTION + "UDDI Services Database Components" + IDS_DATABASE_SERVER "Database Server" + IDS_DATABASE_SERVER_DEFAULT_SITE_NAME_PREFIX "Site hosted on " + IDS_DATABASE_SERVER_COLUMN_NAME "Name" + IDS_DATABASE_SERVER_COLUMN_COMPUTER "Computer" + IDS_DATABASE_SERVER_COLUMN_INSTANCE "Instance" + IDS_DATABASE_SERVER_COLUMN_DESCRIPTION "Description" + IDS_SITE_CONNECT_INSTANCE_FOUND_TEMPLATE + "A UDDI Services site has been found on this computer using the SQL Server database instance %s." + IDS_SITE_CONNECT_NO_INSTANCES_FOUND + "A UDDI Services site is not hosted on this computer." + IDS_DATABASE_SERVER_REGISTRY_READ_FAILED + "An error occurred while attempting to access the registry on the specified computer.\r\nYou may not have sufficient credentials to complete the operation." + IDS_DATABASE_SERVER_OLEDB_READ_FAILED + "An error occurred while attempting to retrieve configuration information from the database.\r\nYou may not have sufficient credentials to complete the operation." + IDS_DATABASE_SERVER_GETDATA_ERROR_TITLE + "Unable to access UDDI Services site" + IDS_ACCOUNT_GROUP_ERROR "This group account cannot be used for this permission level." + IDS_ERROR_TITLE "Error" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_REMOVE_FAILED "UDDI Services Web Server Move Failed" + IDS_WEBSERVER_REMOVE_FAILED_DETAIL + "Could not remove %1 from the UDDI Services site %2. The site is not responding or you do not have sufficient credentials to complete the operation.\r\n\r\nDo you still want to move %1 to %3?" + IDS_WEBSERVER_WEBFARM "UDDI Services Console - Caution" + IDS_WEBSERVER_WEBFARM_DETAIL + "If this UDDI Services Web server is part of a Web farm, you may need to configure its ValidationKey and DecryptionKey values for proper functionality.\r\nFor more information, see the Troubleshooting section in the UDDI Services MMC Snap-in Help." + IDS_DATABASE_SERVER_DBSCHEMA_VERSION_READ_FAILED + "Unable to obtain the database schema version for the UDDI Services site hosted on %s." + IDS_DATABASE_STANDARD_SERVER "Cannot use this database." + IDS_DATABASE_STANDARD_SERVER_DETAIL + "Unable to associate this UDDI Services Web server with this site because it is hosted on a Windows Server 2003, Standard Edition server.\r\nSupport for distributed installations of UDDI Services is available only with Windows Server 2003, Advanced Edition, and Windows Server Datacenter Edition." + IDS_WEBSERVER_ADD_FAILED_DETAIL + "Unable to add the UDDI Services Web Server on computer %s to the UDDI Services site hosted on computer %s." + IDS_WEBSERVER_ADD_FAILED + "Unable to add UDDI Services Web Server to UDDI Services site." + IDS_UDDIMMC_UNSPECIFIED "unspecified" + IDS_GENERAL_EXCEPTION_TITLE "General Exception Occurred" + IDS_GENERAL_EXCEPTION "A general exception has occurred. Please check your network connection and try again." +END + +STRINGTABLE +BEGIN + IDS_DATABASE_SERVER_DESCRIPTION + "Add a computer hosting UDDI Services database components" + IDS_DATABASE_SERVER_ALREADY_EXISTS + "The selected UDDI Services site is already registered in this console." + IDS_DATABASE_SERVER_SELECT_ERROR + "Unable to locate UDDI Services database components on the specified computer.\r\nThe computer does not exist, does not have UDDI Services database components installed, or you do not have sufficient credentials to complete the operation." + IDS_DATABASE_SERVER_SELECT_ERROR_TITLE "Invalid Computer Name" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_COMPONENT_DESCRIPTION "UDDI Services Web Server Component" + IDS_WEBSERVER "Web Server" + IDS_WEBSERVER_START "Start" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_STOP "Stop" + IDS_WEBSERVER_START_DESCRIPTION "Start UDDI Services" + IDS_WEBSERVER_STOP_DESCRIPTION "Stop UDDI Services" + IDS_WEBSERVER_RUNNING "Running" + IDS_WEBSERVER_STOPPED "Stopped" + IDS_WEBSERVER_DESCRIPTION "Add a reference to a UDDI Services Web server" + IDS_WEBSERVER_ADD "Add Web Server..." + IDS_WEBSERVER_COLUMN_NAME "Name" + IDS_WEBSERVER_COLUMN_STATUS "Status" + IDS_WEBSERVER_DISPLAYNAME_TEMPLATE + "UDDI Services Web Server Component on %s" + IDS_WEBSERVER_SELECT_ERROR + "Unable to locate UDDI Services Web server components on the specified computer.\r\nThe computer does not exist, does not have UDDI Services Web server components installed, or you do not have sufficient credentials to complete the operation." + IDS_WEBSERVER_SELECT_ERROR_TITLE "Invalid Computer Name" + IDS_WEBSERVER_ALREADY_EXISTS + "The selected computer is already registered as a web server for this site." + IDS_WEBSERVER_ASSIGNED "UDDI Services Web Server Currently Assigned" + IDS_WEBSERVER_ASSIGNED_DETAIL + "%s is already assigned to the UDDI Services site on %s.\r\n\r\nAre you sure you want to re-assign %s to the UDDI Services site on %s?" + IDS_WEBSERVER_NOT_ASSIGNABLE "UDDI Services Web Server Not Assignable" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_NOT_ASSIGNABLE_DETAIL + "This UDDI Services Web server cannot be moved because is hosted on a Windows Server 2003, Standard Edition server.\r\nSupport for distributed installations of UDDI Services is available only with Windows Server 2003, Advanced Edition and Windows Server 2003, Datacenter Edition." + IDS_WEBSERVER_SERVER_DBSCHEMA_VERSION_READ_FAILED + "Could not obtain database schema version for the Web server located on %s." + IDS_WEBSERVER_SERVER_INVALID_DBSCHEMA_VERSION + "The version of the schema used by the Web server located on %s (%s) is not compatible with the version of the schema being used by the UDDI Services site hosted on %s (%s)." +END + +STRINGTABLE +BEGIN + IDS_CRYPTOGRAPHY_TIMEOUT_ERROR + "The cryptography timeout value must be between 1 and 365 days." + IDS_CRYPTOGRAPHY_RESET_NOW_CONFIRM + "All existing UDDI authentication tokens will be invalidated.\r\n\r\nAre you sure you want to reset the cryptography settings for this instance of UDDI Services?" + IDS_CRYPTOGRAPHY_RESET_NOW_TITLE "Confirm Cryptography Reset" + IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS + "The cryptography settings on this server have been successfully reset." + IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS_TITLE "Cryptography Reset" + IDS_CRYPTOGRAPHY_RESET_NOW_FAILED + "The attempt to reset the cryptography settings on this server failed." + IDS_CRYPTOGRAPHY_RESET_NOW_FAILED_TITLE "Cryptography Reset" + IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR + "The token expiration value must be between 1 and 1000 minutes." + IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR_TITLE "Invalid Value" +END + +STRINGTABLE +BEGIN + IDS_ADVANCED_NAME_COLUMN_NAME "Name" + IDS_ADVANCED_VALUE_COLUMN_NAME "Value" +END + +STRINGTABLE +BEGIN + IDS_REGISTRY_OPEN_ERROR "Unable to open the local registry." + IDS_REGISTRY_OPEN_REMOTE_ERROR "Unable to open the remote registry." + IDS_REGISTRY_UNABLE_TO_OPEN_KEY "Unable to open the following key: " + IDS_REGISTRY_FAILED_TO_READ_VALUE + "The attempt to read the registry value failed." + IDS_REGISTRY_FAILED_TO_WRITE_VALUE + "The attempt to write a registry value failed." +END + +STRINGTABLE +BEGIN + IDS_UDDIMMC_HELPFILE "uddi.mmc.chm" + IDS_UDDIMMC_SNAPINDESC "UDDI Services Management Console" + IDS_UDDIMMC_NAME "UDDI Services" + IDS_UDDIMMC_PROVIDER "Microsoft Corporation" + IDS_UDDIMMC_SNAPINNAME "UDDI Services" + IDS_UDDIMMC_ABOUTNAME "UDDI Services About Name" + IDS_UDDIMMC_COMPONENT_DESCRIPTION "UDDI Services Administration Component" +END + +STRINGTABLE +BEGIN + IDS_UDDIMMC_CONNECTELLIPSISDESCRIPTION + "Connect to a server running UDDI Services database or Web components" + IDS_UDDIMMC_TYPE "Extension Snap-in" + IDS_UDDIMMC_DESCRIPTION "Configures and controls UDDI Services components." + IDS_UDDIMMC_NODBSERVER "" + IDS_UDDIMMC_NOINSTANCE "" +END + +STRINGTABLE +BEGIN + IDS_ACTIVEDIRECTORY_PUBLISH_FAILED + "An error occurred while attempting to publish this site to Active Directory.\r\nThis operation typically requires domain administration credentials." + IDS_ACTIVEDIRECTORY_DELETE_FAILED + "An error occurred while attempting to remove this site from Active Directory.\r\nThis operation typically requires domain administration credentials." + IDS_ACTIVEDIRECTORY_PUBLISH_SUCCEEDED + "The UDDI Services site information was successfully published to Active Directory." + IDS_ACTIVEDIRECTORY_DELETE_SUCCEDED + "The UDDI Services site information was successfully removed from Active Directory." + IDS_ACTIVEDIRECTORY_NO_BINDINGS + "No binding information exists for this site.\r\nNo information was published to Active Directory." +END + +STRINGTABLE +BEGIN + IDS_ERROR_ADDSVC "Unable to add the UDDI Services node" + IDS_ERROR_ADDWEBSITE "Unable to add the Web server node" + IDS_INVALID_VERSION_FORMAT + "%s has an invalid database schema version format." + IDS_DOT_NET_SERVER "Unable to determine the operating system version on the specified computer.\r\nWindows Server 2003, Standard Edition, Datacenter Edition, or Advanced Edition is required." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "UDDI Services MMC Snap-in Module" +#define VER_INTERNALNAME_STR "UDDI.MMC.DLL" +#define VER_ORIGINALFILENAME_STR "UDDI.MMC.DLL" + +#include "common.ver" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + + \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/obj/i386/resource.res b/inetsrv/uddi/source/mmc/obj/i386/resource.res new file mode 100644 index 0000000..a0cd3e9 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/resource.res differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/scp.obj b/inetsrv/uddi/source/mmc/obj/i386/scp.obj new file mode 100644 index 0000000..3b04056 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/scp.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/scppublisher.obj b/inetsrv/uddi/source/mmc/obj/i386/scppublisher.obj new file mode 100644 index 0000000..53233d0 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/scppublisher.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/servercheck.obj b/inetsrv/uddi/source/mmc/obj/i386/servercheck.obj new file mode 100644 index 0000000..f1d6246 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/servercheck.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/stringutil.obj b/inetsrv/uddi/source/mmc/obj/i386/stringutil.obj new file mode 100644 index 0000000..975bad1 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/stringutil.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.dll b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.dll new file mode 100644 index 0000000..03d3510 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.dll differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.exp b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.exp new file mode 100644 index 0000000..0650047 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.exp differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.lib b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.lib new file mode 100644 index 0000000..7a565cc Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.lib differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.pdb b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.pdb new file mode 100644 index 0000000..b9ecb13 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/uddi.mmc.pdb differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddi.obj b/inetsrv/uddi/source/mmc/obj/i386/uddi.obj new file mode 100644 index 0000000..7a065e1 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/uddi.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddimmc.man b/inetsrv/uddi/source/mmc/obj/i386/uddimmc.man new file mode 100644 index 0000000..a3b56c2 --- /dev/null +++ b/inetsrv/uddi/source/mmc/obj/i386/uddimmc.man @@ -0,0 +1,23 @@ + + + + +UDDI Services MMC Snapin + + + + + + diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddiservicesnode.obj b/inetsrv/uddi/source/mmc/obj/i386/uddiservicesnode.obj new file mode 100644 index 0000000..3f479f2 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/uddiservicesnode.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/uddisitenode.obj b/inetsrv/uddi/source/mmc/obj/i386/uddisitenode.obj new file mode 100644 index 0000000..020223e Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/uddisitenode.obj differ diff --git a/inetsrv/uddi/source/mmc/obj/i386/webservernode.obj b/inetsrv/uddi/source/mmc/obj/i386/webservernode.obj new file mode 100644 index 0000000..395b174 Binary files /dev/null and b/inetsrv/uddi/source/mmc/obj/i386/webservernode.obj differ diff --git a/inetsrv/uddi/source/mmc/objectpicker.cpp b/inetsrv/uddi/source/mmc/objectpicker.cpp new file mode 100644 index 0000000..195dfc4 --- /dev/null +++ b/inetsrv/uddi/source/mmc/objectpicker.cpp @@ -0,0 +1,734 @@ +//-------------------------------------------------------------------------- + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0510 +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#endif + +#define SECURITY_WIN32 +#include +#include +#include +#include +#include +#include +#include +#include + +#include "objectpicker.h" + +#define OP_GENERIC_EXCEPTION ( ( DWORD ) 1 ) + +//-------------------------------------------------------------------------- + +UINT g_cfDsObjectPicker = RegisterClipboardFormat( CFSTR_DSOP_DS_SELECTION_LIST ); + +static HRESULT InitObjectPicker( ObjectType oType, + IDsObjectPicker *pDsObjectPicker, + PTCHAR szTarget ); + +static HRESULT InitObjectPickerForComputers( IDsObjectPicker *pDsObjectPicker ); + +static HRESULT InitObjectPickerForGroups( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect, + LPCTSTR pszMachineName, + BOOL fWantSidPath ); + +static HRESULT InitObjectPickerForUsers( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect, + LPCTSTR pszMachineName ); + +static bool ProcessSelectedObjects( IDataObject *pdo, + ObjectType oType, + PTCHAR szObjectName, + ULONG uBufSize ); + +//-------------------------------------------------------------------------- +// returns true if no errors, false otherwise +// use GetLastError() to get error code +// +bool +ObjectPicker( HWND hwndParent, + ObjectType oType, + PTCHAR szObjectName, + ULONG uBufSize, + PTCHAR szTarget ) +{ + IDsObjectPicker *pDsObjectPicker = NULL; + IDataObject *pdo = NULL; + bool bRet = true; // assume no errors + + try + { + HRESULT hr = CoInitializeEx( NULL, COINIT_APARTMENTTHREADED ); + if( FAILED( hr ) ) + { + throw (DWORD)HRESULT_CODE( hr ); + } + + // + // Create an instance of the object picker. + // + hr = CoCreateInstance( CLSID_DsObjectPicker, + NULL, + CLSCTX_INPROC_SERVER, + IID_IDsObjectPicker, + reinterpret_cast( &pDsObjectPicker ) ); + + if( FAILED( hr ) ) + { + throw (DWORD)HRESULT_CODE(hr); + } + + // + // Initialize the object picker instance. + // + hr = InitObjectPicker( oType, pDsObjectPicker, szTarget ); + if( FAILED( hr ) ) + { + throw (DWORD)HRESULT_CODE(hr); + } + + // + // Invoke the modal dialog. + // + hr = pDsObjectPicker->InvokeDialog( hwndParent, &pdo ); + if( S_OK == hr ) + { + if( !ProcessSelectedObjects( pdo, oType, szObjectName, uBufSize )) + { + throw GetLastError(); + } + } + else if( S_FALSE == hr ) // user pressed cancel + { + throw (DWORD)OP_GENERIC_EXCEPTION; + } + else + { + throw (DWORD)HRESULT_CODE(hr); + } + } + catch( DWORD dwErr ) + { + SetLastError( dwErr ); + bRet = false; + } + catch( ... ) + { + bRet = false; + } + + // + // Cleanup. + // + if( pdo ) + pdo->Release(); + + if( pDsObjectPicker ) + pDsObjectPicker->Release(); + + CoUninitialize(); + + return bRet; +} + + +static HRESULT +InitObjectPicker( ObjectType oType, IDsObjectPicker *pDsObjectPicker, PTCHAR szTarget ) +{ + if( NULL == pDsObjectPicker ) + { + return E_INVALIDARG; + } + + HRESULT hr = E_FAIL; + + if( OT_Computer == oType ) + { + hr = InitObjectPickerForComputers( pDsObjectPicker ); + } + else if( OT_User == oType ) + { + hr = InitObjectPickerForUsers( pDsObjectPicker, FALSE, szTarget ); + } + else if( OT_Group == oType ) + { + hr = InitObjectPickerForGroups( pDsObjectPicker, FALSE, szTarget, FALSE ); + } + else if( OT_GroupSID == oType ) + { + hr = InitObjectPickerForGroups( pDsObjectPicker, FALSE, szTarget, TRUE ); + } + + return hr; +} + +static bool +ProcessSelectedObjects( IDataObject *pdo, ObjectType oType, PTCHAR szObjectName, ULONG uBufSize ) +{ + PDS_SELECTION_LIST pDsSelList = NULL; + bool dwRet = true; // assume ok + + STGMEDIUM stgmedium = + { + TYMED_HGLOBAL, + NULL, + NULL + }; + + FORMATETC formatetc = + { + ( CLIPFORMAT ) g_cfDsObjectPicker, + NULL, + DVASPECT_CONTENT, + -1, + TYMED_HGLOBAL + }; + + try + { + // + // Get the global memory block containing a user's selections. + // + HRESULT hr = pdo->GetData( &formatetc, &stgmedium ); + if( FAILED( hr ) ) + throw HRESULT_CODE( hr ); + + // + // Retrieve pointer to DS_SELECTION_LIST structure. + // + pDsSelList = ( PDS_SELECTION_LIST ) GlobalLock( stgmedium.hGlobal ); + if( !pDsSelList ) + { + throw GetLastError(); + } + + // + // assume there is only 1 item returned because + // we have multi-select turned off + // + if( pDsSelList->cItems != 1 ) + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + + UINT i = 0; + + // + // did we request a computer name? If so, we get it directly in the pwzName field + // + if( 0 == _tcsicmp( pDsSelList->aDsSelection[i].pwzClass, TEXT( "computer" )) ) + { + assert( uBufSize > _tcslen( pDsSelList->aDsSelection[i].pwzName ) ); + _tcsncpy( szObjectName, pDsSelList->aDsSelection[i].pwzName, uBufSize - 1 ); + szObjectName[ uBufSize - 1 ] = NULL; + } + // + // user name or group takes some post-processsing... + // + else if( 0 == _tcsicmp( pDsSelList->aDsSelection[i].pwzClass, TEXT( "user" ) ) || + 0 == _tcsicmp( pDsSelList->aDsSelection[i].pwzClass, TEXT( "group" ) ) ) + { + // + // user names from the domain begin with "LDAP:" + // strip off the prefix info, up to the first "cn=" + // then use the TranslateName API to get the form "domain\user" or "domain\group" + // + if( 0 == _tcsnicmp( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "LDAP:" ), 5 ) ) + { + if( OT_Group == oType ) + { + PTCHAR p = _tcsstr( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "CN=" ) ); + if( NULL == p ) + p = _tcsstr( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "cn=" ) ); + + if( NULL == p ) + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + + if( !TranslateName( p, NameFullyQualifiedDN, NameSamCompatible, szObjectName, &uBufSize ) ) + throw GetLastError(); + } + else if( OT_GroupSID == oType ) + { + // + // If we are here, then we should expect a string LDAP://SID= + // + if( 0 == _tcsnicmp( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "LDAP:" ), 5 ) ) + { + LPTSTR p = _tcsstr( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "=" ) ); + if( p ) + { + p++; + p[ _tcslen( p ) - 1 ] = NULL; + + LPTSTR szSID = NULL; + BYTE sidArray[ 512 ]; + TCHAR szDigit[ 3 ]; + + ZeroMemory( sidArray, sizeof sidArray ); + ZeroMemory( szDigit, sizeof szDigit ); + + size_t len = _tcslen(p) / 2; + for (size_t j=0; j < len; j++) + { + _tcsncpy( szDigit, p, 2 ); + LPTSTR stopPtr = NULL; + + sidArray[ j ] = (BYTE)_tcstoul( szDigit, &stopPtr, 16 ); + + p+=2; + } + + if( !ConvertSidToStringSid( sidArray, &szSID ) ) + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + else + { + _tcsncpy( szObjectName, szSID, uBufSize - 1 ); + LocalFree( szSID ); + } + } + else + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + } + else + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + } + else + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + } + // + // otherwise, names on the local box begin with "winnt:" + // and we are only interested in the last two sections of the string, + // delimited by "/" + // + else if( 0 == _tcsnicmp( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "WINNT:" ), 6 ) ) + { + PTCHAR p = pDsSelList->aDsSelection[i].pwzADsPath; + PTCHAR pend = p + _tcslen( p ); + UINT uCount = 0; + while( pend > p ) + { + if( '/' == *pend ) + { + *pend = '\\'; + uCount++; + + if( uCount == 2 ) + { + p = pend + 1; + break; + } + } + pend--; + } + + // + // if this fails, assert during debug but do not stop + // + if( p == pend ) + assert( false ); + + assert( uBufSize > _tcslen( p ) ); + _tcsncpy( szObjectName, p, uBufSize - 1 ); + szObjectName[ uBufSize - 1 ] = NULL; + } + else + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + } + else + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + } + + catch( DWORD dwErr ) + { + SetLastError( dwErr ); + dwRet = false; + } + + if( pDsSelList ) + GlobalUnlock( stgmedium.hGlobal ); + + ReleaseStgMedium( &stgmedium ); + + return dwRet; +} + + +//+-------------------------------------------------------------------------- +// +// Function: InitObjectPickerForGroups +// +// Synopsis: Call IDsObjectPicker::Initialize with arguments that will +// set it to allow the user to pick one or more groups. +// +// Arguments: [pDsObjectPicker] - object picker interface instance +// +// Returns: Result of calling IDsObjectPicker::Initialize. +// +// History: 10-14-1998 DavidMun Created +// 1-8-2000 SergeiA Adapted for IIS +// 9-6-2002 a-dsebes Adapted for UDDI +// +//--------------------------------------------------------------------------- +HRESULT +InitObjectPickerForGroups( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect, + LPCTSTR pszMachineName, + BOOL fWantSidPath ) +{ + // + // Prepare to initialize the object picker. + // Set up the array of scope initializer structures. + // + + static const int SCOPE_INIT_COUNT = 5; + DSOP_SCOPE_INIT_INFO aScopeInit[ SCOPE_INIT_COUNT ]; + + ZeroMemory( aScopeInit, sizeof( DSOP_SCOPE_INIT_INFO ) * SCOPE_INIT_COUNT ); + + // + // Target computer scope. This adds a "Look In" entry for the + // target computer. Computer scopes are always treated as + // downlevel (i.e., they use the WinNT provider). + // + aScopeInit[ 0 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 0 ].flType = DSOP_SCOPE_TYPE_TARGET_COMPUTER; + aScopeInit[ 0 ].flScope = DSOP_SCOPE_FLAG_STARTING_SCOPE; + + aScopeInit[ 0 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_BUILTIN_GROUPS; + aScopeInit[ 0 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS; + + if( fWantSidPath ) + { + aScopeInit[ 0 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // The domain to which the target computer is joined. Note we're + // combining two scope types into flType here for convenience. + // + aScopeInit[ 1 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 1 ].flScope = 0; + aScopeInit[ 1 ].flType = DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN | + DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN; + + aScopeInit[ 1 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE | + DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE; + aScopeInit[ 1 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS; + + if( fWantSidPath ) + { + aScopeInit[ 1 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // The domains in the same forest (enterprise) as the domain to which + // the target machine is joined. Note these can only be DS-aware + // + + aScopeInit[ 2 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 2 ].flType = DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN; + aScopeInit[ 2 ].flScope = 0; + + aScopeInit[ 2 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE; + + if( fWantSidPath ) + { + aScopeInit[ 2 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // Domains external to the enterprise but trusted directly by the + // domain to which the target machine is joined. + // + // If the target machine is joined to an NT4 domain, only the + // external downlevel domain scope applies, and it will cause + // all domains trusted by the joined domain to appear. + // + + aScopeInit[ 3 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 3 ].flScope = 0; + aScopeInit[ 3 ].flType = DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN | + DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN; + + aScopeInit[ 3 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE; + aScopeInit[ 3 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS; + + if( fWantSidPath ) + { + aScopeInit[ 3 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // The Global Catalog + // + + aScopeInit[ 4 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 4 ].flScope = 0; + aScopeInit[ 4 ].flType = DSOP_SCOPE_TYPE_GLOBAL_CATALOG; + + // + // Only native mode applies to gc scope. + // + aScopeInit[ 4 ].FilterFlags.Uplevel.flNativeModeOnly = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE; + + if( fWantSidPath ) + { + aScopeInit[ 4 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // Put the scope init array into the object picker init array + // + + DSOP_INIT_INFO InitInfo; + ZeroMemory( &InitInfo, sizeof( InitInfo ) ); + InitInfo.cbSize = sizeof( InitInfo ); + + // + // The pwzTargetComputer member allows the object picker to be + // retargetted to a different computer. It will behave as if it + // were being run ON THAT COMPUTER. + // + + InitInfo.pwzTargetComputer = pszMachineName; + InitInfo.cDsScopeInfos = SCOPE_INIT_COUNT; + InitInfo.aDsScopeInfos = aScopeInit; + InitInfo.flOptions = fMultiselect ? DSOP_FLAG_MULTISELECT : 0; + + // + // Note object picker makes its own copy of InitInfo. Also note + // that Initialize may be called multiple times, last call wins. + // + + HRESULT hr = pDsObjectPicker->Initialize( &InitInfo ); + + return hr; +} + + +//+-------------------------------------------------------------------------- +// +// Function: InitObjectPickerForGroups +// +// Synopsis: Call IDsObjectPicker::Initialize with arguments that will +// set it to allow the user to pick one or more groups. +// +// Arguments: [pDsObjectPicker] - object picker interface instance +// +// Returns: Result of calling IDsObjectPicker::Initialize. +// +// History: 9-6-2002 a-dsebes Created. +// +// +//--------------------------------------------------------------------------- +HRESULT +InitObjectPickerForUsers( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect, + LPCTSTR pszMachineName ) +{ + // + // Prepare to initialize the object picker. + // Set up the array of scope initializer structures. + // + + static const int SCOPE_INIT_COUNT = 5; + DSOP_SCOPE_INIT_INFO aScopeInit[ SCOPE_INIT_COUNT ]; + + ZeroMemory( aScopeInit, sizeof( DSOP_SCOPE_INIT_INFO ) * SCOPE_INIT_COUNT ); + + // + // Target computer scope. This adds a "Look In" entry for the + // target computer. Computer scopes are always treated as + // downlevel (i.e., they use the WinNT provider). + // + aScopeInit[ 0 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 0 ].flType = DSOP_SCOPE_TYPE_TARGET_COMPUTER; + aScopeInit[ 0 ].flScope = DSOP_SCOPE_FLAG_STARTING_SCOPE; + + aScopeInit[ 0 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + aScopeInit[ 0 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_USERS; + + // + // The domain to which the target computer is joined. Note we're + // combining two scope types into flType here for convenience. + // + aScopeInit[ 1 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 1 ].flScope = 0; + aScopeInit[ 1 ].flType = DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN | + DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN; + + aScopeInit[ 1 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + aScopeInit[ 1 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_USERS; + + // + // The domains in the same forest (enterprise) as the domain to which + // the target machine is joined. Note these can only be DS-aware + // + aScopeInit[ 2 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 2 ].flType = DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN; + aScopeInit[ 2 ].flScope = 0; + + aScopeInit[ 2 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + + // + // Domains external to the enterprise but trusted directly by the + // domain to which the target machine is joined. + // + // If the target machine is joined to an NT4 domain, only the + // external downlevel domain scope applies, and it will cause + // all domains trusted by the joined domain to appear. + // + aScopeInit[ 3 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 3 ].flScope = 0; + aScopeInit[ 3 ].flType = DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN | + DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN; + + aScopeInit[ 3 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + aScopeInit[ 3 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_USERS; + + // + // The Global Catalog + // + aScopeInit[ 4 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 4 ].flScope = 0; + aScopeInit[ 4 ].flType = DSOP_SCOPE_TYPE_GLOBAL_CATALOG; + + // + // Only native mode applies to gc scope. + // + aScopeInit[ 4 ].FilterFlags.Uplevel.flNativeModeOnly = DSOP_FILTER_USERS; + + // + // Put the scope init array into the object picker init array + // + DSOP_INIT_INFO InitInfo; + ZeroMemory( &InitInfo, sizeof( InitInfo ) ); + InitInfo.cbSize = sizeof( InitInfo ); + + // + // The pwzTargetComputer member allows the object picker to be + // retargetted to a different computer. It will behave as if it + // were being run ON THAT COMPUTER. + // + InitInfo.pwzTargetComputer = pszMachineName; + InitInfo.cDsScopeInfos = SCOPE_INIT_COUNT; + InitInfo.aDsScopeInfos = aScopeInit; + InitInfo.flOptions = fMultiselect ? DSOP_FLAG_MULTISELECT : 0; + + // + // Note object picker makes its own copy of InitInfo. Also note + // that Initialize may be called multiple times, last call wins. + // + HRESULT hr = pDsObjectPicker->Initialize( &InitInfo ); + + return hr; +} + + +//+-------------------------------------------------------------------------- +// +// Function: InitObjectPickerForComputers +// +// Synopsis: Call IDsObjectPicker::Initialize with arguments that will +// set it to allow the user to pick a single computer object. +// +// Arguments: [pDsObjectPicker] - object picker interface instance +// +// Returns: Result of calling IDsObjectPicker::Initialize. +// +// History: 10-14-1998 DavidMun Created +// 08-06-2002 a-dsebes Adapted for UDDI. +// +//--------------------------------------------------------------------------- + +HRESULT +InitObjectPickerForComputers( IDsObjectPicker *pDsObjectPicker ) +{ + // + // Prepare to initialize the object picker. + // Set up the array of scope initializer structures. + // + + static const int SCOPE_INIT_COUNT = 2; + DSOP_SCOPE_INIT_INFO aScopeInit[ SCOPE_INIT_COUNT ]; + + ZeroMemory( aScopeInit, sizeof( DSOP_SCOPE_INIT_INFO ) * SCOPE_INIT_COUNT ); + + // + // Build a scope init struct for everything except the joined domain. + // + + aScopeInit[ 0 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 0 ].flType = DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN + | DSOP_SCOPE_TYPE_GLOBAL_CATALOG + | DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN + | DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN + | DSOP_SCOPE_TYPE_WORKGROUP + | DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE + | DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE; + + aScopeInit[ 0 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_COMPUTERS; + aScopeInit[ 0 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_COMPUTERS; + + + // + // scope for the joined domain, make it the default + // + aScopeInit[ 1 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 1 ].flType = DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN + | DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN; + + aScopeInit[ 1 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_COMPUTERS; + aScopeInit[ 1 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_COMPUTERS; + aScopeInit[ 1 ].flScope = DSOP_SCOPE_FLAG_STARTING_SCOPE; + + // + // Put the scope init array into the object picker init array + // + + DSOP_INIT_INFO InitInfo; + ZeroMemory( &InitInfo, sizeof( InitInfo ) ); + + InitInfo.cbSize = sizeof( InitInfo ); + InitInfo.pwzTargetComputer = NULL; // NULL == local machine + InitInfo.cDsScopeInfos = SCOPE_INIT_COUNT; + InitInfo.aDsScopeInfos = aScopeInit; + + // + // Note object picker makes its own copy of InitInfo. Also note + // that Initialize may be called multiple times, last call wins. + // + + return pDsObjectPicker->Initialize(&InitInfo); +} diff --git a/inetsrv/uddi/source/mmc/objectpicker.h b/inetsrv/uddi/source/mmc/objectpicker.h new file mode 100644 index 0000000..7b8d45f --- /dev/null +++ b/inetsrv/uddi/source/mmc/objectpicker.h @@ -0,0 +1,14 @@ +#pragma once + +// +// These are the supported types +// +enum ObjectType +{ + OT_User = 0, + OT_Computer, + OT_Group, + OT_GroupSID +}; + +bool ObjectPicker( HWND hwndParent, ObjectType oType, PTCHAR szObjectName, ULONG uBufSize, PTCHAR szTargetName = NULL ); diff --git a/inetsrv/uddi/source/mmc/placefil.txt b/inetsrv/uddi/source/mmc/placefil.txt new file mode 100644 index 0000000..0811bce --- /dev/null +++ b/inetsrv/uddi/source/mmc/placefil.txt @@ -0,0 +1 @@ +uddi.mmc.dll uddi\system32 \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/res/activedirectory.ico b/inetsrv/uddi/source/mmc/res/activedirectory.ico new file mode 100644 index 0000000..125346f Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/activedirectory.ico differ diff --git a/inetsrv/uddi/source/mmc/res/advancededit.ico b/inetsrv/uddi/source/mmc/res/advancededit.ico new file mode 100644 index 0000000..b0904bb Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/advancededit.ico differ diff --git a/inetsrv/uddi/source/mmc/res/authentication.ico b/inetsrv/uddi/source/mmc/res/authentication.ico new file mode 100644 index 0000000..e573c71 Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/authentication.ico differ diff --git a/inetsrv/uddi/source/mmc/res/cryptography.ico b/inetsrv/uddi/source/mmc/res/cryptography.ico new file mode 100644 index 0000000..19e747d Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/cryptography.ico differ diff --git a/inetsrv/uddi/source/mmc/res/dbconnection.ico b/inetsrv/uddi/source/mmc/res/dbconnection.ico new file mode 100644 index 0000000..45ba51b Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/dbconnection.ico differ diff --git a/inetsrv/uddi/source/mmc/res/eventlog.ico b/inetsrv/uddi/source/mmc/res/eventlog.ico new file mode 100644 index 0000000..aea32af Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/eventlog.ico differ diff --git a/inetsrv/uddi/source/mmc/res/lgicons.bmp b/inetsrv/uddi/source/mmc/res/lgicons.bmp new file mode 100644 index 0000000..85d1fdc Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/lgicons.bmp differ diff --git a/inetsrv/uddi/source/mmc/res/logging.ico b/inetsrv/uddi/source/mmc/res/logging.ico new file mode 100644 index 0000000..59429a1 Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/logging.ico differ diff --git a/inetsrv/uddi/source/mmc/res/logging_eventlog.ico b/inetsrv/uddi/source/mmc/res/logging_eventlog.ico new file mode 100644 index 0000000..aea32af Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/logging_eventlog.ico differ diff --git a/inetsrv/uddi/source/mmc/res/logo.bmp b/inetsrv/uddi/source/mmc/res/logo.bmp new file mode 100644 index 0000000..fedd69a Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/logo.bmp differ diff --git a/inetsrv/uddi/source/mmc/res/logo.gif b/inetsrv/uddi/source/mmc/res/logo.gif new file mode 100644 index 0000000..79178df Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/logo.gif differ diff --git a/inetsrv/uddi/source/mmc/res/logolarge.bmp b/inetsrv/uddi/source/mmc/res/logolarge.bmp new file mode 100644 index 0000000..86ff11b Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/logolarge.bmp differ diff --git a/inetsrv/uddi/source/mmc/res/requiressl.ico b/inetsrv/uddi/source/mmc/res/requiressl.ico new file mode 100644 index 0000000..fb87ecd Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/requiressl.ico differ diff --git a/inetsrv/uddi/source/mmc/res/roles.ico b/inetsrv/uddi/source/mmc/res/roles.ico new file mode 100644 index 0000000..9bbf63a Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/roles.ico differ diff --git a/inetsrv/uddi/source/mmc/res/site.ico b/inetsrv/uddi/source/mmc/res/site.ico new file mode 100644 index 0000000..02c6b5f Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/site.ico differ diff --git a/inetsrv/uddi/source/mmc/res/smicons.bmp b/inetsrv/uddi/source/mmc/res/smicons.bmp new file mode 100644 index 0000000..e56c6af Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/smicons.bmp differ diff --git a/inetsrv/uddi/source/mmc/res/smopen.bmp b/inetsrv/uddi/source/mmc/res/smopen.bmp new file mode 100644 index 0000000..9066d0f Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/smopen.bmp differ diff --git a/inetsrv/uddi/source/mmc/res/toolbar1.bmp b/inetsrv/uddi/source/mmc/res/toolbar1.bmp new file mode 100644 index 0000000..b4f0a21 Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/toolbar1.bmp differ diff --git a/inetsrv/uddi/source/mmc/res/uddi.ico b/inetsrv/uddi/source/mmc/res/uddi.ico new file mode 100644 index 0000000..c98654b Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/uddi.ico differ diff --git a/inetsrv/uddi/source/mmc/res/uddi.services.bmp b/inetsrv/uddi/source/mmc/res/uddi.services.bmp new file mode 100644 index 0000000..f1408db Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/uddi.services.bmp differ diff --git a/inetsrv/uddi/source/mmc/res/webserver.ico b/inetsrv/uddi/source/mmc/res/webserver.ico new file mode 100644 index 0000000..7081810 Binary files /dev/null and b/inetsrv/uddi/source/mmc/res/webserver.ico differ diff --git a/inetsrv/uddi/source/mmc/resource.h b/inetsrv/uddi/source/mmc/resource.h new file mode 100644 index 0000000..b4c9e2f --- /dev/null +++ b/inetsrv/uddi/source/mmc/resource.h @@ -0,0 +1,205 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc +// +#define IDB_SMBMP 3 +#define IDB_LGBMP 4 +#define IDR_SMICONS 5 +#define IDR_LGICONS 6 +#define IDR_TOOLBAR1 7 +#define IDS_UDDIMMC_HELPFILE 99 +#define IDI_UDDIMMC 100 +#define IDS_UDDIMMC_SNAPINDESC 100 +#define IDS_UDDIMMC_NAME 101 +#define IDS_UDDIMMC_PROVIDER 102 +#define IDS_UDDIMMC_SNAPINNAME 103 +#define IDS_UDDIMMC_ABOUTNAME 104 +#define IDS_UDDIMMC_COMPONENT_DESCRIPTION 105 +#define IDS_UDDIMMC_CONNECTELLIPSISDESCRIPTION 120 +#define IDS_UDDIMMC_TYPE 121 +#define IDS_UDDIMMC_DESCRIPTION 122 +#define IDS_UDDIMMC_NODBSERVER 123 +#define IDS_UDDIMMC_NOINSTANCE 124 +#define IDS_UDDIMMC_WARNING 125 +#define IDS_ERROR_ADDSVC 168 +#define IDS_ERROR_ADDNODE 169 +#define IDS_ERROR_ADDWEBSITE 169 +#define IDS_INVALID_VERSION_FORMAT 170 +#define IDS_DOT_NET_SERVER 171 +#define IDI_DATABASE_SERVER 200 +#define IDS_DATABASE_SERVER_DESCRIPTION 202 +#define IDS_DATABASE_SERVER_SELECTION_ERROR 204 +#define IDS_DATABASE_SERVER_ALREADY_EXISTS 204 +#define IDS_DATABASE_SERVER_SELECTION_ERROR_TITLE 205 +#define IDS_DATABASE_SERVER_SELECT_ERROR 206 +#define IDS_DATABASE_SERVER_SELECT_ERROR_TITLE 207 +#define IDS_DATABASE_SERVER_ADD 208 +#define IDS_DATABASE_SERVER_DEFAULT_INSTANCE 209 +#define IDS_DATABASE_SERVER_COMPONENT_DESCRIPTION 210 +#define IDS_DATABASE_SERVER 211 +#define IDS_DATABASE_SERVER_DEFAULT_SITE_NAME_PREFIX 212 +#define IDS_DATABASE_SERVER_COLUMN_NAME 213 +#define IDS_DATABASE_SERVER_COLUMN_COMPUTER 214 +#define IDS_DATABASE_SERVER_COLUMN_INSTANCE 215 +#define IDS_DATABASE_SERVER_COLUMN_DESCRIPTION 216 +#define IDS_SITE_CONNECT_INSTANCE_FOUND_TEMPLATE 217 +#define IDS_SITE_CONNECT_NO_INSTANCES_FOUND 218 +#define IDS_DATABASE_SERVER_REGISTRY_READ_FAILED 219 +#define IDS_DATABASE_SERVER_OLEDB_READ_FAILED 220 +#define IDS_DATABASE_SERVER_GENERIC_GETDATA_ERROR 221 +#define IDS_DATABASE_SERVER_GETDATA_ERROR_TITLE 221 +#define IDS_ACCOUNT_ERROR 222 +#define IDS_ACCOUNT_GROUP_ERROR 222 +#define IDS_ERROR_TITLE 223 +#define IDS_WEBSERVER_REMOVE_FAILED 224 +#define IDS_WEBSERVER_REMOVE_FAILED_DETAIL 225 +#define IDS_WEBSERVER_WEBFARM 226 +#define IDS_WEBSERVER_WEBFARM_DETAIL 227 +#define IDS_DATABASE_SERVER_DBSCHEMA_VERSION_READ_FAILED 228 +#define IDS_DATABASE_STANDARD_SERVER 229 +#define IDS_DATABASE_STANDARD_SERVER_DETAIL 230 +#define IDS_WEBSERVER_ADD_FAILED_DETAIL 231 +#define IDS_WEBSERVER_ADD_FAILED 232 +#define IDS_UDDIMMC_UNSPECIFIED 233 +#define IDS_GENERAL_EXCEPTION_TITLE 234 +#define IDS_GENERAL_EXCEPTION 235 +#define IDI_WEBSERVER 300 +#define IDS_WEBSERVER_COMPONENT_DESCRIPTION 300 +#define IDS_WEBSERVER 301 +#define IDS_WEBSERVER_START 303 +#define IDS_WEBSERVER_STOP 304 +#define IDS_WEBSERVER_START_DESCRIPTION 305 +#define IDS_WEBSERVER_STOP_DESCRIPTION 306 +#define IDS_WEBSERVER_RUNNING 307 +#define IDS_WEBSERVER_STOPPED 308 +#define IDS_WEBSERVER_DESCRIPTION 309 +#define IDS_WEBSERVER_ADD 310 +#define IDS_WEBSERVER_COLUMN_NAME 311 +#define IDS_WEBSERVER_COLUMN_STATUS 312 +#define IDS_WEBSERVER_DISPLAYNAME_TEMPLATE 313 +#define IDS_WEBSERVER_SELECT_ERROR 314 +#define IDS_WEBSERVER_SELECT_ERROR_TITLE 315 +#define IDS_WEBSERVER_ALREADY_EXISTS 316 +#define IDS_WEBSERVER_ASSIGNED 317 +#define IDS_WEBSERVER_ASSIGNED_DETAIL 318 +#define IDS_WEBSERVER_NOT_ASSIGNABLE 319 +#define IDS_WEBSERVER_NOT_ASSIGNABLE_DETAIL 320 +#define IDS_WEBSERVER_SERVER_DBSCHEMA_VERSION_READ_FAILED 321 +#define IDS_WEBSERVER_SERVER_INVALID_DBSCHEMA_VERSION 322 +#define IDD_CRYPTOGRAPHY 400 +#define IDS_CRYPTOGRAPHY_TIMEOUT_ERROR 402 +#define IDS_CRYPTOGRAPHY_RESET_NOW_CONFIRM 403 +#define IDS_CRYPTOGRAPHY_RESET_NOW_TITLE 404 +#define IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS 405 +#define IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS_TITLE 406 +#define IDS_CRYPTOGRAPHY_RESET_NOW_FAILED 407 +#define IDS_CRYPTOGRAPHY_RESET_NOW_FAILED_TITLE 408 +#define IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR 409 +#define IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR_TITLE 410 +#define IDC_CRYPTOGRAPHY_EDIT_TIMEOUT 449 +#define IDC_CRYPTOGRAPHY_SPIN_TIMEOUT 450 +#define IDC_CRYPTOGRAPHY_TXT_RESET_DATE 451 +#define IDC_CRYPTOGRAPHY_EDIT_TICKET_TIMEOUT 453 +#define IDC_CRYPTOGRAPHY_BTN_CHANGE 454 +#define IDC_CRYPTOGRAPHY_BTN_RESET_NOW 455 +#define IDC_CRYPTOGRAPHY_CHECK_AUTO_RESET 456 +#define IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT 459 +#define IDD_ADVANCED_PROPPAGE 500 +#define IDI_ADVANCED 500 +#define IDS_ADVANCED_NAME_COLUMN_NAME 501 +#define IDS_ADVANCED_VALUE_COLUMN_NAME 502 +#define IDS_ADVANCED_CHANGED_COLUMN_NAME 503 +#define IDC_ADVANCED_BTN_EDIT 504 +#define IDD_ACTIVEDIRECTORY_PROPPAGE 600 +#define IDI_ACTIVEDIRECTORY 600 +#define IDS_ACTIVEDIRECTORY_PUBLISH_FAILED 601 +#define IDS_ACTIVEDIRECTORY_DELETE_FAILED 602 +#define IDS_ACTIVEDIRECTORY_PUBLISH_SUCCEEDED 603 +#define IDS_ACTIVEDIRECTORY_DELETE_SUCCEDED 604 +#define IDS_ACTIVEDIRECTORY_NO_BINDINGS 605 +#define IDC_ACTIVEDIRECTORY_LIST_ADVANCED 651 +#define IDC_ACTIVEDIRECTORY_BTN_REFRESH 652 +#define IDC_ACTIVEDIRECTORY_BTN_REMOVE 653 +#define IDC_ACTIVEDIRECTORY_BTN_ADD 655 +#define IDD_ROLES_PROPPAGE 700 +#define IDI_ROLES 700 +#define IDC_ROLES_EDIT_ADMIN_GROUP_NAME 751 +#define IDC_ROLES_EDIT_ADMIN_GROUP_NAME2 752 +#define IDC_ROLES_BTN_ADMINISTRATOR_SELECT 753 +#define IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME 754 +#define IDC_ROLES_BTN_COORDINATOR_SELECT 756 +#define IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME 757 +#define IDC_ROLES_BTN_PUBLISHER_SELECT 758 +#define IDC_ROLES_EDIT_USER_GROUP_NAME 759 +#define IDC_ROLES_BTN_USER_SELECT 760 +#define IDD_SECURITY_PROPPAGE 800 +#define IDI_SECURITY_CRYPTOGRAPHY 801 +#define IDI_SECURITY_REQUIRESSL 802 +#define IDI_SECURITY_AUTHENTICATION 803 +#define IDC_SECURITY_RADIO_AUTHENTICATION_BOTH 851 +#define IDC_SECURITY_RADIO_AUTHENTICATION_UDDI 852 +#define IDC_SECURITY_CHECK_AUTHENTICATED_READS 853 +#define IDC_SECURITY_RADIO_AUTHENTICATION_WINDOWS 854 +#define IDC_SECURITY_CHECK_REQUIRE_SSL 855 +#define IDD_SITE_CONNECT 900 +#define IDC_SITE_CONNECT_CB_DATABASE_INSTANCE 902 +#define IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER 906 +#define IDC_SITE_CONNECT_BTN_BROWSE 907 +#define IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER 908 +#define IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER 909 +#define IDC_SITE_CONNECT_READER 910 +#define IDC_SITE_CONNECT_RADIO_READER 910 +#define IDC_SITE_CONNECT_WRITER 911 +#define IDC_SITE_CONNECT_RADIO_WRITER 911 +#define IDC_SITE_CONNECT_BOTH 912 +#define IDC_SITE_CONNECT_RADIO_BOTH 912 +#define IDC_SITE_CONNECT_RADIO_WRITER2 913 +#define IDC_GENERAL_SITE_TXT_DESCRIPTION 1054 +#define IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE 1055 +#define IDS_REGISTRY_OPEN_ERROR 1160 +#define IDS_REGISTRY_OPEN_REMOTE_ERROR 1161 +#define IDS_REGISTRY_UNABLE_TO_OPEN_KEY 1162 +#define IDS_REGISTRY_FAILED_TO_READ_VALUE 1163 +#define IDS_REGISTRY_FAILED_TO_WRITE_VALUE 1164 +#define IDD_WEBSERVER_NEW 2000 +#define IDD_LOGGING_PROPPAGE 2100 +#define IDI_LOGGING_FILELOG 2101 +#define IDI_LOGGING_EVENTLOG 2102 +#define IDC_LOGGING_SLIDER_FILELOG 2151 +#define IDC_LOGGING_TXT_LOGFILE_LOCATION 2152 +#define IDC_LOGGING_SLIDER_EVENTLOG 2153 +#define IDD_ADVANCED_EDIT 2200 +#define IDC_ADVANCED_EDIT_VALUE 2201 +#define IDC_ADVANCED_EDIT_TXT_NAME 2202 +#define IDC_ADVANCED_EDIT_TXT_DISPLAYNAME 2203 +#define IDD_GENERAL_WEB_PROPPAGE 2300 +#define IDD_GENERAL_SITE_PROPPAGE 2400 +#define IDC_GENERAL_SITE_TXT_UDDI_VERSION 2450 +#define IDC_GENERAL_SITE_TXT_UDDI_LANGUAGE 2451 +#define IDC_GENERAL_SITE_TXT_FRAMEWORK_VERSION 2452 +#define IDC_GENERAL_SITE_LIST_SERVICES 2453 +#define IDC_GENERAL_SITE_TXT_INSTALL_LOCATION 2454 +#define IDC_GENERAL_SITE_TXT_INSTALL_DATE 2455 +#define IDC_GENERAL_SITE_TXT_DISPLAYNAME 2456 +#define IDC_GENERAL_SITE_TXT_PROVIDER_KEY 2457 +#define IDD_DB_CONNECTION_PROPPAGE 2500 +#define IDI_DB_CONNECTION 2500 +#define IDC_DB_CONNECTION_TXT_READER_SERVER 2501 +#define IDC_DB_CONNECTION_TXT_READER_INSTANCE 2502 +#define IDC_DB_CONNECTION_TXT_WRITER_SERVER 2503 +#define IDC_DB_CONNECTION_TXT_WRITER_INSTANCE 2504 +#define IDC_DB_CONNECTION_BTN_READER_SELECT 2505 +#define IDC_DB_CONNECTION_BTN_WRITER_SELECT 2506 +#define ID_BUTTONSTART 40021 +#define ID_BUTTONSTOP 40023 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 171 +#define _APS_NEXT_COMMAND_VALUE 40016 +#define _APS_NEXT_CONTROL_VALUE 1056 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/inetsrv/uddi/source/mmc/resource.hm b/inetsrv/uddi/source/mmc/resource.hm new file mode 100644 index 0000000..f6b2c00 --- /dev/null +++ b/inetsrv/uddi/source/mmc/resource.hm @@ -0,0 +1,4 @@ +// Microsoft Visual C++ generated Help ID include file. +// Used by resource.rc +// +#define HIDHELP 0x80940009 // IDD_CRYPTOGRAPHY diff --git a/inetsrv/uddi/source/mmc/resource.rc b/inetsrv/uddi/source/mmc/resource.rc new file mode 100644 index 0000000..f39a192 --- /dev/null +++ b/inetsrv/uddi/source/mmc/resource.rc @@ -0,0 +1,764 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +// Generated Help ID header file +#define APSTUDIO_HIDDEN_SYMBOLS +#include "resource.hm" +#undef APSTUDIO_HIDDEN_SYMBOLS + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include \r\n" + "\r\n" + "#define VER_FILETYPE\t\t VFT_DLL\r\n" + "#define VER_FILESUBTYPE\t\t VFT2_UNKNOWN\r\n" + "#define VER_FILEDESCRIPTION_STR ""UDDI Services MMC Snap-in Module""\r\n" + "#define VER_INTERNALNAME_STR\t ""UDDI.MMC.DLL""\r\n" + "#define VER_ORIGINALFILENAME_STR ""UDDI.MMC.DLL""\r\n" + "\r\n" + "#include ""common.ver""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDR_SMICONS BITMAP "res\\smicons.bmp" +IDR_LGICONS BITMAP "res\\lgicons.bmp" +IDR_TOOLBAR1 BITMAP "res\\toolbar1.bmp" +IDB_SMBMP BITMAP "res\\logo.bmp" +IDB_LGBMP BITMAP "res\\logolarge.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Toolbar +// + +IDR_TOOLBAR1 TOOLBAR 16, 16 +BEGIN + BUTTON ID_BUTTONSTART + BUTTON ID_BUTTONSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_UDDIMMC ICON "res\\uddi.ico" +IDI_SECURITY_AUTHENTICATION ICON "res\\authentication.ico" +IDI_SECURITY_REQUIRESSL ICON "res\\requiressl.ico" +IDI_ROLES ICON "res\\roles.ico" +IDI_ACTIVEDIRECTORY ICON "res\\activedirectory.ico" +IDI_SECURITY_CRYPTOGRAPHY ICON "res\\cryptography.ico" +IDI_DATABASE_SERVER ICON "res\\site.ico" +IDI_WEBSERVER ICON "res\\webserver.ico" +IDI_DB_CONNECTION ICON "res\\dbconnection.ico" +IDI_ADVANCED ICON "res\\advancededit.ico" +IDI_LOGGING_FILELOG ICON "res\\logging.ico" +IDI_LOGGING_EVENTLOG ICON "res\\logging_eventlog.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ROLES_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Roles" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Publishers' Group Name",IDC_STATIC,7,150,247,40 + GROUPBOX "Administrators' Group Name",IDC_STATIC,7,46,247,40 + GROUPBOX "Coordinators' Group Name",IDC_STATIC,7,98,247,40 + GROUPBOX "Users' Group Name",IDC_STATIC,7,202,247,40 + EDITTEXT IDC_ROLES_EDIT_ADMIN_GROUP_NAME,16,62,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "&Select...",IDC_ROLES_BTN_ADMINISTRATOR_SELECT,194,62, + 50,14 + EDITTEXT IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME,16,113,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "S&elect...",IDC_ROLES_BTN_COORDINATOR_SELECT,194,113,50, + 14 + EDITTEXT IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME,16,164,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "Se&lect...",IDC_ROLES_BTN_PUBLISHER_SELECT,194,164,50, + 14 + EDITTEXT IDC_ROLES_EDIT_USER_GROUP_NAME,16,217,169,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "Selec&t...",IDC_ROLES_BTN_USER_SELECT,194,217,50,14 + LTEXT "Select the group to associated with each level of permission.", + IDC_STATIC,54,16,188,26 + ICON IDI_ROLES,IDC_STATIC,18,15,20,20 +END + +IDD_SECURITY_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Security" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Authenticated access",IDC_STATIC,7,14,247,104 + GROUPBOX "Secure Communications",IDC_STATIC,7,125,247,51 + GROUPBOX "Cryptography",IDC_STATIC,7,183,247,62 + CONTROL "&Windows Integrated and UDDI publisher authentication", + IDC_SECURITY_RADIO_AUTHENTICATION_BOTH,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE | WS_GROUP,38,48,208, + 20 + CONTROL "&UDDI publisher authentication", + IDC_SECURITY_RADIO_AUTHENTICATION_UDDI,"Button", + BS_AUTORADIOBUTTON,38,72,208,10 + CONTROL "Windows &Integrated publisher authentication", + IDC_SECURITY_RADIO_AUTHENTICATION_WINDOWS,"Button", + BS_AUTORADIOBUTTON,38,91,209,10 + CONTROL "Authentication &for read (inquiry) access", + IDC_SECURITY_CHECK_AUTHENTICATED_READS,"Button", + BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,50,102,190,10 + CONTROL "Require &SSL for publication requests to this site.", + IDC_SECURITY_CHECK_REQUIRE_SSL,"Button",BS_AUTOCHECKBOX | + BS_TOP | BS_MULTILINE | WS_TABSTOP,65,142,142,22 + LTEXT "Change the key settings used for UDDI publisher authentication.", + IDC_STATIC,65,197,179,20 + PUSHBUTTON "&Change...",IDC_CRYPTOGRAPHY_BTN_CHANGE,167,221,50,14 + ICON IDI_SECURITY_AUTHENTICATION,IDC_STATIC,27,27,20,20 + LTEXT "Select an authentication type for this site:", + IDC_STATIC,65,30,180,18 + ICON IDI_SECURITY_REQUIRESSL,IDC_STATIC,24,140,20,20 + ICON IDI_SECURITY_CRYPTOGRAPHY,IDC_STATIC,25,195,20,20 +END + +IDD_DB_CONNECTION_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Database Connection" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Read operations computer",IDC_STATIC,6,122,248,61 + PUSHBUTTON "C&hange...",IDC_DB_CONNECTION_BTN_READER_SELECT,189,162, + 50,14 + LTEXT "",IDC_DB_CONNECTION_TXT_READER_SERVER,52,62,181,8 + GROUPBOX "Write operations computer",IDC_STATIC,6,48,248,61 + ICON IDI_DB_CONNECTION,IDC_STATIC,15,16,20,20 + LTEXT "Select the computers hosting the UDDI Services database components that will be used for read (inquiry) and write (publish) operations.", + IDC_STATIC,46,15,190,26 + PUSHBUTTON "&Change...",IDC_DB_CONNECTION_BTN_WRITER_SELECT,189,87, + 50,14 + LTEXT "",IDC_DB_CONNECTION_TXT_WRITER_SERVER,52,138,181,8 + LTEXT "Server:",IDC_STATIC,18,62,25,8 + LTEXT "UDDI Services",IDC_DB_CONNECTION_TXT_WRITER_INSTANCE,52, + 74,181,8 + LTEXT "Instance:",IDC_STATIC,18,74,32,8 + LTEXT "UDDI Services",IDC_DB_CONNECTION_TXT_READER_INSTANCE,52, + 150,181,8 + LTEXT "Instance:",IDC_STATIC,17,150,32,8 + LTEXT "Server:",IDC_STATIC,17,138,25,8 +END + +IDD_ACTIVEDIRECTORY_PROPPAGE DIALOGEX 0, 0, 247, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Active Directory" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Publish",IDC_STATIC,6,20,234,47 + LTEXT "Publishes this instance of UDDI Services to Active Directory.", + IDC_STATIC,49,34,117,20 + PUSHBUTTON "&Publish",IDC_ACTIVEDIRECTORY_BTN_ADD,179,36,50,14 + GROUPBOX "Remove",IDC_STATIC,6,76,234,47 + LTEXT "Removes this instance of UDDI Services from Active Directory.", + IDC_STATIC,13,89,147,20 + PUSHBUTTON "Re&move",IDC_ACTIVEDIRECTORY_BTN_REMOVE,179,91,50,14 + ICON IDI_ACTIVEDIRECTORY,IDC_STATIC,17,35,20,20 +END + +IDD_ADVANCED_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Advanced" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "",IDC_ACTIVEDIRECTORY_LIST_ADVANCED,"SysListView32", + LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | + LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_TABSTOP,7,56,247, + 153 + PUSHBUTTON "&Edit Property...",IDC_ADVANCED_BTN_EDIT,174,222,80,14, + WS_DISABLED + LTEXT "To modify an advanced property, double-click the property name or select it and then click Edit Property.", + IDC_STATIC,53,18,193,34 + ICON IDI_ADVANCED,IDC_STATIC,19,16,20,20 +END + +IDD_GENERAL_SITE_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +EXSTYLE WS_EX_TRANSPARENT +CAPTION "General" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "UDDI Services site for at ", + IDC_GENERAL_SITE_TXT_DISPLAYNAME,39,19,208,8, + SS_WORDELLIPSIS + LTEXT "2.0.000.1",IDC_GENERAL_SITE_TXT_UDDI_VERSION,103,57,118, + 9 + LTEXT "Date:",IDC_STATIC,17,149,64,8 + LTEXT "c:\\inetpub\\uddi", + IDC_GENERAL_SITE_TXT_INSTALL_LOCATION,103,162,137,8, + SS_WORDELLIPSIS + LTEXT "Language:",IDC_STATIC,15,71,68,8 + LTEXT "Location:",IDC_STATIC,17,162,73,8 + LTEXT "Version:",IDC_STATIC,15,57,67,11 + LTEXT "April 10th, 2002",IDC_GENERAL_SITE_TXT_INSTALL_DATE,103, + 149,139,8 + LTEXT "English",IDC_GENERAL_SITE_TXT_UDDI_LANGUAGE,103,71,135, + 9 + LTEXT "Components:",IDC_STATIC,17,193,209,8 + LTEXT ".NET Framework Version:",IDC_STATIC,16,176,82,8 + LISTBOX IDC_GENERAL_SITE_LIST_SERVICES,14,204,233,36,LBS_SORT | + LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_DISABLED | + WS_VSCROLL | WS_TABSTOP + ICON IDI_DATABASE_SERVER,IDC_STATIC,13,13,20,20 + CONTROL "79684fb0-fd0b-44e9-b2b4-7c19863150c7", + IDC_GENERAL_SITE_TXT_PROVIDER_KEY,"Static", + SS_LEFTNOWORDWRAP | WS_GROUP,103,43,144,9 + LTEXT "Site key:",IDC_STATIC,15,43,56,11 + GROUPBOX "Site Description",IDC_STATIC,7,86,247,46 + GROUPBOX "Installation",IDC_STATIC,7,136,247,110 + LTEXT "",IDC_GENERAL_SITE_TXT_DESCRIPTION,17,97,229,27 + LTEXT "2.0.3705.1",IDC_GENERAL_SITE_TXT_FRAMEWORK_VERSION,103, + 176,84,8 + CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,12,36, + 239,1 +END + +IDD_SITE_CONNECT DIALOGEX 0, 0, 346, 146 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Select Computer" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "&Local computer: (the computer this console is running on)", + IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,17,54,199,10 + CONTROL "&Another computer:", + IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER,"Button", + BS_AUTORADIOBUTTON,17,72,77,10 + EDITTEXT IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER,100,70,170,14, + ES_AUTOHSCROLL | WS_DISABLED + PUSHBUTTON "&Browse...",IDC_SITE_CONNECT_BTN_BROWSE,277,70,50,14, + WS_DISABLED + DEFPUSHBUTTON "OK",IDOK,184,125,50,14 + PUSHBUTTON "Cancel",IDCANCEL,237,125,50,14 + PUSHBUTTON "&Help",IDHELP,289,125,50,14,0,0,HIDHELP + LTEXT "Select a computer hosting UDDI Services database components.", + IDC_STATIC,49,19,282,8 + ICON IDI_DATABASE_SERVER,IDC_STATIC,19,13,20,20 + GROUPBOX "Connect to UDDI Services on:",IDC_STATIC,7,39,332,79 + LTEXT "A UDDI Services site is hosted on this computer using the database instance \\(default).", + IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE,29,92,299,19 +END + +IDD_WEBSERVER_NEW DIALOGEX 0, 0, 346, 132 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Select Web Server" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "&Local computer: (the computer this console is running on)", + IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,17,52,199,10 + CONTROL "&Another computer:", + IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER,"Button", + BS_AUTORADIOBUTTON,17,70,77,10 + EDITTEXT IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER,100,68,170,14, + ES_AUTOHSCROLL | WS_DISABLED + PUSHBUTTON "&Browse...",IDC_SITE_CONNECT_BTN_BROWSE,277,68,50,14, + WS_DISABLED + DEFPUSHBUTTON "OK",IDOK,184,111,50,14 + PUSHBUTTON "Cancel",IDCANCEL,236,111,50,14 + PUSHBUTTON "&Help",IDHELP,288,111,50,14 + GROUPBOX "Select the Web server's host computer:",-1,7,37,332,66 + ICON IDI_WEBSERVER,-1,19,11,20,20 + LTEXT "Select a UDDI Services Web server to add to this UDDI Services site.", + -1,49,17,193,8 +END + +IDD_CRYPTOGRAPHY DIALOGEX 0, 0, 220, 198 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "UDDI Services Cryptography" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + EDITTEXT IDC_CRYPTOGRAPHY_EDIT_TICKET_TIMEOUT,55,32,47,14, + ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT,"msctls_updown32", + UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | + UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,92,32,11,14 + PUSHBUTTON "&Reset Now",IDC_CRYPTOGRAPHY_BTN_RESET_NOW,41,102,50,14 + CONTROL "Automatically reset cryptography key", + IDC_CRYPTOGRAPHY_CHECK_AUTO_RESET,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,21,126,182,10 + EDITTEXT IDC_CRYPTOGRAPHY_EDIT_TIMEOUT,56,140,47,14, + ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_CRYPTOGRAPHY_SPIN_TIMEOUT,"msctls_updown32", + UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | + UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,90,140,11, + 14 + DEFPUSHBUTTON "OK",IDOK,59,176,50,14 + PUSHBUTTON "Cancel",IDCANCEL,111,176,50,14 + LTEXT "The current key was created:",IDC_STATIC,21,74,174,11 + GROUPBOX "Cryptography Key Timeout",IDC_STATIC,7,61,206,102 + LTEXT "every",IDC_STATIC,33,143,20,8 + LTEXT "days.",IDC_STATIC,107,143,43,8 + LTEXT "December 23rd, 2001",IDC_CRYPTOGRAPHY_TXT_RESET_DATE,41, + 88,148,8 + GROUPBOX "SOAP Authentication Token Expiration",IDC_STATIC,7,7, + 206,48 + LTEXT "after",IDC_STATIC,33,35,17,8 + LTEXT "minutes.",IDC_STATIC,108,35,60,8 + LTEXT "Tokens issued for publication will expire",IDC_STATIC, + 21,21,171,8 + PUSHBUTTON "&Help",IDHELP,163,176,50,14,0,0,HIDHELP +END + +IDD_LOGGING_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Logging" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Event Log Settings",IDC_STATIC,7,16,247,80 + CONTROL "",IDC_LOGGING_SLIDER_EVENTLOG,"msctls_trackbar32", + TBS_AUTOTICKS | TBS_TOOLTIPS | WS_TABSTOP,20,54,220,18 + CTEXT "None",IDC_STATIC,21,73,18,19 + CTEXT "Verbose",IDC_STATIC,218,73,27,18 + CTEXT "Error",IDC_STATIC,55,73,17,18 + CTEXT "Warning",IDC_STATIC,82,73,28,19 + CTEXT "FailAudit",IDC_STATIC,117,73,30,17 + CTEXT "PassAudit",IDC_STATIC,151,73,32,18 + CTEXT "Info",IDC_STATIC,193,73,14,20 + LTEXT "Select the level of information reported to the Event Log.", + IDC_STATIC,59,31,178,23 + ICON IDI_LOGGING_EVENTLOG,IDC_STATIC,25,29,20,20 + GROUPBOX "Log File Settings",IDC_STATIC,7,102,247,91 + CONTROL "",IDC_LOGGING_SLIDER_FILELOG,"msctls_trackbar32", + TBS_AUTOTICKS | TBS_TOOLTIPS | WS_TABSTOP,18,152,220,18 + LTEXT "Select the level of information reported to the UDDI Services log file.", + IDC_STATIC,59,116,178,23 + ICON IDI_LOGGING_FILELOG,IDC_STATIC,25,115,20,20 + LTEXT "Location:",IDC_STATIC,25,139,30,8 + LTEXT "c:\\inetpub\\uddi\\uddi.log", + IDC_LOGGING_TXT_LOGFILE_LOCATION,59,139,174,8, + SS_WORDELLIPSIS + CTEXT "None",IDC_STATIC,19,171,18,18 + CTEXT "Verbose",IDC_STATIC,216,171,27,18 + CTEXT "Error",IDC_STATIC,53,171,17,19 + CTEXT "Warning",IDC_STATIC,80,171,28,17 + CTEXT "FailAudit",IDC_STATIC,115,171,28,18 + CTEXT "PassAudit",IDC_STATIC,149,171,32,18 + CTEXT "Info",IDC_STATIC,191,171,14,18 +END + +IDD_ADVANCED_EDIT DIALOGEX 0, 0, 277, 91 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Edit Property" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + EDITTEXT IDC_ADVANCED_EDIT_VALUE,47,40,201,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,114,70,50,14 + PUSHBUTTON "Cancel",IDCANCEL,167,70,50,14 + PUSHBUTTON "&Help",IDHELP,220,70,50,14,0,0,HIDHELP + LTEXT "Name:",IDC_STATIC,20,20,22,8 + LTEXT "DefaultDiscoveryURL",IDC_ADVANCED_EDIT_TXT_NAME,47,21, + 169,8 + LTEXT "Value:",IDC_STATIC,20,42,21,8 +END + +IDD_GENERAL_WEB_PROPPAGE DIALOGEX 0, 0, 261, 262 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +EXSTYLE WS_EX_TRANSPARENT +CAPTION "General" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "UDDI Services Web Server Component", + IDC_GENERAL_SITE_TXT_DISPLAYNAME,46,19,193,8 + LTEXT "2.0.000.1",IDC_GENERAL_SITE_TXT_UDDI_VERSION,113,43,124, + 9 + LTEXT "Language:",IDC_STATIC,17,55,35,8 + LTEXT "Version:",IDC_STATIC,17,43,28,11 + LTEXT "English",IDC_GENERAL_SITE_TXT_UDDI_LANGUAGE,113,55,120, + 9 + ICON IDI_WEBSERVER,IDC_STATIC,19,13,20,20 + CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,13,38, + 237,1 + LTEXT "Date:",IDC_STATIC,17,151,19,8 + LTEXT "c:\\inetpub\\uddi", + IDC_GENERAL_SITE_TXT_INSTALL_LOCATION,113,164,131,8, + SS_PATHELLIPSIS + LTEXT "Location:",IDC_STATIC,17,164,30,8 + LTEXT "April 10th, 2002",IDC_GENERAL_SITE_TXT_INSTALL_DATE,113, + 151,129,8 + LTEXT "Components:",IDC_STATIC,17,195,209,8 + LTEXT ".NET Framework Version:",IDC_STATIC,17,178,95,8 + LISTBOX IDC_GENERAL_SITE_LIST_SERVICES,14,206,233,36,LBS_SORT | + LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_DISABLED | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "Installation:",IDC_STATIC,7,138,247,110 + LTEXT "2.0.3705.1",IDC_GENERAL_SITE_TXT_FRAMEWORK_VERSION,113, + 178,129,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_ROLES_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_SECURITY_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 254 + END + + IDD_DB_CONNECTION_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_ACTIVEDIRECTORY_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 240 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_ADVANCED_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_GENERAL_SITE_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 254 + END + + IDD_SITE_CONNECT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 339 + TOPMARGIN, 7 + BOTTOMMARGIN, 139 + END + + IDD_WEBSERVER_NEW, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 339 + TOPMARGIN, 7 + BOTTOMMARGIN, 125 + END + + IDD_CRYPTOGRAPHY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 190 + END + + IDD_LOGGING_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END + + IDD_ADVANCED_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 270 + TOPMARGIN, 7 + BOTTOMMARGIN, 84 + END + + IDD_GENERAL_WEB_PROPPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 255 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_DATABASE_SERVER_ADD "Add Site..." + IDS_DATABASE_SERVER_DEFAULT_INSTANCE "(default)" + IDS_DATABASE_SERVER_COMPONENT_DESCRIPTION + "UDDI Services Database Components" + IDS_DATABASE_SERVER "Database Server" + IDS_DATABASE_SERVER_DEFAULT_SITE_NAME_PREFIX "Site hosted on " + IDS_DATABASE_SERVER_COLUMN_NAME "Name" + IDS_DATABASE_SERVER_COLUMN_COMPUTER "Computer" + IDS_DATABASE_SERVER_COLUMN_INSTANCE "Instance" + IDS_DATABASE_SERVER_COLUMN_DESCRIPTION "Description" + IDS_SITE_CONNECT_INSTANCE_FOUND_TEMPLATE + "A UDDI Services site has been found on this computer using the SQL Server database instance %s." + IDS_SITE_CONNECT_NO_INSTANCES_FOUND + "A UDDI Services site is not hosted on this computer." + IDS_DATABASE_SERVER_REGISTRY_READ_FAILED + "An error occurred while attempting to access the registry on the specified computer.\r\nYou may not have sufficient credentials to complete the operation." + IDS_DATABASE_SERVER_OLEDB_READ_FAILED + "An error occurred while attempting to retrieve configuration information from the database.\r\nYou may not have sufficient credentials to complete the operation." + IDS_DATABASE_SERVER_GETDATA_ERROR_TITLE + "Unable to access UDDI Services site" + IDS_ACCOUNT_GROUP_ERROR "This group account cannot be used for this permission level." + IDS_ERROR_TITLE "Error" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_REMOVE_FAILED "UDDI Services Web Server Move Failed" + IDS_WEBSERVER_REMOVE_FAILED_DETAIL + "Could not remove %1 from the UDDI Services site %2. The site is not responding or you do not have sufficient credentials to complete the operation.\r\n\r\nDo you still want to move %1 to %3?" + IDS_WEBSERVER_WEBFARM "UDDI Services Console - Caution" + IDS_WEBSERVER_WEBFARM_DETAIL + "If this UDDI Services Web server is part of a Web farm, you may need to configure its ValidationKey and DecryptionKey values for proper functionality.\r\nFor more information, see the Troubleshooting section in the UDDI Services MMC Snap-in Help." + IDS_DATABASE_SERVER_DBSCHEMA_VERSION_READ_FAILED + "Unable to obtain the database schema version for the UDDI Services site hosted on %s." + IDS_DATABASE_STANDARD_SERVER "Cannot use this database." + IDS_DATABASE_STANDARD_SERVER_DETAIL + "Unable to associate this UDDI Services Web server with this site because it is hosted on a Windows Server 2003, Standard Edition server.\r\nSupport for distributed installations of UDDI Services is available only with Windows Server 2003, Advanced Edition, and Windows Server Datacenter Edition." + IDS_WEBSERVER_ADD_FAILED_DETAIL + "Unable to add the UDDI Services Web Server on computer %s to the UDDI Services site hosted on computer %s." + IDS_WEBSERVER_ADD_FAILED + "Unable to add UDDI Services Web Server to UDDI Services site." + IDS_UDDIMMC_UNSPECIFIED "unspecified" + IDS_GENERAL_EXCEPTION_TITLE "General Exception Occurred" + IDS_GENERAL_EXCEPTION "A general exception has occurred. Please check your network connection and try again." +END + +STRINGTABLE +BEGIN + IDS_DATABASE_SERVER_DESCRIPTION + "Add a computer hosting UDDI Services database components" + IDS_DATABASE_SERVER_ALREADY_EXISTS + "The selected UDDI Services site is already registered in this console." + IDS_DATABASE_SERVER_SELECT_ERROR + "Unable to locate UDDI Services database components on the specified computer.\r\nThe computer does not exist, does not have UDDI Services database components installed, or you do not have sufficient credentials to complete the operation." + IDS_DATABASE_SERVER_SELECT_ERROR_TITLE "Invalid Computer Name" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_COMPONENT_DESCRIPTION "UDDI Services Web Server Component" + IDS_WEBSERVER "Web Server" + IDS_WEBSERVER_START "Start" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_STOP "Stop" + IDS_WEBSERVER_START_DESCRIPTION "Start UDDI Services" + IDS_WEBSERVER_STOP_DESCRIPTION "Stop UDDI Services" + IDS_WEBSERVER_RUNNING "Running" + IDS_WEBSERVER_STOPPED "Stopped" + IDS_WEBSERVER_DESCRIPTION "Add a reference to a UDDI Services Web server" + IDS_WEBSERVER_ADD "Add Web Server..." + IDS_WEBSERVER_COLUMN_NAME "Name" + IDS_WEBSERVER_COLUMN_STATUS "Status" + IDS_WEBSERVER_DISPLAYNAME_TEMPLATE + "UDDI Services Web Server Component on %s" + IDS_WEBSERVER_SELECT_ERROR + "Unable to locate UDDI Services Web server components on the specified computer.\r\nThe computer does not exist, does not have UDDI Services Web server components installed, or you do not have sufficient credentials to complete the operation." + IDS_WEBSERVER_SELECT_ERROR_TITLE "Invalid Computer Name" + IDS_WEBSERVER_ALREADY_EXISTS + "The selected computer is already registered as a web server for this site." + IDS_WEBSERVER_ASSIGNED "UDDI Services Web Server Currently Assigned" + IDS_WEBSERVER_ASSIGNED_DETAIL + "%s is already assigned to the UDDI Services site on %s.\r\n\r\nAre you sure you want to re-assign %s to the UDDI Services site on %s?" + IDS_WEBSERVER_NOT_ASSIGNABLE "UDDI Services Web Server Not Assignable" +END + +STRINGTABLE +BEGIN + IDS_WEBSERVER_NOT_ASSIGNABLE_DETAIL + "This UDDI Services Web server cannot be moved because is hosted on a Windows Server 2003, Standard Edition server.\r\nSupport for distributed installations of UDDI Services is available only with Windows Server 2003, Advanced Edition and Windows Server 2003, Datacenter Edition." + IDS_WEBSERVER_SERVER_DBSCHEMA_VERSION_READ_FAILED + "Could not obtain database schema version for the Web server located on %s." + IDS_WEBSERVER_SERVER_INVALID_DBSCHEMA_VERSION + "The version of the schema used by the Web server located on %s (%s) is not compatible with the version of the schema being used by the UDDI Services site hosted on %s (%s)." +END + +STRINGTABLE +BEGIN + IDS_CRYPTOGRAPHY_TIMEOUT_ERROR + "The cryptography timeout value must be between 1 and 365 days." + IDS_CRYPTOGRAPHY_RESET_NOW_CONFIRM + "All existing UDDI authentication tokens will be invalidated.\r\n\r\nAre you sure you want to reset the cryptography settings for this instance of UDDI Services?" + IDS_CRYPTOGRAPHY_RESET_NOW_TITLE "Confirm Cryptography Reset" + IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS + "The cryptography settings on this server have been successfully reset." + IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS_TITLE "Cryptography Reset" + IDS_CRYPTOGRAPHY_RESET_NOW_FAILED + "The attempt to reset the cryptography settings on this server failed." + IDS_CRYPTOGRAPHY_RESET_NOW_FAILED_TITLE "Cryptography Reset" + IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR + "The token expiration value must be between 1 and 1000 minutes." + IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR_TITLE "Invalid Value" +END + +STRINGTABLE +BEGIN + IDS_ADVANCED_NAME_COLUMN_NAME "Name" + IDS_ADVANCED_VALUE_COLUMN_NAME "Value" +END + +STRINGTABLE +BEGIN + IDS_REGISTRY_OPEN_ERROR "Unable to open the local registry." + IDS_REGISTRY_OPEN_REMOTE_ERROR "Unable to open the remote registry." + IDS_REGISTRY_UNABLE_TO_OPEN_KEY "Unable to open the following key: " + IDS_REGISTRY_FAILED_TO_READ_VALUE + "The attempt to read the registry value failed." + IDS_REGISTRY_FAILED_TO_WRITE_VALUE + "The attempt to write a registry value failed." +END + +STRINGTABLE +BEGIN + IDS_UDDIMMC_HELPFILE "uddi.mmc.chm" + IDS_UDDIMMC_SNAPINDESC "UDDI Services Management Console" + IDS_UDDIMMC_NAME "UDDI Services" + IDS_UDDIMMC_PROVIDER "Microsoft Corporation" + IDS_UDDIMMC_SNAPINNAME "UDDI Services" + IDS_UDDIMMC_ABOUTNAME "UDDI Services About Name" + IDS_UDDIMMC_COMPONENT_DESCRIPTION "UDDI Services Administration Component" +END + +STRINGTABLE +BEGIN + IDS_UDDIMMC_CONNECTELLIPSISDESCRIPTION + "Connect to a server running UDDI Services database or Web components" + IDS_UDDIMMC_TYPE "Extension Snap-in" + IDS_UDDIMMC_DESCRIPTION "Configures and controls UDDI Services components." + IDS_UDDIMMC_NODBSERVER "" + IDS_UDDIMMC_NOINSTANCE "" +END + +STRINGTABLE +BEGIN + IDS_ACTIVEDIRECTORY_PUBLISH_FAILED + "An error occurred while attempting to publish this site to Active Directory.\r\nThis operation typically requires domain administration credentials." + IDS_ACTIVEDIRECTORY_DELETE_FAILED + "An error occurred while attempting to remove this site from Active Directory.\r\nThis operation typically requires domain administration credentials." + IDS_ACTIVEDIRECTORY_PUBLISH_SUCCEEDED + "The UDDI Services site information was successfully published to Active Directory." + IDS_ACTIVEDIRECTORY_DELETE_SUCCEDED + "The UDDI Services site information was successfully removed from Active Directory." + IDS_ACTIVEDIRECTORY_NO_BINDINGS + "No binding information exists for this site.\r\nNo information was published to Active Directory." +END + +STRINGTABLE +BEGIN + IDS_ERROR_ADDSVC "Unable to add the UDDI Services node" + IDS_ERROR_ADDWEBSITE "Unable to add the Web server node" + IDS_INVALID_VERSION_FORMAT + "%s has an invalid database schema version format." + IDS_DOT_NET_SERVER "Unable to determine the operating system version on the specified computer.\r\nWindows Server 2003, Standard Edition, Datacenter Edition, or Advanced Edition is required." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "UDDI Services MMC Snap-in Module" +#define VER_INTERNALNAME_STR "UDDI.MMC.DLL" +#define VER_ORIGINALFILENAME_STR "UDDI.MMC.DLL" + +#include "common.ver" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/inetsrv/uddi/source/mmc/scp.cpp b/inetsrv/uddi/source/mmc/scp.cpp new file mode 100644 index 0000000..3470bbf --- /dev/null +++ b/inetsrv/uddi/source/mmc/scp.cpp @@ -0,0 +1,471 @@ +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif +#define SECURITY_WIN32 + +#include +#include +#include +#include +#include +#include "uddi.h" +#include "scp.h" +using namespace std; + +wstring CUDDIServiceCxnPt::strRootDSE = L""; +const LPWSTR CUDDIServiceCxnPt::UDDI_KEYWORD = L"UDDI"; +const LPWSTR CUDDIServiceCxnPt::UDDI_VERSION_KEYWORD = L"2.0"; + +const LPWSTR CUDDIServiceCxnPt::VENDOR_KEYWORD = L"Microsoft Corporation"; +const LPWSTR CUDDIServiceCxnPt::VENDOR_GUID_KEYWORD = L"83C29870-1DFC-11D3-A193-0000F87A9099"; + +const LPWSTR CUDDIServiceCxnPt::PRODUCT_KEYWORD = L"UDDI Services"; +const LPWSTR CUDDIServiceCxnPt::PRODUCT_GUID_KEYWORD = L"09A92664-D144-49DB-A600-2B3ED04BF639"; + +const LPWSTR CUDDIServiceCxnPt::DISCOVERY_URL_KEYWORD = L"DiscoveryUrl"; +const LPWSTR CUDDIServiceCxnPt::DISCOVERYURL_GUID_KEYWORD = L"1276768A-1488-4C6F-A8D8-19556C6BE583"; +const LPWSTR CUDDIServiceCxnPt::DISCOVERYURL_SERVICE_CLASS_NAME = L"UddiDiscoveryUrl"; + +const LPWSTR CUDDIServiceCxnPt::PUBLISH_KEYWORD = L"Publish API"; +const LPWSTR CUDDIServiceCxnPt::PUBLISH_GUID_KEYWORD = L"64C756D1-3374-4E00-AE83-EE12E38FAE63"; +const LPWSTR CUDDIServiceCxnPt::PUBLISH_SERVICE_CLASSNAME = L"UddiPublishUrl"; +const LPWSTR CUDDIServiceCxnPt::PUBLISH_KEY_V2 = L"A2F36B65-2D66-4088-ABC7-914D0E05EB9E"; + +const LPWSTR CUDDIServiceCxnPt::INQUIRE_KEYWORD = L"Inquire API"; +const LPWSTR CUDDIServiceCxnPt::INQUIRE_GUID_KEYWORD = L"4CD7E4BC-648B-426D-9936-443EAAC8AE23"; +const LPWSTR CUDDIServiceCxnPt::INQUIRE_SERVICE_CLASS_NAME = L"UddiInquireUrl"; +const LPWSTR CUDDIServiceCxnPt::INQUIRE_KEY_V2 = L"AC104DCC-D623-452F-88A7-F8ACD94D9B2B"; + +const LPWSTR CUDDIServiceCxnPt::ADD_WEB_REFERENCE_KEYWORD = L"Add Web Reference"; +const LPWSTR CUDDIServiceCxnPt::ADD_WEB_REFERENCE_GUID_KEYWORD = L"CE653789-F6D4-41B7-B7F4-31501831897D"; +const LPWSTR CUDDIServiceCxnPt::ADD_WEB_REFERENCE_SERVICE_CLASS_NAME = L"UddiAddWebReferenceUrl"; + +const LPWSTR CUDDIServiceCxnPt::WEB_SITE_KEYWORD = L"Web Site"; +const LPWSTR CUDDIServiceCxnPt::WEB_SITE_GUID_KEYWORD = L"4CEC1CEF-1F68-4B23-8CB7-8BAA763AEB89"; +const LPWSTR CUDDIServiceCxnPt::WEB_SITE_SERVICE_CLASS_NAME = L"UddiWebSiteUrl"; + +const LPWSTR CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_KEYWORD = L"WindowsAuthentication"; +const LPWSTR CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_KEYWORD = L"AnonymousAuthentication"; +const LPWSTR CUDDIServiceCxnPt::UDDI_AUTHENTICATION_KEYWORD = L"UddiAuthentication"; + +const LPWSTR CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_GUID_KEYWORD = L"0C61E2C3-73C5-4743-8163-6647AF5B4B9E"; +const LPWSTR CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_GUID_KEYWORD = L"E4A56494-4946-4805-ACA5-546B8D08EEFD"; +const LPWSTR CUDDIServiceCxnPt::UDDI_AUTHENTICATION_GUID_KEYWORD = L"F358808C-E939-4813-A407-8873BFDC3D57"; + +CUDDIServiceCxnPt:: +CUDDIServiceCxnPt( LPWSTR szName, LPWSTR szClassName ) + : strName( szName ) + , strClassName( szClassName ) +{ +} + +CUDDIServiceCxnPt:: +~CUDDIServiceCxnPt() +{ +} + +LPWSTR +CUDDIServiceCxnPt::GetRootDSE() +{ + if( 0 == strRootDSE.length() ) + { + HRESULT hr = 0; + CComPtr pRoot = NULL; + hr = ADsGetObject( L"LDAP://RootDSE", IID_IADs, (void**) &pRoot ); + if( FAILED(hr) ) + { + throw CUDDIException( E_FAIL, L"Unable to acquire the root naming context. The domain may not exist or is not available." ); + } + + CComVariant var = 0; + USES_CONVERSION; + + CComBSTR bstrDNC( L"defaultNamingContext" ); + pRoot->Get( bstrDNC, &var ); + strRootDSE = var.bstrVal; + } + + return (LPWSTR) strRootDSE.c_str(); +} + +void +CUDDIServiceCxnPt::AddDefaultKeywords() +{ + keywords.push_back( VENDOR_KEYWORD ); + keywords.push_back( VENDOR_GUID_KEYWORD ); + keywords.push_back( PRODUCT_KEYWORD ); + keywords.push_back( PRODUCT_GUID_KEYWORD ); + keywords.push_back( UDDI_KEYWORD ); + keywords.push_back( UDDI_VERSION_KEYWORD ); +} + +void +CUDDIServiceCxnPt::DeleteSiteContainer( LPWSTR pszName, BOOL bFailIfNotThere ) +{ + if( NULL == pszName || 0 == wcslen( pszName ) ) + { + throw CUDDIException( E_INVALIDARG, L"Site container name must be specified" ); + } + + wstring strSitesPath; + wstring strPath; + try + { + strSitesPath = L",CN=Sites,CN=UDDI,CN=Microsoft,CN=System,"; + strSitesPath += GetRootDSE(); + + strPath = L"LDAP://"; + + if( NULL != pszName && 0 != _wcsnicmp( L"cn=", pszName, 3 ) ) + strPath += L"CN="; + + strPath += pszName; + strPath += strSitesPath; + } + catch( ... ) + { + throw CUDDIException( E_OUTOFMEMORY, L"Ran out of available memory in function: CUDDIServiceCxnPt::DeleteSiteContainer." ); + } + + // + // Get a reference to the System container + // + CComPtr pSite = NULL; + + HRESULT hr = ADsGetObject( (LPWSTR) strPath.c_str(), IID_IDirectoryObject, (void**) &pSite ); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::DeleteSiteContainer failed. Unable to acquire the site container" ); + } + + CComPtr pDelete = NULL; + hr = pSite->QueryInterface( IID_IADsDeleteOps, (void**) &pDelete ); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::DeleteSiteContainer failed. Unable to acquire the IADsDeleteOps for site container" ); + } + + hr = pDelete->DeleteObject( 0 ); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::DeleteSiteContainer failed on call to IADsDeleteObject::DeleteObject" ); + } +} + +void +CUDDIServiceCxnPt::Create( IDirectoryObject* pDirObject ) +{ + if( 0 == attributes.size() || 0 == keywords.size() ) + { + throw CUDDIException( E_INVALIDARG, L"Error occurred in CUDDIServiceCxnPt::Create attributes and keywords must be present" ); + } + + if( NULL == pDirObject ) + { + throw CUDDIException( E_INVALIDARG, L"The parent container was not specified for this service connection point." ); + } + else + { + // + // THE PURPOSE OF HAVING THIS CODE IN THE "IF" BLOCK IS TO + // APPEASE PREFAST, OTHERWISE PREFAST THROWS ERROR ON THE USE + // OF pDirObject WITHOUT CHECKING FOR NULL + // + + ADSVALUE cn, objclass, serviceclass; + + // + // Setup the container and class name values + // + cn.dwType = ADSTYPE_CASE_IGNORE_STRING; + cn.CaseIgnoreString = (LPWSTR) strName.c_str(); + objclass.dwType = ADSTYPE_CASE_IGNORE_STRING; + objclass.CaseIgnoreString = L"serviceConnectionPoint"; + serviceclass.dwType = ADSTYPE_CASE_IGNORE_STRING; + serviceclass.CaseIgnoreString = (LPWSTR) strClassName.c_str(); + + // + // Populate the keywords values array + // + ADSVALUE* pKeywordValues = new ADSVALUE[ keywords.size() ]; + if( NULL == pKeywordValues ) + { + throw CUDDIException( E_OUTOFMEMORY, L"Ran out of memory allocating memory for pKeywordValues." ); + } + + int n = 0; + for( vector::iterator iter = keywords.begin(); + iter != keywords.end(); iter++ ) + { + pKeywordValues[ n ].CaseIgnoreString = (LPWSTR) (*iter).c_str(); + pKeywordValues[ n ].dwType = ADSTYPE_CASE_IGNORE_STRING; + n++; + } + + // + // Create and populate the attribute array + // + size_t nAttribs = attributes.size(); + size_t nTotalAttributes = nAttribs + 4; + + ADSVALUE* pValues = new ADSVALUE[ nAttribs ]; + if( NULL == pValues ) + { + delete [] pKeywordValues; + throw CUDDIException( E_OUTOFMEMORY, L"Ran out of memory allocating memory for pValues." ); + } + + ADS_ATTR_INFO* pAttrs = new ADS_ATTR_INFO[ nTotalAttributes ]; + if( NULL == pAttrs ) + { + delete [] pKeywordValues; + delete [] pValues; + throw CUDDIException( E_OUTOFMEMORY, L"Ran out of memory allocating memory for pAttrs." ); + } + + pAttrs[ nAttribs ].pszAttrName = L"cn"; + pAttrs[ nAttribs ].dwControlCode = ADS_ATTR_UPDATE; + pAttrs[ nAttribs ].dwADsType = ADSTYPE_CASE_IGNORE_STRING; + pAttrs[ nAttribs ].dwNumValues = 1; + pAttrs[ nAttribs ].pADsValues = &cn; + + pAttrs[ nAttribs + 1 ].pszAttrName = L"objectClass"; + pAttrs[ nAttribs + 1 ].dwControlCode = ADS_ATTR_UPDATE; + pAttrs[ nAttribs + 1 ].dwADsType = ADSTYPE_CASE_IGNORE_STRING; + pAttrs[ nAttribs + 1 ].dwNumValues = 1; + pAttrs[ nAttribs + 1 ].pADsValues = &objclass; + + pAttrs[ nAttribs + 2 ].pszAttrName = L"keywords"; + pAttrs[ nAttribs + 2 ].dwControlCode = ADS_ATTR_UPDATE; + pAttrs[ nAttribs + 2 ].dwADsType = ADSTYPE_CASE_IGNORE_STRING; + pAttrs[ nAttribs + 2 ].dwNumValues = (DWORD) keywords.size(); + pAttrs[ nAttribs + 2 ].pADsValues = pKeywordValues; + + pAttrs[ nAttribs + 3 ].pszAttrName = L"serviceClassName"; + pAttrs[ nAttribs + 3 ].dwControlCode = ADS_ATTR_UPDATE; + pAttrs[ nAttribs + 3 ].dwADsType = ADSTYPE_CASE_IGNORE_STRING; + pAttrs[ nAttribs + 3 ].dwNumValues = 1; + pAttrs[ nAttribs + 3 ].pADsValues = &serviceclass; + + map::iterator attributeIter = attributes.begin(); + + for( size_t i=0; i pSystem = NULL; + hr = ADsGetObject( (LPWSTR) strSystemPath.c_str(), IID_IDirectoryObject, (void**) &pSystem ); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::CreateSiteContainer failed. Unable to acquire the System container in Active Directory." ); + } + + // + // Get a reference to the CN=Microsoft,CN=System container + // + wstring strMicrosoftPath( L"LDAP://CN=Microsoft,CN=System," ); + strMicrosoftPath += GetRootDSE(); + + CComPtr pMicrosoft = NULL; + hr = ADsGetObject( strMicrosoftPath.c_str(), IID_IDirectoryObject, (void**) &pMicrosoft ); + + if( FAILED(hr) ) + { + // + // Create the Microsoft Container + // + CreateContainer( pSystem, L"CN=Microsoft", &pMicrosoft ); + } + + // + // Get a reference to the CN=UDDI,CN=Microsoft,CN=System container + // + wstring strUddiPath( L"LDAP://CN=UDDI,CN=Microsoft,CN=System," ); + strUddiPath += GetRootDSE(); + + CComPtr pUddi = NULL; + hr = ADsGetObject( strUddiPath.c_str(), IID_IDirectoryObject, (void**) &pUddi ); + if( FAILED(hr) ) + { + // + // Create the UDDI Container + // + CreateContainer( pMicrosoft, L"CN=UDDI", &pUddi ); + } + + // + // Get a reference to the CN=Sites,CN=UDDI,CN=Microsoft,CN=System container + // + wstring strSitesPath( L"LDAP://CN=Sites,CN=UDDI,CN=Microsoft,CN=System," ); + strSitesPath += GetRootDSE(); + + CComPtr pSites = NULL; + hr = ADsGetObject( strSitesPath.c_str(), IID_IDirectoryObject, (void**) &pSites ); + if( FAILED(hr) ) + { + // + // Create the Sites Container + // + CreateContainer( pUddi, L"CN=Sites", &pSites ); + } + + // + // Get a reference to the CN=,CN=Sites,CN=UDDI,CN=Microsoft,CN=System container + // + wstring strSitePath( L"LDAP://CN=" ); + strSitePath += pszName; + strSitePath += L",CN=Sites,CN=UDDI,CN=Microsoft,CN=System,"; + strSitePath += GetRootDSE(); + + hr = ADsGetObject( strSitePath.c_str(), IID_IDirectoryObject, (void**) ppContainer ); + if( FAILED(hr) ) + { + // + // Create the Sites Container + // + wstring strSiteName( L"CN=" ); + strSiteName += pszName; + CreateContainer( pSites, (LPWSTR) strSiteName.c_str(), ppContainer ); + } + + // + // Set the display name on the site container + // + CComPtr pADs = NULL; + hr = (*ppContainer)->QueryInterface( IID_IADs, (void**) &pADs ); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::CreateSiteContainer failed. Unable to acquire IADs interface pointer." ); + } + + CComBSTR bstrDispName( L"displayName" ); + hr = pADs->Put( bstrDispName, CComVariant( pszDisplayName ) ); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::CreateSiteContainer failed. Attempt to Put displayName failed." ); + } + + CComBSTR bstrDesc( L"description" ); + hr = pADs->Put( bstrDesc, CComVariant( pszDisplayName ) ); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::CreateSiteContainer failed. Attempt to Put displayName failed." ); + } + + hr = pADs->SetInfo(); + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CUDDIServiceCxnPt::CreateSiteContainer failed. Attempt to SetInfo failed." ); + } +} + +void +CUDDIServiceCxnPt::CreateContainer( + IDirectoryObject* pObj, + LPWSTR szName, + IDirectoryObject** ppContainer ) +{ + // + // Check pre-conditions + // + if( NULL == pObj || NULL == ppContainer || NULL == szName ) + { + throw CUDDIException( E_INVALIDARG, L"CUDDIServiceCxnPt::CreateContainer failed. All arguments must be specified." ); + } + + // + // Create the value structure for the objectClass + // + HRESULT hr = 0; + ADSVALUE classValue; + ADS_ATTR_INFO attrInfo[] = + { + { L"objectClass", ADS_ATTR_UPDATE, ADSTYPE_CASE_IGNORE_STRING, &classValue, 1 }, + }; + + DWORD dwAttrs = sizeof(attrInfo)/sizeof(ADS_ATTR_INFO); + + classValue.dwType = ADSTYPE_CASE_IGNORE_STRING; + classValue.CaseIgnoreString = L"container"; + + // + // Create the container as a child of the specified parent + // + IDispatch* pDisp = NULL; + if( pObj ) + { + hr = pObj->CreateDSObject( szName, attrInfo, dwAttrs, &pDisp ); + + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"CreateContainer() failed on CreateDSObject" ); + } + } + + // + // QI for an IDirectoryObject interface + // + if( pDisp ) + { + hr = pDisp->QueryInterface( IID_IDirectoryObject, (void**) ppContainer ); + pDisp->Release(); + + if( FAILED(hr) ) + { + throw CUDDIException( hr, L"QueryInterface failed looking for IDirectoryObject" ); + } + } +} diff --git a/inetsrv/uddi/source/mmc/scp.h b/inetsrv/uddi/source/mmc/scp.h new file mode 100644 index 0000000..11059ef --- /dev/null +++ b/inetsrv/uddi/source/mmc/scp.h @@ -0,0 +1,78 @@ +#pragma once +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif +#define SECURITY_WIN32 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class CUDDIServiceCxnPt +{ +public: + CUDDIServiceCxnPt( LPWSTR szName, LPWSTR szClassName ); + void AddDefaultKeywords(); + void Create( IDirectoryObject* pDirObject ); + static void CreateSiteContainer( LPWSTR pszName, LPWSTR pszDisplayName, IDirectoryObject** ppContainer ); + static void CreateContainer( IDirectoryObject* pObj, LPWSTR szName, IDirectoryObject** ppContainer ); + static void DeleteSiteContainer( LPWSTR pszName, BOOL bFailIfNotThere = FALSE ); + + static LPWSTR GetRootDSE(); + + std::vector keywords; + std::map attributes; + + const static LPWSTR UDDI_KEYWORD; + const static LPWSTR UDDI_VERSION_KEYWORD; + + const static LPWSTR VENDOR_KEYWORD; + const static LPWSTR VENDOR_GUID_KEYWORD; + + const static LPWSTR PRODUCT_KEYWORD; + const static LPWSTR PRODUCT_GUID_KEYWORD; + + const static LPWSTR DISCOVERY_URL_KEYWORD; + const static LPWSTR DISCOVERYURL_GUID_KEYWORD; + const static LPWSTR DISCOVERYURL_SERVICE_CLASS_NAME; + + const static LPWSTR PUBLISH_KEYWORD; + const static LPWSTR PUBLISH_GUID_KEYWORD; + const static LPWSTR PUBLISH_SERVICE_CLASSNAME; + const static LPWSTR PUBLISH_KEY_V2; + + const static LPWSTR INQUIRE_KEYWORD; + const static LPWSTR INQUIRE_GUID_KEYWORD; + const static LPWSTR INQUIRE_SERVICE_CLASS_NAME; + const static LPWSTR INQUIRE_KEY_V2; + + const static LPWSTR ADD_WEB_REFERENCE_KEYWORD; + const static LPWSTR ADD_WEB_REFERENCE_GUID_KEYWORD; + const static LPWSTR ADD_WEB_REFERENCE_SERVICE_CLASS_NAME; + + const static LPWSTR WEB_SITE_KEYWORD; + const static LPWSTR WEB_SITE_GUID_KEYWORD; + const static LPWSTR WEB_SITE_SERVICE_CLASS_NAME; + + const static LPWSTR WINDOWS_AUTHENTICATION_KEYWORD; + const static LPWSTR WINDOWS_AUTHENTICATION_GUID_KEYWORD; + + const static LPWSTR UDDI_AUTHENTICATION_KEYWORD; + const static LPWSTR UDDI_AUTHENTICATION_GUID_KEYWORD; + + const static LPWSTR ANONYMOUS_AUTHENTICATION_KEYWORD; + const static LPWSTR ANONYMOUS_AUTHENTICATION_GUID_KEYWORD; + +private: + CUDDIServiceCxnPt(); + std::wstring strName; + std::wstring strClassName; + static std::wstring strRootDSE; +}; + diff --git a/inetsrv/uddi/source/mmc/scppublisher.cpp b/inetsrv/uddi/source/mmc/scppublisher.cpp new file mode 100644 index 0000000..7d44b23 --- /dev/null +++ b/inetsrv/uddi/source/mmc/scppublisher.cpp @@ -0,0 +1,586 @@ +#include +#include +#include "net_config_get.h" +#include "net_businessEntity_bindingTemplates_get.h" +#include "net_bindingTemplate_tModelInstanceInfos_get.h" +#include "uddi.h" +#include "globals.h" +#include "scppublisher.h" + +using namespace std; + +void HandleErrorRecords( HRESULT hrErr ); + +CUDDIServiceCxnPtPublisher::CUDDIServiceCxnPtPublisher( const wstring& strConnectionString, const wstring& strSiteKey, const wstring& strSiteName, const wstring& strDefaultDiscoveryUrl ) +: m_strConnectionString( strConnectionString ) +, m_strSiteKey(strSiteKey) +, m_strSiteName(strSiteName) +, m_strDefaultDiscoveryUrl(strDefaultDiscoveryUrl) +, m_pSiteContainer( NULL ) +{ +} + +CUDDIServiceCxnPtPublisher::~CUDDIServiceCxnPtPublisher() +{ + // + // Commit each the service connection points + // + for( CUDDIServiceCxnPtPublisher::iterator iter = this->begin(); iter != this->end(); iter++ ) + { + delete (*iter); + } +} + +void CUDDIServiceCxnPtPublisher::PublishServiceCxnPts( IDirectoryObject *pDirObject ) +{ + if( NULL != pDirObject ) + m_pSiteContainer = pDirObject; + + // + // There is no binding for the discovery url so we must add it independently + // + AddDiscoveryUrlScp(); + + // + // Commit each the service connection points + // + for( CUDDIServiceCxnPtPublisher::iterator iter = this->begin(); iter != this->end(); iter++ ) + { + (*iter)->Create( m_pSiteContainer ); + } +} + +void CUDDIServiceCxnPtPublisher::CreateSiteContainer() +{ + CUDDIServiceCxnPt::CreateSiteContainer( (LPWSTR) m_strSiteKey.c_str(), (LPWSTR) m_strSiteName.c_str(), &m_pSiteContainer ); +} + +void CUDDIServiceCxnPtPublisher::DeleteSiteContainer() +{ + CUDDIServiceCxnPt::DeleteSiteContainer( (LPWSTR) m_strSiteKey.c_str() ); +} + +void CUDDIServiceCxnPtPublisher::ProcessSite() +{ + if( 0 == m_strConnectionString.length() || + 0 == m_strSiteKey.length() || + 0 == m_strSiteName.length() || + 0 == m_strDefaultDiscoveryUrl.length() ) + { + throw CUDDIException( E_INVALIDARG, L"The default provider information for this site was not found." ); + } + + // + // Get all the bindings for the provider for the site + // + net_businessEntity_bindingTemplates_get getbindings; + getbindings.m_connectionString = m_strConnectionString.c_str(); + wcsncpy( getbindings.m_businessKey, m_strSiteKey.c_str(), ARRAYLEN( getbindings.m_businessKey ) ); + getbindings.m_businessKey[ ARRAYLEN( getbindings.m_businessKey ) - 1 ] = NULL; + + DBROWCOUNT rowCount; + HRESULT hr = getbindings.Open(); + + while( SUCCEEDED(hr) && hr != DB_S_NORESULT ) + { + if( NULL != getbindings.GetInterface() ) + { + HRESULT hr2 = getbindings.Bind(); + if( SUCCEEDED( hr2 ) ) + { + while( S_OK == getbindings.MoveNext() ) + { + ProcessBinding( StripBraces( getbindings.m_colbindingKey ), getbindings.m_colaccessPoint ); + } + } + } + + hr = getbindings.GetNextResult( &rowCount ); + } + + if( FAILED(hr) ) + HandleErrorRecords(hr); + + getbindings.Close(); +} + +void CUDDIServiceCxnPtPublisher::ProcessBinding( const wstring& strBindingKey, const wstring& strAccessPoint ) +{ + try + { + HRESULT hr = S_OK; + wstring strAuthenticationKey( L"" ); + wstring strAuthenticationVerb( L"" ); + wstring strKey( L"" ); + + // + // Get all the tModelInstanceInfo records for each binding + // + net_bindingTemplate_tModelInstanceInfos_get gettmii; + gettmii.m_connectionString = m_strConnectionString.c_str(); + wcsncpy( gettmii.m_bindingKey, strBindingKey.c_str(), sizeof( gettmii.m_bindingKey ) / sizeof( WCHAR ) ); + gettmii.m_bindingKey[ sizeof( gettmii.m_bindingKey ) / sizeof( WCHAR ) - 1 ] = NULL; + + DBROWCOUNT rowCount; + hr = gettmii.Open(); + + while( SUCCEEDED(hr) && hr != DB_S_NORESULT ) + { + if( NULL != gettmii.GetInterface() ) + { + HRESULT hr2 = gettmii.Bind(); + if( SUCCEEDED( hr2 ) ) + { + while( S_OK == gettmii.MoveNext() ) + { + // + // We are going to compare these guids against + // A number of constants so make it upper case + // and remove the curly braces + // + _wcsupr( gettmii.m_coltModelKey ); + wstring strTModelKey = StripBraces( gettmii.m_coltModelKey ); + + // + // Determine the authentication mode( uddi, windows, anonymous ) + // and type( inquire, publish, addwebreference or web site ) + // + if( CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_GUID_KEYWORD == strTModelKey || + CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_GUID_KEYWORD == strTModelKey || + CUDDIServiceCxnPt::UDDI_AUTHENTICATION_GUID_KEYWORD == strTModelKey ) + { + strAuthenticationKey = strTModelKey; + + if( CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_GUID_KEYWORD == strTModelKey ) + { + strAuthenticationVerb = CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_KEYWORD; + } + else if( CUDDIServiceCxnPt::UDDI_AUTHENTICATION_GUID_KEYWORD == strTModelKey ) + { + strAuthenticationVerb = CUDDIServiceCxnPt::UDDI_AUTHENTICATION_KEYWORD; + } + else if( CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_GUID_KEYWORD == strTModelKey ) + { + strAuthenticationVerb = CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_KEYWORD; + } + } + else if( CUDDIServiceCxnPt::PUBLISH_GUID_KEYWORD == strTModelKey || + CUDDIServiceCxnPt::PUBLISH_KEY_V2 == strTModelKey ) + { + strKey = CUDDIServiceCxnPt::PUBLISH_GUID_KEYWORD; + } + else if( CUDDIServiceCxnPt::INQUIRE_GUID_KEYWORD == strTModelKey || + CUDDIServiceCxnPt::INQUIRE_KEY_V2 == strTModelKey ) + { + strKey = CUDDIServiceCxnPt::INQUIRE_GUID_KEYWORD; + } + else if( CUDDIServiceCxnPt::ADD_WEB_REFERENCE_GUID_KEYWORD == strTModelKey || + CUDDIServiceCxnPt::WEB_SITE_GUID_KEYWORD == strTModelKey ) + { + strKey = strTModelKey; + } + } + } + } + + hr = gettmii.GetNextResult( &rowCount ); + } + + if( FAILED(hr) ) + HandleErrorRecords(hr); + + gettmii.Close(); + + // + // We will only add service connection points for + // bindings that specify both an authentication model + // and a tmodel on our list of types. + // + if( strKey.length() && strAuthenticationKey.length() ) + { + // + // Add the appropriate Service Connection Point to + // this collection. But don't publish yet. + // + if( CUDDIServiceCxnPt::PUBLISH_GUID_KEYWORD == strKey ) + { + AddPublishScp( strBindingKey, strAccessPoint, strKey, strAuthenticationKey, strAuthenticationVerb ); + } + else if( CUDDIServiceCxnPt::INQUIRE_GUID_KEYWORD == strKey ) + { + AddInquireScp( strBindingKey, strAccessPoint, strKey, strAuthenticationKey, strAuthenticationVerb ); + } + else if( CUDDIServiceCxnPt::ADD_WEB_REFERENCE_GUID_KEYWORD == strKey ) + { + AddAddWebReferenceScp( strBindingKey, strAccessPoint, strKey, strAuthenticationKey, strAuthenticationVerb ); + } + else if( CUDDIServiceCxnPt::WEB_SITE_GUID_KEYWORD == strKey ) + { + AddWebSiteScp( strBindingKey, strAccessPoint, strKey, strAuthenticationKey, strAuthenticationVerb ); + } + } + else + { + OutputDebugStringW( L"Binding not published:\n" ); + OutputDebugStringW( L"Binding Key:\n" ); + OutputDebugStringW( strBindingKey.c_str() ); + OutputDebugStringW( L"\ntModelKey: " ); + OutputDebugStringW( strKey.c_str() ); + OutputDebugStringW( L"\nAuthentication tModelKey: " ); + OutputDebugStringW( strAuthenticationKey.c_str() ); + OutputDebugStringW( L"\n" ); + } + } + catch( ... ) + { + } +} + +void CUDDIServiceCxnPtPublisher::AddInquireScp( const wstring& strBindingKey, const wstring& strAccessPoint, const wstring& strTModelKey, const wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ) +{ + try + { + wstring strDescription = L"UDDI Inquire API for "; + strDescription += m_strSiteName; + + if( CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Windows Authentication Model"; + else if( CUDDIServiceCxnPt::UDDI_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports UDDI Authentication Model"; + else if( CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Anonymous Authentication Model"; + + CUDDIServiceCxnPt* scp = new CUDDIServiceCxnPt( (LPWSTR)strBindingKey.c_str(), CUDDIServiceCxnPt::INQUIRE_SERVICE_CLASS_NAME ); + if( NULL == scp ) + { + throw E_OUTOFMEMORY; + } + + scp->AddDefaultKeywords(); + scp->keywords.push_back( CUDDIServiceCxnPt::INQUIRE_KEYWORD ); + scp->keywords.push_back( CUDDIServiceCxnPt::INQUIRE_GUID_KEYWORD ); + scp->keywords.push_back( strAuthenticationKey ); + scp->keywords.push_back( strAuthenticationVerb ); + scp->attributes[ L"serviceBindingInformation" ] = strAccessPoint.c_str(); + scp->attributes[ L"url" ] = strAccessPoint.c_str(); + scp->attributes[ L"description" ] = strDescription.c_str(); + scp->attributes[ L"displayName" ] = L"Inquire"; + push_back( scp ); + } + catch( ... ) + { + throw CUDDIException( E_FAIL, L"Execution of function CUDDIServiceCxnPtPublisher::AddPublishScp failed." ); + } +} + +void CUDDIServiceCxnPtPublisher::AddPublishScp( const wstring& strBindingKey, const wstring& strAccessPoint, const wstring& strTModelKey, const wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ) +{ + try + { + wstring strDescription = L"UDDI Publish API for "; + strDescription += m_strSiteName; + + if( CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Windows Authentication Model"; + else if( CUDDIServiceCxnPt::UDDI_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports UDDI Authentication Model"; + else if( CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Anonymous Authentication Model"; + + CUDDIServiceCxnPt* scp = new CUDDIServiceCxnPt( (LPWSTR)strBindingKey.c_str(), CUDDIServiceCxnPt::PUBLISH_SERVICE_CLASSNAME ); + if( NULL == scp ) + { + throw E_OUTOFMEMORY; + } + + scp->AddDefaultKeywords(); + scp->keywords.push_back( CUDDIServiceCxnPt::PUBLISH_KEYWORD ); + scp->keywords.push_back( CUDDIServiceCxnPt::PUBLISH_GUID_KEYWORD ); + scp->keywords.push_back( strAuthenticationKey ); + scp->keywords.push_back( strAuthenticationVerb ); + scp->attributes[ L"serviceBindingInformation" ] = strAccessPoint.c_str(); + scp->attributes[ L"url" ] = strAccessPoint.c_str(); + scp->attributes[ L"description" ] = strDescription.c_str(); + scp->attributes[ L"displayName" ] = L"Publish"; + push_back( scp ); + } + catch( ... ) + { + throw CUDDIException( E_FAIL, L"Execution of function CUDDIServiceCxnPtPublisher::AddPublishScp failed." ); + } +} + +void CUDDIServiceCxnPtPublisher::AddAddWebReferenceScp( const wstring& strBindingKey, const wstring& strAccessPoint, const wstring& strTModelKey, const wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ) +{ + try + { + wstring strDescription = L"Add Web Reference for "; + strDescription += m_strSiteName; + + if( CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Windows Authentication Model"; + else if( CUDDIServiceCxnPt::UDDI_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports UDDI Authentication Model"; + else if( CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Anonymous Authentication Model"; + + CUDDIServiceCxnPt* scp = new CUDDIServiceCxnPt( (LPWSTR)strBindingKey.c_str(), CUDDIServiceCxnPt::ADD_WEB_REFERENCE_SERVICE_CLASS_NAME ); + if( NULL == scp ) + { + throw E_OUTOFMEMORY; + } + + scp->AddDefaultKeywords(); + scp->keywords.push_back( CUDDIServiceCxnPt::ADD_WEB_REFERENCE_KEYWORD ); + scp->keywords.push_back( CUDDIServiceCxnPt::ADD_WEB_REFERENCE_GUID_KEYWORD ); + scp->keywords.push_back( strAuthenticationKey ); + scp->keywords.push_back( strAuthenticationVerb ); + scp->attributes[ L"serviceBindingInformation" ] = strAccessPoint.c_str(); + scp->attributes[ L"url" ] = strAccessPoint.c_str(); + scp->attributes[ L"description" ] = strDescription.c_str(); + scp->attributes[ L"displayName" ] = L"Add Web Reference"; + push_back( scp ); + } + catch( ... ) + { + throw CUDDIException( E_FAIL, L"Execution of function CUDDIServiceCxnPtPublisher::AddAddWebReferenceScp failed." ); + } +} + +void CUDDIServiceCxnPtPublisher::AddWebSiteScp( const wstring& strBindingKey, const wstring& strAccessPoint, const wstring& strTModelKey, const wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ) +{ + try + { + wstring strDescription = L"Web Site for "; + strDescription += m_strSiteName; + + if(CUDDIServiceCxnPt::WINDOWS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Windows Authentication Model"; + else if( CUDDIServiceCxnPt::UDDI_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports UDDI Authentication Model"; + else if( CUDDIServiceCxnPt::ANONYMOUS_AUTHENTICATION_GUID_KEYWORD == strAuthenticationKey ) + strDescription += L", binding supports Anonymous Authentication Model"; + + CUDDIServiceCxnPt* scp = new CUDDIServiceCxnPt( (LPWSTR)strBindingKey.c_str(), CUDDIServiceCxnPt::WEB_SITE_SERVICE_CLASS_NAME ); + if( NULL == scp ) + { + throw E_OUTOFMEMORY; + } + + scp->AddDefaultKeywords(); + scp->keywords.push_back( CUDDIServiceCxnPt::WEB_SITE_KEYWORD ); + scp->keywords.push_back( CUDDIServiceCxnPt::WEB_SITE_GUID_KEYWORD ); + scp->keywords.push_back( strAuthenticationKey ); + scp->keywords.push_back( strAuthenticationVerb ); + scp->attributes[ L"serviceBindingInformation" ] = strAccessPoint.c_str(); + scp->attributes[ L"url" ] = strAccessPoint.c_str(); + scp->attributes[ L"description" ] = strDescription.c_str(); + scp->attributes[ L"displayName" ] = L"Web Site"; + push_back( scp ); + } + catch( ... ) + { + throw CUDDIException( E_FAIL, L"Execution of function CUDDIServiceCxnPtPublisher::AddWebSiteScp failed." ); + } +} + +void CUDDIServiceCxnPtPublisher::AddDiscoveryUrlScp() +{ + try + { + wstring strDescription = L"DiscoveryUrl for "; + strDescription += m_strSiteName; + + // + // No binding key exists for discovery Urls so create one + // + UUID uuid; + RPC_STATUS rpcstatus = ::UuidCreate( &uuid ); + + WCHAR wszUuid[ 50 ]; + ::StringFromGUID2( uuid, wszUuid, sizeof( wszUuid ) / sizeof( WCHAR ) ); + + CUDDIServiceCxnPt* scp = new CUDDIServiceCxnPt( (LPWSTR) StripBraces( wszUuid ).c_str(), CUDDIServiceCxnPt::DISCOVERYURL_SERVICE_CLASS_NAME ); + if( NULL == scp ) + { + throw E_OUTOFMEMORY; + } + + scp->AddDefaultKeywords(); + scp->keywords.push_back( CUDDIServiceCxnPt::DISCOVERY_URL_KEYWORD ); + scp->keywords.push_back( CUDDIServiceCxnPt::DISCOVERYURL_GUID_KEYWORD ); + + wstring strUrl = m_strDefaultDiscoveryUrl; + strUrl += m_strSiteKey; + + scp->attributes[ L"serviceBindingInformation" ] = strUrl; + scp->attributes[ L"url" ] = strUrl; + scp->attributes[ L"description" ] = strDescription.c_str(); + scp->attributes[ L"displayName" ] = L"DiscoveryUrl"; + push_back( scp ); + } + catch( ... ) + { + throw CUDDIException( E_OUTOFMEMORY, L"Ran out of memory inside the function AddDiscoveryUrlScp." ); + return; + } +} + + +// +// This function will retrieve the UDDI Site information +// needed to publish the default provider information into +// Active Directory using Service Publication. It uses +// the net_config_get stored procedure. +// +void CUDDIServiceCxnPtPublisher::GetSiteInfo() +{ + if( 0 == m_strConnectionString.length() ) + { + throw CUDDIException( E_INVALIDARG, L"An attempt to retrieve the UDDI site information failed because the connection string was not specified" ); + } + + try + { + // + // Setup the net_config_get stored procedure object. + // + net_config_get rs; + rs.m_connectionString = m_strConnectionString.c_str(); + DBROWCOUNT rowCount; + HRESULT hr = rs.Open(); + + while( SUCCEEDED(hr) && hr != DB_S_NORESULT ) + { + if( NULL != rs.GetInterface() ) + { + HRESULT hr2 = rs.Bind(); + if( SUCCEEDED( hr2 ) ) + { + while( S_OK == rs.MoveNext() ) + { + _ASSERT( !rs.m_dwconfigNameStatus ); + _ASSERT( !rs.m_dwconfigValueStatus ); + + // + // Save the Site.Key for follow on tests + // + if( 0 == _wcsicmp( rs.m_configName, L"Site.Key" ) ) + m_strSiteKey = rs.m_configValue; + else if( 0 == _wcsicmp( rs.m_configName, L"Site.Name" ) ) + { + // + // Save the default provider name to use + // for the displayName for the site container + // + m_strSiteName = rs.m_configValue; + } + else if( 0 == _wcsicmp( rs.m_configName, L"DefaultDiscoveryUrl" ) ) + { + // + // We'll also need the DefaultDiscoveryUrl prefix + // to be able to publish the Service Connection Point + // associated with it. + // + m_strSiteName = rs.m_configValue; + } + } + } + } + + hr = rs.GetNextResult( &rowCount ); + } + + if( FAILED(hr) ) + { + HandleErrorRecords(hr); + } + } + catch( ... ) + { + throw CUDDIException( E_FAIL, L"An attempt to retrieve the UDDI site information failed." ); + } +} + +wstring CUDDIServiceCxnPtPublisher::StripBraces( LPWSTR szKey ) +{ + // + // Converts {3172C204-058E-4E41-9CD3-7C1FD49FC44F} into 3172C204-058E-4E41-9CD3-7C1FD49FC44F + // + size_t n = wcslen( szKey ); + + if( 38 == n && '{' == szKey[ 0 ] && '}' == szKey[ n - 1 ] ) + { + return wstring( &szKey[ 1 ], 36 ); + } + + return wstring( szKey ); +} + +void HandleErrorRecords( HRESULT hrErr ) +{ + CDBErrorInfo ErrorInfo; + ULONG cRecords = 0; + HRESULT hr; + ULONG i; + CComBSTR bstrDesc, bstrHelpFile, bstrSource, bstrMsg; + GUID guid; + DWORD dwHelpContext; + WCHAR wszGuid[ 40 ]; + USES_CONVERSION; + + ErrorInfo.m_spErrorInfo = NULL; + ErrorInfo.m_spErrorRecords = NULL; + + // + // If the user passed in an HRESULT then trace it + // + if( hrErr != S_OK ) + { + TCHAR sz[ 256 ]; + _stprintf( sz, _T("OLE DB Error Record dump for hr = 0x%x\n"), hrErr ); + bstrMsg += sz; + } + + LCID lcLocale = GetSystemDefaultLCID(); + + hr = ErrorInfo.GetErrorRecords(&cRecords); + if( FAILED(hr) && NULL == ErrorInfo.m_spErrorInfo.p ) + { + TCHAR sz[ 256 ]; + _stprintf( sz, _T("No OLE DB Error Information found: hr = 0x%x\n"), hr ); + bstrMsg += sz; + } + else + { + for( i=0; i < cRecords; i++ ) + { + hr = ErrorInfo.GetAllErrorInfo(i, lcLocale, &bstrDesc, &bstrSource, &guid, + &dwHelpContext, &bstrHelpFile); + if( FAILED(hr) ) + { + TCHAR sz[ 256 ]; + _stprintf( sz, _T("OLE DB Error Record dump retrieval failed: hr = 0x%x\n"), hr ); + bstrMsg += sz; + break; + } + + StringFromGUID2( guid, wszGuid, sizeof(wszGuid) / sizeof(WCHAR) ); + TCHAR sz[ 256 ]; + _stprintf( + sz, + _T("Row #: %4d Source: \"%s\" Description: \"%s\" Help File: \"%s\" Help Context: %4d GUID: %s\n"), + i, OLE2T(bstrSource), OLE2T(bstrDesc), OLE2T(bstrHelpFile), dwHelpContext, OLE2T(wszGuid) ); + + bstrMsg += sz; + + bstrSource.Empty(); + bstrDesc.Empty(); + bstrHelpFile.Empty(); + } + + bstrMsg += _T("OLE DB Error Record dump end\n"); + + throw CUDDIException( hr, bstrMsg.m_str ); + } +} diff --git a/inetsrv/uddi/source/mmc/scppublisher.h b/inetsrv/uddi/source/mmc/scppublisher.h new file mode 100644 index 0000000..bf12f90 --- /dev/null +++ b/inetsrv/uddi/source/mmc/scppublisher.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include +#include +#include +#include +#include "scp.h" + +class CUDDIServiceCxnPtPublisher : public std::vector +{ +public: + CUDDIServiceCxnPtPublisher( + const std::wstring& strConnectionString, + const std::wstring& strSiteKey = L"", + const std::wstring& strSiteName = L"", + const std::wstring& strDefaultDiscoveryUrl = L"" ); + + ~CUDDIServiceCxnPtPublisher(); + + void GetSiteInfo(); + void ProcessSite(); + void DeleteSiteContainer(); + void CreateSiteContainer(); + void PublishServiceCxnPts( IDirectoryObject *pDirObject = NULL ); + std::wstring StripBraces( LPWSTR szKey ); + +private: + void ProcessBinding( const std::wstring& strBindingKey, const std::wstring& strAccessPoint ); + void AddInquireScp( const std::wstring& strBindingKey, const std::wstring& strAccessPoint, const std::wstring& strTModelKey, const std::wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ); + void AddPublishScp( const std::wstring& strBindingKey, const std::wstring& strAccessPoint, const std::wstring& strTModelKey, const std::wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ); + void AddAddWebReferenceScp( const std::wstring& strBindingKey, const std::wstring& strAccessPoint, const std::wstring& strTModelKey, const std::wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ); + void AddWebSiteScp( const std::wstring& strBindingKey, const std::wstring& strAccessPoint, const std::wstring& strTModelKey, const std::wstring& strAuthenticationKey, const std::wstring& strAuthenticationVerb ); + void AddDiscoveryUrlScp(); + + CUDDIServiceCxnPtPublisher(); + std::wstring m_strSiteKey; + std::wstring m_strSiteName; + std::wstring m_strDefaultDiscoveryUrl; + std::wstring m_strConnectionString; + CComPtr m_pSiteContainer; +}; diff --git a/inetsrv/uddi/source/mmc/servercheck.cpp b/inetsrv/uddi/source/mmc/servercheck.cpp new file mode 100644 index 0000000..5e432ec --- /dev/null +++ b/inetsrv/uddi/source/mmc/servercheck.cpp @@ -0,0 +1,172 @@ +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0510 +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#endif + +#define SECURITY_WIN32 + +#include +#include +#include +#include +#include +#include +#include "globals.h" + +static HRESULT GetOSProductSuiteMask( LPCTSTR pszRemoteServer, UINT *pdwMask ); + +HRESULT +GetOSProductSuiteMask( LPCTSTR szRemoteServer, UINT *pdwMask ) +{ + HRESULT hr = S_OK; + + if( IsBadWritePtr( pdwMask, sizeof( UINT ) ) ) + { + return E_INVALIDARG; + } + + try + { + DWORD retCount = 0; + TCHAR buf[ 512 ] = {0}; + LPCTSTR locatorPath = L"//%s/root/cimv2"; + CComBSTR objQry = L"SELECT * FROM Win32_OperatingSystem"; + + CComPtr pWMIOS; + CComPtr pWMISvc; + CComPtr pWMILocator; + CComPtr pWMIEnum; + + // + // First, compose the locator string + // + if( szRemoteServer ) + { + _stprintf( buf, locatorPath, szRemoteServer ); + } + else + { + _stprintf( buf, locatorPath, _T(".") ); + } + + hr = pWMILocator.CoCreateInstance( CLSID_WbemLocator ); + if( FAILED(hr) ) + { + throw hr; + } + + BSTR bstrBuf = ::SysAllocString( buf ); + if( NULL == bstrBuf ) + { + throw E_OUTOFMEMORY; + } + + hr = pWMILocator->ConnectServer( bstrBuf, NULL, NULL, NULL, + WBEM_FLAG_CONNECT_USE_MAX_WAIT, + NULL, NULL, &pWMISvc ); + ::SysFreeString( bstrBuf ); + if( FAILED(hr) ) + { + throw hr; + } + + hr = CoSetProxyBlanket( pWMISvc, + RPC_C_AUTHN_WINNT, + RPC_C_AUTHZ_NONE, + NULL, + RPC_C_AUTHN_LEVEL_CALL, + RPC_C_IMP_LEVEL_IMPERSONATE, + NULL, + EOAC_NONE ); + if( FAILED(hr) ) + { + throw hr; + } + + // + // Now get the Win32_OperatingSystem instances and check the first one found + // + hr = pWMISvc->ExecQuery( CComBSTR( L"WQL" ), objQry, + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_ENSURE_LOCATABLE, + NULL, &pWMIEnum ); + if( FAILED(hr) ) + { + throw hr; + } + + hr = pWMIEnum->Next( 60000, 1, &pWMIOS, &retCount ); + if( WBEM_S_NO_ERROR == hr ) + { + VARIANT vt; + CIMTYPE cimType; + long flavor = 0; + + ZeroMemory( &vt, sizeof( vt ) ); + VariantInit( &vt ); + + hr = pWMIOS->Get( L"SuiteMask", 0, &vt, &cimType, &flavor ); + if( FAILED( hr ) ) + { + VariantClear( &vt ); + throw hr; + } + + if( VT_NULL == vt.vt || VT_EMPTY == vt.vt ) + { + VariantClear( &vt ); + throw E_FAIL; + } + + hr = VariantChangeType( &vt, &vt, 0, VT_UINT ); + if( FAILED( hr ) ) + { + VariantClear( &vt ); + throw hr; + } + + *pdwMask = vt.uintVal; + } + } + catch( HRESULT hrErr ) + { + hr = hrErr; + } + catch(...) + { + hr = E_UNEXPECTED; + } + + return hr; +} + + +HRESULT +IsStandardServer( LPCTSTR szRemoteServer, BOOL *pbResult ) +{ + if( IsBadWritePtr( pbResult, sizeof( BOOL ) ) ) + { + return E_INVALIDARG; + } + + HRESULT hr = E_FAIL; + UINT uSuiteMask = 0; + hr = GetOSProductSuiteMask( szRemoteServer, &uSuiteMask ); + if( FAILED(hr) ) + { + return hr; + } + + if( ( uSuiteMask & VER_SUITE_DATACENTER ) || ( uSuiteMask & VER_SUITE_ENTERPRISE ) ) + { + *pbResult = FALSE; + } + else + { + *pbResult = TRUE; + } + + return S_OK; +} diff --git a/inetsrv/uddi/source/mmc/sources b/inetsrv/uddi/source/mmc/sources new file mode 100644 index 0000000..c514e7c --- /dev/null +++ b/inetsrv/uddi/source/mmc/sources @@ -0,0 +1,77 @@ +TARGETNAME=uddi.mmc +TARGETPATH=obj +TARGETTYPE=DYNLINK +DLLDEF=uddi.mmc.def +DLLENTRY=_DllMainCRTStartup + +# +# Fusionized +# + +SXS_ASSEMBLY_NAME=Microsoft.Windows.ServerAdmin.UDDIServices +SXS_ASSEMBLY_VERSION=1.0 +SXS_ASSEMBLY_LANGUAGE_INDEPENDENT=1 +SXS_MANIFEST=uddimmc.manifest +SXS_MANIFEST_IN_RESOURCES=1 +SXS_NO_BINPLACE=1 +SXS_MANIFEST_RESOURCE_ID=2 + +# ISOLATION_AWARE_ENABLED ==> use ui themes +C_DEFINES=$(C_DEFINES) -DISOLATION_AWARE_ENABLED + +INCLUDES=$(INCLUDES);C:\nt\public\sdk\inc\mfc42$(_NTROOT)\public\sdk\inc\atl30; + +USE_MFCUNICODE=1 +USE_STL=1 +USE_MSVCRT=1 +USE_ATL=1 +ATL_VER=30 +USE_VCCOM=1 + +TARGETLIBS=\ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\comdlg32.lib \ + $(SDK_LIB_PATH)\comsvcs.lib \ + $(SDK_LIB_PATH)\gdi32.lib \ + $(SDK_LIB_PATH)\htmlhelp.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\mmc.lib \ + $(SDK_LIB_PATH)\odbc32.lib \ + $(SDK_LIB_PATH)\odbccp32.lib \ + $(SDK_LIB_PATH)\oleaut32.lib \ + $(SDK_LIB_PATH)\ole32.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\Secur32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\uuid.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\winspool.lib \ + $(SDK_LIB_PATH)\rpcrt4.lib \ + $(SDK_LIB_PATH)\adsiid.lib \ + $(SDK_LIB_PATH)\activeds.lib \ + $(SDK_LIB_PATH)\wbemuuid.lib + +SOURCES=\ +about.cpp \ +basesnap.cpp \ +comp.cpp \ +compdata.cpp \ +dataobj.cpp \ +delebase.cpp \ +mmccrack.cpp \ +objectpicker.cpp \ +scp.cpp \ +scppublisher.cpp \ +uddi.cpp \ +uddiservicesnode.cpp \ +uddisitenode.cpp \ +webservernode.cpp \ +servercheck.cpp \ +stringutil.cpp \ +resource.rc + +C_DEFINES = $(C_DEFINES) /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP /DISOLATION_AWARE_ENABLED + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/mmc/stringutil.cpp b/inetsrv/uddi/source/mmc/stringutil.cpp new file mode 100644 index 0000000..e98bd25 --- /dev/null +++ b/inetsrv/uddi/source/mmc/stringutil.cpp @@ -0,0 +1,64 @@ +#include "globals.h" +#include + + +// +// Convert wszBuf to upper case in-place (ie, modify the existing string). +// +void +ToUpper( WCHAR *wszBuf ) +{ + // + // Param check. strlen crashes when you pass it NULL, so the assumption + // is that wcslen does also. + // + if( NULL == wszBuf ) + { + return; + } + + const int iLen = wcslen( wszBuf ); + + // + // For each character that needs to be converted to upper case, do + // the conversion in-place. + // + for( int i = 0; i < iLen; i++ ) + { + if( iswlower( wszBuf[ i ] ) ) + { + wszBuf[ i ] = towupper( wszBuf[ i ] ); + } + } +} + + +// +// Convert wszBuf to lower case in-place (ie, modify the existing string). +// +void +ToLower( WCHAR *wszBuf ) +{ + // + // Param check. strlen crashes when you pass it NULL, so the assumption + // is that wcslen does also. + // + if( NULL == wszBuf ) + { + return; + } + + const int iLen = wcslen( wszBuf ); + + // + // For each character that needs to be converted to upper case, do + // the conversion in-place. + // + for( int i = 0; i < iLen; i++ ) + { + if( iswupper( wszBuf[ i ] ) ) + { + wszBuf[ i ] = towlower( wszBuf[ i ] ); + } + } +} diff --git a/inetsrv/uddi/source/mmc/uddi.cpp b/inetsrv/uddi/source/mmc/uddi.cpp new file mode 100644 index 0000000..e6343a9 --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddi.cpp @@ -0,0 +1,523 @@ +#include "uddi.h" +#include "globals.h" +#include "resource.h" +#include + +#define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x80000000) ) +#define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x80000001) ) +#define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x80000002) ) +#define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x80000003) ) + +CUDDIRegistryKey::CUDDIRegistryKey( HKEY hHive, const tstring& szRoot, REGSAM access, const tstring& szComputer ) + : m_szRoot( szRoot ) + , m_hHive( NULL ) + , m_hkey( NULL ) +{ + BOOL bResult = FALSE; + LONG lResult = 0; + TCHAR szComputerName[ 256 ]; + DWORD dwSize = 256; + szComputerName[ 0 ] = 0; + bResult = GetComputerName( szComputerName, &dwSize ); + UDDIASSERT( bResult ); + + // + // Open a registry key to hHive on the remote or local server + // + if( szComputer == _T("") || 0 == _tcscmp( szComputerName, szComputer.c_str() ) ) + { + lResult = RegOpenKeyEx( hHive, NULL, NULL, access, &m_hHive ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_OPEN_ERROR, g_hinst ); + } + else + { + lResult = RegConnectRegistry( szComputer.c_str(), hHive, &m_hHive ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_OPEN_REMOTE_ERROR, g_hinst ); + } + + // + // Open the UDDI sub key for READ and WRITE + // + lResult = RegOpenKeyEx( m_hHive, szRoot.c_str(), 0UL, access, &m_hkey ); + if( ERROR_SUCCESS != lResult ) + { + _TCHAR szUnable[ 128 ]; + ::LoadString( g_hinst, IDS_REGISTRY_UNABLE_TO_OPEN_KEY, szUnable, ARRAYLEN( szUnable ) ); + tstring str( szUnable ); + str += szRoot; + + RegCloseKey( m_hHive ); + THROW_UDDIEXCEPTION_RC( lResult, str ); + } +} + +CUDDIRegistryKey::CUDDIRegistryKey( const tstring& szRoot, REGSAM access, const tstring& szComputer ) + : m_szRoot( szRoot ) + , m_hHive( NULL ) + , m_hkey( NULL ) +{ + BOOL bResult = FALSE; + LONG lResult = 0; + TCHAR szComputerName[ 256 ]; + DWORD dwSize = 256; + szComputerName[ 0 ] = 0; + bResult = GetComputerName( szComputerName, &dwSize ); + + // + // Open a registry key to HKLM on the remote or local server + // + if( szComputer == _T("") || 0 == _tcscmp( szComputerName, szComputer.c_str() ) ) + { + lResult = RegOpenKeyEx( HKEY_LOCAL_MACHINE, NULL, NULL, access, &m_hHive ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_OPEN_ERROR, g_hinst ); + } + else + { + lResult = RegConnectRegistry( szComputer.c_str(), HKEY_LOCAL_MACHINE, &m_hHive ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_OPEN_REMOTE_ERROR, g_hinst ); + } + + // + // Open the UDDI sub key for READ and WRITE + // + lResult = RegOpenKeyEx( m_hHive, szRoot.c_str(), 0UL, access, &m_hkey ); + if( ERROR_SUCCESS != lResult ) + { + _TCHAR szUnable[ 128 ]; + ::LoadString( g_hinst, IDS_REGISTRY_UNABLE_TO_OPEN_KEY, szUnable, ARRAYLEN( szUnable ) ); + tstring str( szUnable ); + str += szRoot; + + RegCloseKey( m_hHive ); + THROW_UDDIEXCEPTION_RC( lResult, str ); + } +} + +CUDDIRegistryKey::~CUDDIRegistryKey() +{ + Close(); +} + +void +CUDDIRegistryKey::Create( HKEY hHive, const tstring& szPath, const tstring& szComputer ) +{ + BOOL bResult = FALSE; + LONG lResult = 0; + TCHAR szComputerName[ 256 ]; + DWORD dwSize = 256; + szComputerName[ 0 ] = 0; + bResult = GetComputerName( szComputerName, &dwSize ); + HKEY hRoot = NULL; + HKEY hkey = NULL; + + UDDIASSERT( bResult ); + + // + // Open a registry key to hHive on the remote or local server + // + if( szComputer == _T("") || 0 == _tcscmp( szComputerName, szComputer.c_str() ) ) + { + lResult = RegOpenKeyEx( hHive, NULL, NULL, KEY_ALL_ACCESS, &hRoot ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_OPEN_ERROR, g_hinst ); + } + else + { + lResult = RegConnectRegistry( szComputer.c_str(), hHive, &hRoot ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_OPEN_REMOTE_ERROR, g_hinst ); + } + + // + // Open the UDDI sub key for READ and WRITE + // + lResult = RegCreateKey( hHive, szPath.c_str(), &hkey ); + if( ERROR_SUCCESS != lResult ) + { + _TCHAR szUnable[ 128 ]; + ::LoadString( g_hinst, IDS_REGISTRY_UNABLE_TO_OPEN_KEY, szUnable, ARRAYLEN( szUnable ) ); + tstring str( szUnable ); + str += szPath; + + RegCloseKey( hRoot ); + THROW_UDDIEXCEPTION_RC( lResult, str ); + } + + RegCloseKey( hkey ); + RegCloseKey( hRoot ); +} + +void CUDDIRegistryKey::Close() +{ + if( m_hkey ) + { + ::RegCloseKey( m_hkey ); + m_hkey = NULL; + } + + if( m_hHive ) + { + ::RegCloseKey( m_hHive ); + m_hHive = NULL; + } +} + +DWORD CUDDIRegistryKey::GetDWORD( const LPCTSTR szName, DWORD dwDefault ) +{ + DWORD dwValue = dwDefault; + + try + { + dwValue = GetDWORD( szName ); + } + catch(...) + { + } + + return dwValue; +} + +DWORD CUDDIRegistryKey::GetDWORD( const LPCTSTR szName ) +{ +#if defined( _DEBUG ) || defined( DBG ) + OutputDebugString( _T("Reading Registry Value: " ) ); + OutputDebugString( szName ); + OutputDebugString( _T("\n") ); +#endif + DWORD dwValue = 0UL; + DWORD dwSize = sizeof( dwValue ); + DWORD dwType = REG_DWORD; + + LONG lResult = RegQueryValueEx( m_hkey, szName, NULL, &dwType, (LPBYTE) &dwValue, &dwSize ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_FAILED_TO_READ_VALUE, g_hinst ); + + return dwValue; +} + +void CUDDIRegistryKey::GetMultiString( const LPCTSTR szName, StringVector& strs ) +{ +#if defined( _DEBUG ) || defined( DBG ) + OutputDebugString( _T("Reading Registry Value: " ) ); + OutputDebugString( szName ); + OutputDebugString( _T("\n") ); +#endif + TCHAR szValue[ 1024 ]; + DWORD dwSize = sizeof( szValue ); + DWORD dwType = REG_MULTI_SZ; + + LONG lResult = RegQueryValueEx( m_hkey, szName, NULL, &dwType, (LPBYTE) szValue, &dwSize ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_FAILED_TO_READ_VALUE, g_hinst ); + + _TCHAR* psz = szValue; + while( NULL != psz[ 0 ] ) + { + strs.push_back( psz ); + psz += _tcslen( psz ) + 1; + } +} + +tstring CUDDIRegistryKey::GetString( const LPCTSTR szName, const LPCTSTR szDefault ) +{ + tstring strReturn = szDefault; + try + { + strReturn = GetString( szName ); + } + catch(...) + { +#if defined( _DEBUG ) || defined( DBG ) + + OutputDebugString( _T("Failed using default value:: " ) ); + OutputDebugString( szDefault ); + OutputDebugString( _T("\n") ); +#endif + } + + return strReturn; +} + +tstring CUDDIRegistryKey::GetString( const LPCTSTR szName ) +{ +#if defined( _DEBUG ) || defined( DBG ) + OutputDebugString( _T("Reading Registry Value: " ) ); + OutputDebugString( szName ); + OutputDebugString( _T("\n") ); +#endif + TCHAR szValue[ 1024 ]; + DWORD dwSize = sizeof( szValue ); + DWORD dwType = REG_SZ; + + LONG lResult = RegQueryValueEx( m_hkey, szName, NULL, &dwType, (LPBYTE) szValue, &dwSize ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_FAILED_TO_READ_VALUE, g_hinst ); + + return tstring( szValue ); +} + +void CUDDIRegistryKey::SetValue( const LPCTSTR szName, DWORD dwValue ) +{ + DWORD dwSize = sizeof( dwValue ); + LONG lResult = RegSetValueEx( m_hkey, szName, NULL, REG_DWORD, (LPBYTE) &dwValue, sizeof( dwValue ) ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_FAILED_TO_WRITE_VALUE, g_hinst ); +} + +void CUDDIRegistryKey::SetValue( const LPCTSTR szName, LPCTSTR szValue ) +{ + DWORD dwSize = (DWORD) ( _tcslen( szValue ) + 1 ) * sizeof( TCHAR ); + LONG lResult = RegSetValueEx( m_hkey, szName, NULL, REG_SZ, (LPBYTE) szValue, dwSize ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_FAILED_TO_WRITE_VALUE, g_hinst ); +} + +void CUDDIRegistryKey::DeleteValue( const tstring& szValue ) +{ + LONG lResult = RegDeleteValue( m_hkey, szValue.c_str() ); + UDDIVERIFYST( ERROR_SUCCESS == lResult, IDS_REGISTRY_FAILED_TO_READ_VALUE, g_hinst ); +} + +BOOL CUDDIRegistryKey::KeyExists( HKEY hHive, const tstring& szPath, const tstring& szComputer ) +{ + BOOL fRet = FALSE; + + TCHAR szComputerName[ 256 ]; + DWORD dwSize = 256; + szComputerName[ 0 ] = 0; + GetComputerName( szComputerName, &dwSize ); + HKEY hKey = NULL; + HKEY hQueriedKey = NULL; + LONG lResult; + + // + // Open a registry key to HKLM on the remote or local server + // + if( szComputer == _T("") || 0 == _tcscmp( szComputerName, szComputer.c_str() ) ) + { + lResult = RegOpenKeyEx( hHive, NULL, NULL, KEY_READ, &hKey ); + } + else + { + lResult = RegConnectRegistry( szComputer.c_str(), hHive, &hKey ); + } + + if( ERROR_SUCCESS != lResult ) + { + return FALSE; + } + + lResult = RegOpenKeyEx( hKey, szPath.c_str(), 0, KEY_READ, &hQueriedKey ); + if( ERROR_SUCCESS != lResult ) + { + fRet = FALSE; + } + else + { + fRet = TRUE; + RegCloseKey( hQueriedKey ); + } + + RegCloseKey( hKey ); + return fRet; +} + +void CUDDIRegistryKey::DeleteKey( HKEY hHive, const tstring& szPath, const tstring& szComputer ) +{ + BOOL bResult = FALSE; + LONG lResult = 0; + TCHAR szComputerName[ 256 ]; + DWORD dwSize = 256; + szComputerName[ 0 ] = 0; + bResult = GetComputerName( szComputerName, &dwSize ); + HKEY hKey = NULL; + + // + // Open a registry key to HKLM on the remote or local server + // + if( szComputer == _T("") || 0 == _tcscmp( szComputerName, szComputer.c_str() ) ) + { + lResult = RegOpenKeyEx( hHive, NULL, NULL, KEY_READ, &hKey ); + } + else + { + lResult = RegConnectRegistry( szComputer.c_str(), hHive, &hKey ); + } + + DWORD dwResult = SHDeleteKey( hKey, szPath.c_str() ); + UDDIVERIFYST( ERROR_SUCCESS == dwResult, IDS_REGISTRY_FAILED_TO_READ_VALUE, g_hinst ); +} + +void UDDIMsgBox( HWND hwndParent, int idMsg, int idTitle, UINT nType, LPCTSTR szDetail ) +{ + _TCHAR szMessage[ 512 ]; + _TCHAR szTitle[ 256 ]; + + int nResult = LoadString( g_hinst, idMsg, szMessage, ARRAYLEN( szMessage ) - 1 ); + if( nResult <= 0 ) + { + _sntprintf( szMessage, ARRAYLEN(szMessage), _T("Message string missing. ID=%d"), idMsg ); + szMessage[ ARRAYLEN(szMessage) - 1 ] = NULL; + } + + nResult = LoadString( g_hinst, idTitle, szTitle, ARRAYLEN( szTitle ) - 1 ); + if( nResult <= 0 ) + { + _sntprintf( szMessage, ARRAYLEN(szTitle), _T("Title string missing. ID=%d"), idTitle ); + } + + tstring strMessage = szMessage; +#if defined(DBG) || defined(_DEBUG) + if( szDetail ) + { + strMessage += _T("\nDetail:\n\n"); + strMessage += szDetail; + } +#endif + MessageBox( hwndParent, strMessage.c_str(), szTitle, nType ); +} + + +void UDDIMsgBox( HWND hwndParent, LPCTSTR szMsg, int idTitle, UINT nType, LPCTSTR szDetail ) +{ + _TCHAR szMessage[ 512 ]; + _TCHAR szTitle[ 256 ]; + + _tcsncpy( szMessage, szMsg, ARRAYLEN( szMessage ) - 1 ); + + int nResult = LoadString( g_hinst, idTitle, szTitle, ARRAYLEN( szTitle ) - 1 ); + if( nResult <= 0 ) + { + _sntprintf( szMessage, ARRAYLEN(szTitle), _T("Title string missing. ID=%d"), idTitle ); + } + + tstring strMessage = szMessage; +#if defined(DBG) || defined(_DEBUG) + if( szDetail ) + { + strMessage += _T("\nDetail:\n\n"); + strMessage += szDetail; + } +#endif + MessageBox( hwndParent, strMessage.c_str(), szTitle, nType ); +} + + +// +// This function accepts a date expressed in the format +// mm/dd/yyyy or m/d/yyyy and returns the localized +// representation of that date in the long format. +// +wstring LocalizedDate( const wstring& str ) +{ + try + { + size_t n = str.length(); + size_t nposMonth = str.find( L'/' ); + size_t nposDay = str.find( L'/', nposMonth + 2 ); + + if( ( 1 != nposMonth && 2 != nposMonth ) || + ( ( nposMonth + 2 != nposDay ) && + ( nposMonth + 3 != nposDay ) ) || + ( n < 8 || n > 10 ) ) + { + throw "Invalid date format. Date must be of the form x/x/xxxx."; + } + + SYSTEMTIME st; + memset( &st, 0x00, sizeof( SYSTEMTIME ) ); + + st.wYear = (WORD) _wtoi( str.substr( nposDay + 1, 4 ).c_str() ); + st.wMonth = (WORD) _wtoi( str.substr( 0, nposMonth ).c_str() ); + st.wDay = (WORD) _wtoi( str.substr( nposMonth + 1, nposDay - nposMonth ).c_str() ); + + DWORD dwRC = ERROR_SUCCESS; + wchar_t szDate[ 150 ]; + int nLen = GetDateFormatW( + LOCALE_USER_DEFAULT, + DATE_LONGDATE, + &st, + NULL, + szDate, + 150 ); + + if( 0 == nLen ) + { + throw "GetDateFormat failed"; + } + + return wstring( szDate ); + } + catch(...) + { + return wstring(L""); + } +} + +wstring LocalizedDateTime( const wstring& str ) +{ + try + { + const size_t nposMonth = 0; + const size_t nposDay = 3; + const size_t nposYear = 6; + const size_t nposTime = 10; + const size_t nposHour = 11; + const size_t nposMinute = 14; + const size_t nposSecond = 17; + + size_t n = str.length(); + + if( L'/' != str.c_str()[nposDay - 1] || + L'/' != str.c_str()[nposYear - 1] || + L' ' != str.c_str()[nposHour - 1] || + L':' != str.c_str()[nposMinute - 1] || + L':' != str.c_str()[nposSecond - 1] || + n != 19 ) + { + throw "Invalid datetime format. Date must be of the form MM/dd/yyyy HH:mm:ss"; + } + + SYSTEMTIME st; + memset( &st, 0x00, sizeof( SYSTEMTIME ) ); + + st.wYear = (WORD) _wtoi( str.substr( nposYear, 4 ).c_str() ); + st.wMonth = (WORD) _wtoi( str.substr( nposMonth, 2 ).c_str() ); + st.wDay = (WORD) _wtoi( str.substr( nposDay, 2 ).c_str() ); + st.wHour = (WORD) _wtoi( str.substr( nposHour, 2 ).c_str() ); + st.wMinute = (WORD) _wtoi( str.substr( nposMinute, 2 ).c_str() ); + st.wSecond = (WORD) _wtoi( str.substr( nposSecond, 2 ).c_str() ); + + DWORD dwRC = ERROR_SUCCESS; + wchar_t szDate[ 150 ]; + int nLen = GetDateFormat( + LOCALE_USER_DEFAULT, + DATE_LONGDATE, + &st, + NULL, + szDate, + ARRAYLEN( szDate ) ); + + if( 0 == nLen ) + { + throw "GetDateFormat failed"; + } + + dwRC = ERROR_SUCCESS; + wchar_t szTime[ 150 ]; + nLen = GetTimeFormat( + LOCALE_USER_DEFAULT, + 0, + &st, + NULL, + szTime, + ARRAYLEN( szTime ) ); + + if( 0 == nLen ) + { + throw "GetTimeFormat failed"; + } + + wstring strDateTime = szDate; + strDateTime += L" "; + strDateTime += szTime; + return strDateTime; + } + catch(...) + { + return wstring(L""); + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/uddi.h b/inetsrv/uddi/source/mmc/uddi.h new file mode 100644 index 0000000..26e621c --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddi.h @@ -0,0 +1,411 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#ifdef _UNICODE +#define tstring wstring +#define tstringstream wstringstream +#else // #ifdef _UNICODE +#define tstring string +#define tstringstream stringstream +#endif // #ifdef _UNICODE + +// +// useful debug macros +// + +// +// pragma message macro +// usage: +// #pragma UDDIMSG(Fix this later) +// outputs during compile: +// C:\...\Foo.c(25) : Fix this later +// +#define UDDISTR2(x) #x +#define UDDISTR(x) UDDISTR2(x) +#define UDDIMSG(x) message(__FILE__ "(" UDDISTR(__LINE__) ") : " #x) + +// +// Break macro - break in debugger +// +#ifdef _X86_ +#define UDDIBREAK() _asm { int 3 } +#endif + +// +// Assertion macro - trace a message and break if assertion failes +// +#if defined( _DEBUG ) || defined( DBG ) +// +// Print the location and expression of the assertion and halt +// +#define UDDIASSERT(exp) \ + if( !(exp) ) \ + { \ + char psz[256]; \ + ::_snprintf(psz, 256, "%s(%d) : Assertion Failed! - %s\n", \ + __FILE__, __LINE__, #exp); \ + OutputDebugStringA(psz); \ + UDDIBREAK(); \ + } +#else +#define UDDIASSERT(exp) +#endif + +// +// Verify macro - like UDDIASSERT but remains in all builds +// + +#define UDDIVERIFYST(exp, id, hinst) \ +if( !(exp) ) \ +{ \ + _TCHAR szLocalizedString[ 512 ]; \ + ::LoadString( hinst, id, szLocalizedString, 512 ); \ + OutputDebugString( szLocalizedString ); \ + throw CUDDIException((HRESULT)E_FAIL, \ + szLocalizedString, _T(__FILE__), \ + __LINE__, _T(__TIMESTAMP__), _T(__FUNCTION__) ); \ +} + +#define UDDIVERIFY(exp, str) \ +if( !(exp) ) \ +{ \ + OutputDebugString( str ); \ + throw CUDDIException((HRESULT)E_FAIL, \ + str, _T(__FILE__), \ + __LINE__, _T(__TIMESTAMP__), _T(__FUNCTION__) ); \ +} + +// +// Verify an hresult - trace description of message if bad HRESULT +// +#define UDDIVERIFYHR(hr) \ + if( !SUCCEEDED(hr) ) \ + { \ + LPWSTR lpMsg; \ + int n = ::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | \ + FORMAT_MESSAGE_FROM_SYSTEM | \ + FORMAT_MESSAGE_IGNORE_INSERTS, \ + NULL, (hr), 0, \ + (LPWSTR)&lpMsg, 0, NULL); \ + if( n != 0 ) { \ + lpMsg[::wcslen(lpMsg) - 2] = 0; \ + } else { \ + lpMsg = L"Unknown"; \ + } \ + wstring strMsg(lpMsg); \ + ::LocalFree(lpMsg); \ + throw CUDDIException((HRESULT)(hr), strMsg, _T(__FILE__), \ + __LINE__, _T(__TIMESTAMP__), _T(__FUNCTION__)); \ + } + + +// +// Verify an API call - trace description of message if GetLastError fails +// +#define UDDIVERIFYAPI() \ + if( ::GetLastError() != ERROR_SUCCESS ) \ + { \ + DWORD dwErr = ::GetLastError(); \ + LPWSTR lpMsg; \ + int n = ::FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | \ + FORMAT_MESSAGE_FROM_SYSTEM | \ + FORMAT_MESSAGE_IGNORE_INSERTS, \ + NULL, dwErr, 0, \ + (LPWSTR)&lpMsg, 0, NULL); \ + if( n != 0 ) { \ + lpMsg[ ::wcslen(lpMsg) - 2 ] = 0; \ + } else { \ + lpMsg = L"Unknown"; \ + } \ + wstring strMsg( lpMsg ); \ + ::LocalFree(lpMsg); \ + throw CUDDIException((dwErr), strMsg.c_str(), _T(__FILE__), \ + __LINE__, _T(__TIMESTAMP__), _T(__FUNCTION__) ); \ + } + + +// +// main tracing function +// +void UDDITRACE( const char* pszFile, int nLine, + int nSev, int nCat, + const wchar_t* pszContext, + const wchar_t* pszFormat, ... ); + +// +// Severity codes +// use when calling UDDITRACE to pull in file/line number +// +#define UDDI_SEVERITY_ERR __FILE__, __LINE__, 0x01 // EVENTLOG_ERROR_TYPE These are in WINNT.H +#define UDDI_SEVERITY_WARN __FILE__, __LINE__, 0x02 // EVENTLOG_WARNING_TYPE +#define UDDI_SEVERITY_INFO __FILE__, __LINE__, 0x04 // EVENTLOG_INFORMATION_TYPE +#define UDDI_SEVERITY_PASS __FILE__, __LINE__, 0x08 // EVENTLOG_AUDIT_SUCCESS +#define UDDI_SEVERITY_FAIL __FILE__, __LINE__, 0x10 // EVENTLOG_AUDIT_FAILURE +#define UDDI_SEVERITY_VERB __FILE__, __LINE__, 0x20 // most detailed output + +// +// Category codes +// +#define UDDI_CATEGORY_NONE 0x00 +#define UDDI_CATEGORY_UI 0x01 +#define UDDI_CATEGORY_MMC 0x02 +#define UDDI_CATEGORY_INSTALL 0x03 + +// +// Class CUDDIException +// General exception class used for exception handling throughout. +// +class CUDDIException +{ +public: + + // + // Default constructor for CUDDIException + // Simply sets default parameters. + // + CUDDIException() + : m_dwErr( -1 ) + , m_hrErr( E_FAIL ) + , m_sErr( _T( "Unknown error" ) ) + , m_iLine( -1 ) {} + + // + // Copy constructor for CUDDIException + // Deep copy from _copy. + // Params: + // _copy - the source object from which to copy. + // + CUDDIException( const CUDDIException& _copy ) + : m_dwErr( _copy.m_dwErr ) + , m_hrErr( _copy.m_hrErr ) + , m_sErr( _copy.m_sErr ) + , m_sBuildTimestamp( _copy.m_sBuildTimestamp ) + , m_sFile( _copy.m_sFile ) + , m_iLine( _copy.m_iLine ) + , m_sFunction( _copy.m_sFunction ) {} + + // + // Constructor for CUDDIException + // Generates error info from a DWORD, meaning that it assumes + // the DWORD was generated from GetLastError() and uses the + // system FormatMessage() function to get the error text. + // Params: + // _err - a value returned from GetLastError(). + // _file - the source file name where the error occurred. + // _line - the line number in the source where the error + // occurred. + // _timestamp - the build timestamp of the file where the + // error occurred. + // + CUDDIException( DWORD _err, const tstring& _file = _T( "" ), int _line = -1, + const tstring& _timestamp = _T( "" ), const tstring& _function = _T("") ) + : m_dwErr( _err ) + , m_hrErr( E_FAIL ) + , m_sBuildTimestamp( _timestamp ) + , m_sFile( _file ) + , m_iLine( _line ) + , m_sFunction( _function ) + { + LPVOID lpMsgBuf; + FormatMessage( // Gets the error text from the OS + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + _err, + MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), + ( LPTSTR )&lpMsgBuf, + 0, + NULL + ); + m_sErr = ( LPTSTR )lpMsgBuf; + LocalFree( lpMsgBuf ); + } + + // + // Constructor for CUDDIException + // Stores error info from a DWORD and passed-in string. + // Params: + // _err - a DWORD error value. + // _str - error text. + // _file - the source file name where the error occurred. + // _line - the line number in the source where the error + // occurred. + // _timestamp - the build timestamp of the file where the + // error occurred. + // + CUDDIException( DWORD _err, const tstring& _str, const tstring& _file = _T( "" ), + int _line = -1, const tstring& _timestamp = _T( "" ), const tstring& _function = _T("") ) + : m_dwErr( _err ) + , m_sErr( _str ) + , m_hrErr( E_FAIL ) + , m_sBuildTimestamp( _timestamp ) + , m_sFile( _file ) + , m_iLine( _line ) + , m_sFunction(_function) {} + + // + // Constructor for CUDDIException + // Stores error info from an HRESULT and an error string. + // Params: + // _hr - an HRESULT. + // _str - an error string. + // _file - the source file name where the error occurred. + // _line - the line number in the source where the error + // occurred. + // _timestamp - the build timestamp of the file where the + // error occurred. + // + CUDDIException( HRESULT _hr, const tstring& _str, const tstring& _file = _T( "" ), + int _line = -1, const tstring& _timestamp = _T( "" ), const tstring& _function = _T("") ) + : m_dwErr( -1 ) + , m_sErr( _str ) + , m_hrErr( _hr ) + , m_sBuildTimestamp( _timestamp ) + , m_sFile( _file ) + , m_iLine( _line ) + , m_sFunction( _function ) {} + + // + // Constructor for CUDDIException + // Stores error info from an error string. + // Params: + // _str - an error string. + // _file - the source file name where the error occurred. + // _line - the line number in the source where the error + // occurred. + // _timestamp - the build timestamp of the file where the + // error occurred. + // + CUDDIException( const tstring& _str, const tstring& _file = _T( "" ), + int _line = -1, const tstring& _timestamp = _T( "" ), const tstring& _function = _T("") ) + : m_dwErr( -1 ) + , m_sErr( _str ) + , m_hrErr( E_FAIL ) + , m_sBuildTimestamp( _timestamp ) + , m_sFile( _file ) + , m_iLine( _line ) + , m_sFunction( _function ) {} + + // + // Assignment operator for CUDDIException + // Deep copy from _copy. + // Params: + // _copy - the source object from which to copy. + // + CUDDIException& operator=( const CUDDIException& _copy ) + { + m_dwErr = _copy.m_dwErr; + m_hrErr = _copy.m_hrErr; + m_sErr = _copy.m_sErr; + m_sBuildTimestamp = _copy.m_sBuildTimestamp; + m_sFile = _copy.m_sFile; + m_iLine = _copy.m_iLine; + m_sFunction = _copy.m_sFunction; + } + + // + // Cast operators + // We use cast operators to return the various error values + // that can be stored in the error object. Thus, the following + // code is possible: + // CUDDIException _err( GetLastError() ); + // DWORD dwErr = _err; // this will be GetLastError() + // HRESULT hrErr = _err; // this will be E_FAIL + // Tstring strErr = _err; // this will be the text description + // // of GetLastError + // + operator DWORD() const { return m_dwErr; } + operator HRESULT() const { return m_hrErr; } + operator const tstring&() const { return m_sErr; } + operator LPCTSTR() const { return m_sErr.c_str(); } + + const tstring& GetTimeStamp() const { return m_sBuildTimestamp; } + const tstring& GetFile() const { return m_sFile; } + int GetLine() const { return m_iLine; } + const tstring& GetFunction() const { return m_sFunction; } + const tstring GetEntireError() const + { + tstringstream strm; + strm << _T("Error: ") << m_sErr + << _T("\nCode: 0x") << hex << m_hrErr; + +#if defined(_DEBUG) || defined(DBG) + strm << _T("\nFile: ") << m_sFile + << _T("\nFunction: ") << m_sFunction + << _T("\nLine: ") << m_iLine; +#endif + return strm.str(); + } + +private: + DWORD m_dwErr; + HRESULT m_hrErr; + tstring m_sErr; + + tstring m_sBuildTimestamp; + tstring m_sFile; + tstring m_sFunction; + int m_iLine; +}; + +#define THROW_UDDIEXCEPTION_ST( _hr_, _id_, _hinst_ ) \ + _TCHAR szLocalizedString[ 1024 ]; \ + ::LoadString( _hinst_, _id_, szLocalizedString, 1024 ); \ + throw CUDDIException((HRESULT)_hr_, \ + szLocalizedString, _T(__FILE__), \ + __LINE__, _T(__TIMESTAMP__), _T(__FUNCTION__) ); \ + + +#define THROW_UDDIEXCEPTION( _hr_, _str_ ) \ + throw CUDDIException( (HRESULT)(_hr_), _str_, _T( __FILE__ ), __LINE__, _T( __TIMESTAMP__ ), _T( __FUNCTION__) ); + +#define THROW_UDDIEXCEPTION_RC( _rc_, _str_ ) \ + throw CUDDIException( (DWORD)(_rc_), _str_, _T( __FILE__ ), __LINE__, _T( __TIMESTAMP__ ), _T( __FUNCTION__) ); + +// +// +// +typedef vector StringVector; + +class CUDDIRegistryKey +{ +public: + CUDDIRegistryKey( const tstring& szRoot, REGSAM access = KEY_ALL_ACCESS, const tstring& szComputer=_T("") ); + CUDDIRegistryKey( HKEY hHive, const tstring& szRoot, REGSAM access = KEY_ALL_ACCESS, const tstring& szComputer=_T("") ); + ~CUDDIRegistryKey(); + void Close(); + DWORD GetDWORD( const LPCTSTR szName, DWORD dwDefault ); + DWORD GetDWORD( const LPCTSTR szName ); + tstring GetString( const LPCTSTR szName, const LPCTSTR szDefault ); + tstring GetString( const LPCTSTR szName ); + void GetMultiString( const LPCTSTR szName, StringVector& strs ); + void SetValue( const LPCTSTR szName, DWORD dwValue ); + void SetValue( const LPCTSTR szName, LPCTSTR szValue ); + void DeleteValue( const tstring& szValue ); + static void Create( HKEY hHive, const tstring& szPath, const tstring& szComputer=_T("") ); + static void DeleteKey( HKEY hHive, const tstring& szPath, const tstring& szComputer=_T("") ); + static BOOL KeyExists( HKEY hHive, const tstring& szPath, const tstring& szComputer=_T("") ); + // + // implements the "get" property for the registry key handle + // + HKEY GetCurrentHandle() { return m_hkey; } + +private: + HKEY m_hHive; + HKEY m_hkey; + tstring m_szRoot; +}; + +void UDDIMsgBox( HWND hwndParent, int idMsg, int idTitle, UINT nType, LPCTSTR szDetail = NULL ); +void UDDIMsgBox( HWND hwndParent, LPCTSTR szMsg, int idTitle, UINT nType, LPCTSTR szDetail = NULL ); +wstring LocalizedDate( const wstring& str ); +wstring LocalizedDateTime( const wstring& str ); diff --git a/inetsrv/uddi/source/mmc/uddi.mmc.def b/inetsrv/uddi/source/mmc/uddi.mmc.def new file mode 100644 index 0000000..87df605 --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddi.mmc.def @@ -0,0 +1,5 @@ +EXPORTS + DllGetClassObject PRIVATE + DllCanUnloadNow PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/inetsrv/uddi/source/mmc/uddi.msc b/inetsrv/uddi/source/mmc/uddi.msc new file mode 100644 index 0000000..079fe62 --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddi.msc @@ -0,0 +1,598 @@ + + + {9794EF0D-A3D7-4BD0-B184-7AA2AAC5AEA3} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {7503DD53-4B8C-4192-8A63-8679F35D933A} + + + + + + + + + + + + + + {C96401CC-0E17-11D3-885B-00C04F72C717} + + + + + + + + + + + + {00000000-0000-0000-0000-000000000000} + + + + + + + {71E5B33E-1064-11D2-808F-0000F875A9CE} + + UDDI Services Console + Favorites + UDDI Services + Console Root + + + + + +SUwBAQEAAgAEACAAIAD/////EQD//////////0JNNgAAAAAAAAA2AAAAKAAAAIAAAAAgAAAAAQAQ +AAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABhMONcJmFhPAAEAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGUAywTMBA8J7wjN +DNMxRGXTfkx+Al0gFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAABDAJMN2gG6AbkVmRXaLdot2zG6JSNh035MfgJdIRgAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhAE4FHQLbBZgheB00Ge0UeB14HZgh +mSUjYdN+TH4CXXQdJAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAGUA9Qk+AngNVxUTETM+DBksGcwMygzKDMoMI2HTfkx+Al1XFdMAaAgAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZQA5Eh0CFQ30BPAMdUq3UrAtbiWwLbAxjylu +JcoMygzKDMoMeB1XGRUJaggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACF +BFkaugX0BNMAzAh1RrdSdUYTPm4ljymwLdEx8jUTOjNCVELRMS0dyhDKDMoQagxEBAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFh48CtMA0wDMCPIxdUp1RnVGdUawLW8lsC0TPnVG +NEITPlRCdUZ1RnVGdUYSOk0hygypDGYIRQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABuGX0W +0wDTAPMAFAHKDFVGdUZ1RnVGMz5uJZApEz7YVtdWW2cZX1tndUZ1RnVGdUZ1RnVGEz6PKcoQRAQA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAACEAeyKXDfMAFAEVATUB8ASwLXVGM0IzPnVGsC1vJbAtdUp1 +SnVGdUYZXxlf3nfedxpjGmN1RnVGdUapDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACPIdgV9AAV +ATUBNgFXAXgBygx1SvI18jXyNTM+biWQKfI5t1KWTnVGdUZURjRCVEZURnVGdUZ1Ri0dCiEAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAGMINy6XERUBNgFXAXgBeAGZATIFsC3RNbAtjynyNbAtjymwLbdS +2FaWTnVGdUYzQhI6Ejp1RnVG8jksIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArHfchtw02AVcB +eAGZAZkBwEzATANZBVEqKQshTiE0Qm8lsC0TPhpj2FaWTnVKdUrRMRM+dUZ1RsoMrAwAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAKx3WIZcBVwGZAZkBuQG6AcBMQ2UjWU52DHaocSlBMz6wLY8psC35 +Xhpj+V63UlRGsC11RnVGjyluGfAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK4pthl3AZgBmQG5 +AdoB2wGPMYV1hmXdf5t/WX9Zf9ExVUZvJbAtMz57azpj+V5vJTNCdUbyOeoQbREyEQAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAACuLdYZeAGZAbkB2gHbAfwBYAIiYahxTnZOdk52N3tVRtdW0TGQKbAt +OmN7a7AtkClVRnVGLR2ocWc5NgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAri33GZkBmQG6AdsB +FQJgBoEOqCmPJaklLB2MRdZmGV/5WpZOjymwLVRC+V4MGfI1VEaPKRJGm38tZlcBAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAM4xGBqZAboB2wEVAoEOohLDGsMawxqqEjoSbiU6ZzpjGmMZX9E1sC2w +MQwZbyUzPvE1CinJabJ6ZVkwGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACNLXkmmQHaAfwBaAqi +FsMawx7kIgQnBCfyJm8ZdUo6Y1tnOmO3Uo8psC2PKfI1EzotGSkVICXATGIZcQkAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAApRC6NvoB2wH8AYkOwxrkIgQnBS8mMyYzJjONKm4le2t8b3xvfG/yObAt +0THRNbAtZQXAAaABgAGAAdUdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+U45FvoBNgaqFgQn +BSsmMyYzJjMmMyYzTDtpGRlf3nv/f/9/e2uQKbAt0TUnCQAC4AHAAaABrQFwGQAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAFJG2zpUAokS5CIFKyYzJjMnN3RDuldrQ0k/zzqPKb53nXOdcxlf0TGw +LQwVtwEGArMBxgGgAdQBhQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjDF1Tqx7DHgQnJS8m +Myc3cEPfW9dbkE+RU/9vjyVUQpZOlk6WTnVKbiV0BfUBIALmAawBxwEZFgAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAABSRg0zxiYFKyYzJjNrQ5BP3V/6X9dj+3P/czpTLR35Xjpj8jUTPi8J +PgL8AQYCAALGAXYeZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQRaX+kuBS8mM0g7 +bUeyU9df+l/9Y9Rb+1//Z2oZygxJFa4RkQpXAj4C/AHaAQACNwJPBQAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAKSV5Vwo70xoPL/oislOdS/xf/GfUW/9nuk9IOyYzBS/LGn8CPgId +AtsBugEWAhUGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAayldSxMzLkcV +L3VDXT+7T9hbn0+WS3BDSDsmMwUv4x6RDj4C/AEcAl4GFg4iAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAayl4Y1FPEzvbGnVDdz95Q1s7cT9rQyYzJjMFK7EOVwIdAl4K +vw43GiEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApRT4VnlX +MkcXNxYrUj9rQzA3JzcmMyUv5CKqEncKvxYfM24VAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABrKTpbeleVV1hDb0MnNxkvGSsyMxErWD/6OtIlhQwA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AKUUzjW2TthOPUs9Rz1Pdj7yLSsZIQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAQk0+AAAAAAAAAD4AAAAoAAAAgAAAACAAAAABAAEAAAAAAAACAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAP///wD/////AAAAAAAAAAAAAAAA///B/wAAAAAAAAAAAAAAAP/gAf8AAAAAAAAA +AAAAAAD/AAH/AAAAAAAAAAAAAAAA/AAA/wAAAAAAAAAAAAAAAPgAAH8AAAAAAAAAAAAAAADwAAA/ +AAAAAAAAAAAAAAAA4AAADwAAAAAAAAAAAAAAAOAAAAEAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAA +AAAAgAAAAAAAAAAAAAAAAAAAAIAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAA +AAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAA +AAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAA +AAAAAAAAAACAAAADAAAAAAAAAAAAAAAAgAAAAwAAAAAAAAAAAAAAAIAAAAcAAAAAAAAAAAAAAADA +AAAHAAAAAAAAAAAAAAAAwAAADwAAAAAAAAAAAAAAAOAAAB8AAAAAAAAAAAAAAADwAAAfAAAAAAAA +AAAAAAAA+AAAPwAAAAAAAAAAAAAAAPwAAP8AAAAAAAAAAAAAAAD/AAH/AAAAAAAAAAAAAAAA/8AH +/wAAAAAAAAAAAAAAAA== + + +SUwBAQEAAgAEABAAEAD/////EQD//////////0JNNgAAAAAAAAA2AAAAKAAAAEAAAAAQAAAAAQAQ +AAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENp4FAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACHAA4RUB1wJSwt +snbgUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +ZQCTFXURlCWUKZQllCUQTuBQlCUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAZQR0FTYBTx1PHU8dTx1PHU8dTx1PHU8dTx1PHcoQAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQB0GTYB0wDTAE8dlk74WrZOtk63UvhaGV/XVvI1AAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADIDHYR8wA2AXcBlgluJdRO0TUz +PnVGVUb4WvI1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwVFQEU +AZkBmQHgUOBQ0TW3Um4l0TGWTlRGSy3gUOBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAthlWAXgBugH7AZBu9XpuJdhWVEbRMbdSjyn1evV6Q2kAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD3GVcBmQEuAm8COR7yOfUlbiW2UrZS8TWFJYYBrx0AAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgamQEQAoEO5CbrHt8anw6zHbZS +EjqLHYwBhgEMCQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkBn7AW8O +BS8mMyYzcz8/M1sWbiVuJeMJwAGAAekAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAABMHbce5CYmM2w/b0dvR99bPzM7CjsKDgLGAaYBRAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKUUSiYmM0g71lv6X/5z2VssM3gGdwL0AQACjQEAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADNNQ8/Vz9aO9tb/mdzPyYzqhJf +AvwBEQJDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzTVS +U21HNzN3PyYzBS+RDp8OFxJlBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAKUUrC2QQjJPEzvyMu0hLBUhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAQk0+AAAAAAAAAD4AAAAoAAAAQAAAABAAAAABAAEAAAAAAIAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD/nwAAAAAAAPAfAAAAAAAAwA8AAAAAAACAAAAAAAAA +AAABAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAA +AAEAAAAAAAAAAwAAAAAAAIADAAAAAAAAwAcAAAAAAADgDwAAAAAAAA== + + +SUwBAQIAAwAEABAAEAD/////CQD//////////0JNNgQAAAAAAAA2BAAAKAAAAEAAAAAQAAAAAQAI +AAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAA +wNzAAPDKpgAzAAAAAAAzADMAMwAzMwAAFhYWABwcHAAiIiIAKSkpAFVVVQBNTU0AQkJCADk5OQCA +fP8AUFD/AJMA1gD/7MwAxtbvANbn5wCQqa0AAP8zAAAAZgAAAJkAAADMAAAzAAAAMzMAADNmAAAz +mQAAM8wAADP/AABmAAAAZjMAAGZmAABmmQAAZswAAGb/AACZAAAAmTMAAJlmAACZmQAAmcwAAJn/ +AADMAAAAzDMAAMxmAADMmQAAzMwAAMz/AAD/ZgAA/5kAAP/MADP/AAD/ADMAMwBmADMAmQAzAMwA +MwD/AP8zAAAzMzMAMzNmADMzmQAzM8wAMzP/ADNmAAAzZjMAM2ZmADNmmQAzZswAM2b/ADOZAAAz +mTMAM5lmADOZmQAzmcwAM5n/ADPMAAAzzDMAM8xmADPMmQAzzMwAM8z/ADP/MwAz/2YAM/+ZADP/ +zAAz//8AZgAAAGYAMwBmAGYAZgCZAGYAzABmAP8AZjMAAGYzMwBmM2YAZjOZAGYzzABmM/8AZmYA +AGZmMwBmZmYAZmaZAGZmzABmmQAAZpkzAGaZZgBmmZkAZpnMAGaZ/wBmzAAAZswzAGbMmQBmzMwA +Zsz/AGb/AABm/zMAZv+ZAGb/zADMAP8A/wDMAJmZAACZM5kAmQCZAJkAzACZAAAAmTMzAJkAZgCZ +M8wAmQD/AJlmAACZZjMAmTNmAJlmmQCZZswAmTP/AJmZMwCZmWYAmZmZAJmZzACZmf8AmcwAAJnM +MwBmzGYAmcyZAJnMzACZzP8Amf8AAJn/MwCZzGYAmf+ZAJn/zACZ//8AzAAAAJkAMwDMAGYAzACZ +AMwAzACZMwAAzDMzAMwzZgDMM5kAzDPMAMwz/wDMZgAAzGYzAJlmZgDMZpkAzGbMAJlm/wDMmQAA +zJkzAMyZZgDMmZkAzJnMAMyZ/wDMzAAAzMwzAMzMZgDMzJkAzMzMAMzM/wDM/wAAzP8zAJn/ZgDM +/5kAzP/MAMz//wDMADMA/wBmAP8AmQDMMwAA/zMzAP8zZgD/M5kA/zPMAP8z/wD/ZgAA/2YzAMxm +ZgD/ZpkA/2bMAMxm/wD/mQAA/5kzAP+ZZgD/mZkA/5nMAP+Z/wD/zAAA/8wzAP/MZgD/zJkA/8zM +AP/M/wD//zMAzP9mAP//mQD//8wAZmb/AGb/ZgBm//8A/2ZmAP9m/wD//2YAIQClAF9fXwB3d3cA +hoaGAJaWlgDLy8sAsrKyANfX1wDd3d0A4+PjAOrq6gDx8fEA+Pj4APD7/wCkoKAAgICAAAAA/wAA +/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAArJAAAAAAAAAAAAAAAAAAAKyQAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATExMTmiQAAAAAAAAAAAAAExMTE5ok +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIuti4uLi+wkEwAAAAAAAACL +rYuLi4vsJBMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABq2sbGxsbGxsbGxs +bGyuAAatrGxsbGxsbGxsbGxsrgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoumpqZs +7wfv7+8HBweuAAaLpqambO8H7+/vBwcHrgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AACtpqysrOrvrq6SkgeuAAAAraasrKzq766ukpIHrgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAC0pqasrCQkru/qru+SEyQktKamrKwkJK7v6q7vkhMkJAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAraysrKyTmuoHkq7v6pqaTK2srKysk5rqB5Ku7+qamkwAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAK2srHBws66Q6u/vrklI6gCtrKxwcLOukOrv765JSOoAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACzrAYtVXfU1IvvrmxrSJAAs6wGLVV31NSL765s +a0iQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtKxxVlZWnduz6uoCJyeQALSscVZW +Vp3bs+rqAicnkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACzVVZ4eHjh27KyAEhI +AAAAs1VWeHh44duysgBISAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnVZWwsLi +wpeysootkAAAAJ1WVsLC4sKXsrKKLZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AACdnbrC4p1WcdOsgQAAAAAAnZ26wuKdVnHTrIEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAJh4up1WVnHTswAAAAAAAACYeLqdVlZx07MAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAJiYnZ2dAAAAAAAAAAAAAACYmJ2dnQAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAQk0+AAAAAAAAAD4AAAAoAAAAQAAAABAAAAABAAEAAAAAAIAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD/n/+fAAAAAPgf+B8AAAAA4A/gDwAAAACAAIAAAAAA +AAABAAEAAAAAgAOAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQAAAAAAAQABAAAAAAABAAEAAAAA +gBOAEwAAAACAA4ADAAAAAMAHwAcAAAAA4A/gDwAAAAD4P/g/AAAAAA== + + +SUwBAQEAAgAEACAAIAD/////CQD//////////0JNNgQAAAAAAAA2BAAAKAAAAIAAAAAgAAAAAQAI +AAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAA +wNzAAPDKpgAzAAAAAAAzADMAMwAzMwAAFhYWABwcHAAiIiIAKSkpAFVVVQBNTU0AQkJCADk5OQCA +fP8AUFD/AJMA1gD/7MwAxtbvANbn5wCQqa0AAP8zAAAAZgAAAJkAAADMAAAzAAAAMzMAADNmAAAz +mQAAM8wAADP/AABmAAAAZjMAAGZmAABmmQAAZswAAGb/AACZAAAAmTMAAJlmAACZmQAAmcwAAJn/ +AADMAAAAzDMAAMxmAADMmQAAzMwAAMz/AAD/ZgAA/5kAAP/MADP/AAD/ADMAMwBmADMAmQAzAMwA +MwD/AP8zAAAzMzMAMzNmADMzmQAzM8wAMzP/ADNmAAAzZjMAM2ZmADNmmQAzZswAM2b/ADOZAAAz +mTMAM5lmADOZmQAzmcwAM5n/ADPMAAAzzDMAM8xmADPMmQAzzMwAM8z/ADP/MwAz/2YAM/+ZADP/ +zAAz//8AZgAAAGYAMwBmAGYAZgCZAGYAzABmAP8AZjMAAGYzMwBmM2YAZjOZAGYzzABmM/8AZmYA +AGZmMwBmZmYAZmaZAGZmzABmmQAAZpkzAGaZZgBmmZkAZpnMAGaZ/wBmzAAAZswzAGbMmQBmzMwA +Zsz/AGb/AABm/zMAZv+ZAGb/zADMAP8A/wDMAJmZAACZM5kAmQCZAJkAzACZAAAAmTMzAJkAZgCZ +M8wAmQD/AJlmAACZZjMAmTNmAJlmmQCZZswAmTP/AJmZMwCZmWYAmZmZAJmZzACZmf8AmcwAAJnM +MwBmzGYAmcyZAJnMzACZzP8Amf8AAJn/MwCZzGYAmf+ZAJn/zACZ//8AzAAAAJkAMwDMAGYAzACZ +AMwAzACZMwAAzDMzAMwzZgDMM5kAzDPMAMwz/wDMZgAAzGYzAJlmZgDMZpkAzGbMAJlm/wDMmQAA +zJkzAMyZZgDMmZkAzJnMAMyZ/wDMzAAAzMwzAMzMZgDMzJkAzMzMAMzM/wDM/wAAzP8zAJn/ZgDM +/5kAzP/MAMz//wDMADMA/wBmAP8AmQDMMwAA/zMzAP8zZgD/M5kA/zPMAP8z/wD/ZgAA/2YzAMxm +ZgD/ZpkA/2bMAMxm/wD/mQAA/5kzAP+ZZgD/mZkA/5nMAP+Z/wD/zAAA/8wzAP/MZgD/zJkA/8zM +AP/M/wD//zMAzP9mAP//mQD//8wAZmb/AGb/ZgBm//8A/2ZmAP9m/wD//2YAIQClAF9fXwB3d3cA +hoaGAJaWlgDLy8sAsrKyANfX1wDd3d0A4+PjAOrq6gDx8fEA+Pj4APD7/wCkoKAAgICAAAAA/wAA +/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACVG +RiVGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAACsrayshqztTJp1RiQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAALKzrKytrc/Pz89GmnVGRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALOzrKytrYZmra2trUaadUaLhgAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACzs9Osp4btZmZmZmZmRpp1 +RqemhgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1LOz +rIaG7e+ubK6urmxmZmZmra2GhgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAALmzrKamZffv9+xsbK6uruzt7a5mZmZmhmYAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAubOmpmau9/f3965sruz37e3t9/f39+xmZmZmZgAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALrUpqampmbt9/f37Wyu7AfvvAe8 +9/f39/f37GxmZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC6uaympqys +pq737ez3rmyu9/f39wcH8/O8B/f392ZmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAALqtpqysrKysZveurq7sbK7s7/f39+3t7e339/dm7AAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAADctK2mrKysrKyGrq6urq6ubK7v7/f39+3s7Pf3rmwAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmtrKysrKysJCRGRmZmbO1sruy8B/f3 +967s9/dmhgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACa2srKysrKwk +RkZ1dUxK7a6urgcHB+/trvf3rmaGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAJraysrKysrK5NTAC9vb2u92yu7fG8B2zt965mbIYAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAmtrKysrKysLUZMdXV1vffvrq6uvPGuru33ZkxKrAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACa2srKyssi00SmxsZm4HBwf3bK7tB2au +7a7svXSsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxraysrLI0NDQ0 +NHGzbLy8vAeurq5mbO2uZkyaS4YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAPGzrKysTjQ0NFVVVZaG97y8vO9srq6u7GZmKCQohgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAA8bqsrKxxNFVVVVZWVnJs8fHx8a6urq6uSCcnJyezAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACbOssnFVVVZWVlZWl2YH8wAA8a6urg0n +LScna7QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADzurJxVVVWVlaY +CVdWl67z8/MHrq5mrE6KSCeKugAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAPMJcTRVVlZWeOLBeJ7ibO339/f3bIqyLUhrSLMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAPOXVVVWVnh4CcLC8+K7Zge8ruyGrKxILUizswAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8/FWVVZWeJ7BwuKewuJsZklskLLTrKwt +srMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA87uXlpe5nsHi +wp7iCVZWVnHT06ysrLKyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAA89ydeLqYugnB4Zh4VlZVVZDTrKzTs7kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAA88KYnbmYmLu6eHhWVlWQstOz1Lm5AAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8/EJmLq6nZedVlZWVXGy1Nu5AAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPPxCZ67 +eFa6up2WmLq6CQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAADz8fHx3LoJ3AncugAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAQk0+AAAAAAAAAD4AAAAoAAAAgAAAACAAAAABAAEAAAAAAAACAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAP///wD/////AAAAAAAAAAAAAAAA///B/wAAAAAAAAAAAAAAAP/gAf8A +AAAAAAAAAAAAAAD/AAH/AAAAAAAAAAAAAAAA/AAA/wAAAAAAAAAAAAAAAPgAAH8AAAAAAAAAAAAA +AADwAAA/AAAAAAAAAAAAAAAA4AAADwAAAAAAAAAAAAAAAOAAAAEAAAAAAAAAAAAAAADAAAAAAAAA +AAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAIAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAA +AAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAEAADAAAAAAAAAAAAAAAAAAAAAwAAAAAA +AAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAA +AAMAAAAAAAAAAAAAAACAAGADAAAAAAAAAAAAAAAAgAAAAwAAAAAAAAAAAAAAAIAAAAcAAAAAAAAA +AAAAAADAAAAHAAAAAAAAAAAAAAAAwAAADwAAAAAAAAAAAAAAAOAAAB8AAAAAAAAAAAAAAADwAAAf +AAAAAAAAAAAAAAAA+AAAPwAAAAAAAAAAAAAAAPwAAP8AAAAAAAAAAAAAAAD/AAH/AAAAAAAAAAAA +AAAA/8AH/wAAAAAAAAAAAAAAAA== + + + + + +SUwBAQIAAwAEABAAEAD/////CQD//////////0JNNgQAAAAAAAA2BAAAKAAAAEAAAAAQAAAAAQAI +AAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAA +wNzAAPDKpgAzAAAAAAAzADMAMwAzMwAAFhYWABwcHAAiIiIAKSkpAFVVVQBNTU0AQkJCADk5OQCA +fP8AUFD/AJMA1gD/7MwAxtbvANbn5wCQqa0AAP8zAAAAZgAAAJkAAADMAAAzAAAAMzMAADNmAAAz +mQAAM8wAADP/AABmAAAAZjMAAGZmAABmmQAAZswAAGb/AACZAAAAmTMAAJlmAACZmQAAmcwAAJn/ +AADMAAAAzDMAAMxmAADMmQAAzMwAAMz/AAD/ZgAA/5kAAP/MADP/AAD/ADMAMwBmADMAmQAzAMwA +MwD/AP8zAAAzMzMAMzNmADMzmQAzM8wAMzP/ADNmAAAzZjMAM2ZmADNmmQAzZswAM2b/ADOZAAAz +mTMAM5lmADOZmQAzmcwAM5n/ADPMAAAzzDMAM8xmADPMmQAzzMwAM8z/ADP/MwAz/2YAM/+ZADP/ +zAAz//8AZgAAAGYAMwBmAGYAZgCZAGYAzABmAP8AZjMAAGYzMwBmM2YAZjOZAGYzzABmM/8AZmYA +AGZmMwBmZmYAZmaZAGZmzABmmQAAZpkzAGaZZgBmmZkAZpnMAGaZ/wBmzAAAZswzAGbMmQBmzMwA +Zsz/AGb/AABm/zMAZv+ZAGb/zADMAP8A/wDMAJmZAACZM5kAmQCZAJkAzACZAAAAmTMzAJkAZgCZ +M8wAmQD/AJlmAACZZjMAmTNmAJlmmQCZZswAmTP/AJmZMwCZmWYAmZmZAJmZzACZmf8AmcwAAJnM +MwBmzGYAmcyZAJnMzACZzP8Amf8AAJn/MwCZzGYAmf+ZAJn/zACZ//8AzAAAAJkAMwDMAGYAzACZ +AMwAzACZMwAAzDMzAMwzZgDMM5kAzDPMAMwz/wDMZgAAzGYzAJlmZgDMZpkAzGbMAJlm/wDMmQAA +zJkzAMyZZgDMmZkAzJnMAMyZ/wDMzAAAzMwzAMzMZgDMzJkAzMzMAMzM/wDM/wAAzP8zAJn/ZgDM +/5kAzP/MAMz//wDMADMA/wBmAP8AmQDMMwAA/zMzAP8zZgD/M5kA/zPMAP8z/wD/ZgAA/2YzAMxm +ZgD/ZpkA/2bMAMxm/wD/mQAA/5kzAP+ZZgD/mZkA/5nMAP+Z/wD/zAAA/8wzAP/MZgD/zJkA/8zM +AP/M/wD//zMAzP9mAP//mQD//8wAZmb/AGb/ZgBm//8A/2ZmAP9m/wD//2YAIQClAF9fXwB3d3cA +hoaGAJaWlgDLy8sAsrKyANfX1wDd3d0A4+PjAOrq6gDx8fEA+Pj4APD7/wCkoKAAgICAAAAA/wAA +/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7Ozs7Ozs7Ozs7Ozs +7OwAAADs7Ozs7Ozs7Ozs7OwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOz/+wf7 +B/sH+wf7B/vsAAAA7P/7B/sH+wf7B/vsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AADs/wf7B/sH+wf7B/sH7AAA7P/7B/sH+wf7B/sHAOwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAA7P/7B/sH+wf7B/sH++wAAOz/B/sH+wf7B/sH7ADsAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAOz/B/sH+wf7B/sH+wfsAOz/B/sH+wf7B/sH+wDs7AAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs//sH+wf7B/sH+wf77ADs/////////////+wAB+wAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7P8H+wf7B/sH+wf7B+wA7Ozs7Ozs7Ozs7Ozs +7PvsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOz/+wf7B/sH+wf7B/vsAADs/wf7 +B/sH+wf7B/sH7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs//////////////// +7AAA7P/7B/sH+wf//////+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7Af7B/sH ++wfs7Ozs7OwAAOz/B/sH+wf/7Ozs7OzsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AADsB/sH+wfsAAAAAAAAAAAA7P//////7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAOzs7OzsAAAAAAAAAAAAAADs7Ozs7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAQk0+AAAAAAAAAD4AAAAoAAAAQAAAABAAAAABAAEAAAAAAIAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD/////AAAAAP////8AAAAAwADgAAAAAACAAMAAAAAA +AIAAwAAAAAAAgACAAAAAAACAAIAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAgAAAAAAA +gACAAAAAAACAAYABAAAAAMB/wH8AAAAA4P/g/wAAAAD/////AAAAAA== + + +SUwBAQEAAgAEACAAIAD/////CQD//////////0JNNgQAAAAAAAA2BAAAKAAAAIAAAAAgAAAAAQAI +AAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAA +wNzAAPDKpgAzAAAAAAAzADMAMwAzMwAAFhYWABwcHAAiIiIAKSkpAFVVVQBNTU0AQkJCADk5OQCA +fP8AUFD/AJMA1gD/7MwAxtbvANbn5wCQqa0AAP8zAAAAZgAAAJkAAADMAAAzAAAAMzMAADNmAAAz +mQAAM8wAADP/AABmAAAAZjMAAGZmAABmmQAAZswAAGb/AACZAAAAmTMAAJlmAACZmQAAmcwAAJn/ +AADMAAAAzDMAAMxmAADMmQAAzMwAAMz/AAD/ZgAA/5kAAP/MADP/AAD/ADMAMwBmADMAmQAzAMwA +MwD/AP8zAAAzMzMAMzNmADMzmQAzM8wAMzP/ADNmAAAzZjMAM2ZmADNmmQAzZswAM2b/ADOZAAAz +mTMAM5lmADOZmQAzmcwAM5n/ADPMAAAzzDMAM8xmADPMmQAzzMwAM8z/ADP/MwAz/2YAM/+ZADP/ +zAAz//8AZgAAAGYAMwBmAGYAZgCZAGYAzABmAP8AZjMAAGYzMwBmM2YAZjOZAGYzzABmM/8AZmYA +AGZmMwBmZmYAZmaZAGZmzABmmQAAZpkzAGaZZgBmmZkAZpnMAGaZ/wBmzAAAZswzAGbMmQBmzMwA +Zsz/AGb/AABm/zMAZv+ZAGb/zADMAP8A/wDMAJmZAACZM5kAmQCZAJkAzACZAAAAmTMzAJkAZgCZ +M8wAmQD/AJlmAACZZjMAmTNmAJlmmQCZZswAmTP/AJmZMwCZmWYAmZmZAJmZzACZmf8AmcwAAJnM +MwBmzGYAmcyZAJnMzACZzP8Amf8AAJn/MwCZzGYAmf+ZAJn/zACZ//8AzAAAAJkAMwDMAGYAzACZ +AMwAzACZMwAAzDMzAMwzZgDMM5kAzDPMAMwz/wDMZgAAzGYzAJlmZgDMZpkAzGbMAJlm/wDMmQAA +zJkzAMyZZgDMmZkAzJnMAMyZ/wDMzAAAzMwzAMzMZgDMzJkAzMzMAMzM/wDM/wAAzP8zAJn/ZgDM +/5kAzP/MAMz//wDMADMA/wBmAP8AmQDMMwAA/zMzAP8zZgD/M5kA/zPMAP8z/wD/ZgAA/2YzAMxm +ZgD/ZpkA/2bMAMxm/wD/mQAA/5kzAP+ZZgD/mZkA/5nMAP+Z/wD/zAAA/8wzAP/MZgD/zJkA/8zM +AP/M/wD//zMAzP9mAP//mQD//8wAZmb/AGb/ZgBm//8A/2ZmAP9m/wD//2YAIQClAF9fXwB3d3cA +hoaGAJaWlgDLy8sAsrKyANfX1wDd3d0A4+PjAOrq6gDx8fEA+Pj4APD7/wCkoKAAgICAAAAA/wAA +/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs +7Ozs7Ozs7OwDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7P/7B/sH ++wf7B/sH+wf7B/sH+wf7B/sH+wf7BwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAADs/wf7B/sH+wf7B/sH+wf7B/sH+wf7B/sH+wf7AwAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAOz/+wf7B/sH+wf7B/sH+wf7B/sH+wf7B/sH+wcDAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7P8H+wf7B/sH+wf7B/sH+wf7B/sH ++wf7B/sH+wMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs//sH+wf7 +B/sH+wf7B/sH+wf7B/sH+wf7B/sHAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAOz/B/sH+wf7B/sH+wf7B/sH+wf7B/sH+wf7B/sDAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAA7P/7B/sH+wf7B/sH+wf7B/sH+wf7B/sH+wf7BwMAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs/wf7B/sH+wf7B/sH+wf7B/sH+wf7 +B/sH+wf7AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOz/+wf7B/sH ++wf7B/sH+wf7B/sH+wf7B/sH+wcDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAA7P8H+wf7B/sH+wf7B/sH+wf7B/sH+wf7B/sH+wMAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAADs//sH+wf7B/sH+wf7B/sH+wf7B/sH+wf7B/sHAwAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOz/B/sH+wf7B/sH+wf7B/sH+wf7B/sH ++wf7B/sDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7P/7B/sH+wf7 +B/sH+wf7B/sH+wf7B/sH+wf7BwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAADs/wf7B/sH+wf7B/sH+wf7B/sH+wf7B/sH+wf7AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAOz/+wf7B/sH+wf7B/sH+wf7B/sH+wf7B/sH+wcDAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7P8H+wf7B/sH+wf7B/sH+wf7B/sH+wf7 +B/sH+wMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs//sH+wf7B/sH ++wf7B/sH+wf7B/sH+wf7B/sHAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAOz///////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAA7AcHBwcHBwcHBwcHBwcHB+zs7Ozs7Ozs7Ozs7AAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7P/7B/sH+wf7B/sH+wfsAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7P/7B/sH+wf7 +B/sH7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAA7P///////////+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAA7Ozs7Ozs7OzsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAQk0+AAAAAAAAAD4AAAAoAAAAgAAAACAAAAABAAEAAAAAAAACAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAP///wD/////AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAP////8A +AAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAwAAAAwAAAAAAAAAAAAAAAIAAAAEAAAAAAAAAAAAA +AACAAAABAAAAAAAAAAAAAAAAgAAAAQAAAAAAAAAAAAAAAIAAAAEAAAAAAAAAAAAAAACAAAABAAAA +AAAAAAAAAAAAgAAAAQAAAAAAAAAAAAAAAIAAAAEAAAAAAAAAAAAAAACAAAABAAAAAAAAAAAAAAAA +gAAAAQAAAAAAAAAAAAAAAIAAAAEAAAAAAAAAAAAAAACAAAABAAAAAAAAAAAAAAAAgAAAAQAAAAAA +AAAAAAAAAIAAAAEAAAAAAAAAAAAAAACAAAABAAAAAAAAAAAAAAAAgAAAAQAAAAAAAAAAAAAAAIAA +AAEAAAAAAAAAAAAAAACAAAABAAAAAAAAAAAAAAAAgAAAAQAAAAAAAAAAAAAAAIAAAAMAAAAAAAAA +AAAAAACAAAAHAAAAAAAAAAAAAAAAwAB//wAAAAAAAAAAAAAAAOAA//8AAAAAAAAAAAAAAADwAf// +AAAAAAAAAAAAAAAA+AP//wAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAD/////AAAAAAAAAAAA +AAAA/////wAAAAAAAAAAAAAAAA== + + +AQAAABQAAAAAAAAABAAAAP////8= + + + diff --git a/inetsrv/uddi/source/mmc/uddimmc.manifest b/inetsrv/uddi/source/mmc/uddimmc.manifest new file mode 100644 index 0000000..4e9740b --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddimmc.manifest @@ -0,0 +1,22 @@ + + + +UDDI Services MMC Snapin + + + + + + diff --git a/inetsrv/uddi/source/mmc/uddiservicesnode.cpp b/inetsrv/uddi/source/mmc/uddiservicesnode.cpp new file mode 100644 index 0000000..0dd9dcd --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddiservicesnode.cpp @@ -0,0 +1,1017 @@ +#include "uddiservicesnode.h" +#include "uddisitenode.h" +#include "webservernode.h" +#include +#include + +// {7334C141-C93C-4bb5-BB36-BDEE77BA2D87} +const GUID CUDDIServicesNode::thisGuid = { 0x7334c141, 0xc93c, 0x4bb5, { 0xbb, 0x36, 0xbd, 0xee, 0x77, 0xba, 0x2d, 0x87 } }; + +//============================================================== +// +// CUDDIServicesNode implementation +// +// +CUDDIServicesNode::CUDDIServicesNode() + : m_strRemoteComputerName( _T("") ) +{ +} + +void CUDDIServicesNode::SetRemoteComputerName( LPCTSTR szRemoteComputerName ) +{ + m_strRemoteComputerName = szRemoteComputerName; +} + +LPCTSTR CUDDIServicesNode::GetRemoteComputerName() +{ + return m_strRemoteComputerName.c_str(); +} + +CUDDIServicesNode::~CUDDIServicesNode() +{ + if( !IsExtension() ) + { + SaveUDDISites(); + } + ClearChildMap(); +} + + +BOOL CUDDIServicesNode::IsDirty() +{ + return m_bIsDirty; +} + +HRESULT CUDDIServicesNode::Load( IStream *pStm ) +{ + return S_OK; +#if 0 + if( IsExtension() ) + return S_OK; + + ULONG ulSize = 0; + ULONG ulRead = 0; + HRESULT hr = pStm->Read( &ulSize, sizeof( ulSize ), &ulRead ); + if( FAILED(hr) ) + { + return hr; + } + + if( ulSize ) + { + // + // There are database servers saved in the file + // + + // + // Read the saved string into a buffer + // + PTCHAR szDatabaseNames = new TCHAR[ ulSize + 1 ]; + if( NULL == szDatabaseNames ) + { + return E_OUTOFMEMORY; + } + + hr =pStm->Read( szDatabaseNames, ulSize * sizeof( TCHAR ), &ulRead ); + if( FAILED(hr) ) + { + delete [] szDatabaseNames; + return hr; + } + + // + // Terminate the buffer + // + szDatabaseNames[ ulSize ] = NULL; + + // + // Use begin and end to bracket each server name and + // instance name. When a pair is found add the database instance + // node to the collection of child nodes. + // A % character is used as the delimiter. + // + PTCHAR begin = szDatabaseNames; + PTCHAR end = szDatabaseNames; + int n = 0; + PTCHAR szTempServerName = NULL; + BOOL bLookingForServerName = TRUE; + + while( *end ) + { + if( _T('%') == *end ) + { + // + // Found either the database name or the instance name + // + *end = NULL; + + if( bLookingForServerName ) + { + // + // Found the server name, save it and keep + // searching for the instance name + // before we add a node. + // + szTempServerName = begin; + bLookingForServerName = FALSE; + } + else + { + // + // Found the instance name + // Construct and add the node to the collection + // + m_mapChildren[ n ] = CUDDISiteNode::Create( szTempServerName, begin, n, this, FALSE ); + n++; + bLookingForServerName = TRUE; + } + + // + // Update the pointers past the delimiter + // + end++; + begin = end; + } + else + { + end++; + } + } + } + return S_OK; +#endif +} + +HRESULT CUDDIServicesNode::Save( IStream *pStm, BOOL fClearDirty ) +{ + return S_OK; + +#if 0 + if( IsExtension() ) + return S_OK; + + // + // Create a string buffer of strings delimited by % + // + tstring str( _T("") ); + + for( CChildMap::iterator iter = m_mapChildren.begin(); + iter != m_mapChildren.end(); iter++ ) + { + CUDDISiteNode* pNode = (CUDDISiteNode*) iter->second; + + if( !pNode->IsDeleted() ) + { + // + // Server Name + // + str.append( pNode->GetName() ); + str.append( _T("%") ); + + // + // Database Instance Name + // + str.append( pNode->GetInstanceName() ); + str.append( _T("%") ); + } + } + + // + // Write out the size of the string into the stream + // + ULONG ulSize = (ULONG) str.length(); + ULONG ulWritten = 0; + HRESULT hr = pStm->Write( &ulSize, sizeof( ulSize ), &ulWritten ); + _ASSERT( SUCCEEDED(hr) ); + + // + // Write the computer names out to the stream + // + hr = pStm->Write( str.c_str(), ulSize * sizeof( TCHAR ), &ulWritten ); + + // + // Clear the dirty flag if requested + // + if( fClearDirty ) + m_bIsDirty = FALSE; + + return hr; +#endif + +} + +ULONG CUDDIServicesNode::GetSizeMax() +{ + ULONG ulSize = 0; + + return (ULONG) ( m_mapChildren.size() * 512 ); +} + +HRESULT CUDDIServicesNode::OnAddMenuItems( IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed ) +{ + HRESULT hr = S_OK; + if( !IsExtension() ) + { + WCHAR szDatabaseServerMenuText[ MAX_PATH ]; + WCHAR szDatabaseServerMenuDescription[ MAX_PATH ]; + + LoadStringW( g_hinst, IDS_DATABASE_SERVER_ADD, szDatabaseServerMenuText, ARRAYLEN( szDatabaseServerMenuText ) ); + LoadStringW( g_hinst, IDS_DATABASE_SERVER_DESCRIPTION, szDatabaseServerMenuDescription, ARRAYLEN( szDatabaseServerMenuDescription ) ); + + CONTEXTMENUITEM menuItemsNew[] = + { + { + szDatabaseServerMenuText, szDatabaseServerMenuDescription, + IDM_NEW_DBSERVER, CCM_INSERTIONPOINTID_PRIMARY_TOP, 0, 0 + }, + { NULL, NULL, 0, 0, 0 } + }; + + // + // Loop through and add each of the menu items, we + // want to add to new menu, so see if it is allowed. + // + if( *pInsertionsAllowed & CCM_INSERTIONALLOWED_TOP ) + { + for( LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++ ) + { + hr = pContextMenuCallback->AddItem( m ); + if( FAILED(hr) ) + break; + } + } + } + + return hr; +} + +CDelegationBase * +CUDDIServicesNode::FindChild( LPCTSTR szName ) +{ + for( CChildMap::iterator iter = m_mapChildren.begin(); + iter != m_mapChildren.end(); iter++ ) + { + CUDDISiteNode* pNode = reinterpret_cast( iter->second ); + if( NULL == pNode ) + { + continue; + } + + if( !pNode->IsDeleted() && ( 0 == _tcsicmp( szName, pNode->GetName() ) ) ) + return iter->second; + } + + return NULL; +} + +HRESULT CUDDIServicesNode::OnMenuCommand( IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject ) +{ + if( ( NULL == pConsole ) || ( NULL == pConsoleNameSpace ) || ( NULL == pDataObject ) ) + { + return E_INVALIDARG; + } + + if( IDM_NEW_DBSERVER != lCommandID ) + { + return S_OK; + } + + // + // Add a new site to the console + // + HWND hwndConsole = NULL; + HRESULT hr = pConsole->GetMainWindow( &hwndConsole ); + if( FAILED(hr) ) + { + return hr; + } + + DatabaseData data; + data.pBase = this; + INT_PTR nResult = DialogBoxParam( g_hinst, MAKEINTRESOURCE( IDD_SITE_CONNECT ), hwndConsole, CUDDISiteNode::NewDatabaseServerDialogProc, (LPARAM) &data ); + + if( nResult ) + { + try + { + // + // Check to make sure this has the database component installed + // + if( !CUDDISiteNode::IsDatabaseServer( data.szServerName, data.szInstanceName ) ) + { + _TCHAR szMessage[ 512 ]; + _TCHAR szTitle[ 128 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + + MessageBox( hwndConsole, + szMessage, + szTitle, + MB_OK ); + + return S_OK; + } + + if( FindChild( data.szServerName ) ) + { + _TCHAR szMessage[ 512 ]; + _TCHAR szTitle[ 128 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_ALREADY_EXISTS, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + + MessageBox( hwndConsole, + szMessage, + szTitle, + MB_OK ); + + return S_OK; + } + + // + // Create new UDDI Site node. This call to Create will throw a CUDDIException + // if it is unable to connect to the database on szServerName. + // + int n = (int) m_mapChildren.size(); + CUDDISiteNode *pSiteNode = CUDDISiteNode::Create( data.szServerName, data.szInstanceName, n, this, m_bIsExtension ); + m_mapChildren[ n ] = pSiteNode; + + SCOPEDATAITEM sdi; + ZeroMemory( &sdi, sizeof(SCOPEDATAITEM) ); + + sdi.mask = SDI_STR | // Displayname is valid + SDI_PARAM | // lParam is valid + SDI_IMAGE | // nImage is valid + SDI_OPENIMAGE | // nOpenImage is valid + SDI_PARENT | + SDI_CHILDREN; + + sdi.relativeID = GetScopeItemValue(); + sdi.nImage = m_mapChildren[ n ]->GetBitmapIndex(); + sdi.nOpenImage = MMC_IMAGECALLBACK; + sdi.displayname = MMC_CALLBACK; + sdi.lParam = (LPARAM) m_mapChildren[ n ]; + sdi.cChildren = m_mapChildren[ n ]->HasChildren(); + + hr = pConsoleNameSpace->InsertItem( &sdi ); + _ASSERT( SUCCEEDED(hr) ); + + m_mapChildren[ n ]->SetScopeItemValue( sdi.ID ); + m_mapChildren[ n ]->SetParentScopeItem( sdi.relativeID ); + + IConsoleNameSpace2 *pNS2 = NULL; + hr = pConsoleNameSpace->QueryInterface( IID_IConsoleNameSpace2, reinterpret_cast( &pNS2 ) ); + if( FAILED(hr) ) + { + return hr; + } + + pNS2->Expand( sdi.ID ); + pNS2->Release(); + + m_bIsDirty = TRUE; + } + catch( CUDDIException &e ) + { + UDDIMsgBox( hwndConsole, (LPCTSTR) e, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + return E_FAIL; + } + catch( ... ) + { + UDDIMsgBox( hwndConsole, IDS_ERROR_ADDSVC, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + return E_UNEXPECTED; + } + } + return S_OK; +} + +const _TCHAR *CUDDIServicesNode::GetDisplayName( int nCol ) +{ + _TCHAR wszName[ 256 ]; + + switch( nCol ) + { + case 0: + LoadString( g_hinst, IDS_UDDIMMC_SNAPINNAME, wszName, ARRAYLEN( wszName ) ); + break; + + case 1: + LoadString( g_hinst, IDS_UDDIMMC_TYPE, wszName, ARRAYLEN( wszName ) ); + break; + + case 2: + LoadString( g_hinst, IDS_UDDIMMC_DESCRIPTION, wszName, ARRAYLEN( wszName ) ); + break; + + default: + _tcscpy( wszName, _T("") ); + break; + } + + m_strDisplayName = wszName; + + return m_strDisplayName.c_str(); +} + +HRESULT CUDDIServicesNode::OnShow( IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem ) +{ + HRESULT hr = S_OK; + + IHeaderCtrl *pHeaderCtrl = NULL; + IResultData *pResultData = NULL; + + hr = pConsole->QueryInterface( IID_IHeaderCtrl, (void **)&pHeaderCtrl ); + if( FAILED(hr) ) + { + return hr; + } + + hr = pConsole->QueryInterface( IID_IResultData, (void **)&pResultData ); + if( FAILED(hr) ) + { + pHeaderCtrl->Release(); + return hr; + } + + if( bShow ) + { + // + // Set the column headers in the results pane + // + WCHAR szColumnName[ 256 ]; + ::LoadStringW( g_hinst, IDS_DATABASE_SERVER_COLUMN_NAME, szColumnName, ARRAYLEN( szColumnName ) ); + hr = pHeaderCtrl->InsertColumn( 0, szColumnName, 0, 150 ); + _ASSERT( S_OK == hr ); + + ::LoadStringW( g_hinst, IDS_DATABASE_SERVER_COLUMN_COMPUTER, szColumnName, ARRAYLEN( szColumnName ) ); + hr = pHeaderCtrl->InsertColumn( 1, szColumnName, 0, 150 ); + _ASSERT( S_OK == hr ); + + ::LoadStringW( g_hinst, IDS_DATABASE_SERVER_COLUMN_INSTANCE, szColumnName, ARRAYLEN( szColumnName ) ); + hr = pHeaderCtrl->InsertColumn( 2, szColumnName, 0, 150 ); + _ASSERT( S_OK == hr ); + + ::LoadStringW( g_hinst, IDS_DATABASE_SERVER_COLUMN_DESCRIPTION, szColumnName, ARRAYLEN( szColumnName ) ); + hr = pHeaderCtrl->InsertColumn( 3, szColumnName, 0, 150 ); + _ASSERT( S_OK == hr ); + + pHeaderCtrl->Release(); + pResultData->Release(); + } + else + { +// pResultData->DeleteAllRsltItems(); + } + + return hr; +} + +HRESULT +CUDDIServicesNode::OnExpand( IConsoleNameSpace *pConsoleNameSpace, + IConsole *pConsole, + HSCOPEITEM parent ) +{ + if( ( NULL == pConsoleNameSpace ) || ( NULL == pConsole ) || ( NULL == parent ) ) + { + return E_INVALIDARG; + } + + HWND hwndConsole = NULL; + HRESULT hr = pConsole->GetMainWindow( &hwndConsole ); + if( FAILED(hr) ) + { + return hr; + } + + // + // Cache static node's HSCOPEITEM for future use + // + SetScopeItemValue( parent ); + + wstring wszTargetComputerName; + + if( IsExtension() && m_strRemoteComputerName.length() > 0 ) + { + // + // The computer management console has been retargeted use the + // computer name from the console. + // + wszTargetComputerName = m_strRemoteComputerName; + } + else + { + // + // Use the local machine name + // + WCHAR wszLocalComputerName[ 256 ]; + DWORD dwSize = ARRAYLEN( wszLocalComputerName ); + wszLocalComputerName[ 0 ] = 0x00; + ::GetComputerName( wszLocalComputerName, &dwSize ); + wszTargetComputerName = wszLocalComputerName; + } + + LoadUDDISites( hwndConsole, wszTargetComputerName ); + + // + // Create the child nodes, then expand them + // + SCOPEDATAITEM sdi; + for( CChildMap::iterator iter = m_mapChildren.begin(); + iter != m_mapChildren.end(); iter++ ) + { + ZeroMemory( &sdi, sizeof(SCOPEDATAITEM) ); + + sdi.mask = SDI_STR | // Displayname is valid + SDI_PARAM | // lParam is valid + SDI_IMAGE | // nImage is valid + SDI_OPENIMAGE | // nOpenImage is valid + SDI_PARENT | + SDI_CHILDREN; + + sdi.relativeID = (HSCOPEITEM) parent; + sdi.nImage = iter->second->GetBitmapIndex(); + sdi.nOpenImage = MMC_IMAGECALLBACK; + sdi.displayname = MMC_CALLBACK; + sdi.lParam = (LPARAM) iter->second; + sdi.cChildren = iter->second->HasChildren(); + + hr = pConsoleNameSpace->InsertItem( &sdi ); + _ASSERT( SUCCEEDED(hr) ); + + iter->second->SetScopeItemValue( sdi.ID ); + iter->second->SetParentScopeItem( sdi.relativeID ); + + IConsoleNameSpace2 *pNS2 = NULL; + hr = pConsoleNameSpace->QueryInterface( IID_IConsoleNameSpace2, reinterpret_cast( &pNS2 ) ); + if( FAILED(hr) ) + { + return hr; + } + + pNS2->Expand( sdi.ID ); + pNS2->Release(); + } + + return hr; +} + +HRESULT +CUDDIServicesNode::OnShowContextHelp( IDisplayHelp *pDisplayHelp, LPOLESTR helpFile ) +{ + try + { + if( ( NULL == pDisplayHelp ) || ( NULL == helpFile ) ) + { + return E_INVALIDARG; + } + + wstring wstrTopicName = helpFile; + wstrTopicName += g_wszUddiServicesNodeHelp; + + LPOLESTR pszTopic = static_cast( CoTaskMemAlloc( ( wstrTopicName.length() + 1 ) * sizeof(WCHAR) ) ); + if( NULL == pszTopic ) + { + return E_OUTOFMEMORY; + } + + wcsncpy( pszTopic, wstrTopicName.c_str(), wstrTopicName.length() ); + pszTopic[ wstrTopicName.length() ] = NULL; + + return pDisplayHelp->ShowTopic( pszTopic ); + } + catch( ... ) + { + return E_OUTOFMEMORY; + } +} + + +HRESULT +CUDDIServicesNode::RemoveChildren( IConsoleNameSpace *pNS ) +{ + if( NULL == pNS ) + { + return E_INVALIDARG; + } + + for( CChildMap::iterator iter = m_mapChildren.begin(); + iter != m_mapChildren.end(); iter++ ) + { + CDelegationBase *pBase = reinterpret_cast( iter->second ); + pBase->RemoveChildren( pNS ); + + HSCOPEITEM hsi = pBase->GetScopeItemValue(); + pNS->DeleteItem( hsi, TRUE ); + } + + ClearChildMap(); + + pNS->DeleteItem( GetScopeItemValue(), TRUE ); + return S_OK; +} +HRESULT +CUDDIServicesNode::OnRefresh( IConsole *pConsole ) +{ + if( NULL == pConsole ) + { + return S_FALSE; + } + + CChildMap::iterator it = m_mapChildren.begin(); + while( it != m_mapChildren.end() ) + { + it->second->OnRefresh( pConsole ); + it++; + } + + return S_OK; +} + +HRESULT CUDDIServicesNode::OnSelect( CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect ) +{ + if( ( NULL == pComponent ) || ( NULL == pConsole ) ) + { + return E_INVALIDARG; + } + + HRESULT hr = E_FAIL; + if( bSelect ) + { + // + // Enable refresh verb + // + IConsoleVerb *pConsoleVerb = NULL; + + hr = pConsole->QueryConsoleVerb( &pConsoleVerb ); + if( FAILED(hr) ) + { + return hr; + } + + hr = pConsoleVerb->SetVerbState( MMC_VERB_OPEN, ENABLED, TRUE ); + if( FAILED(hr) ) + { + pConsoleVerb->Release(); + return hr; + } + + hr = pConsoleVerb->SetVerbState( MMC_VERB_REFRESH, ENABLED, TRUE ); + if( FAILED(hr) ) + { + pConsoleVerb->Release(); + return hr; + } + + hr = pConsoleVerb->SetVerbState( MMC_VERB_DELETE, HIDDEN, TRUE ); + + pConsoleVerb->Release(); + } + + return hr; +} + +// +// The sole purpose of this function is to put the appropriate entries into +// m_mapChildren. These entries are almost always CUDDISiteNode *'s, except +// in 1 case when there can be exactly 1 CUDDIWebServerNode *. +// +// The entries in m_mapChildren are determined by 3 factors: +// +// 1. Wether we are running inside Computer Management as +// an extension, or not. +// 2. Wether the machine we are filling m_mapChildren for +// hosts a UDDI Site, or not. +// 3. Wether the machine we are filling m_mapChildren for +// hosts a UDDI Web Server, or not. +// +// -------------------------------------------------------------------------- +// Is Extension - If we are running as an extension of Computer Management, +// then we want to show only the UDDI bits that are located +// on the computer, AND NOTHING ELSE. +// -------------------------------------------------------------------------- +// TRUE : Do nothing. +// -------------------------------------------------------------------------- +// FALSE : Create 1 entry in m_mapChildren for each persisted UDDI Site. +// -------------------------------------------------------------------------- +// +// +// -------------------------------------------------------------------------- +// Host for UDDI Site - If szComputerName is host of a UDDI Site, then we +// must ensure that that UDDI Site is present +// in m_mapChildren. +// -------------------------------------------------------------------------- +// TRUE : Attempt to add an entry to m_mapChildren which represents the +// UDDI Site, if one does not already exist. +// -------------------------------------------------------------------------- +// FALSE : Do nothing. +// -------------------------------------------------------------------------- +// +// +// -------------------------------------------------------------------------- +// Host for UDDI Web Server - If we are running as an extension, we can only +// show the UDDI bits on this particular computer. +// So, show just the UDDI Web Server node. If not +// running as an extension, add the UDDI Site that +// the UDDI Web Server belongs to. +// -------------------------------------------------------------------------- +// TRUE : If Extension, add an entry for that UDDI Web Server node to +// m_mapChildren. +// If not, determine the UDDI Site that the UDDI Web Server belongs +// to, and add an entry for that UDDI Site. +// -------------------------------------------------------------------------- +// FALSE : Do nothing. +// -------------------------------------------------------------------------- +// +BOOL +CUDDIServicesNode::LoadUDDISites( HWND hwndConsole, const tstring& szComputerName ) +{ + try + { + BOOL fRet = TRUE; + + list< wstring > failedSiteRefs; + failedSiteRefs.clear(); + + ClearChildMap(); + + // + // ---- #1 ---- + // + // If we are NOT running as an extension of Computer Management, then + // load our list of persisted UDDI Sites. + // + if( FALSE == IsExtension() ) + { + try + { + CUDDIRegistryKey sitesKey( HKEY_CURRENT_USER, + g_szUDDIAdminSites, + KEY_ALL_ACCESS, + szComputerName.c_str() ); + + HKEY hSitesKey = sitesKey.GetCurrentHandle(); + if( NULL == hSitesKey ) + { + fRet = FALSE; + } + + DWORD dwIndex = 0; + int n = 0; + + WCHAR szComputer[ 128 ]; + WCHAR szInstance[ 128 ]; + DWORD dwNameSize; + DWORD dwValueSize; + DWORD dwType = REG_SZ; + + dwNameSize = 128; + dwValueSize = 128 * sizeof( WCHAR ); + memset( szComputer, 0, 128 * sizeof( WCHAR ) ); + memset( szInstance, 0, 128 * sizeof( WCHAR ) ); + + LONG lRet = RegEnumValue( hSitesKey, + dwIndex, + szComputer, + &dwNameSize, + NULL, + &dwType, + (LPBYTE)szInstance, + &dwValueSize ); + + while( ( ERROR_NO_MORE_ITEMS != lRet ) && ( ERROR_SUCCESS == lRet ) ) + { + // + // This call to Create will throw if it cannot connect to the + // database on szComputer. However, this might be 1 of many + // UDDI Sites we are trying to create a reference to! Instead + // of exiting immediately here, just tell the user that there + // was a problem, and continue on with the next Site in the list. + // + try + { + if( CUDDISiteNode::IsDatabaseServer( szComputer, szInstance ) ) + { + ToUpper( szComputer ); + + CUDDISiteNode *pSiteNode = CUDDISiteNode::Create( szComputer, szInstance, n, this, FALSE ); + m_mapChildren[ n ] = pSiteNode; + n++; + } + dwIndex++; + } + catch( CUDDIException &e ) + { + UDDIMsgBox( hwndConsole, e, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + dwIndex++; + + failedSiteRefs.push_back( szComputer ); + } + + dwNameSize = 128; + dwValueSize = 128 * sizeof( WCHAR ); + memset( szComputer, 0, 128 * sizeof( WCHAR ) ); + memset( szInstance, 0, 128 * sizeof( WCHAR ) ); + + lRet = RegEnumValue( hSitesKey, + dwIndex, + szComputer, + &dwNameSize, + NULL, + &dwType, + (LPBYTE)szInstance, + &dwValueSize ); + } + } + catch( ... ) + { + // + // If we are in here, it is most likely that the registry key containing + // the names of the persisted UDDI Sites does not exist. If this is the + // case, continue on silently and try to determine if the local machine + // is host for a UDDI Site and/or a UDDI Web Server. + // + fRet = FALSE; + } + + } + + + // + // ---- #2 ---- + // + // If the machine that we are running on is host for a + // UDDI Site, and that Site is currently not in our list + // of Sites that are to be displayed, then add it. + // + if( CUDDISiteNode::IsDatabaseServer( (WCHAR *)szComputerName.c_str() ) && + ( NULL == FindChild( szComputerName.c_str() ) ) && + ( failedSiteRefs.end() == find( failedSiteRefs.begin(), failedSiteRefs.end(), szComputerName ) ) ) + { + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup\\DBServer" ), + KEY_READ, + szComputerName ); + int iSize = m_mapChildren.size(); + tstring strInstance; + strInstance = key.GetString( _T("InstanceNameOnly"), _T("----") ); + CUDDISiteNode* pNode = CUDDISiteNode::Create( (WCHAR *)szComputerName.c_str(), + (WCHAR *)InstanceRealName( strInstance.c_str() ), + iSize, + this, + m_bIsExtension ); + m_mapChildren[ iSize ] = pNode; + } + catch( CUDDIException &e ) + { + UDDIMsgBox( hwndConsole, e, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + fRet = FALSE; + } + catch( ... ) + { + fRet = FALSE; + } + } + + + // + // ---- #3 ---- + // + // Determine if the local machine hosts a UDDI Web Server. If it does, + // determine which UDDI Site it is associated with, by examining the + // connection string. + // + if( CUDDIWebServerNode::IsWebServer( szComputerName.c_str() ) ) + { + wstring wszConnStrWriter; + wstring wszDomain, wszServer, wszInstance; + + CUDDIWebServerNode::GetWriterConnectionString( szComputerName, wszConnStrWriter ); + CUDDIWebServerNode::CrackConnectionString( wszConnStrWriter, + wszDomain, + wszServer, + wszInstance ); + + if( NULL == FindChild( wszServer.c_str() ) ) + { + // + // If we are running as an extension of Computer Management, then + // display JUST THE UDDI WEB SERVER. + // + // If we are running as the UDDI Admin Console, then add a UDDI + // Site Node which represents the Site which the Web Server is + // part of. + // + if( IsExtension() ) + { + try + { + int iSize = m_mapChildren.size(); + CUDDIWebServerNode* pNode = new CUDDIWebServerNode( szComputerName.c_str(), iSize, 0, IsExtension() ); + m_mapChildren[ iSize ] = pNode; + } + catch( CUDDIException &e ) + { + UDDIMsgBox( hwndConsole, e, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + fRet = FALSE; + } + catch( ... ) + { + fRet = FALSE; + } + } + else if( failedSiteRefs.end() == find( failedSiteRefs.begin(), failedSiteRefs.end(), wszServer ) ) + { + try + { + if( ( 0 != wszServer.length() ) && CUDDISiteNode::IsDatabaseServer( (TCHAR *)wszServer.c_str() ) ) + { + int iSize = m_mapChildren.size(); + CUDDISiteNode* pNode = CUDDISiteNode::Create( (WCHAR *)wszServer.c_str(), + (WCHAR *)InstanceRealName( wszInstance.c_str() ), + iSize, + this, + m_bIsExtension ); + m_mapChildren[ iSize ] = pNode; + } + } + catch( CUDDIException &e ) + { + UDDIMsgBox( hwndConsole, e, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + fRet = FALSE; + } + catch( ... ) + { + fRet = FALSE; + } + } + } + } + + return fRet; + } + catch( CUDDIException &e ) + { + throw e; + } + catch(...) + { + return FALSE; + } +} + + +BOOL +CUDDIServicesNode::SaveUDDISites() +{ + try + { + if( CUDDIRegistryKey::KeyExists( HKEY_CURRENT_USER, g_szUDDIAdminSites ) ) + { + CUDDIRegistryKey::DeleteKey( HKEY_CURRENT_USER, g_szUDDIAdminSites ); + } + + CUDDIRegistryKey::Create( HKEY_CURRENT_USER, g_szUDDIAdminSites ); + + CUDDIRegistryKey sitesKey( HKEY_CURRENT_USER, g_szUDDIAdminSites, KEY_ALL_ACCESS ); + + for( CChildMap::iterator iter = m_mapChildren.begin(); iter != m_mapChildren.end(); iter++ ) + { + CUDDISiteNode* pNode = reinterpret_cast( iter->second ); + if( ( NULL != pNode ) && ( !pNode->IsDeleted() ) ) + { + sitesKey.SetValue( pNode->GetName(), pNode->GetInstanceName() ); + } + } + + return TRUE; + } + catch(...) + { + return FALSE; + } +} + + +void CUDDIServicesNode::ClearChildMap() +{ + for( CChildMap::iterator iter = m_mapChildren.begin(); + iter != m_mapChildren.end(); iter++ ) + { + delete iter->second; + iter->second = NULL; + } + + m_mapChildren.clear(); +} + + +BOOL +CUDDIServicesNode::ChildExists( const WCHAR *pwszName ) +{ + if( NULL == pwszName ) + { + return FALSE; + } + + return ( NULL == FindChild( pwszName ) ) ? FALSE : TRUE; +} diff --git a/inetsrv/uddi/source/mmc/uddiservicesnode.h b/inetsrv/uddi/source/mmc/uddiservicesnode.h new file mode 100644 index 0000000..225c580 --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddiservicesnode.h @@ -0,0 +1,59 @@ +#pragma once + +#include "delebase.h" +#include +using namespace std; +class CUDDISiteNode; + +typedef map CChildMap; +typedef pair CChildMapEntry; + +class CUDDIServicesNode : public CDelegationBase +{ +public: + CUDDIServicesNode(); + virtual ~CUDDIServicesNode(); + + virtual const _TCHAR *GetDisplayName( int nCol = 0 ); + virtual const GUID & getNodeType() { return thisGuid; } + virtual const int GetBitmapIndex() { return INDEX_UDDISERVICES; } + virtual BOOL ChildExists( const WCHAR *pwszName ); + + virtual BOOL IsDirty(); + virtual HRESULT Load( IStream *pStm ); + virtual HRESULT Save( IStream *pStm, BOOL fClearDirty ); + virtual ULONG GetSizeMax(); + +public: + // + // Virtual functions go here (for MMCN_*) + // + virtual HRESULT OnExpand( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent ); + virtual HRESULT OnShowContextHelp( IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile ); + virtual HRESULT OnShow( IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem ); + virtual HRESULT OnAddMenuItems( IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed ); + virtual HRESULT OnMenuCommand( IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject ); + virtual HRESULT OnRefresh( IConsole *pConsole ); + virtual HRESULT OnSelect( CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect ); + virtual HRESULT RemoveChildren( IConsoleNameSpace *pNS ); + + void SetRemoteComputerName( LPCTSTR szRemoteComputerName ); + LPCTSTR GetRemoteComputerName(); + CDelegationBase* FindChild( LPCTSTR szName ); + +private: + BOOL LoadUDDISites( HWND hwndConsole, const tstring& szComputerName ); + BOOL SaveUDDISites(); + + void ClearChildMap(); + +private: + CChildMap m_mapChildren; + LONG_PTR m_ppHandle; + BOOL m_bIsDirty; + tstring m_strDisplayName; + tstring m_strRemoteComputerName; + + enum menuItems { IDM_NEW_DBSERVER = 1 }; + static const GUID thisGuid; +}; diff --git a/inetsrv/uddi/source/mmc/uddisitenode.cpp b/inetsrv/uddi/source/mmc/uddisitenode.cpp new file mode 100644 index 0000000..a6a7319 --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddisitenode.cpp @@ -0,0 +1,3960 @@ +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#include +#include + +#include "uddisitenode.h" +#include "webservernode.h" +#include "comp.h" +#include "compdata.h" +#include "dataobj.h" +#include "globals.h" +#include "resource.h" +#include "objectpicker.h" +#include +#include +#include + +#include +#include +#include +#include "net_config_get.h" +#include "net_config_save.h" +#include "ADM_execResetKeyImmediate.h" +#include "ADM_setAdminAccount.h" + +#include + +#include "uddi.h" +#include "scppublisher.h" + +BOOL RefreshInstances( HWND hwndList, PTCHAR szComputerName = _T("") ); +BOOL GetInstances( PTCHAR szComputer, StringVector& instances ); + +// {53186FE3-F178-460c-8F3B-352549292B91} +const GUID CUDDISiteNode::thisGuid = { 0x53186fe3, 0xf178, 0x460c, { 0x8f, 0x3b, 0x35, 0x25, 0x49, 0x29, 0x2b, 0x91 } }; + +UINT CUDDISiteNode::m_nNextChildID = 0; + +//============================================================== +// +// CDBSchemaVersion implementation +// +// +CDBSchemaVersion::CDBSchemaVersion() : + m_major( -1 ), + m_minor( -1 ), + m_build( -1 ), + m_rev( -1 ) +{} + +BOOL +CDBSchemaVersion::IsCompatible( const CDBSchemaVersion& version ) +{ + // + // The major and minor versions MUST be equal in order for the versions to be + // compatible. Other values are ignored. + // + return ( m_major == version.m_major ) && + ( m_minor == version.m_minor ); +} + +BOOL +CDBSchemaVersion::Parse( const tstring& versionString ) +{ + szVersion = versionString; + int length = versionString.length(); + + _TCHAR *buffer = new _TCHAR[ length + 1]; + if( NULL == buffer ) + { + throw E_OUTOFMEMORY; + return FALSE; + } + _tcscpy( buffer, versionString.c_str() ); + + m_major = GetPart( _tcstok( buffer, _T(".") ) ); + m_minor = GetPart( _tcstok( NULL, _T(".") ) ); + m_build = GetPart( _tcstok( NULL, _T(".") ) ); + m_rev = GetPart( _tcstok( NULL, _T(".") ) ); + + delete[] buffer; + buffer = NULL; + + return ( m_major != -1 && + m_minor != -1 && + m_build != -1 && + m_rev != -1 ); +} + +int +CDBSchemaVersion::GetPart( const _TCHAR* token ) +{ + if( NULL == token ) + { + return -1; + } + + int part = _tstoi( token ); + if( 0 == part && 0 != _tcscmp( token, _T( "0" ) ) ) + { + return -1; + } + + return part; +} + +//============================================================== +// +// CUDDISiteNode implementation +// +// +CUDDISiteNode::CUDDISiteNode( _TCHAR *szName, _TCHAR *szInstanceName, int id, CUDDIServicesNode *parent, BOOL bExtension ) + : m_szName(NULL) + , m_szInstanceName(NULL) + , m_ppHandle( 0 ) + , m_isDeleted( FALSE ) + , m_pParent( parent ) + , m_bIsDirty( FALSE ) + , m_bStdSvr( TRUE ) +{ + OutputDebugString( _T("Site Information Follows:\n" ) ); + OutputDebugString( _T("Computer: ") ); + OutputDebugString( szName ); + OutputDebugString( _T("\nInstance: " ) ); + OutputDebugString( szInstanceName ); + OutputDebugString( _T("\n") ); + + m_szName = new _TCHAR[ ( _tcslen( szName ) + 1 ) ]; + _tcscpy( m_szName, szName ); + + tstring strFullyQualifiedInstanceName; + CUDDISiteNode::GetFullyQualifiedInstanceName( szName, strFullyQualifiedInstanceName ); + + m_szInstanceName = new _TCHAR[ strFullyQualifiedInstanceName.length() + 1 ]; + _tcscpy( m_szInstanceName, strFullyQualifiedInstanceName.c_str() ); + + m_bIsExtension = bExtension; +} + +CUDDISiteNode::~CUDDISiteNode() +{ + ClearChildMap(); + + if( m_szName ) + delete [] m_szName; + + if( m_szInstanceName ) + delete [] m_szInstanceName; + +} + +BOOL +CUDDISiteNode::ChildExists( const WCHAR *pwszName ) +{ + if( NULL == pwszName ) + { + return FALSE; + } + + return ( NULL == FindChild( pwszName ) ) ? FALSE : TRUE; +} + + +BOOL +CUDDISiteNode::HasChildren() +{ + if( 0 == m_mapConfig.size() && !CUDDIWebServerNode::IsWebServer( m_szName ) ) + return FALSE; + + return TRUE; +} + + +CUDDIServicesNode * +CUDDISiteNode::GetStaticNode() +{ + return m_pParent; +} + + +HRESULT +CUDDISiteNode::GetData() +{ + HRESULT hr = E_FAIL; + try + { + m_mapConfig.clear(); + + // + // Determine if the OS that this site node is running on is Windows Server 2003 Standard or not. + // + hr = IsStandardServer( m_szName, &m_bStdSvr ); + if( FAILED(hr) ) + { + THROW_UDDIEXCEPTION_ST( hr, IDS_DOT_NET_SERVER, g_hinst ); + } + + // + // Initialize the map to the default settings + // + m_mapConfig[ UDDI_AUTHENTICATION_MODE ] = _T( "3" ); + m_mapConfig[ UDDI_REQUIRE_SSL ] = _T( "1" ); + + m_mapConfig[ UDDI_ADMIN_GROUP ] = _T( "S-1-5-32-544" ); + m_mapConfig[ UDDI_COORDINATOR_GROUP ] = _T( "S-1-5-32-544" ); + m_mapConfig[ UDDI_PUBLISHER_GROUP ] = _T( "S-1-5-32-544" ); + m_mapConfig[ UDDI_USER_GROUP ] = _T( "S-1-5-32-545" ); + m_mapConfig[ UDDI_TICKET_TIMEOUT ] = _T( "60" ); + m_mapConfig[ UDDI_KEY_TIMEOUT ] = _T( "7" ); + m_mapConfig[ UDDI_KEY_RESET_DATE ] = _T( "" ); + m_mapConfig[ UDDI_KEY_AUTORESET ] = _T( "0" ); + m_mapConfig[ UDDI_DISCOVERY_URL ] = _T( "" ); + m_mapConfig[ UDDI_FIND_MAXROWS ] = _T( "1000" ); + + // + // Build up the default Site Name in case Site.Name is not specified + // + _TCHAR szBuffer[ 256 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_DEFAULT_SITE_NAME_PREFIX, szBuffer, ARRAYLEN( szBuffer ) - 1 ); + m_mapConfig[ UDDI_SITE_NAME ] = szBuffer; + m_mapConfig[ UDDI_SITE_NAME ] += m_szName; + + // + // Get the setup information + // + CUDDIRegistryKey rootkey( _T( "SOFTWARE\\Microsoft\\UDDI"), KEY_READ, m_szName ); + m_mapConfig[ UDDI_SETUP_LOCATION ] = rootkey.GetString( _T("InstallRoot"), _T("") ); + rootkey.Close(); + + _TCHAR szValue[ 256 ]; + CUDDIRegistryKey setupkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup"), KEY_READ, m_szName ); + m_mapConfig[ UDDI_SETUP_DB ] = _itot( setupkey.GetDWORD( _T("DBServer"), 0 ), szValue, 10 ); + m_mapConfig[ UDDI_SETUP_WEB ] = _itot( setupkey.GetDWORD( _T("WebServer"), 0 ), szValue, 10 ); + m_mapConfig[ UDDI_SETUP_ADMIN ] = _itot( setupkey.GetDWORD( _T("Admin"), 0 ), szValue, 10 ); + setupkey.Close(); + + CUDDIRegistryKey dbkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup\\DBServer"), KEY_READ, m_szName ); + m_mapConfig[ UDDI_SETUP_DATE ] = dbkey.GetString( _T("InstallDate"), _T("") ); + m_mapConfig[ UDDI_SETUP_LANGUAGE ] = dbkey.GetString( _T("ProductLanguage"), _T("") ); + m_mapConfig[ UDDI_SETUP_NAME ] = dbkey.GetString( _T("ProductName"), _T("") ); + m_mapConfig[ UDDI_SETUP_FRAMEWORK_VERSION ] = dbkey.GetString( _T("FrameworkVersion"), _T("") ); + m_mapConfig[ UDDI_SETUP_MANUFACTURER ] = dbkey.GetString( _T("Manufacturer"), _T("") ); + m_mapConfig[ UDDI_SETUP_VERSION ] = dbkey.GetString( _T("ProductVersion"), _T("") ); + dbkey.Close(); + + // + // Populate the configuration map from the database + // + hr = GetConfig( m_mapConfig, GetConnectionStringOLEDB() ); + if( FAILED(hr) ) + { + THROW_UDDIEXCEPTION_ST( E_FAIL, IDS_DATABASE_SERVER_OLEDB_READ_FAILED, g_hinst ); + } + else + { + // + // Get our version information + // + if( FALSE == m_siteVersion.Parse( m_mapConfig[ UDDI_DBSCHEMA_VERSION ] ) ) + { + _TCHAR szMessage[ 512 ]; + _TCHAR szMessageFormat[ 512 ]; + + memset( szMessage, 0, 512 * sizeof( _TCHAR ) ); + memset( szMessageFormat, 0, 512 * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_DATABASE_SERVER_DBSCHEMA_VERSION_READ_FAILED, szMessageFormat, ARRAYLEN( szMessageFormat ) ); + _sntprintf( szMessage, ARRAYLEN( szMessage ) - 1, szMessageFormat, m_szName ); + + THROW_UDDIEXCEPTION( E_FAIL, szMessage ); + } + + WCHAR wszBuf[ 256 ]; + wszBuf[ 0 ] = 0x00; + LoadString( g_hinst, IDS_UDDIMMC_UNSPECIFIED, wszBuf, ARRAYLEN( wszBuf ) ); + + if( _T( "unspecified" ) == m_mapConfig[ UDDI_SITE_DESCRIPTION ] ) + { + m_mapConfig[ UDDI_SITE_DESCRIPTION ] = wszBuf; + } + + if( _T( "unspecified" ) == m_mapConfig[ UDDI_SITE_NAME ] ) + { + m_mapConfig[ UDDI_SITE_NAME ] = wszBuf; + } + } + } + catch( CUDDIException &e ) + { + // re-throw. + throw e; + } + catch( ... ) + { + if( FALSE == FAILED( hr ) ) + { + hr = E_FAIL; + } + } + + return hr; +} + +const _TCHAR *CUDDISiteNode::GetDisplayName( int nCol ) +{ + switch( nCol ) + { + case 0: + { + m_strDisplayName = m_mapConfig[ UDDI_SITE_NAME ]; + break; + } + case 1: + { + m_strDisplayName = m_szName; + break; + } + + case 2: + { + if( 0 == _tcslen( m_szInstanceName ) ) + m_strDisplayName = DefaultInstanceDisplayName(); + else + m_strDisplayName = m_szInstanceName; + + break; + } + + case 3: + { + m_strDisplayName = m_mapConfig[ UDDI_SITE_DESCRIPTION ]; + break; + } + + default: + { + m_strDisplayName = _T(""); + break; + } + } + + return m_strDisplayName.c_str(); +} + +HRESULT CUDDISiteNode::OnShow( IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem ) +{ + HRESULT hr = S_OK; + + IHeaderCtrl *pHeaderCtrl = NULL; + IResultData *pResultData = NULL; + + if( bShow ) + { + hr = pConsole->QueryInterface( IID_IHeaderCtrl, (void **)&pHeaderCtrl ); + _ASSERT( SUCCEEDED(hr) ); + + hr = pConsole->QueryInterface( IID_IResultData, (void **)&pResultData ); + _ASSERT( SUCCEEDED(hr) ); + + // + // Set the column headers in the results pane + // + + WCHAR szColumnName[ 256 ]; + LoadStringW( g_hinst, IDS_WEBSERVER_COLUMN_NAME, szColumnName, ARRAYLEN( szColumnName ) ); + hr = pHeaderCtrl->InsertColumn( 0, szColumnName, 0, 150 ); + _ASSERT( S_OK == hr ); + + LoadStringW( g_hinst, IDS_WEBSERVER_COLUMN_STATUS, szColumnName, ARRAYLEN( szColumnName ) ); + hr = pHeaderCtrl->InsertColumn( 1, szColumnName, 0, 100 ); + _ASSERT( S_OK == hr ); + + pHeaderCtrl->Release(); + pResultData->Release(); + } + + return hr; +} + +HRESULT CUDDISiteNode::OnExpand( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent ) +{ + // + // Cache static node's HSCOPEITEM for future use + // +// m_hParentHScopeItem = parent; + + if( !m_bExpanded ) + { + // Load up the child nodes. + LoadChildMap( m_mapConfig[ UDDI_SITE_WEBSERVERS ] ); + + return AddChildrenToScopePane( pConsoleNameSpace, GetScopeItemValue() ); + } + + return S_OK; +} + +HRESULT +CUDDISiteNode::RemoveChildren( IConsoleNameSpace *pNS ) +{ + if( NULL == pNS ) + { + return E_INVALIDARG; + } + + for( CUDDIWebServerNodeMap::iterator iter = m_mapChildren.begin(); + iter != m_mapChildren.end(); iter++ ) + { + CUDDIWebServerNode *pWSNode = (CUDDIWebServerNode *)iter->second; + HSCOPEITEM hsi = pWSNode->GetScopeItemValue(); + pNS->DeleteItem( hsi, TRUE ); + } + + ClearChildMap(); + + return S_OK; +} + +HRESULT +CUDDISiteNode::OnPropertyChange( IConsole *pConsole, CComponent *pComponent ) +{ + HRESULT hr = S_FALSE; + + try + { + hr = SaveData(); + if( S_OK != hr ) + return hr; + + hr = GetData(); + if( S_OK != hr ) + return hr; + } + catch( CUDDIException& e ) + { + TCHAR szTitle[ 256 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + HWND hwnd; + pConsole->GetMainWindow( &hwnd ); + MessageBox( hwnd, e.GetEntireError().c_str(), szTitle, MB_ICONERROR | MB_OK | MB_APPLMODAL ); + return E_FAIL; + } + catch(...) + { + return E_FAIL; + } + + // + // Call IConsole::UpdateAllViews to redraw the item + // in all views. We need a data object because of the + // way UpdateAllViews is implemented, and because + // MMCN_PROPERTY_CHANGE doesn't give us one + // + hr = pConsole->UpdateAllViews( NULL, GetScopeItemValue(), 0 ); + + return hr; +} + +HRESULT CUDDISiteNode::OnShowContextHelp(IDisplayHelp *pDisplayHelp, LPOLESTR helpFile) +{ + if( ( NULL == pDisplayHelp ) || ( NULL == helpFile ) ) + { + return E_INVALIDARG; + } + + wstring wstrHelpInfo = helpFile; + wstrHelpInfo += g_wszUddiSiteNodeHelp; + + LPOLESTR pszTopic = static_cast(CoTaskMemAlloc((wstrHelpInfo.length() + 1) * sizeof(WCHAR))); + if( NULL == pszTopic ) + { + return E_OUTOFMEMORY; + } + + wcsncpy( pszTopic, wstrHelpInfo.c_str(), wstrHelpInfo.length() ); + pszTopic[ wstrHelpInfo.length() ] = NULL; + return pDisplayHelp->ShowTopic( pszTopic ); +} + +HRESULT CUDDISiteNode::OnSelect( CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect ) +{ + if( ( NULL == pComponent ) ||( NULL == pConsole ) ) + { + return E_INVALIDARG; + } + + HRESULT hr = E_FAIL; + if( bSelect ) + { + // + // Enable refresh, and delete verbs + // + IConsoleVerb *pConsoleVerb = NULL; + + hr = pConsole->QueryConsoleVerb( &pConsoleVerb ); + if( FAILED(hr) ) + { + return hr; + } + + hr = pConsoleVerb->SetVerbState( MMC_VERB_REFRESH, ENABLED, TRUE ); + + if( !IsExtension() ) + { + hr = pConsoleVerb->SetVerbState( MMC_VERB_DELETE, ENABLED, TRUE ); + _ASSERT( S_OK == hr ); + } + + hr = pConsoleVerb->SetVerbState( MMC_VERB_OPEN, ENABLED, TRUE ); + if( FAILED(hr) ) + { + pConsoleVerb->Release(); + return hr; + } + + // + // Can't get to properties (via the standard methods) unless + // we tell MMC to display the Properties menu item and + // toolbar button, this will give the user a visual cue that + // there's "something" to do + // + hr = pConsoleVerb->SetVerbState( MMC_VERB_PROPERTIES, ENABLED, TRUE ); + + // + // Also set MMC_VERB_PROPERTIES as the default verb + // + hr = pConsoleVerb->SetDefaultVerb( MMC_VERB_PROPERTIES ); + + pConsoleVerb->Release(); + } + + return S_FALSE; +} + +BOOL CALLBACK CUDDISiteNode::GeneralDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + static CUDDISiteNode *pDatabaseServer = NULL; + + switch( uMsg ) + { + case WM_INITDIALOG: + { + // + // Catch the "this" pointer so we can actually operate on the object + // + pDatabaseServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + CConfigMap& m_mapProperties = pDatabaseServer->m_mapConfig; + + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_INSTALL_DATE, LocalizedDate( m_mapProperties[ UDDI_SETUP_DATE ] ).c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_UDDI_LANGUAGE, m_mapProperties[ UDDI_SETUP_LANGUAGE ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_DISPLAYNAME, m_mapProperties[ UDDI_SITE_NAME ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_DESCRIPTION, m_mapProperties[ UDDI_SITE_DESCRIPTION ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_PROVIDER_KEY, m_mapProperties[ UDDI_SITE_KEY ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_FRAMEWORK_VERSION, m_mapProperties[ UDDI_SETUP_FRAMEWORK_VERSION ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_UDDI_VERSION, m_mapProperties[ UDDI_SETUP_VERSION ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_INSTALL_LOCATION, m_mapProperties[ UDDI_SETUP_LOCATION ].c_str() ); + + _TCHAR szServiceName[ 256 ]; + if( _T("1") == m_mapProperties[ UDDI_SETUP_WEB ] ) + { + ::LoadString( g_hinst, IDS_WEBSERVER_COMPONENT_DESCRIPTION, szServiceName, ARRAYLEN( szServiceName ) ); + ListBox_AddString( GetDlgItem( hwndDlg, IDC_GENERAL_SITE_LIST_SERVICES ), szServiceName ); + } + + if( _T("1") == m_mapProperties[ UDDI_SETUP_DB ] ) + { + ::LoadString( g_hinst, IDS_DATABASE_SERVER_COMPONENT_DESCRIPTION, szServiceName, ARRAYLEN( szServiceName ) ); + ListBox_AddString( GetDlgItem( hwndDlg, IDC_GENERAL_SITE_LIST_SERVICES ), szServiceName ); + } + + if( _T("1") == m_mapProperties[ UDDI_SETUP_ADMIN ] ) + { + ::LoadString( g_hinst, IDS_UDDIMMC_COMPONENT_DESCRIPTION, szServiceName, ARRAYLEN( szServiceName ) ); + ListBox_AddString( GetDlgItem( hwndDlg, IDC_GENERAL_SITE_LIST_SERVICES ), szServiceName ); + } + } + break; + case WM_NOTIFY: + if( PSN_HELP == ((NMHDR *) lParam)->code ) + { + wstring strHelp( pDatabaseServer->GetHelpFile() ); + strHelp += g_wszUddiSiteGeneralPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + + case WM_HELP: + { + wstring strHelp( pDatabaseServer->GetHelpFile() ); + strHelp += g_wszUddiSiteGeneralPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + } + + return FALSE; +} + +void SplitGroupName( const PTCHAR szGroupName, StringVector& names ) +{ + // + // Example: CREEVES\\Administrators + // + PTCHAR begin = szGroupName; + PTCHAR end = begin; + + while( *end ) + { + if( _T('\\') == *end ) + { + TCHAR szNameTemp[ 256 ]; + _tcsncpy( szNameTemp, begin, end - begin ); + szNameTemp[ end - begin ] = NULL; + names.push_back( szNameTemp ); + begin = end + 1; + } + end++; + } + + // + // Get the last one + // + if( begin != end ) + { + names.push_back( begin ); + } +} + +struct RolesData +{ + RolesData( CUDDISiteNode* pServer ) + : pDBServer( pServer ) + , bAdminChanged( false ) + , bCoordinatorChanged( false ) + , bPublishChanged( false ) + , bUserChanged( false ) + , bInitialized( false ){} + + CUDDISiteNode* pDBServer; + bool bAdminChanged; + bool bCoordinatorChanged; + bool bPublishChanged; + bool bUserChanged; + bool bInitialized; + + // + // These members get updated when the user picks a new role/group + // + tstring tsNewAdminSID; + tstring tsNewCoordinatorSID; + tstring tsNewPublisherSID; + tstring tsNewUserSID; +}; + +tstring SidFromGroupName( const tstring& strGroupName, const LPCTSTR szTargetComputer ) +{ + BYTE sid[ 1024 ]; + TCHAR domain[ 1024 ]; + LPTSTR szSidBuf = NULL; + DWORD cbSID = ARRAYLEN( sid ); + DWORD cbDomain = ARRAYLEN( domain ); + SID_NAME_USE puse; + tstring strSid = _T(""); + + try + { + BOOL bRet = LookupAccountName( + NULL, + strGroupName.c_str(), + sid, + &cbSID, + domain, + &cbDomain, + &puse ); + if( !bRet ) + UDDIVERIFYAPI();// bRet, _T("The attempt to lookup the security identifer failed" ) ); + + bRet = ConvertSidToStringSid( sid, &szSidBuf ); + UDDIASSERT( bRet ); + + strSid = szSidBuf; + + if( szSidBuf ) + LocalFree( szSidBuf ); + } + catch( CUDDIException& e ) + { + MessageBox( NULL, e.GetEntireError().c_str(), _T("Security name conversion failed" ), MB_OK ); + } + return strSid; +} + +tstring GroupNameFromSid( const tstring& strGroupSid, const tstring& strTargetComputer ) +{ + PSID lpSid = NULL; + TCHAR domain[ 1024 ]; + TCHAR name[ 1024 ]; + DWORD cbDomain = ( sizeof domain / sizeof domain[0] ); + DWORD cbName = ( sizeof name / sizeof name[0] ); + SID_NAME_USE puse; + tstring strGroupName = _T(""); + + BOOL bRet = ConvertStringSidToSid( strGroupSid.c_str(), &lpSid ); + UDDIVERIFY( bRet, _T("Unable to convert the group security identifer into a textual name." ) ); + + bRet = LookupAccountSid( strTargetComputer.c_str(), lpSid, name, &cbName, domain, &cbDomain, &puse ); + if( !bRet ) + { + if( lpSid ) + LocalFree( lpSid ); + + // + // If we can't look up the account, we can't continue. + // + THROW_UDDIEXCEPTION_ST( GetLastError(), IDS_ACCOUNT_GROUP_ERROR, g_hinst ); + } + + strGroupName = domain; + strGroupName += _T("\\"); + strGroupName += name; + + if( lpSid ) + LocalFree( lpSid ); + + return strGroupName; +} + +BOOL CALLBACK CUDDISiteNode::RolesDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) + { + case WM_INITDIALOG: + { + // + // Save the window data into the user data reference + // + CUDDISiteNode* pDBServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + RolesData* pdata = new RolesData( pDBServer ); + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, reinterpret_cast( pdata ) ); + + // + // Admin group. + // + try + { + tstring strAdminGroup = GroupNameFromSid( pDBServer->m_mapConfig[ UDDI_ADMIN_GROUP ], pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_ADMIN_GROUP_NAME, strAdminGroup.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_ADMIN_GROUP_NAME, pDBServer->m_mapConfig[ UDDI_ADMIN_GROUP ].c_str() ); + } + + // + // Coordinator Group. + // + try + { + tstring strCoordinatorGroup = GroupNameFromSid( pDBServer->m_mapConfig[ UDDI_COORDINATOR_GROUP ], pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME, strCoordinatorGroup.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME, pDBServer->m_mapConfig[ UDDI_ADMIN_GROUP ].c_str() ); + } + + // + // Publisher Group. + // + try + { + tstring strPublisherGroup = GroupNameFromSid( pDBServer->m_mapConfig[ UDDI_PUBLISHER_GROUP ], pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME, strPublisherGroup.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME, pDBServer->m_mapConfig[ UDDI_ADMIN_GROUP ].c_str() ); + } + + // + // User Group. + // + try + { + tstring strUserGroup = GroupNameFromSid( pDBServer->m_mapConfig[ UDDI_USER_GROUP ], pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_USER_GROUP_NAME, strUserGroup.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_USER_GROUP_NAME, pDBServer->m_mapConfig[ UDDI_USER_GROUP ].c_str() ); + } + + pdata->bInitialized = true; + } + + case WM_COMMAND: + { + RolesData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + + if( BN_CLICKED == HIWORD(wParam) ) + { + try + { + TCHAR szGroupSID[ 1024 ]; + + if( IDC_ROLES_BTN_ADMINISTRATOR_SELECT == LOWORD(wParam) ) + { + if( ObjectPicker( hwndDlg, OT_GroupSID, szGroupSID, ARRAYLEN( szGroupSID ), pdata->pDBServer->m_szName ) ) + { + try + { + tstring tstr = GroupNameFromSid( szGroupSID, pdata->pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_ADMIN_GROUP_NAME, tstr.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_ADMIN_GROUP_NAME, szGroupSID ); + } + + pdata->bAdminChanged = true; + pdata->tsNewAdminSID = szGroupSID; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + } + } + else if( IDC_ROLES_BTN_COORDINATOR_SELECT == LOWORD(wParam) ) + { + if( ObjectPicker( hwndDlg, OT_GroupSID, szGroupSID, ARRAYLEN( szGroupSID ), pdata->pDBServer->m_szName ) ) + { + try + { + tstring tstr = GroupNameFromSid( szGroupSID, pdata->pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME, tstr.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME, szGroupSID ); + } + + pdata->bCoordinatorChanged = true; + pdata->tsNewCoordinatorSID = szGroupSID; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + } + } + else if( IDC_ROLES_BTN_PUBLISHER_SELECT == LOWORD(wParam) ) + { + if( ObjectPicker( hwndDlg, OT_GroupSID, szGroupSID, ARRAYLEN( szGroupSID ), pdata->pDBServer->m_szName ) ) + { + try + { + tstring tstr = GroupNameFromSid( szGroupSID, pdata->pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME, tstr.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME, szGroupSID ); + } + + pdata->bPublishChanged = true; + pdata->tsNewPublisherSID = szGroupSID; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + } + } + else if( IDC_ROLES_BTN_USER_SELECT == LOWORD(wParam) ) + { + if( ObjectPicker( hwndDlg, OT_GroupSID, szGroupSID, ARRAYLEN( szGroupSID ), pdata->pDBServer->m_szName ) ) + { + try + { + tstring tstr = GroupNameFromSid( szGroupSID, pdata->pDBServer->m_szName ); + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_USER_GROUP_NAME, tstr.c_str() ); + } + catch( ... ) + { + SetDlgItemText( hwndDlg, IDC_ROLES_EDIT_USER_GROUP_NAME, szGroupSID ); + } + + pdata->bUserChanged = true; + pdata->tsNewUserSID = szGroupSID; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + } + } + + break; + } + catch( CUDDIException& exception ) + { + _TCHAR szTitle[256]; + ::LoadString( g_hinst, IDS_UDDIMMC_SNAPINNAME, szTitle, ARRAYLEN( szTitle ) - 1 ); + + MessageBox( hwndDlg, (LPCTSTR) exception, szTitle, MB_ICONERROR | MB_OK | MB_APPLMODAL ); + + break; + } + catch( ... ) + { + TCHAR wszTitle[ 128 ]; + TCHAR wszMsg[ 256 ]; + + LoadString( g_hinst, IDS_GENERAL_EXCEPTION_TITLE, wszTitle, 128 ); + LoadString( g_hinst, IDS_GENERAL_EXCEPTION, wszMsg, 256 ); + MessageBox( hwndDlg, wszMsg, wszTitle, MB_OK ); + break; + } + } + else if( EN_CHANGE == HIWORD(wParam) ) + { + if( pdata->bInitialized ) + { + switch( LOWORD(wParam) ) + { + case IDC_ROLES_EDIT_USER_GROUP_NAME: + pdata->bUserChanged = true; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + break; + case IDC_ROLES_EDIT_PUBLISHER_GROUP_NAME: + pdata->bPublishChanged = true; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + break; + case IDC_ROLES_EDIT_COORDINATOR_GROUP_NAME: + pdata->bCoordinatorChanged = true; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + break; + case IDC_ROLES_EDIT_ADMIN_GROUP_NAME: + pdata->bAdminChanged = true; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + break; + } + } + } + break; + } + + case WM_DESTROY: + { + delete reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + break; + } + + case WM_HELP: + { + RolesData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + wstring strHelp( pdata->pDBServer->GetHelpFile() ); + strHelp += g_wszUddiRolesPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + break; + } + + case WM_NOTIFY: + switch( ((NMHDR *) lParam)->code ) + { + case PSN_APPLY: + { + RolesData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + + CUDDISiteNode* pDBServer = pdata->pDBServer; + + if( pdata->bAdminChanged ) + { + pDBServer->m_mapChanges[ UDDI_ADMIN_GROUP ] = pdata->tsNewAdminSID; + pdata->bAdminChanged = false; + } + + if( pdata->bCoordinatorChanged ) + { + pDBServer->m_mapChanges[ UDDI_COORDINATOR_GROUP ] = pdata->tsNewCoordinatorSID; + pdata->bCoordinatorChanged = false; + } + + if( pdata->bPublishChanged ) + { + pDBServer->m_mapChanges[ UDDI_PUBLISHER_GROUP ] = pdata->tsNewPublisherSID; + pdata->bPublishChanged = false; + } + + if( pdata->bUserChanged ) + { + pDBServer->m_mapChanges[ UDDI_USER_GROUP ] = pdata->tsNewUserSID; + pdata->bUserChanged = false; + } + + // + // Ask MMC to send us a message (on the main thread) so + // we know the Apply button was clicked. + // + HRESULT hr = MMCPropertyChangeNotify( pDBServer->m_ppHandle, reinterpret_cast(pDBServer) ); + _ASSERT( SUCCEEDED(hr) ); + + return PSNRET_NOERROR; + } + + case PSN_HELP: + { + RolesData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + wstring strHelp( pdata->pDBServer->GetHelpFile() ); + strHelp += g_wszUddiRolesPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + break; + } + break; + } + } + + return FALSE; +} + +struct SecurityData +{ + SecurityData( CUDDISiteNode* pDBServer ) + : pServer( pDBServer ) + , bModeChanged( false ) + , bSSLChanged( false ) + , bKeyTimeoutChanged( false ) + , bTicketTimeoutChanged( false ) + , bAutoKeyResetChanged( false ) + , bAutoKeyReset( false ) + , nKeyTimeout( 0 ) + , nTicketTimeout( 0 ) + { + if( NULL != pServer ) + { + bAutoKeyReset = ( 0 != _tcscmp( _T("0"), pServer->GetConfigMap()[ UDDI_KEY_AUTORESET ].c_str() ) ); + nKeyTimeout = _tstoi( pDBServer->GetConfigMap()[ UDDI_KEY_TIMEOUT ].c_str() ); + nTicketTimeout = _tstoi( pDBServer->GetConfigMap()[ UDDI_TICKET_TIMEOUT ].c_str() ); + } + } + + bool bModeChanged; + bool bSSLChanged; + bool bKeyTimeoutChanged; + bool bTicketTimeoutChanged; + bool bAutoKeyResetChanged; + bool bAutoKeyReset; + int nKeyTimeout; + int nTicketTimeout; + CUDDISiteNode* pServer; +}; + +BOOL CALLBACK CUDDISiteNode::SecurityDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) + { + case WM_INITDIALOG: + { + // + // Catch the "this" pointer so we can actually operate on the object + // + CUDDISiteNode* pDBServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + SecurityData* pdata = new SecurityData( pDBServer ); + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, reinterpret_cast( pdata ) ); + _TCHAR* pszMode = (_TCHAR*) pDBServer->m_mapConfig[ UDDI_AUTHENTICATION_MODE ].c_str(); + int nAuthenticationMode = _ttoi( pszMode ); + switch( nAuthenticationMode ) + { + case 1: + SendDlgItemMessage( hwndDlg, IDC_SECURITY_RADIO_AUTHENTICATION_UDDI, BM_SETCHECK, BST_CHECKED, NULL ); + break; + case 2: + case 6: + SendDlgItemMessage( hwndDlg, IDC_SECURITY_RADIO_AUTHENTICATION_WINDOWS, BM_SETCHECK, BST_CHECKED, NULL ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SECURITY_CHECK_AUTHENTICATED_READS ), TRUE ); + break; + case 3: + default: + SendDlgItemMessage( hwndDlg, IDC_SECURITY_RADIO_AUTHENTICATION_BOTH, BM_SETCHECK, BST_CHECKED, NULL ); + break; + } + + if( 4 & nAuthenticationMode ) + { + SendDlgItemMessage( hwndDlg, IDC_SECURITY_CHECK_AUTHENTICATED_READS, BM_SETCHECK, BST_CHECKED, NULL ); + } + + // + // Setup the HTTPS requirement setting + // + _TCHAR* pszHttps = (_TCHAR*) pDBServer->m_mapConfig[ UDDI_REQUIRE_SSL ].c_str(); + int nhttps = _ttoi( pszHttps ); + if( 0 == nhttps ) + { + SendDlgItemMessage( hwndDlg, IDC_SECURITY_CHECK_REQUIRE_SSL, BM_SETCHECK, BST_UNCHECKED, NULL ); + } + else + { + SendDlgItemMessage( hwndDlg, IDC_SECURITY_CHECK_REQUIRE_SSL, BM_SETCHECK, BST_CHECKED, NULL ); + } + } + break; + case WM_HELP: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ) ; + wstring strHelp( pdata->pServer->GetHelpFile() ); + strHelp += g_wszUddiSecurityPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + + case WM_COMMAND: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + CUDDISiteNode* pDBServer = pdata->pServer; + + // + // Set the state of the Authenticated Reads check box + // + LRESULT nChecked = SendDlgItemMessage( hwndDlg, IDC_SECURITY_RADIO_AUTHENTICATION_WINDOWS, BM_GETCHECK, NULL, NULL ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SECURITY_CHECK_AUTHENTICATED_READS ), BST_CHECKED == nChecked ? TRUE : FALSE ); + if( !nChecked ) + { + SendDlgItemMessage( hwndDlg, IDC_SECURITY_CHECK_AUTHENTICATED_READS, BM_SETCHECK, FALSE, NULL ); + } + + if( IDC_CRYPTOGRAPHY_BTN_CHANGE == LOWORD(wParam) ) + { + INT_PTR nResult = DialogBoxParam( g_hinst, MAKEINTRESOURCE( IDD_CRYPTOGRAPHY ), GetParent(hwndDlg), CryptographyDialogProc, (LPARAM) pdata ); + + if( nResult ) + { + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0 ); + } + } + else if( BN_CLICKED == HIWORD(wParam) && + ( IDC_SECURITY_RADIO_AUTHENTICATION_BOTH == LOWORD(wParam) || + IDC_SECURITY_RADIO_AUTHENTICATION_UDDI == LOWORD(wParam) || + IDC_SECURITY_RADIO_AUTHENTICATION_WINDOWS == LOWORD(wParam) || + IDC_SECURITY_CHECK_AUTHENTICATED_READS == LOWORD(wParam) ) ) + { + pdata->bModeChanged = true; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0 ); + } + else if( BN_CLICKED == HIWORD(wParam) && IDC_SECURITY_CHECK_REQUIRE_SSL == LOWORD(wParam) ) + { + pdata->bSSLChanged = true; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0 ); + } + } + break; + + case WM_DESTROY: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + CUDDISiteNode* pDBServer = pdata->pServer; + delete pdata; + + // + // Tell MMC that we're done with the property sheet (we got this + // handle in CreatePropertyPages + // + MMCFreeNotifyHandle( pDBServer->m_ppHandle ); + } + break; + + case WM_NOTIFY: + { + switch( ((NMHDR *) lParam)->code ) + { + case PSN_APPLY: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + CUDDISiteNode* pDBServer = pdata->pServer; + + if( pdata->bAutoKeyResetChanged ) + { + pDBServer->m_mapChanges[ UDDI_KEY_AUTORESET ] = pdata->bAutoKeyReset ? _T("1") : _T("0"); + } + + if( pdata->bKeyTimeoutChanged ) + { + _TCHAR szValue[ 10 ]; + pDBServer->m_mapChanges[ UDDI_KEY_TIMEOUT ] = _itot( pdata->nKeyTimeout, szValue, 10 ); + } + + if( pdata->bTicketTimeoutChanged ) + { + _TCHAR szValue[ 10 ]; + pDBServer->m_mapChanges[ UDDI_TICKET_TIMEOUT ] = _itot( pdata->nTicketTimeout, szValue, 10 ); + } + + if( pdata->bModeChanged ) + { + if( BST_CHECKED == SendDlgItemMessage( hwndDlg, IDC_SECURITY_RADIO_AUTHENTICATION_BOTH, BM_GETCHECK, 0, 0 ) ) + { + pDBServer->m_mapChanges[ UDDI_AUTHENTICATION_MODE ] = _T("3"); + } + else if( BST_CHECKED == SendDlgItemMessage( hwndDlg, IDC_SECURITY_RADIO_AUTHENTICATION_UDDI, BM_GETCHECK, 0, 0 ) ) + { + pDBServer->m_mapChanges[ UDDI_AUTHENTICATION_MODE ] = _T("1"); + } + else if( BST_CHECKED == SendDlgItemMessage( hwndDlg, IDC_SECURITY_RADIO_AUTHENTICATION_WINDOWS, BM_GETCHECK, 0, 0 ) ) + { + if( BST_CHECKED == SendDlgItemMessage( hwndDlg, IDC_SECURITY_CHECK_AUTHENTICATED_READS, BM_GETCHECK, 0, 0 ) ) + pDBServer->m_mapChanges[ UDDI_AUTHENTICATION_MODE ] = _T("6"); + else + pDBServer->m_mapChanges[ UDDI_AUTHENTICATION_MODE ] = _T("2"); + } + } + + if( pdata->bSSLChanged ) + { + LRESULT nChecked = SendDlgItemMessage( hwndDlg, IDC_SECURITY_CHECK_REQUIRE_SSL, BM_GETCHECK, NULL, NULL ); + pDBServer->m_mapChanges[ UDDI_REQUIRE_SSL ] = ( BST_CHECKED == nChecked ? _T("1") : _T("0") ); + } + + pdata->bAutoKeyResetChanged = false; + pdata->bKeyTimeoutChanged = false; + pdata->bModeChanged = false; + pdata->bSSLChanged = false; + pdata->bTicketTimeoutChanged = false; + + HRESULT hr = MMCPropertyChangeNotify( pDBServer->m_ppHandle, reinterpret_cast(pDBServer) ); + _ASSERT( SUCCEEDED(hr) ); + } + return PSNRET_NOERROR; + + case PSN_HELP: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + wstring strHelp( pdata->pServer->GetHelpFile() ); + strHelp += g_wszUddiSecurityPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + } + } + break; + } + + return FALSE; +} + +size_t CUDDISiteNode::PublishToActiveDirectory() +{ + // + // Build up the list of ServiceConnectionPoint classes + // + CUDDIServiceCxnPtPublisher publisher( + GetConnectionStringOLEDB(), + m_mapConfig[ UDDI_SITE_KEY ], + m_mapConfig[ UDDI_SITE_NAME ], + m_mapConfig[ UDDI_DISCOVERY_URL ] ); + + // + // Process the binding information for the default + // provider for the site + // + publisher.ProcessSite(); + + // + // If there are no bindings don't publish anything + // + if( 0 == publisher.size() ) + return 0; + + // + // Delete the Site container + // + try + { + publisher.DeleteSiteContainer(); + } + catch(...) + { + } + + // + // Publish the Site Container + // + publisher.CreateSiteContainer(); + + // + // Publish the Service Connection Points + // + publisher.PublishServiceCxnPts(); + + return publisher.size(); +} + +void CUDDISiteNode::RemoveFromActiveDirectory() +{ + // + // Build up the list of ServiceConnectionPoint classes + // + CUDDIServiceCxnPtPublisher publisher( + GetConnectionStringOLEDB(), + m_mapConfig[ UDDI_SITE_KEY ], + m_mapConfig[ UDDI_SITE_NAME ], + m_mapConfig[ UDDI_DISCOVERY_URL ] ); + + publisher.DeleteSiteContainer(); +} + +BOOL CUDDISiteNode::CanPublishToActiveDirectory() +{ + return TRUE; +} + +BOOL CALLBACK CUDDISiteNode::ActiveDirectoryDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + static CUDDISiteNode *pDatabaseServer = NULL; + + switch( uMsg ) + { + case WM_INITDIALOG: + // + // Catch the "this" pointer so we can actually operate on the object + // + pDatabaseServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + + break; + case WM_HELP: + { + wstring strHelp( pDatabaseServer->GetHelpFile() ); + strHelp += g_wszUddiActiveDirectoryPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + + case WM_COMMAND: + if( IDC_ACTIVEDIRECTORY_BTN_ADD == LOWORD(wParam) ) + { + try + { + size_t nCount = pDatabaseServer->PublishToActiveDirectory(); + + // + // Tell the user the publication job succeeded + // + _TCHAR szMessage[ 256 ]; + _TCHAR szTitle[ 256 ]; + + if( nCount ) + { + LoadString( g_hinst, IDS_ACTIVEDIRECTORY_PUBLISH_SUCCEEDED, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_UDDIMMC_NAME, szTitle, ARRAYLEN( szTitle ) ); + } + else + { + LoadString( g_hinst, IDS_ACTIVEDIRECTORY_NO_BINDINGS, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_UDDIMMC_NAME, szTitle, ARRAYLEN( szTitle ) ); + } + + MessageBox( hwndDlg, szMessage, szTitle, MB_OK ); + } + catch( CUDDIException& e ) + { + UDDIMsgBox( hwndDlg, IDS_ACTIVEDIRECTORY_PUBLISH_FAILED, IDS_UDDIMMC_SNAPINNAME, MB_ICONERROR, e.GetEntireError().c_str() ); + } + } + if( IDC_ACTIVEDIRECTORY_BTN_REMOVE == LOWORD(wParam) ) + { + try + { + pDatabaseServer->RemoveFromActiveDirectory(); + + // + // Tell the user the publication job succeeded + // + _TCHAR szMessage[ 256 ]; + _TCHAR szTitle[ 256 ]; + LoadString( g_hinst, IDS_ACTIVEDIRECTORY_DELETE_SUCCEDED, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_UDDIMMC_NAME, szTitle, ARRAYLEN( szTitle ) ); + MessageBox( hwndDlg, szMessage, szTitle, MB_OK ); + } + catch( CUDDIException& e ) + { + UDDIMsgBox( hwndDlg, IDS_ACTIVEDIRECTORY_DELETE_FAILED, IDS_UDDIMMC_SNAPINNAME, MB_ICONERROR, e.GetEntireError().c_str() ); + } + } + break; + + case WM_NOTIFY: + switch( ((NMHDR *) lParam)->code ) + { + case PSN_APPLY: + return PSNRET_NOERROR; + + case PSN_HELP: + { + wstring strHelp( pDatabaseServer->GetHelpFile() ); + strHelp += g_wszUddiActiveDirectoryPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + } + break; + } + + return FALSE; +} + +HRESULT CUDDISiteNode::HasPropertySheets() +{ + // + // Say "yes" when MMC asks if we have pages + // + return S_OK; +} + +HRESULT +CUDDISiteNode::CreatePropertyPages( IPropertySheetCallback *lpProvider, LONG_PTR handle ) +{ + if( ( NULL == lpProvider ) || ( 0 == handle ) ) + { + return E_INVALIDARG; + } + + HRESULT hr = S_OK; + try + { + hr = GetData(); + } + catch( CUDDIException& e ) + { + IConsole *pConsole = NULL; + HWND hwndConsole = NULL; + + // + // This *should* always work. If it does work, then we use + // pConsole to get the main window handle for the mmc, and use + // this main window handle to display a modal dialog. + // + // If this fails (which it never should), we then display dialog, + // but with a NULL HWND. + // + hr = lpProvider->QueryInterface( IID_IConsole, (void **)&pConsole ); + + if( NULL != pConsole ) + { + pConsole->GetMainWindow( &hwndConsole ); + } + + TCHAR szTitle[ 256 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_GETDATA_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + + MessageBox( hwndConsole, e.GetEntireError().c_str(), szTitle, MB_ICONERROR | MB_OK | MB_APPLMODAL ); + + if( NULL != pConsole ) + { + pConsole->Release(); + } + + return E_FAIL; + } + catch(...) + { + return E_FAIL; + } + + PropertyPages pps[] = { + { IDD_GENERAL_SITE_PROPPAGE, GeneralDialogProc }, + { IDD_ROLES_PROPPAGE, RolesDialogProc }, + { IDD_SECURITY_PROPPAGE, SecurityDialogProc }, + { IDD_ACTIVEDIRECTORY_PROPPAGE, ActiveDirectoryDialogProc }, + { IDD_ADVANCED_PROPPAGE, AdvancedDialogProc } }; + + PROPSHEETPAGE psp; + HPROPSHEETPAGE hPage = NULL; + + // + // Cache this handle so we can call MMCPropertyChangeNotify + // + m_ppHandle = handle; + + // + // Create the property page for this node. + // NOTE: if your node has multiple pages, put the following + // in a loop and create multiple pages calling + // lpProvider->AddPage() for each page. + // + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_HASHELP; + psp.hInstance = g_hinst; + psp.lParam = reinterpret_cast(this); + + for( int i=0; i < ARRAYLEN( pps ); i++ ) + { + psp.pszTemplate = MAKEINTRESOURCE( pps[ i ].id ); + psp.pfnDlgProc = pps[ i ].dlgproc; + + hPage = CreatePropertySheetPage( &psp ); + _ASSERT( hPage ); + + hr = lpProvider->AddPage( hPage ); + if( FAILED(hr) ) + break; + } + + return hr; +} + +HRESULT CUDDISiteNode::GetWatermarks( + HBITMAP *lphWatermark, + HBITMAP *lphHeader, + HPALETTE *lphPalette, + BOOL *bStretch ) +{ + return S_FALSE; +} + +HRESULT CUDDISiteNode::OnUpdateItem( IConsole *pConsole, long item, ITEM_TYPE itemtype ) + +{ + HRESULT hr = S_FALSE; + + _ASSERT( NULL != this || m_isDeleted || RESULT == itemtype ); + + // + // Redraw the item + // + IResultData *pResultData = NULL; + + hr = pConsole->QueryInterface( IID_IResultData, (void **)&pResultData ); + _ASSERT( SUCCEEDED(hr) ); + + HRESULTITEM myhresultitem; + _ASSERT( NULL != &myhresultitem ); + + // + // lparam == this. See CSpaceStation::OnShow + // + hr = pResultData->FindItemByLParam( (LPARAM)this, &myhresultitem ); + + if( FAILED(hr) ) + { + // + // Failed : Reason may be that current view does not have this item. + // So exit gracefully. + // + hr = S_FALSE; + } + else + { + hr = pResultData->UpdateItem( myhresultitem ); + _ASSERT( SUCCEEDED(hr) ); + } + + pResultData->Release(); + + return hr; +} + +HRESULT CUDDISiteNode::OnRefresh( IConsole *pConsole ) +{ + // + // Call IConsole::UpdateAllViews to redraw all views + // owned by the parent scope item + // + HRESULT hr = pConsole->UpdateAllViews( NULL, m_pParent->GetParentScopeItem(), UPDATE_SCOPEITEM ); + _ASSERT( S_OK == hr); + + if( TRUE == SUCCEEDED( hr ) ) + { + CUDDIWebServerNodeMap::iterator it = m_mapChildren.begin(); + for ( it = m_mapChildren.begin(); it != m_mapChildren.end(); it++ ) + { + CUDDIWebServerNode *pWSNode = it->second; + if( NULL != pWSNode ) + { + pWSNode->OnRefresh( pConsole ); + } + } + } + + return hr; +} + +HRESULT CUDDISiteNode::OnAddMenuItems( IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed ) +{ + HRESULT hr = S_OK; + + if( !IsExtension() ) + { + WCHAR szWebServerMenuText[ MAX_PATH ]; + WCHAR szWebServerMenuDescription[ MAX_PATH ]; + + LoadStringW( g_hinst, IDS_WEBSERVER_ADD, szWebServerMenuText, ARRAYLEN( szWebServerMenuText ) ); + LoadStringW( g_hinst, IDS_WEBSERVER_DESCRIPTION, szWebServerMenuDescription, ARRAYLEN( szWebServerMenuDescription ) ); + + CONTEXTMENUITEM menuItemsNew[] = + { + { + szWebServerMenuText, + szWebServerMenuDescription, + IDM_NEW_WEBSERVER, + CCM_INSERTIONPOINTID_PRIMARY_TOP, + m_bStdSvr ? MF_GRAYED : 0, // this menu option is disabled iff site node is on a Windows Server 2003 standard machine. + 0 + }, + { NULL, NULL, 0, 0, 0 } + }; + + + // + // Loop through and add each of the menu items, we + // want to add to new menu, so see if it is allowed. + // + if( *pInsertionsAllowed & CCM_INSERTIONALLOWED_TOP ) + { + for( LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++ ) + { + hr = pContextMenuCallback->AddItem( m ); + if( FAILED(hr) ) + break; + } + } + } + +#if defined( _DEBUG ) || defined( DBG ) + CONTEXTMENUITEM menuItemsNew[] = + { + { + _T("Debug"), _T("Dump all the configuration data"), + IDM_DEBUG, CCM_INSERTIONPOINTID_PRIMARY_TOP, 0, 0 + }, + { NULL, NULL, 0, 0, 0 } + }; + + + // + // Loop through and add each of the menu items, we + // want to add to new menu, so see if it is allowed. + // + if( *pInsertionsAllowed & CCM_INSERTIONALLOWED_TOP ) + { + for( LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++ ) + { + hr = pContextMenuCallback->AddItem( m ); + if( FAILED(hr) ) + break; + } + } +#endif + + return hr; +} + +CUDDIWebServerNode* CUDDISiteNode::FindChild( LPCTSTR szName ) +{ + CUDDIWebServerNodeMap::iterator it; + for( it = m_mapChildren.begin(); it != m_mapChildren.end(); it++ ) + { + CUDDIWebServerNode* pNode = it->second; + + if( ( NULL != pNode ) && ( !pNode->IsDeleted() ) && ( 0 == _tcsicmp( szName, pNode->GetName() ) ) ) + { + return pNode; + } + } + + return NULL; +} + +HRESULT CUDDISiteNode::OnMenuCommand( IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject ) +{ + switch( lCommandID ) + { + case IDM_NEW_WEBSERVER: + { + // + // Use these for some message boxes. + // + _TCHAR szMessage[ 512 ]; + _TCHAR szTitle[ 128 ]; + + WebServerData wsData; + wsData.pBase = this; + + HWND hwndConsole = NULL; + HRESULT hr = pConsole->GetMainWindow( &hwndConsole ); + _ASSERT( S_OK == hr); + + INT_PTR nResult = DialogBoxParam( g_hinst, MAKEINTRESOURCE( IDD_WEBSERVER_NEW ), hwndConsole, CUDDIWebServerNode::NewWebServerDialogProc, (LPARAM)&wsData ); + + if( nResult ) + { + try + { + wstring strOldConnStr; + CUDDIWebServerNode::GetWriterConnectionString( wsData.szName, strOldConnStr ); + + if( !CUDDISiteNode::AddWebServerToSite( m_szName, wsData.szName, hwndConsole ) ) + { + return E_FAIL; + } + + if( 0 != strOldConnStr.length() ) + { + wstring strDomain, strServer, strInstance; + CUDDIWebServerNode::CrackConnectionString( strOldConnStr, strDomain, strServer, strInstance ); + + CUDDISiteNode *pOldSite = static_cast( m_pParent->FindChild( strServer.c_str() ) ); + if( NULL != pOldSite ) + { + CUDDIWebServerNode *pOldWS = pOldSite->FindChild( wsData.szName.c_str() ); + if( NULL != pOldSite ) + { + pOldWS->DeleteFromScopePane( pConsoleNameSpace ); + } + } + } + + // + // Make sure the version of the web server is compatible with the version on the site. + // + UINT n = m_nNextChildID; + CUDDIWebServerNode *pNode = new CUDDIWebServerNode( wsData.szName.c_str(), n, this, m_bIsExtension ); + if( TRUE == AddChildEntry( pNode, n ) ) + { + + // + // Set the connection strings registry keys on the web server machine to point to this UDDI site. + // + tstring szConnStr = CUDDIWebServerNode::BuildConnectionString( m_szName ); + + CUDDIWebServerNode::SetReaderConnectionString( wsData.szName.c_str(), szConnStr ); + CUDDIWebServerNode::SetWriterConnectionString( wsData.szName.c_str(), szConnStr ); + + // + // Add this new web server node to the list of web servers for this site. + // + m_nNextChildID++; + + m_bIsDirty = TRUE; + + SCOPEDATAITEM sdi; + ZeroMemory( &sdi, sizeof(SCOPEDATAITEM) ); + + sdi.mask = SDI_STR | // Displayname is valid + SDI_PARAM | // lParam is valid + SDI_IMAGE | // nImage is valid + SDI_OPENIMAGE | // nOpenImage is valid + SDI_PARENT | + SDI_CHILDREN; + + sdi.relativeID = GetScopeItemValue(); + sdi.nImage = m_mapChildren[ n ]->GetBitmapIndex(); + sdi.nOpenImage = MMC_IMAGECALLBACK; + sdi.displayname = MMC_CALLBACK; + sdi.lParam = (LPARAM) m_mapChildren[ n ]; + sdi.cChildren = m_mapChildren[ n ]->HasChildren(); + + hr = pConsoleNameSpace->InsertItem( &sdi ); + _ASSERT( SUCCEEDED(hr) ); + + m_mapChildren[ n ]->SetScopeItemValue( sdi.ID ); + m_mapChildren[ n ]->SetParentScopeItem( sdi.relativeID ); + + // + // We created a new object in result pane. We need to insert this object + // in all the views, call UpdateAllViews for this. + // Pass pointer to data object passed into OnMenuCommand. + // + hr = pConsole->UpdateAllViews( pDataObject, GetScopeItemValue(), UPDATE_SCOPEITEM ); + _ASSERT( S_OK == hr); + + // + // Prompt the user with a warning to tell them that they might have to alter their + // machine.config settings if this web server is part of a web farm. + // + memset( szMessage, 0, 512 * sizeof( _TCHAR ) ); + memset( szTitle, 0, 128 * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_WEBSERVER_WEBFARM_DETAIL, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_WEBSERVER_WEBFARM, szTitle, ARRAYLEN( szTitle ) ); + + MessageBox( hwndConsole, szMessage, szTitle, MB_OK ); + } + } + catch( CUDDIException &e ) + { + UDDIMsgBox( hwndConsole, (LPCTSTR) e, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + return E_FAIL; + } + catch( ... ) + { + UDDIMsgBox( hwndConsole, IDS_ERROR_ADDWEBSITE, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + return E_UNEXPECTED; + } + } + } + break; + +#if defined( _DEBUG ) || defined( DBG ) + case IDM_DEBUG: + { + try + { + GetData(); + } + catch( CUDDIException& e ) + { + TCHAR szTitle[ 256 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_GETDATA_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + HWND hwnd; + pConsole->GetMainWindow( &hwnd ); + MessageBox( hwnd, e.GetEntireError().c_str(), szTitle, MB_ICONERROR | MB_OK | MB_APPLMODAL ); + return E_FAIL; + } + + for( CConfigMap::iterator iter = m_mapConfig.begin(); + iter != m_mapConfig.end(); iter++ ) + { + OutputDebugString( (*iter).first.c_str() ); + OutputDebugString( _T(" = ") ); + OutputDebugString( (*iter).second.c_str() ); + OutputDebugString( _T("\n") ); + } + } + break; +#endif + } + + return S_OK; +} + +HRESULT +CUDDISiteNode::OnDelete( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsoleComp ) +{ + if( ( NULL == pConsoleNameSpace ) || ( NULL == pConsoleComp ) ) + { + return E_INVALIDARG; + } + + HRESULT hr; + hr = pConsoleNameSpace->DeleteItem( GetScopeItemValue(), TRUE ); + + // + // Now set isDeleted member so that the parent doesn't try to + // to insert it again in CUDDIServicesNode::OnShow. Admittedly, a hack... + // + m_isDeleted = TRUE; + + return hr; +} + +const LPCTSTR CUDDISiteNode::GetName() +{ + return m_szName; +} + + +BOOL +CUDDISiteNode::GetFullyQualifiedInstanceName( LPCTSTR szName, tstring& strInstanceName ) +{ + try + { + strInstanceName = _T( "" ); + + CUDDIRegistryKey dbkey( _T( "SOFTWARE\\Microsoft\\UDDI" ), KEY_READ, szName ); + strInstanceName = dbkey.GetString( _T( "InstanceName" ) ); + dbkey.Close(); + + return TRUE; + } + catch( ... ) + { + strInstanceName = _T( "" ); + return FALSE; + } +} + +const _TCHAR * +CUDDISiteNode::GetInstanceName() +{ + return m_szInstanceName; +} + +CUDDISiteNode* CUDDISiteNode::Create( _TCHAR *szName, _TCHAR *szInstanceName, int id, CUDDIServicesNode* parent, BOOL bExtension ) +{ + CUDDISiteNode* pNode = new CUDDISiteNode( szName, szInstanceName, id, parent, bExtension ); + + try + { + if( pNode ) + pNode->GetData(); + } + catch( CUDDIException &e ) + { + delete pNode; + pNode = NULL; + + throw e; + } + catch(...) + { + } + return pNode; +} + +CConfigMap& CUDDISiteNode::GetConfigMap() +{ + return m_mapConfig; +} + + +tstring +CUDDISiteNode::GetConnectionStringOLEDB() +{ + try + { + tstring strConn = GetConnectionString(); + if( tstring::npos == strConn.find( _T( "Provider=SQLOLEDB.1" ) ) ) + { + strConn += _T( ";Provider=SQLOLEDB.1" ); + } + + return strConn; + } + catch( ... ) + { + return _T( "" ); + } +} + +tstring +CUDDISiteNode::GetConnectionString() +{ + try + { + tstring strConn = _T( "Data Source=" ); + tstring strInstanceName = _T( "" ); + + BOOL b = GetFullyQualifiedInstanceName( m_szName, strInstanceName ); + if( FALSE == b ) + { + return _T( "" ); + } + + strConn += strInstanceName; + + strConn += _T(";Initial Catalog=uddi;Integrated Security=SSPI;"); + + return strConn; + } + catch( ... ) + { + return _T( "" ); + } +} + + +BOOL CALLBACK CUDDISiteNode::CryptographyDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + CUDDISiteNode *pDatabaseServer = NULL; + + switch( uMsg ) + { + case WM_INITDIALOG: + { + SecurityData* pdata = reinterpret_cast(lParam); + CUDDISiteNode* pDBServer = pdata->pServer; + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam ); + + SetDlgItemText( hwndDlg, IDC_CRYPTOGRAPHY_TXT_RESET_DATE, LocalizedDateTime( pdata->pServer->GetConfigMap()[ UDDI_KEY_RESET_DATE ] ).c_str() ); + SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT, UDM_SETRANGE32, (WPARAM) 1, (LPARAM) 1000 ); + SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TIMEOUT, UDM_SETRANGE32, (WPARAM) 1, (LPARAM) 365 ); + SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT, UDM_SETPOS32, NULL, (LPARAM) pdata->nTicketTimeout ); + SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TIMEOUT, UDM_SETPOS32, NULL, (LPARAM) pdata->nKeyTimeout ); + SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_CHECK_AUTO_RESET, BM_SETCHECK, pdata->bAutoKeyReset ? BST_CHECKED : BST_UNCHECKED, NULL ); + EnableWindow( GetDlgItem( hwndDlg, IDC_CRYPTOGRAPHY_EDIT_TIMEOUT ), pdata->bAutoKeyReset ); + EnableWindow( GetDlgItem( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TIMEOUT ), pdata->bAutoKeyReset ); + } + break; + + case WM_HELP: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ) ; + wstring strHelp( pdata->pServer->GetHelpFile() ); + strHelp += g_wszUddiCryptographyHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + + case WM_COMMAND: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ) ; + _TCHAR szMessage[ 512 ]; + _TCHAR szTitle[ 256 ]; + + switch( LOWORD(wParam) ) + { + case IDC_CRYPTOGRAPHY_BTN_RESET_NOW: + ::LoadString( g_hinst, IDS_CRYPTOGRAPHY_RESET_NOW_CONFIRM, szMessage, ARRAYLEN( szMessage ) ); + ::LoadString( g_hinst, IDS_CRYPTOGRAPHY_RESET_NOW_TITLE, szTitle, ARRAYLEN( szTitle ) ); + + if( IDYES == MessageBox( hwndDlg, szMessage, szTitle, MB_YESNO | MB_ICONQUESTION ) ) + { + if( TRUE == pdata->pServer->ResetCryptography() ) + { + ::LoadString( g_hinst, IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS, szMessage, ARRAYLEN( szMessage ) ); + ::LoadString( g_hinst, IDS_CRYPTOGRAPHY_RESET_NOW_SUCCESS_TITLE, szTitle, ARRAYLEN( szTitle ) ); + + SetDlgItemText( hwndDlg, IDC_CRYPTOGRAPHY_TXT_RESET_DATE, LocalizedDateTime( pdata->pServer->m_mapConfig[ UDDI_KEY_RESET_DATE ] ).c_str() ); + MessageBox( hwndDlg, szMessage, szTitle, MB_OK ); + } + else + { + ::LoadString( g_hinst, IDS_CRYPTOGRAPHY_RESET_NOW_FAILED, szMessage, ARRAYLEN( szMessage ) ); + ::LoadString( g_hinst, IDS_CRYPTOGRAPHY_RESET_NOW_FAILED_TITLE, szTitle, ARRAYLEN( szTitle ) ); + MessageBox( hwndDlg, szMessage, szTitle, MB_OK ); + } + } + break; + + case IDC_CRYPTOGRAPHY_CHECK_AUTO_RESET: + { + LRESULT nChecked = SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_CHECK_AUTO_RESET, BM_GETCHECK, NULL, NULL ); + EnableWindow( GetDlgItem( hwndDlg, IDC_CRYPTOGRAPHY_EDIT_TIMEOUT ), BST_CHECKED == nChecked ? TRUE : FALSE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TIMEOUT ), BST_CHECKED == nChecked ? TRUE : FALSE ); + pdata->bAutoKeyResetChanged = true; + } + break; + + case IDC_CRYPTOGRAPHY_EDIT_TIMEOUT: + { + if( ( EN_CHANGE == HIWORD( wParam ) ) && ( NULL != pdata ) ) + { + pdata->bKeyTimeoutChanged = true; + } + } + break; + + case IDC_CRYPTOGRAPHY_EDIT_TICKET_TIMEOUT: + { + if( ( EN_CHANGE == HIWORD( wParam ) ) && ( NULL != pdata ) ) + { + pdata->bTicketTimeoutChanged = true; + } + } + break; + + case IDHELP: + { + wstring strHelp( pdata->pServer->GetHelpFile() ); + strHelp += g_wszUddiCryptographyHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + + case IDOK: + { + // + // Check that the ticket timeout is in proper range. + // + + BOOL bError = FALSE; + LRESULT lValue = SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT, UDM_GETPOS32, NULL, (LPARAM) &bError ); + if( bError ) + { + // + // Value out of range + // + LoadString( g_hinst, IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + + MessageBox( hwndDlg, szMessage, szTitle, MB_ICONERROR ); + SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT, UDM_SETPOS32, NULL, (LPARAM) 1000 ); + SetFocus( GetDlgItem( hwndDlg, IDC_CRYPTOGRAPHY_EDIT_TICKET_TIMEOUT ) ); + return FALSE; + } + + if( pdata->bTicketTimeoutChanged ) + { + pdata->nTicketTimeout = lValue; + } + + if( IsWindowEnabled( GetDlgItem( hwndDlg, IDC_CRYPTOGRAPHY_EDIT_TIMEOUT ) ) ) + { + // + // Check that the cryptography expiration is within specs + // + lValue = SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TIMEOUT, UDM_GETPOS32, NULL, (LPARAM) &bError ); + + if( bError ) + { + // + // Value out of range + // + LoadString( g_hinst, IDS_CRYPTOGRAPHY_TIMEOUT_ERROR, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_CRYPTOGRAPHY_TICKET_TIMEOUT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + + MessageBox( hwndDlg, szMessage, szTitle, MB_ICONERROR ); + SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_SPIN_TIMEOUT, UDM_SETPOS32, NULL, (LPARAM) 365 ); + SetFocus( GetDlgItem( hwndDlg, IDC_CRYPTOGRAPHY_EDIT_TIMEOUT ) ); + return FALSE; + } + + // + // We won't update the key timeout unless auto + // reset is enabled + // + if( pdata->bKeyTimeoutChanged ) + { + pdata->nKeyTimeout = lValue; + } + } + + if( pdata->bAutoKeyResetChanged ) + { + LRESULT nChecked = SendDlgItemMessage( hwndDlg, IDC_CRYPTOGRAPHY_CHECK_AUTO_RESET, BM_GETCHECK, NULL, NULL ); + pdata->bAutoKeyReset = BST_CHECKED == nChecked; + } + EndDialog( hwndDlg, TRUE ); + } + break; + + case IDCANCEL: + { + // + // Reset the change flags if the dialog is cancelled + // + pdata->bAutoKeyResetChanged = false; + pdata->bKeyTimeoutChanged = false; + pdata->bTicketTimeoutChanged = false; + + EndDialog( hwndDlg, FALSE ); + } + break; + } /* End switch(...)*/ + } /* End case WM_COMMAND */ + break; + case WM_NOTIFY: + { + SecurityData* pdata = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ) ; + LPNMHDR phdr = (LPNMHDR) lParam; + + if( UDN_DELTAPOS == phdr->code && IDC_CRYPTOGRAPHY_SPIN_TIMEOUT == phdr->idFrom ) + { + pdata->bKeyTimeoutChanged = true; + } + else if( UDN_DELTAPOS == phdr->code && IDC_CRYPTOGRAPHY_SPIN_TICKET_TIMEOUT == phdr->idFrom ) + { + pdata->bTicketTimeoutChanged = true; + } + } + break; + + case WM_DESTROY: + break; + + } /* End switch(nMsg) */ + + return FALSE; +} + +BOOL +CUDDISiteNode::IsDatabaseServer( PTCHAR szName ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup" ), KEY_READ, szName ); + DWORD dwDB = key.GetDWORD( _T( "DBServer" ), 0 ); + key.Close(); + + return ( 0 == dwDB ) ? FALSE : TRUE; + } + catch( ... ) + { + return FALSE; + } +} + +BOOL +CUDDISiteNode::IsDatabaseServer( PTCHAR szName, PTCHAR szInstance ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup" ), KEY_READ, szName ); + DWORD dwDB = key.GetDWORD( _T( "DBServer" ), 0 ); + key.Close(); + + if( 0 == dwDB ) + return FALSE; + + CUDDIRegistryKey dbkey( _T( "SOFTWARE\\Microsoft\\UDDI" ), KEY_READ, szName ); + tstring strInstance = dbkey.GetString( _T( "InstanceName" ), _T("") ); + dbkey.Close(); + + if( 0 != _tcsicmp( szInstance, InstanceRealName( strInstance.c_str() ) ) ) + return FALSE; + + return TRUE; + } + catch( ... ) + { + return FALSE; + } +} + +BOOL CUDDISiteNode::ResetCryptography() +{ + BOOL fRet = FALSE; + try + { + HRESULT hr = E_FAIL; + ADM_execResetKeyImmediate resetkey; + resetkey.m_connectionString = GetConnectionStringOLEDB().c_str(); + + hr = resetkey.Open(); + + if( FAILED(hr) || 0 != resetkey.m_RETURNVALUE ) + { + CUDDISiteNode::HandleOLEDBError( hr ); + } + + m_mapConfig[ UDDI_KEY_RESET_DATE ] = resetkey.m_keyLastResetDate; + fRet = TRUE; + } + catch( CUDDIException &e ) + { + OutputDebugString( e ); + fRet = FALSE; + } + catch( ... ) + { + fRet = FALSE; + } + + return fRet; +} + +HRESULT CUDDISiteNode::SaveData() +{ + HRESULT hr = S_OK; + + // + // Save each modifed configuration value into the configuration table + // using net_config_save + // + OutputDebugString( _T("Updating Values...\n") ); + + for( CConfigMap::iterator iter = m_mapChanges.begin(); + iter != m_mapChanges.end(); iter++ ) + { + if( 0 == _tcsicmp( (*iter).first.c_str(), UDDI_ADMIN_GROUP ) ) + { + OutputDebugString( _T("The Administrator Group Name was modified\n") ); + + // + // The admin group has been changed. We need to update this independently because the + // translation of the "S-1..." format to SID is very difficult in T-SQL + // + // TODO: This call should be bound inside a transaction. with net_config_save + // + ADM_setAdminAccount updateadmin; + updateadmin.m_connectionString = GetConnectionStringOLEDB().c_str(); + _tcsncpy( updateadmin.m_accountName, GroupNameFromSid( (*iter).second, m_szName ).c_str(), ARRAYLEN( updateadmin.m_accountName ) ); + updateadmin.m_accountName[ ARRAYLEN( updateadmin.m_accountName ) - 1 ] = NULL; + hr = updateadmin.Open(); + if( FAILED(hr) || 0 != updateadmin.m_RETURNVALUE ) + { + try + { + CUDDISiteNode::HandleOLEDBError( hr ); + } + catch( CUDDIException &e ) + { + // leave 'hr' the same. + OutputDebugString( e ); + } + catch( ... ) + { + // leave 'hr' the same. + } + + break; + } + } + + OutputDebugString( (*iter).first.c_str() ); + OutputDebugString( _T(" = ") ); + OutputDebugString( (*iter).second.c_str() ); + OutputDebugString( _T("\n") ); + + net_config_save rs; + rs.m_connectionString = GetConnectionStringOLEDB().c_str(); + _tcsncpy( rs.m_configName, (*iter).first.c_str(), ARRAYLEN( rs.m_configName ) - 1 ); + rs.m_configName[ ARRAYLEN( rs.m_configName ) - 1 ] = 0x00; + + _tcsncpy( rs.m_configValue, (*iter).second.c_str(), ARRAYLEN( rs.m_configValue ) - 1 ); + rs.m_configValue[ ARRAYLEN( rs.m_configValue ) - 1 ] = 0x00; + + hr = rs.Open(); + if( FAILED(hr) || 0 != rs.m_RETURNVALUE ) + { + try + { + CUDDISiteNode::HandleOLEDBError( hr ); + } + catch( CUDDIException &e ) + { + // leave 'hr' the same. + OutputDebugString( e ); + } + catch( ... ) + { + // leave 'hr' the same. + } + + break; + } + } + + // + // Regardless of the outcome clear the change collection + // + m_mapChanges.clear(); + + return hr; +} + +struct PropertyData +{ + CUDDISiteNode* pServer; + _TCHAR szName[ 512 ]; + _TCHAR szValue[ 512 ]; + _TCHAR szDefault[ 512 ]; + _TCHAR szHelpText[ 512 ]; +}; + +BOOL CALLBACK CUDDISiteNode::AdvancedDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) + { + case WM_INITDIALOG: + { + CUDDISiteNode* pDatabaseServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, reinterpret_cast(pDatabaseServer) ); + + CConfigMap& m_mapConfig = pDatabaseServer->m_mapConfig; + HWND hwndList = GetDlgItem( hwndDlg, IDC_ACTIVEDIRECTORY_LIST_ADVANCED ); + + ListView_SetExtendedListViewStyleEx( hwndList, 0, LVS_EX_BORDERSELECT | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES ); + + TCHAR szName[ 256 ]; + LVCOLUMN lvcol; + LoadString( g_hinst, IDS_ADVANCED_NAME_COLUMN_NAME, szName, ARRAYLEN( szName ) ); + ZeroMemory( &lvcol, sizeof( lvcol ) ); + lvcol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT; + lvcol.fmt = LVCFMT_LEFT; + lvcol.cx = 150; + lvcol.pszText = szName; + ListView_InsertColumn( hwndList, 0, &lvcol ); + + LoadString( g_hinst, IDS_ADVANCED_VALUE_COLUMN_NAME, szName, ARRAYLEN( szName ) ); + ZeroMemory( &lvcol, sizeof( lvcol ) ); + lvcol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT; + lvcol.fmt = LVCFMT_LEFT; + lvcol.cx = 215; + lvcol.pszText = szName; + ListView_InsertColumn( hwndList, 1, &lvcol ); + + LPCTSTR ppszValues[] = { + UDDI_DISCOVERY_URL, + UDDI_FIND_MAXROWS, + UDDI_OPERATOR_NAME }; + + for( int i=0; i< ARRAYLEN( ppszValues ); i++ ) + { + LVITEM item; + ZeroMemory( &item, sizeof( item ) ); + item.mask = LVIF_TEXT; + item.pszText = _T(""); + int nIndex = ListView_InsertItem( hwndList, &item ); + + ListView_SetItemText( hwndList, nIndex, 0, (PTCHAR) ppszValues[ i ] ); + ListView_SetItemText( hwndList, nIndex, 1, (_TCHAR*) m_mapConfig[ ppszValues[ i ] ].c_str() ); + } + + break; + } + case WM_COMMAND: + if( IDC_ADVANCED_BTN_EDIT == LOWORD( wParam ) ) + { + CUDDISiteNode* pDatabaseServer = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + + HWND hwndList = GetDlgItem( hwndDlg, IDC_ACTIVEDIRECTORY_LIST_ADVANCED ); + int n = ListView_GetNextItem( hwndList, -1, LVNI_SELECTED ); + if( -1 != n ) + { + PropertyData data; + data.pServer = pDatabaseServer; + + ListView_GetItemText( hwndList, n, 0, data.szName, 256 ); + ListView_GetItemText( hwndList, n, 1, data.szValue, 256 ); + + INT_PTR nResult = DialogBoxParam( g_hinst, MAKEINTRESOURCE( IDD_ADVANCED_EDIT ), hwndDlg, PropertyEditDialogProc, (LPARAM) &data ); + + if( nResult ) + { + ListView_SetItemText( hwndList, n, 1, data.szValue ); + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + } + } + } + break; + case WM_NOTIFY: + if( IDC_ACTIVEDIRECTORY_LIST_ADVANCED == wParam && NM_DBLCLK == ((LPNMHDR)lParam)->code ) + { + CUDDISiteNode* pDatabaseServer = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + + HWND hwndList = GetDlgItem( hwndDlg, IDC_ACTIVEDIRECTORY_LIST_ADVANCED ); + + // + // The list was double-clicked + // use hit test to determine the item index + // + LPNMITEMACTIVATE pitem = (LPNMITEMACTIVATE) lParam; + LVHITTESTINFO htinfo; + ZeroMemory( &htinfo, sizeof( LVHITTESTINFO ) ); + htinfo.pt = pitem->ptAction; + int n = ListView_SubItemHitTest( GetDlgItem( hwndDlg, IDC_ACTIVEDIRECTORY_LIST_ADVANCED ),&htinfo ); + + if( -1 != n ) + { + PropertyData data; + data.pServer = pDatabaseServer; + + ListView_GetItemText( hwndList, n, 0, data.szName, ARRAYLEN( data.szName ) ); + ListView_GetItemText( hwndList, n, 1, data.szValue, ARRAYLEN( data.szValue ) ); + + INT_PTR nResult = DialogBoxParam( g_hinst, MAKEINTRESOURCE( IDD_ADVANCED_EDIT ), hwndDlg, PropertyEditDialogProc, (LPARAM) &data ); + + if( nResult ) + { + ListView_SetItemText( hwndList, n, 1, data.szValue ); + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + } + } + } + else if( IDC_ACTIVEDIRECTORY_LIST_ADVANCED == wParam && + LVN_ITEMCHANGED == ((LPNMHDR)lParam)->code ) + { + HWND hwndList = GetDlgItem( hwndDlg, IDC_ACTIVEDIRECTORY_LIST_ADVANCED ); + EnableWindow( GetDlgItem( hwndDlg, IDC_ADVANCED_BTN_EDIT ), ( ListView_GetSelectedCount( hwndList ) > 0 ) ); + } + else if( PSN_APPLY == ((NMHDR *) lParam)->code ) + { + CUDDISiteNode* pDatabaseServer = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + + // + // Loop through the items and add modified items to the change collection + // + HWND hwndList = GetDlgItem( hwndDlg, IDC_ACTIVEDIRECTORY_LIST_ADVANCED ); + int n = ListView_GetNextItem( hwndList, -1, LVNI_ALL ); + while( -1 != n ) + { + _TCHAR szModified[ 2 ]; + ListView_GetItemText( hwndList, n, 0, szModified, 2 ); + + if( NULL != szModified[ 0 ] ) + { + _TCHAR szName[ 256 ]; + _TCHAR szValue[ 256 ]; + ListView_GetItemText( hwndList, n, 0, szName, ARRAYLEN( szName ) ); + ListView_GetItemText( hwndList, n, 1, szValue, ARRAYLEN( szValue ) ); + pDatabaseServer->m_mapChanges[ szName ] = szValue; + } + + n = ListView_GetNextItem( hwndList, n, LVNI_ALL ); + } + + // + // Ask MMC to send us a message (on the main thread) so + // we know the Apply button was clicked. + // + HRESULT hr = MMCPropertyChangeNotify( pDatabaseServer->m_ppHandle, reinterpret_cast( pDatabaseServer ) ); + _ASSERT( SUCCEEDED(hr) ); + + return PSNRET_NOERROR; + } + else if( PSN_HELP == ((NMHDR *) lParam)->code ) + { + CUDDISiteNode* pDatabaseServer = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + wstring strHelp( pDatabaseServer->GetHelpFile() ); + strHelp += g_wszUddiAdvancedPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + + break; + case WM_HELP: + { + CUDDISiteNode* pDatabaseServer = reinterpret_cast( GetWindowLongPtr( hwndDlg, GWLP_USERDATA ) ); + wstring strHelp( pDatabaseServer->GetHelpFile() ); + strHelp += g_wszUddiAdvancedPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + } + + return FALSE; +} + +BOOL CALLBACK CUDDISiteNode::PropertyEditDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) + { + case WM_INITDIALOG: + { + PropertyData* pdata = (PropertyData*) lParam; + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, reinterpret_cast( pdata ) ); + + SetDlgItemText( hwndDlg, IDC_ADVANCED_EDIT_TXT_NAME, pdata->szName ); + SetDlgItemText( hwndDlg, IDC_ADVANCED_EDIT_VALUE, pdata->szValue ); + break; + } + case WM_HELP: + { + PropertyData* pdata = reinterpret_cast( GetWindowLongPtrA( hwndDlg, GWLP_USERDATA ) ); + wstring strHelp( pdata->pServer->GetHelpFile() ); + + strHelp += g_wszUddiEditPropertyHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + break; + } + case WM_COMMAND: + + if( IDOK == LOWORD( wParam ) ) + { + PropertyData* pdata = reinterpret_cast( GetWindowLongPtrA( hwndDlg, GWLP_USERDATA ) ); + GetDlgItemText( hwndDlg, IDC_ADVANCED_EDIT_VALUE, pdata->szValue, sizeof( pdata->szValue ) / sizeof( _TCHAR ) ); + + EndDialog( hwndDlg, TRUE ); + return FALSE; + } + else if( IDCANCEL == LOWORD( wParam ) ) + { + EndDialog( hwndDlg, FALSE ); + return FALSE; + } + else if( IDHELP == LOWORD( wParam ) ) + { + PropertyData* pdata = reinterpret_cast( GetWindowLongPtrA( hwndDlg, GWLP_USERDATA ) ); + wstring strHelp( pdata->pServer->GetHelpFile() ); + strHelp += g_wszUddiEditPropertyHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + } + + return FALSE; +} + +BOOL CALLBACK CUDDISiteNode::NewDatabaseServerDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + static DatabaseData* pData = NULL; + + switch( uMsg ) + { + case WM_INITDIALOG: + { + WCHAR wszBuf[ 256 ]; + wszBuf[ 0 ] = 0x00; + DWORD dwBufSize = 256; + + GetComputerName( wszBuf, &dwBufSize ); + + pData = reinterpret_cast(lParam); + + BOOL fChildExists = FALSE; + if( pData && pData->pBase ) + { + if( pData->pBase->ChildExists( wszBuf ) ) + { + fChildExists = TRUE; + } + } + + if( IsDatabaseServer( _T("") ) && !fChildExists ) + { + SendDlgItemMessage( hwndDlg, IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER, BM_SETCHECK, TRUE, NULL ); + EnableWindow( GetDlgItem( hwndDlg, IDOK ), TRUE ); + RefreshInstances( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE ) ); + } + else + { + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER ), FALSE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_BTN_BROWSE ), TRUE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ), TRUE ); + EnableWindow( GetDlgItem( hwndDlg, IDOK ), FALSE ); + + SetDlgItemText( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE, _T("") ); + SendDlgItemMessage( hwndDlg, IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER, BM_SETCHECK, TRUE, NULL ); + SetFocus( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ) ); + } + break; + } + + case WM_HELP: + { + wstring strHelp( pData->pBase->GetHelpFile() ); + strHelp += g_wszUddiAddSiteHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + break; + } + + case WM_COMMAND: + { + switch( LOWORD(wParam) ) + { + case IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER: + { + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_BTN_BROWSE ), FALSE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ), FALSE ); + EnableWindow( GetDlgItem( hwndDlg, IDOK ), TRUE ); + + RefreshInstances( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE ) ); + break; + } + + case IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER: + { + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_BTN_BROWSE ), TRUE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ), TRUE ); + + WCHAR wszComputerName[ 256 ]; + wszComputerName[ 0 ] = 0x00; + GetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, wszComputerName, ARRAYLEN( wszComputerName ) ); + + // + // Enable the OK button only if there is some sort of text + // in the edit control where the computer name is supposed + // to be typed in. + // + EnableWindow( GetDlgItem( hwndDlg, IDOK ), 0 == wcslen( wszComputerName ) ? FALSE : TRUE ); + + if( 0 == _tcslen( wszComputerName ) ) + SetDlgItemText( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE, _T("") ); + else + RefreshInstances( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE ), wszComputerName ); + + break; + } + + case IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER: + { + if( EN_CHANGE == HIWORD(wParam) ) + { + SetDlgItemText( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE, _T("") ); + + WCHAR wszComputerName[ 256 ]; + wszComputerName[ 0 ] = 0x00; + GetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, wszComputerName, ARRAYLEN( wszComputerName ) ); + + // + // Enable the OK button only if there is some sort of text + // in the edit control where the computer name is supposed + // to be typed in. + // + EnableWindow( GetDlgItem( hwndDlg, IDOK ), 0 == wcslen( wszComputerName ) ? FALSE : TRUE ); + } + break; + } + + case IDC_SITE_CONNECT_BTN_BROWSE: + { + _TCHAR szComputerName[ 256 ]; + if( ObjectPicker( hwndDlg, OT_Computer, szComputerName, ARRAYLEN( szComputerName ) ) ) + { + SetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, szComputerName ); + RefreshInstances( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE ), szComputerName ); + } + + break; + } + + case IDHELP: + { + wstring strHelp( pData->pBase->GetHelpFile() ); + strHelp += g_wszUddiAddSiteHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + + break; + } + + case IDOK: + { + DWORD dwSize = 256; + + if( SendDlgItemMessage( hwndDlg, IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER, BM_GETCHECK, NULL, NULL ) ) + { + // + // The user chose to use the database on the local computer. + // + pData->szServerName[ 0 ] = 0; + GetComputerName( pData->szServerName, &dwSize ); + } + else + { + // + // The user chose to go with whatever they typed in for a computer name. + // + GetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, pData->szServerName, dwSize ); + + static const tstring szLocalhost = _T("localhost"); + + // + // If the user typed in 'localhost', we have to switch it. Must be + // careful though... 'localhostabc' is a 100% legal computer name. + // + if( ( szLocalhost.length() == _tcslen( pData->szServerName ) ) && ( 0 == _tcsncicmp( szLocalhost.c_str(), pData->szServerName, szLocalhost.length() ) ) ) + { + dwSize = 256; + pData->szServerName[ 0 ] = 0; + GetComputerName( pData->szServerName, &dwSize ); + + // + // If there is no UDDI database installed on the local computer, + // tell the user & force them to re-select. + // + if( !CUDDISiteNode::IsDatabaseServer( pData->szServerName ) ) + { + _TCHAR szTitle[ 256 ]; + _TCHAR szMessage[ 1024 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + MessageBox( hwndDlg, szMessage, szTitle, MB_ICONERROR ); + return FALSE; + } + } + } + + if( 0 == _tcslen( pData->szServerName ) || !CUDDISiteNode::IsDatabaseServer( pData->szServerName ) ) + { + _TCHAR szTitle[ 256 ]; + _TCHAR szMessage[ 1024 ]; + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_DATABASE_SERVER_SELECT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + MessageBox( hwndDlg, szMessage, szTitle, MB_ICONERROR ); + return FALSE; + } + + // + // Copy the instance name into the structure + // + tstring strLocalInstanceName; + BOOL bSuccess = CUDDISiteNode::GetFullyQualifiedInstanceName( pData->szServerName, strLocalInstanceName ); + _tcsncpy( pData->szInstanceName, strLocalInstanceName.c_str(), ARRAYLEN( pData->szInstanceName ) ); + pData->szInstanceName[ ARRAYLEN( pData->szInstanceName ) - 1 ] = NULL; + + ToUpper( pData->szServerName ); + + EndDialog( hwndDlg, TRUE ); + return TRUE; + } + + case IDCANCEL: + { + EndDialog( hwndDlg, FALSE ); + return TRUE; + } + } + } + + case WM_DESTROY: + { + break; + } + } + + return FALSE; +} + +BOOL GetInstances( PTCHAR szComputer, StringVector& instances ) +{ + try + { + CUDDIRegistryKey key( _T("SOFTWARE\\Microsoft\\Microsoft SQL Server" ), KEY_READ, szComputer ); + key.GetMultiString( _T("InstalledInstances"), instances ); + } + catch(...) + { + } + + return ( 0 != instances.size() ); +} + +// +// This function will look at the registry of the specifed +// computer and determine it hosts a UDDI Services Database +// Component. If it does it will set the text of the specified +// control and return TRUE. +// +BOOL RefreshInstances( HWND hwnd, PTCHAR szComputerName ) +{ + try + { + _TCHAR szText[ 512 ]; + _TCHAR szComputer[ 256 ]; + DWORD dwSize = ARRAYLEN( szComputer ); + + if( 0 == _tcslen( szComputerName ) ) + { + szComputer[ 0 ] = 0; + ::GetComputerName( szComputer, &dwSize ); + } + else + { + _tcsncpy( szComputer, szComputerName, ARRAYLEN( szComputer ) - 1 ); + szComputer[ ARRAYLEN( szComputer ) - 1 ] = NULL; + } + + BOOL bFound = FALSE; + + StringVector instances; + if( GetInstances( szComputer, instances ) ) + { + CUDDIRegistryKey dbkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup\\DBServer" ), KEY_READ, szComputer ); + tstring strInstance = dbkey.GetString( _T( "InstanceNameOnly" ), _T("----") ); + dbkey.Close(); + + if( _T("----") != strInstance ) + { + for( StringVector::iterator iter = instances.begin(); + iter != instances.end() && !bFound; iter++ ) + { + if( 0 == _tcsicmp( strInstance.c_str(), InstanceDisplayName( (*iter).c_str() ) ) ) + { + _TCHAR szTemplate[ 512 ]; + LoadString( g_hinst, IDS_SITE_CONNECT_INSTANCE_FOUND_TEMPLATE, szTemplate, ARRAYLEN( szTemplate ) ); + _sntprintf( szText, ARRAYLEN( szText ), szTemplate, strInstance.c_str() ); + szText[ ARRAYLEN( szText ) - 1 ] = NULL; + bFound = TRUE; + } + } + } + } + + if( !bFound ) + { + LoadString( g_hinst, IDS_SITE_CONNECT_NO_INSTANCES_FOUND, szText, ARRAYLEN( szText ) ); + } + + SetWindowText( hwnd, szText ); + + return TRUE; + } + catch( ... ) + { + return FALSE; + } +} + +_TCHAR szDefaultInstance[ 256 ] = _T(""); + +_TCHAR* DefaultInstanceDisplayName() +{ + if( !szDefaultInstance[ 0 ] ) + { + ::LoadString( g_hinst, IDS_DATABASE_SERVER_DEFAULT_INSTANCE, szDefaultInstance, ARRAYLEN( szDefaultInstance ) ); + } + + return (_TCHAR*) szDefaultInstance; +} + +const _TCHAR szDefaultRealName[] = _T(""); + +LPCTSTR InstanceDisplayName( LPCTSTR szName ) +{ + if( tstring( szName ) == tstring( _T("MSSQLSERVER") ) || + 0 == _tcslen( szName ) ) + { + return DefaultInstanceDisplayName(); + } + else + return szName; +} + +LPCTSTR InstanceRealName( LPCTSTR szName ) +{ + if( tstring( szName ) == tstring( DefaultInstanceDisplayName() ) ) + { + return szDefaultRealName; + } + else + return szName; +} + +void +CUDDISiteNode::HandleOLEDBError( HRESULT hrErr ) +{ + CDBErrorInfo ErrorInfo; + ULONG cRecords = 0; + HRESULT hr; + ULONG i; + CComBSTR bstrDesc, bstrHelpFile, bstrSource, bstrMsg; + GUID guid; + DWORD dwHelpContext; + WCHAR wszGuid[40]; + USES_CONVERSION; + + // If the user passed in an HRESULT then trace it + if( hrErr != S_OK ) + { + TCHAR sz[ 256 ]; + _sntprintf( sz, 256, _T("OLE DB Error Record dump for hr = 0x%x\n"), hrErr ); + sz[ 255 ] = 0x00; + bstrMsg += sz; + } + + LCID lcLocale = GetSystemDefaultLCID(); + + hr = ErrorInfo.GetErrorRecords(&cRecords); + if( FAILED(hr) && ( ErrorInfo.m_spErrorInfo == NULL ) ) + { + TCHAR sz[ 256 ]; + _sntprintf( sz, 256, _T("No OLE DB Error Information found: hr = 0x%x\n"), hr ); + sz[ 255 ] = 0x00; + bstrMsg += sz; + } + else + { + for( i = 0; i < cRecords; i++ ) + { + hr = ErrorInfo.GetAllErrorInfo(i, lcLocale, &bstrDesc, &bstrSource, &guid, + &dwHelpContext, &bstrHelpFile); + if( FAILED(hr) ) + { + TCHAR sz[ 256 ]; + _sntprintf( sz, 256, _T("OLE DB Error Record dump retrieval failed: hr = 0x%x\n"), hr ); + sz[ 255 ] = 0x00; + bstrMsg += sz; + break; + } + + StringFromGUID2( guid, wszGuid, sizeof(wszGuid) / sizeof(WCHAR) ); + TCHAR sz[ 256 ]; + _sntprintf( + sz, 256, + _T("Row #: %4d Source: \"%s\" Description: \"%s\" Help File: \"%s\" Help Context: %4d GUID: %s\n"), + i, OLE2T(bstrSource), OLE2T(bstrDesc), OLE2T(bstrHelpFile), dwHelpContext, OLE2T(wszGuid) ); + + sz[ 255 ] = 0x00; + bstrMsg += sz; + + bstrSource.Empty(); + bstrDesc.Empty(); + bstrHelpFile.Empty(); + } + + bstrMsg += _T("OLE DB Error Record dump end\n"); + + throw CUDDIException( hrErr, wstring( bstrMsg.m_str ) ); + } +} + + +void +CUDDISiteNode::ClearChildMap() +{ + for( CUDDIWebServerNodeMap::iterator iter = m_mapChildren.begin(); + iter != m_mapChildren.end(); iter++ ) + { + delete iter->second; + iter->second = NULL; + } + + m_mapChildren.clear(); +} + + +BOOL +CUDDISiteNode::LoadChildMap( const tstring& szWebServers ) +{ + BOOL fRet = FALSE; + + // + // Blow away any current children. + // + ClearChildMap(); + + if( IsExtension() ) + { + if( CUDDIWebServerNode::IsWebServer( m_szName ) ) + { + tstring strDomain, strServer, strInstance, strWriter; + CUDDIWebServerNode::GetWriterConnectionString( m_szName, strWriter ); + + if( !strWriter.empty() ) + { + CUDDIWebServerNode::CrackConnectionString( strWriter, strDomain, strServer, strInstance ); + + if( 0 == _tcsicmp( strServer.c_str(), m_szName ) ) + { + UINT n = m_nNextChildID; + m_nNextChildID++; + CUDDIWebServerNode *pNode = new CUDDIWebServerNode( strServer.c_str(), n, this, m_bIsExtension ); + AddChildEntry( pNode, n ); + } + } + } + } + else + { + CStringCollection webServers( szWebServers ); + int iWebServerCnt = webServers.Size(); + for( int i = 0; i < iWebServerCnt; i++ ) + { + const wstring& webServer = webServers[ i ]; + + // + // If the machine is hosting the UDDI Web Server, and if that Web Server is not already + // a part of this UDDI site, then add it. + // + if( CUDDIWebServerNode::IsWebServer( webServer.c_str() ) && ( NULL == FindChild( webServer.c_str() ) ) ) + { + UINT n = m_nNextChildID; + m_nNextChildID++; + CUDDIWebServerNode *pNode = new CUDDIWebServerNode( webServer.c_str(), n, this, m_bIsExtension ); + AddChildEntry( pNode, n ); + } + } + + fRet = TRUE; + + if( 0 == m_mapChildren.size() ) + { + if( CUDDIWebServerNode::IsWebServer( m_szName ) ) + { + tstring szWriter, szDomain, szServer, szInstance; + CUDDIWebServerNode::GetWriterConnectionString( m_szName, szWriter ); + + if( !szWriter.empty() ) + { + CUDDIWebServerNode::CrackConnectionString( szWriter, szDomain, szServer, szInstance ); + + if( 0 == _tcsicmp( szServer.c_str(), m_szName ) ) + { + // add a node in our child map, change our list of writers + UINT n = m_mapChildren.size(); + + CUDDIWebServerNode *pNode = new CUDDIWebServerNode( m_szName, n, this, m_bIsExtension ); + + + if( TRUE == AddChildEntry( pNode, n ) ) + { + tstring szWriters; + SaveChildMap( szWriters ); + + m_mapChanges[ UDDI_SITE_WEBSERVERS ] = szWriters; + } + } + } + } + } + } + return fRet; +} + +int +CUDDISiteNode::SaveChildMap( tstring& szWebServers ) +{ + szWebServers = _T(""); + BOOL fFirst = TRUE; + CUDDIWebServerNodeMap::iterator it; + int cnt = 0; + + for( it = m_mapChildren.begin(); it != m_mapChildren.end(); it++ ) + { + CUDDIWebServerNode *pWS = it->second; + + if( !pWS->IsDeleted() ) + { + if( fFirst ) + { + fFirst = FALSE; + } + else + { + szWebServers.append( _T("%") ); + } + + szWebServers.append( pWS->GetName() ); + cnt++; + } + } + + return cnt; +} + +void +CUDDISiteNode::OnDeleteChild( const tstring& szName ) +{ + // + // The child node has already removed itself from the scope pane. + // We use this function to update our change map to reflect the + // fact that we now have 1 less Web Server writing to this DB. + // + tstring szWebServers; + SaveChildMap( szWebServers ); + + m_mapChanges[ UDDI_SITE_WEBSERVERS ] = szWebServers; + + SaveData(); + + m_mapConfig[ UDDI_SITE_WEBSERVERS ] = szWebServers; +} + + +HRESULT +CUDDISiteNode::AddChildrenToScopePane( IConsoleNameSpace *pConsoleNameSpace, HSCOPEITEM parent ) +{ + HRESULT hr = E_FAIL; + + if( ( NULL == pConsoleNameSpace ) || ( NULL == parent ) ) + { + return E_INVALIDARG; + } + + // + // Create the child nodes, then expand them + // + SCOPEDATAITEM sdi; + CUDDIWebServerNodeMap::iterator it; + + for( it = m_mapChildren.begin(); it != m_mapChildren.end(); it++ ) + { + CUDDIWebServerNode *pWSNode = it->second; + if( NULL == pWSNode ) + { + hr = E_FAIL; + return hr; + } + + if( !( pWSNode->IsDeleted() ) ) + { + ZeroMemory( &sdi, sizeof(SCOPEDATAITEM) ); + + sdi.mask = SDI_STR | // Displayname is valid + SDI_PARAM | // lParam is valid + SDI_IMAGE | // nImage is valid + SDI_OPENIMAGE | // nOpenImage is valid + SDI_PARENT | + SDI_CHILDREN; + + sdi.relativeID = parent; + sdi.nImage = pWSNode->GetBitmapIndex(); + sdi.nOpenImage = MMC_IMAGECALLBACK; //INDEX_OPENFOLDER; + sdi.displayname = MMC_CALLBACK; + sdi.lParam = (LPARAM)pWSNode; // The cookie + sdi.cChildren = 0; + + hr = pConsoleNameSpace->InsertItem( &sdi ); + _ASSERT( SUCCEEDED(hr) ); + + pWSNode->SetScopeItemValue( sdi.ID ); + pWSNode->SetParentScopeItem( sdi.relativeID ); + } + } + + hr = S_OK; + return hr; +} + +HRESULT +CUDDISiteNode::GetConfig( CConfigMap& configMap, const tstring& connectionString ) +{ + tstring tempConnectionString( connectionString ); + if( connectionString.find( _T("Provider=SQLOLEDB.1") ) == std::wstring::npos ) + { + tempConnectionString.append( _T(";Provider=SQLOLEDB.1") ); + } + + net_config_get configGet; + configGet.m_connectionString = tempConnectionString.c_str(); + + DBROWCOUNT rowCount; + HRESULT hr = configGet.Open(); + + while( SUCCEEDED(hr) && hr != DB_S_NORESULT ) + { + if( NULL != configGet.GetInterface() ) + { + HRESULT hr2 = configGet.Bind(); + + if( SUCCEEDED( hr2 ) ) + { + while( S_OK == configGet.MoveNext() ) + { + _ASSERT( !configGet.m_dwconfigNameStatus ); + _ASSERT( !configGet.m_dwconfigValueStatus ); + + configMap[ configGet.m_configName ] = configGet.m_configValue; + } + } + } + + hr = configGet.GetNextResult( &rowCount ); + } + + return hr; +} + +HRESULT +CUDDISiteNode::SaveConfig( CConfigMap& configMap, const tstring& connectionString ) +{ + tstring tempConnectionString( connectionString ); + if( connectionString.find( _T("Provider=SQLOLEDB.1") ) == std::wstring::npos ) + { + tempConnectionString.append( _T(";Provider=SQLOLEDB.1") ); + } + + HRESULT hr = E_FAIL; + + for( CConfigMap::iterator iterator = configMap.begin(); iterator != configMap.end(); iterator++ ) + { + net_config_save configSave; + configSave.m_connectionString = tempConnectionString.c_str(); + + OutputDebugString( (*iterator).first.c_str() ); + OutputDebugString( _T(" = ") ); + OutputDebugString( (*iterator).second.c_str() ); + OutputDebugString( _T("\n") ); + + _tcsncpy( configSave.m_configName, (*iterator).first.c_str(), ARRAYLEN( configSave.m_configName ) - 1 ); + configSave.m_configName[ ARRAYLEN( configSave.m_configName ) - 1 ] = 0x00; + + _tcsncpy( configSave.m_configValue, (*iterator).second.c_str(), ARRAYLEN( configSave.m_configValue ) - 1 ); + configSave.m_configValue[ ARRAYLEN( configSave.m_configValue ) - 1 ] = 0x00; + + hr = configSave.Open(); + if( FAILED(hr) || 0 != configSave.m_RETURNVALUE ) + { + break; + } + } + + return hr; +} + +const _TCHAR * +CUDDISiteNode::GetNextWebServer( tstring& webServerList, int& position ) +{ + int length = webServerList.length(); + int nextPosition = position; + const _TCHAR* webServer = NULL; + + // + // No point if there no string. + // + if( 0 == length) + { + return NULL; + } + + while( nextPosition < length && webServerList[nextPosition] != WEBSERVER_LIST_DELIM ) + { + nextPosition++; + } + + if( nextPosition < length ) + { + webServerList[ nextPosition ] = NULL_TERMINATOR; + webServer = webServerList.c_str() + position; + } + else + { + webServer = ( 0 == position ) ? webServerList.c_str() : NULL; + } + position = nextPosition; + + return webServer; +} + +void +CUDDISiteNode::AddWebServer( tstring& webServerList, const tstring& webServer ) +{ + if( webServerList.length() > 0 ) + { + webServerList += WEBSERVER_LIST_DELIM; + } + webServerList.append( webServer ); +} + +BOOL +CUDDISiteNode::AddChildEntry( CUDDIWebServerNode *pNode, UINT position ) +{ + CUDDIWebServerNodeMapEntry entry( position, pNode ); + m_mapChildren.insert( entry ); + + return TRUE; +} + +void +CUDDISiteNode::AddChild( const wstring& strName, IConsole *pConsole ) +{ + if( FindChild( strName.c_str() ) || ( NULL == pConsole ) ) + { + return; + } + + IConsoleNameSpace *pConsoleNameSpace = NULL; + pConsole->QueryInterface( IID_IConsoleNameSpace, reinterpret_cast( &pConsoleNameSpace ) ); + if( NULL == pConsoleNameSpace ) + { + return; + } + + HRESULT hr; + + CUDDIWebServerNode *pNewWS = new CUDDIWebServerNode( strName.c_str(), m_nNextChildID, this, m_bIsExtension ); + m_nNextChildID++; + + AddChildEntry( pNewWS ); + + SCOPEDATAITEM sdi; + ZeroMemory( &sdi, sizeof( SCOPEDATAITEM ) ); + + sdi.mask = SDI_STR | // Displayname is valid + SDI_PARAM | // lParam is valid + SDI_IMAGE | // nImage is valid + SDI_OPENIMAGE | // nOpenImage is valid + SDI_PARENT | + SDI_CHILDREN; + + sdi.relativeID = GetScopeItemValue(); + sdi.nImage = pNewWS->GetBitmapIndex(); + sdi.nOpenImage = MMC_IMAGECALLBACK; + sdi.displayname = MMC_CALLBACK; + sdi.lParam = (LPARAM)pNewWS; + sdi.cChildren = pNewWS->HasChildren(); + + hr = pConsoleNameSpace->InsertItem( &sdi ); + _ASSERT( SUCCEEDED(hr) ); + + pNewWS->SetScopeItemValue( sdi.ID ); + pNewWS->SetParentScopeItem( sdi.relativeID ); + + // + // We created a new object in result pane. We need to insert this object + // in all the views, call UpdateAllViews for this. + // Pass pointer to data object passed into OnMenuCommand. + // + //hr = pConsole->UpdateAllViews( pDataObject, m_hParentHScopeItem, UPDATE_SCOPEITEM ); + //_ASSERT( S_OK == hr); + + // + // Prompt the user with a warning to tell them that they might have to alter their + // machine.config settings if this web server is part of a web farm. + // + WCHAR wszMessage[ 512 ]; + WCHAR wszTitle[ 512 ]; + memset( wszMessage, 0, 512 * sizeof( _TCHAR ) ); + memset( wszTitle, 0, 128 * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_WEBSERVER_WEBFARM_DETAIL, wszMessage, ARRAYLEN( wszMessage ) ); + LoadString( g_hinst, IDS_WEBSERVER_WEBFARM, wszTitle, ARRAYLEN( wszTitle ) ); + + HWND hwndConsole = NULL; + pConsole->GetMainWindow( &hwndConsole ); + + MessageBox( hwndConsole, wszMessage, wszTitle, MB_OK ); + + pConsoleNameSpace->Release(); +} + +BOOL +CUDDISiteNode::AddWebServerToSite( const wstring& strSite, + const wstring& strWebServer, + HWND hwndParent ) +{ + try + { + // + // Make sure our params at least have some sort of content! + // + if( ( 0 == strSite.length() ) || ( 0 == strWebServer.length() ) ) + { + return FALSE; + } + + // + // If strSite does not contain the name of a machine/cluster + // resource which hosts a UDDI Site, barf @ the user & exit + // immediately. + // + if( !CUDDISiteNode::IsDatabaseServer( (PTCHAR)strSite.c_str() ) ) + { + UDDIMsgBox( hwndParent, + IDS_DATABASE_SERVER_SELECT_ERROR, + IDS_DATABASE_SERVER_SELECT_ERROR_TITLE, + MB_ICONEXCLAMATION | MB_OK ); + return FALSE; + } + + // + // If strWebServer does not contain the name of a machine + // which hosts a UDDI Web Server, barf @ the user & exit + // immediately. + // + if( !CUDDIWebServerNode::IsWebServer( strWebServer.c_str() ) ) + { + UDDIMsgBox( hwndParent, + IDS_WEBSERVER_SELECT_ERROR, + IDS_WEBSERVER_SELECT_ERROR_TITLE, + MB_ICONEXCLAMATION | MB_OK ); + return FALSE; + } + + if( strSite != strWebServer ) + { + // + // In this particular case the user is attempting to add to the UDDI Site a + // UDDI Web Server which is running on a Windows Server 2003 Standard machine. This cannot + // happen. + // + BOOL bWSRunsOnStdSvr = TRUE; + HRESULT hr = E_FAIL; + hr = ::IsStandardServer( strWebServer.c_str(), &bWSRunsOnStdSvr ); + if( FAILED(hr) ) + { + UDDIMsgBox( hwndParent, + IDS_DOT_NET_SERVER, + IDS_ERROR_TITLE, + MB_ICONEXCLAMATION | MB_OK ); + return FALSE; + } + + if( TRUE == bWSRunsOnStdSvr ) + { + UDDIMsgBox( hwndParent, + IDS_WEBSERVER_NOT_ASSIGNABLE_DETAIL, + IDS_WEBSERVER_NOT_ASSIGNABLE, + MB_ICONEXCLAMATION | MB_OK ); + return FALSE; + } + + // + // In this particular case the user is attempting to add a UDDI Web Server + // to a UDDI Site which is running on a Windows Server 2003 Standard machine. This cannot + // happen. + // + BOOL bDBRunsOnStdSvr = TRUE; + hr = ::IsStandardServer( strSite.c_str(), &bDBRunsOnStdSvr ); + if( FAILED(hr) ) + { + UDDIMsgBox( hwndParent, + IDS_DOT_NET_SERVER, + IDS_ERROR_TITLE, + MB_ICONEXCLAMATION | MB_OK ); + return FALSE; + } + + if( TRUE == bDBRunsOnStdSvr ) + { + UDDIMsgBox( hwndParent, + IDS_DATABASE_STANDARD_SERVER_DETAIL, + IDS_DATABASE_STANDARD_SERVER, + MB_ICONEXCLAMATION | MB_OK ); + + return FALSE; + } + } + + // + // Do a check here to make sure the db schema on the new site + // is legit. + // + + wstring strWSCurrentSite = _T( "" ); + BOOL fWSCurrentSiteIsValid = FALSE; + BOOL fSameSite = FALSE; + BOOL fOKToMoveWebServer = FALSE; + + // + // 1. Determine if the web server is: currently assigned to a site, if that + // site is valid, and if that site is the same as the new site. + // + if( CUDDIWebServerNode::IsAssignedToSite( strWebServer, CM_Writer, strWSCurrentSite ) ) + { + // + // The web server thinks that it is currently assigned to a site. However we + // must take into consideration the following 2 cases: + // + // 1. The web server's connection string contains garbage. + // 2. The web server's connection string is valid, but the site that it + // refers to does not exist anymore. + // + if( ( 0 == strWSCurrentSite.length() ) || + !CUDDISiteNode::IsDatabaseServer( (PTCHAR)strWSCurrentSite.c_str() ) ) + { + fWSCurrentSiteIsValid = FALSE; + } + else + { + fWSCurrentSiteIsValid = TRUE; + } + + // + // The user is trying to add the web server back to the same site that the + // web server thinks it belongs to. This can happen when the user un-installs + // and then re-installs the database. + // + fSameSite = ( 0 == _wcsicmp( strWSCurrentSite.c_str(), strSite.c_str() ) ) ? TRUE : FALSE; + + // + // If the old site is valid, and if the site that the user wants isn't the + // old site, ask them if they are really sure. + // + if( fWSCurrentSiteIsValid && !fSameSite ) + { + // + // First prompt the user to see if they really want to remove the web server from its current site. + // + WCHAR wszMessage[ 512 ]; + WCHAR wszMessageFormat[ 512 ]; + WCHAR wszTitle[ 128 ]; + + wszMessage[ 0 ] = 0x00; + wszTitle[ 0 ] = 0x00; + wszMessageFormat[ 0 ] = 0x00; + + LoadString( g_hinst, IDS_WEBSERVER_ASSIGNED_DETAIL, wszMessageFormat, ARRAYLEN( wszMessageFormat ) ); + _sntprintf( wszMessage, + ARRAYLEN(wszMessage) - 1, + wszMessageFormat, + strWebServer.c_str(), + strWSCurrentSite.c_str(), + strWebServer.c_str(), + strSite.c_str() ); + + LoadString( g_hinst, IDS_WEBSERVER_ASSIGNED, wszTitle, ARRAYLEN( wszTitle ) ); + + int iYesNo = MessageBox( hwndParent, wszMessage, wszTitle, MB_YESNO ); + if( IDNO == iYesNo ) + { + return FALSE; + } + else + { + fOKToMoveWebServer = TRUE; + } + } + // + // If we're in here, either the old site is bogus, or it's the same site. + // In either case, it's ok to move the web server. + // + else + { + fOKToMoveWebServer = TRUE; + } + } + else + { + fOKToMoveWebServer = TRUE; + } + + // + // 2. Get the list of Web Servers that the old Site contains. + // + if( ( FALSE == fSameSite ) && fWSCurrentSiteIsValid ) + { + HRESULT hr = E_FAIL; + CConfigMap configOldSite; + wstring strOldConnStr; + + BOOL b = CUDDIWebServerNode::GetWriterConnectionString( strWebServer, strOldConnStr ); + + CUDDIWebServerNode::SetWriterConnectionString( strWebServer, L"" ); + CUDDIWebServerNode::SetReaderConnectionString( strWebServer, L"" ); + + hr = GetConfig( configOldSite, strOldConnStr ); + if( FAILED(hr) ) + { + UDDIMsgBox( hwndParent, + IDS_DATABASE_SERVER_OLEDB_READ_FAILED, + IDS_DATABASE_SERVER_GETDATA_ERROR_TITLE, + MB_OK ); + return FALSE; + } + + CStringCollection oldSiteWebServers( configOldSite[ UDDI_SITE_WEBSERVERS ] ); + oldSiteWebServers.DeleteString( strWebServer ); + configOldSite[ UDDI_SITE_WEBSERVERS ] = oldSiteWebServers.GetDelimitedString(); + + hr = SaveConfig( configOldSite, strOldConnStr ); + if( FAILED(hr) ) + { + WCHAR wszMessageFormat[ 512 ]; + WCHAR wszTitle[ 128 ]; + + memset( wszMessageFormat, 0, 512 * sizeof( WCHAR ) ); + memset( wszTitle, 0, 128 * sizeof( WCHAR ) ); + + LoadString( g_hinst, + IDS_WEBSERVER_REMOVE_FAILED_DETAIL, + wszMessageFormat, + ARRAYLEN( wszMessageFormat ) ); + + TCHAR pwszFormatted[ 512 ]; + pwszFormatted[ 0 ] = 0x00; + + LPCTSTR pwszArgs[ 3 ] = { strWebServer.c_str(), strWSCurrentSite.c_str(), strSite.c_str() }; + DWORD dwBytesWritten = FormatMessage( FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, + (LPCVOID)wszMessageFormat, + 0, + 0, + pwszFormatted, + 512, + (va_list *)pwszArgs + ); + + LoadString( g_hinst, + IDS_WEBSERVER_REMOVE_FAILED, + wszTitle, + ARRAYLEN( wszTitle ) ); + + int iYesNo = MessageBox( hwndParent, + pwszFormatted, + wszTitle, + MB_ICONEXCLAMATION | MB_YESNO ); + + // + // User does not want to continue. + // + if( IDNO == iYesNo ) + { + CUDDIWebServerNode::SetReaderConnectionString( strWebServer, strOldConnStr ); + CUDDIWebServerNode::SetWriterConnectionString( strWebServer, strOldConnStr ); + + return FALSE; + } + } + } + + + // + // 3. Get the list of Web Servers that the new Site contains. + // + if( fOKToMoveWebServer ) + { + HRESULT hr = E_FAIL; + CConfigMap configNewSite; + wstring strNewConnStr; + + strNewConnStr = CUDDIWebServerNode::BuildConnectionString( strSite ); + hr = GetConfig( configNewSite, strNewConnStr ); + if( FAILED(hr) ) + { + UDDIMsgBox( hwndParent, + IDS_DATABASE_SERVER_OLEDB_READ_FAILED, + IDS_DATABASE_SERVER_GETDATA_ERROR_TITLE, + MB_OK ); + return FALSE; + } + + wstring strWSSchemaVersion; + if( !CUDDIWebServerNode::GetDBSchemaVersion( strWebServer, strWSSchemaVersion ) ) + { + WCHAR wszTitle[ 256 ]; + WCHAR wszMessageFormat[ 512 ]; + WCHAR wszMessage[ 512 ]; + + memset( wszMessage, 0, 512 * sizeof( WCHAR ) ); + memset( wszMessageFormat, 0, 512 * sizeof( WCHAR ) ); + + LoadString( g_hinst, IDS_ERROR_TITLE, wszTitle, ARRAYLEN( wszTitle ) ); + LoadString( g_hinst, IDS_WEBSERVER_SERVER_DBSCHEMA_VERSION_READ_FAILED, wszMessageFormat, ARRAYLEN( wszMessageFormat ) ); + _sntprintf( wszMessage, ARRAYLEN( wszMessage ) - 1, wszMessageFormat, strWebServer.c_str() ); + + MessageBox( hwndParent, wszMessage, wszTitle, MB_ICONERROR ); + + return FALSE; + } + + CDBSchemaVersion schemaVersionWS; + if( !schemaVersionWS.Parse( strWSSchemaVersion ) ) + { + _TCHAR szTitle[ 256 ]; + _TCHAR szMessageFormat[ 512 ]; + _TCHAR szMessage[ 512 ]; + + memset( szMessage, 0, 512 * sizeof( _TCHAR ) ); + memset( szMessageFormat, 0, 512 * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + LoadString( g_hinst, IDS_INVALID_VERSION_FORMAT, szMessageFormat, ARRAYLEN( szMessageFormat ) ); + _sntprintf( szMessage, ARRAYLEN( szMessage ) - 1, szMessageFormat, strWebServer ); + + MessageBox( hwndParent, szMessage, szTitle, MB_ICONERROR ); + + return FALSE; + } + + CDBSchemaVersion schemaVersionNewSite; + if( !schemaVersionNewSite.Parse( configNewSite[ UDDI_DBSCHEMA_VERSION ] ) ) + { + _TCHAR szTitle[ 256 ]; + _TCHAR szMessageFormat[ 512 ]; + _TCHAR szMessage[ 512 ]; + + memset( szMessage, 0, 512 * sizeof( _TCHAR ) ); + memset( szMessageFormat, 0, 512 * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + LoadString( g_hinst, IDS_DATABASE_SERVER_DBSCHEMA_VERSION_READ_FAILED, szMessageFormat, ARRAYLEN( szMessageFormat ) ); + _sntprintf( szMessage, ARRAYLEN( szMessage ) - 1, szMessageFormat, strSite ); + + MessageBox( hwndParent, szMessage, szTitle, MB_ICONERROR ); + + return FALSE; + } + + // + // Make sure the web server version is compatible. + // + if( FALSE == schemaVersionNewSite.IsCompatible( schemaVersionWS ) ) + { + _TCHAR szTitle[ 256 ]; + _TCHAR szMessage[ 1024 ]; + _TCHAR szMessageFormat[ 512 ]; + + memset( szTitle, 0, 256 * sizeof( _TCHAR ) ); + memset( szMessage, 0, 1024 * sizeof( _TCHAR ) ); + memset( szMessageFormat, 0, 512 * sizeof( _TCHAR ) ); + + LoadString( g_hinst, IDS_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + LoadString( g_hinst, IDS_WEBSERVER_SERVER_INVALID_DBSCHEMA_VERSION, szMessageFormat, ARRAYLEN( szMessageFormat ) ); + _sntprintf( szMessage, + ARRAYLEN( szMessage ) - 1, + szMessageFormat, + strWebServer.c_str(), + schemaVersionWS.szVersion.c_str(), + strSite.c_str(), + schemaVersionNewSite.szVersion.c_str() ); + + MessageBox( hwndParent, szMessage, szTitle, MB_ICONERROR ); + + return FALSE; + } + + CStringCollection newSiteWebServers( configNewSite[ UDDI_SITE_WEBSERVERS ] ); + + if( newSiteWebServers.Exists( strWebServer ) && fSameSite ) + { + WCHAR wszMessage[ 256 ]; + WCHAR wszTitle[ 256 ]; + wszMessage[ 0 ] = 0x00; + wszTitle[ 0 ] = 0x00; + + LoadString( g_hinst, IDS_WEBSERVER_ALREADY_EXISTS, wszMessage, ARRAYLEN( wszMessage ) ); + LoadString( g_hinst, IDS_WEBSERVER_SELECT_ERROR_TITLE, wszTitle, ARRAYLEN( wszTitle ) ); + + MessageBox( hwndParent, wszMessage, wszTitle, MB_OK ); + return FALSE; + } + + newSiteWebServers.AddString( strWebServer ); + configNewSite[ UDDI_SITE_WEBSERVERS ] = newSiteWebServers.GetDelimitedString(); + + hr = SaveConfig( configNewSite, strNewConnStr ); + if( FAILED(hr) ) + { + WCHAR wszMessage[ 512 ]; + WCHAR wszMessageFormat[ 512 ]; + WCHAR wszTitle[ 128 ]; + + memset( wszMessage, 0, 512 * sizeof( WCHAR ) ); + memset( wszMessageFormat, 0, 512 * sizeof( WCHAR ) ); + memset( wszTitle, 0, 128 * sizeof( WCHAR ) ); + + LoadString( g_hinst, + IDS_WEBSERVER_ADD_FAILED_DETAIL, + wszMessageFormat, + ARRAYLEN( wszMessageFormat ) ); + + _sntprintf( wszMessage, + ARRAYLEN(wszMessage) - 1, + wszMessageFormat, + strWebServer.c_str(), + strSite.c_str() ); + + LoadString( g_hinst, + IDS_WEBSERVER_ADD_FAILED, + wszTitle, + ARRAYLEN( wszTitle ) ); + + MessageBox( hwndParent, + wszMessage, + wszTitle, + MB_ICONEXCLAMATION | MB_YESNO ); + + CUDDIWebServerNode::SetReaderConnectionString( strWebServer, L"" ); + CUDDIWebServerNode::SetWriterConnectionString( strWebServer, L"" ); + + return FALSE; + } + + CUDDIWebServerNode::SetReaderConnectionString( strWebServer, strNewConnStr ); + CUDDIWebServerNode::SetWriterConnectionString( strWebServer, strNewConnStr ); + } + + return TRUE; + } + catch( CUDDIException &e ) + { + UDDIMsgBox( hwndParent, (LPCTSTR) e, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + return FALSE; + } + catch( ... ) + { + UDDIMsgBox( hwndParent, IDS_ERROR_ADDWEBSITE, IDS_ERROR_TITLE, MB_ICONEXCLAMATION | MB_OK ); + return FALSE; + } + +} + + + +CStringCollection::CStringCollection( const wstring& strDelimitedStrings, + const wstring& strDelim ) +{ + _coll.clear(); + + if( 0 == strDelimitedStrings.length() ) + { + return; + } + + _strDelim = strDelim; + + WCHAR *pwsz = new WCHAR[ strDelimitedStrings.length() + 1 ]; + if( NULL == pwsz ) + { + return; + } + + wcsncpy( pwsz, strDelimitedStrings.c_str(), strDelimitedStrings.length() ); + pwsz[ strDelimitedStrings.length() ] = 0x00; + + // + // Convert to upper case. + // + pwsz = _wcsupr( pwsz ); + + WCHAR *pwszToken = wcstok( pwsz, _strDelim.c_str() ); + while( NULL != pwszToken ) + { + _coll.push_back( pwszToken ); + pwszToken = wcstok( NULL, _strDelim.c_str() ); + } + + delete [] pwsz; +} + +CStringCollection::~CStringCollection() +{ + _coll.clear(); +} + +void +CStringCollection::DeleteString( const wstring& str ) +{ + if( 0 == str.length() ) + { + return; + } + + vector< wstring >::iterator it = _coll.begin(); + for( ; it != _coll.end(); it++ ) + { + if( 0 == _wcsicmp( str.c_str(), it->c_str() ) ) + { + _coll.erase( it ); + break; + } + } +} + +void +CStringCollection::AddString( const wstring& str ) +{ + if( 0 == str.length() ) + { + return; + } + + WCHAR *pwsz = new WCHAR[ str.length() + 1 ]; + if( NULL == pwsz ) + { + return; + } + + wcsncpy( pwsz, str.c_str(), str.length() ); + pwsz[ str.length() ] = 0x00; + + pwsz = _wcsupr( pwsz ); + + vector< wstring >::const_iterator cit; + + cit = find( _coll.begin(), _coll.end(), str ); + if( _coll.end() == cit ) + { + _coll.push_back( str ); + } + + delete [] pwsz; +} + +wstring +CStringCollection::GetDelimitedString() const +{ + wstring str; + vector< wstring >::const_iterator cit; + + bool first = true; + for( cit = _coll.begin(); cit != _coll.end(); cit++ ) + { + first = ( _coll.begin() == cit ) ? true : false; + + if( !first ) + { + str += _strDelim; + } + + str += *cit; + } + + return str; +} + + +BOOL +CStringCollection::Exists( const wstring& str ) const +{ + BOOL fRet = FALSE; + if( 0 == str.length() ) + { + return fRet; + } + + vector< wstring >::const_iterator cit = _coll.begin(); + for( ; cit != _coll.end(); cit++ ) + { + if( 0 == _wcsicmp( str.c_str(), cit->c_str() ) ) + { + fRet = TRUE; + break; + } + } + + return fRet; +} + diff --git a/inetsrv/uddi/source/mmc/uddisitenode.h b/inetsrv/uddi/source/mmc/uddisitenode.h new file mode 100644 index 0000000..13473af --- /dev/null +++ b/inetsrv/uddi/source/mmc/uddisitenode.h @@ -0,0 +1,167 @@ +#pragma once + +#include "globals.h" +#include "delebase.h" +#include +#include +#include + +using namespace std; + + +#define WEBSERVER_LIST_DELIM _T( '%' ) +#define NULL_TERMINATOR _T( '\0' ) + +class CUDDIServicesNode; +typedef map CConfigMap; + +class CUDDIWebServerNode; +typedef map CUDDIWebServerNodeMap; +typedef pair CUDDIWebServerNodeMapEntry; + +// +// Utility class. +// +class CStringCollection +{ +public: + CStringCollection( const wstring& strDelimitedStrings, const wstring& strDelim = L"%" ); + virtual ~CStringCollection(); + + void DeleteString( const wstring& str ); + void AddString( const wstring& str ); + + wstring GetDelimitedString() const; + BOOL Exists( const wstring& str ) const; + inline int Size() const {return _coll.size();} + inline const wstring& operator[]( const int &idx ) const {return _coll[idx];} + +private: + CStringCollection(); + CStringCollection( const CStringCollection& copy ); + CStringCollection& operator=( const CStringCollection& rhs ); + + vector< wstring > _coll; + wstring _strDelim; +}; + +// +// Helper class for working with versions. +// +class CDBSchemaVersion +{ +public: + CDBSchemaVersion(); + + BOOL Parse( const tstring& versionString ); + BOOL IsCompatible( const CDBSchemaVersion& version ); + +public: + int m_major; + int m_minor; + int m_build; + int m_rev; + tstring szVersion; + +private: + int GetPart( const _TCHAR* token ); +}; + +class CUDDISiteNode : public CDelegationBase +{ +public: + CUDDISiteNode( _TCHAR *szName, _TCHAR *szInstanceName, int id, CUDDIServicesNode *parent, BOOL bExtension ); + virtual ~CUDDISiteNode(); + + static CUDDISiteNode* Create( _TCHAR *szName, _TCHAR *szInstanceName, int id, CUDDIServicesNode* parent, BOOL bExtension ); + static BOOL IsDatabaseServer( PTCHAR szName ); + static BOOL IsDatabaseServer( PTCHAR szName, PTCHAR szInstance ); + static BOOL CALLBACK NewDatabaseServerDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL GetFullyQualifiedInstanceName( LPCTSTR szName, tstring& strInstanceName ); + static BOOL AddWebServerToSite( const wstring& strSite, const wstring& strWebServer, HWND hwndConsole ); + + virtual const _TCHAR *GetDisplayName( int nCol = 0 ); + virtual const GUID & getNodeType() { return thisGuid; } + virtual const int GetBitmapIndex() { return INDEX_DBSERVER; } + virtual BOOL ChildExists( const WCHAR *pwszName ); + virtual BOOL HasChildren(); + BOOL IsDeleted() { return m_isDeleted; } + HRESULT GetData(); + HRESULT SaveData(); + HRESULT AddChildrenToScopePane( IConsoleNameSpace *pConsoleNameSpace, HSCOPEITEM parent ); + BOOL ResetCryptography(); + tstring GetConnectionString(); + CConfigMap& GetConfigMap(); + const LPCTSTR GetName(); + const _TCHAR *GetInstanceName(); + size_t PublishToActiveDirectory(); + void RemoveFromActiveDirectory(); + BOOL CanPublishToActiveDirectory(); + CUDDIWebServerNode* FindChild( LPCTSTR szName ); + CUDDIServicesNode *GetStaticNode(); + void OnDeleteChild( const tstring& szName ); + void AddChild( const wstring& strName, IConsole *pConsole ); + +public: + // + // Virtual functions go here (for MMCN_*) + // + virtual HRESULT OnSelect( CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect ); + virtual HRESULT OnPropertyChange( IConsole *pConsole, CComponent *pComponent ); + virtual HRESULT OnUpdateItem( IConsole *pConsole, long item, ITEM_TYPE itemtype ); + virtual HRESULT OnRefresh( IConsole *pConsole ); + virtual HRESULT OnDelete( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsoleComp ); + virtual HRESULT OnShowContextHelp(IDisplayHelp *pDisplayHelp, LPOLESTR helpFile); + virtual HRESULT OnShow( IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem ); + virtual HRESULT OnExpand( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent ); + virtual HRESULT OnAddMenuItems( IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed ); + virtual HRESULT OnMenuCommand( IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject ); + virtual HRESULT CreatePropertyPages( IPropertySheetCallback *lpProvider, LONG_PTR handle ); + virtual HRESULT HasPropertySheets(); + virtual HRESULT GetWatermarks( HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch ); + virtual HRESULT RemoveChildren( IConsoleNameSpace *pNS ); + +private: + void ClearChildMap(); + BOOL LoadChildMap( const tstring& szWebServers ); + BOOL SaveChildMap( tstring& szWebServers ); + static HRESULT GetConfig( CConfigMap& configMap, const tstring& connectionString ); + static HRESULT SaveConfig( CConfigMap& configMap, const tstring& connectionString ); + const _TCHAR* GetNextWebServer( tstring& webServerList, int& position ); + void AddWebServer( tstring& webServerList, const tstring& webServer ); + BOOL AddChildEntry( CUDDIWebServerNode *pNode, UINT position = -1 ); + tstring GetConnectionStringOLEDB(); + + static void HandleOLEDBError( HRESULT hrErr ); + +private: + // + // Property page dialog procedures + // + static BOOL CALLBACK GeneralDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK RolesDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK SecurityDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK ActiveDirectoryDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK CryptographyDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK AdvancedDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK PropertyEditDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + + static const GUID thisGuid; + enum menuItems { IDM_NEW_WEBSERVER = 1, IDM_DEBUG }; + static UINT m_nNextChildID; + + _TCHAR* m_szName; + _TCHAR* m_szInstanceName; + tstring m_strDisplayName; + LONG_PTR m_ppHandle; + CUDDIServicesNode* m_pParent; + BOOL m_isDeleted; + CConfigMap m_mapConfig; + CConfigMap m_mapChanges; + CUDDIWebServerNodeMap m_mapChildren; + CDBSchemaVersion m_siteVersion; + +public: + BOOL m_bIsDirty; + BOOL m_bStdSvr; +}; \ No newline at end of file diff --git a/inetsrv/uddi/source/mmc/webservernode.cpp b/inetsrv/uddi/source/mmc/webservernode.cpp new file mode 100644 index 0000000..5e10c6d --- /dev/null +++ b/inetsrv/uddi/source/mmc/webservernode.cpp @@ -0,0 +1,1961 @@ +#include +#include +#include "webservernode.h" +#include "comp.h" +#include "compdata.h" +#include "dataobj.h" +#include "globals.h" +#include "resource.h" +#include "uddi.h" +#include "uddisitenode.h" +#include "objectpicker.h" +#include +#include +#include + +// {8ACBC688-ADDB-4298-9475-76AC4BF01FB1} +const GUID CUDDIWebServerNode::thisGuid = { 0x8acbc688, 0xaddb, 0x4298, { 0x94, 0x75, 0x76, 0xac, 0x4b, 0xf0, 0x1f, 0xb1 } }; + + +//============================================================== +// +// CUDDIWebServerNode implementation +// +// +CUDDIWebServerNode::CUDDIWebServerNode( const _TCHAR *szName, int id, CUDDISiteNode* parent, BOOL bExtension ) + : m_szName(NULL) + , m_nId( id ) + , m_ppHandle( 0 ) + , m_isDeleted( FALSE ) + , m_pParent( parent ) + , m_pToolbar( NULL ) + , m_isScopeItem( TRUE ) + , m_bStdSvr( TRUE ) + , m_fDeleteFromScopePane( FALSE ) + , m_hwndPropSheet( NULL ) +{ + int iLen = _tcslen( szName ) + 1; + m_szName = new _TCHAR[ iLen ]; + memset( m_szName, 0, iLen * sizeof( _TCHAR ) ); + _tcsncpy( m_szName, szName, iLen - 1 ); + + m_bIsExtension = bExtension; + + GetData(); + + BOOL bW3SvcRunning = IsW3SvcRunning(); + if( ( FALSE == bW3SvcRunning ) && IsRunning() ) + { + Stop(); + m_mapProperties[ UDDI_RUN ] = _T("0"); + } +} + +CUDDIWebServerNode::~CUDDIWebServerNode() +{ + if( m_szName ) + { + delete [] m_szName; + } + + if( NULL != m_ppHandle ) + { + MMCFreeNotifyHandle( m_ppHandle ); + } + + if( NULL != m_hwndPropSheet ) + { + SendMessage( m_hwndPropSheet, WM_CLOSE, 0, 0 ); + } +} + +HRESULT CUDDIWebServerNode::GetData() +{ + try + { + // + // Determine if the OS that this web server is running on is Windows Server 2003 Standard or not. + // + HRESULT hr = E_FAIL; + hr = IsStandardServer( m_szName, &m_bStdSvr ); + if( FAILED(hr) ) + { + THROW_UDDIEXCEPTION_ST( hr, IDS_DOT_NET_SERVER, g_hinst ); + } + + m_mapProperties.clear(); + + CUDDIRegistryKey rootkey( _T( "SOFTWARE\\Microsoft\\UDDI"), KEY_READ, m_szName ); + + _TCHAR szRun[ 35 ]; + m_mapProperties[ UDDI_RUN ] = _itot( rootkey.GetDWORD( _T("Run"), 1 ), szRun, 10 ); + m_mapProperties[ UDDI_SETUP_LOCATION ] = rootkey.GetString( _T("InstallRoot"), _T("") ); + rootkey.Close(); + + CUDDIRegistryKey databasekey( _T( "SOFTWARE\\Microsoft\\UDDI\\Database"), KEY_READ, m_szName ); + m_mapProperties[ UDDI_READER_CXN ] = databasekey.GetString( _T("ReaderConnectionString"), _T("") ); + m_mapProperties[ UDDI_WRITER_CXN ] = databasekey.GetString( _T("WriterConnectionString"), _T("") ); + databasekey.Close(); + + // + // Ensure that the UDDI Site that this web server thinks it communicates + // with is still installed. + // + tstring strDomain, strServer, strInstance; + CrackConnectionString( m_mapProperties[ UDDI_WRITER_CXN ], strDomain, strServer, strInstance ); + if( !CUDDISiteNode::IsDatabaseServer( (PTCHAR)strServer.c_str() ) ) + { + m_mapProperties[ UDDI_READER_CXN ] = _T( "" ); + m_mapProperties[ UDDI_WRITER_CXN ] = _T( "" ); + } + + _TCHAR szValue[ 100 ]; + + _TCHAR szDefaultLogFile[ _MAX_PATH + 1 ]; + memset( szDefaultLogFile, 0, ( _MAX_PATH + 1 ) * sizeof( _TCHAR ) ); + GetSystemDirectory( szDefaultLogFile, _MAX_PATH ); + + tstring strDefaultLogFile( szDefaultLogFile ); + strDefaultLogFile += _T( "\\LogFiles\\UDDI\\uddi.log" ); + + try + { + CUDDIRegistryKey debugkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Debug"), KEY_READ, m_szName ); + m_mapProperties[ UDDI_EVENTLOG_LEVEL ] = _itot( debugkey.GetDWORD( _T("EventLogLevel"), 2 ), szValue, 10 ); + m_mapProperties[ UDDI_FILELOG_LEVEL ] = _itot( debugkey.GetDWORD( _T("FileLogLevel"), 0 ), szValue, 10 ); + m_mapProperties[ UDDI_LOG_FILENAME ] = debugkey.GetString( _T("LogFilename"), strDefaultLogFile.c_str() ); + debugkey.Close(); + } + catch( ... ) + { + m_mapProperties[ UDDI_EVENTLOG_LEVEL ] = _itot( 2, szValue, 10 ); + m_mapProperties[ UDDI_FILELOG_LEVEL ] = _itot( 0, szValue, 10 ); + m_mapProperties[ UDDI_LOG_FILENAME ] = strDefaultLogFile; + } + + + // + // Get the setup information + // + CUDDIRegistryKey setupkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup"), KEY_READ, m_szName ); + m_mapProperties[ UDDI_SETUP_DB ] = _itot( setupkey.GetDWORD( _T("DBServer"), 0 ), szValue, 10 ); + m_mapProperties[ UDDI_SETUP_WEB ] = _itot( setupkey.GetDWORD( _T("WebServer"), 0 ), szValue, 10 ); + m_mapProperties[ UDDI_SETUP_ADMIN ] = _itot( setupkey.GetDWORD( _T("Admin"), 0 ), szValue, 10 ); + setupkey.Close(); + + CUDDIRegistryKey webkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup\\WebServer"), KEY_READ, m_szName ); + m_mapProperties[ UDDI_SETUP_DATE ] = webkey.GetString( _T("InstallDate"), _T("") ); + m_mapProperties[ UDDI_SETUP_LANGUAGE ] = webkey.GetString( _T("ProductLanguage"), _T("") ); + m_mapProperties[ UDDI_SETUP_NAME ] = webkey.GetString( _T("ProductName"), _T("") ); + m_mapProperties[ UDDI_SETUP_FRAMEWORK_VERSION ] = webkey.GetString( _T("FrameworkVersion"), _T("") ); + m_mapProperties[ UDDI_SETUP_MANUFACTURER ] = webkey.GetString( _T("Manufacturer"), _T("") ); + m_mapProperties[ UDDI_SETUP_VERSION ] = webkey.GetString( _T("ProductVersion"), _T("") ); + webkey.Close(); + } + catch(...) + { + return E_FAIL; + } + + return S_OK; +} + +const LPCTSTR CUDDIWebServerNode::GetName() +{ + return m_szName; +} + +BOOL +CUDDIWebServerNode::ChildExists( const WCHAR *pwszName ) +{ + if( NULL == pwszName ) + { + return FALSE; + } + + wstring strWriterConn; + GetWriterConnectionString( m_szName, strWriterConn ); + + wstring strDomain, strServer, strInstance; + CrackConnectionString( strWriterConn, strDomain, strServer, strInstance ); + + return ( 0 == _wcsicmp( pwszName, strServer.c_str() ) ) ? TRUE : FALSE; +} + +HRESULT CUDDIWebServerNode::SaveData() +{ + try + { + // + // Save the changed values + // + for( CPropertyMap::iterator iter = m_mapChanges.begin(); + iter != m_mapChanges.end(); iter++ ) + { + if( _T("Database.ReaderConnectionString") == (*iter).first ) + { + CUDDIRegistryKey databasekey( _T( "SOFTWARE\\Microsoft\\UDDI\\Database"), KEY_ALL_ACCESS, m_szName ); + databasekey.SetValue( _T( "ReaderConnectionString" ), m_mapChanges[ _T( "Database.ReaderConnectionString" ) ].c_str() ); + databasekey.Close(); + } + else if( UDDI_WRITER_CXN == (*iter).first ) + { + CUDDIRegistryKey databasekey( _T( "SOFTWARE\\Microsoft\\UDDI\\Database"), KEY_ALL_ACCESS, m_szName ); + databasekey.SetValue( _T( "WriterConnectionString" ), m_mapChanges[ _T( "Database.WriterConnectionString" ) ].c_str() ); + databasekey.Close(); + } + else if(UDDI_EVENTLOG_LEVEL == (*iter).first ) + { + DWORD dwValue = _ttoi( m_mapChanges[ UDDI_EVENTLOG_LEVEL ].c_str() ); + UDDIASSERT( dwValue < 7 ); + + CUDDIRegistryKey debugkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Debug"), KEY_ALL_ACCESS, m_szName ); + debugkey.SetValue( _T("EventLogLevel"), dwValue ); + debugkey.Close(); + } + else if( (*iter).first == UDDI_FILELOG_LEVEL ) + { + DWORD dwValue = _ttoi( m_mapChanges[ UDDI_FILELOG_LEVEL ].c_str() ); + UDDIASSERT( dwValue < 7 ); + + CUDDIRegistryKey debugkey( _T( "SOFTWARE\\Microsoft\\UDDI\\Debug"), KEY_ALL_ACCESS, m_szName ); + debugkey.SetValue( _T("FileLogLevel"), dwValue ); + debugkey.Close(); + } + } + + // + // Clear the changes collection + // + m_mapChanges.clear(); + + } + catch(...) + { + return E_FAIL; + } + + return S_OK; +} + +BOOL CUDDIWebServerNode::IsWebServer( const WCHAR *pwszName ) +{ + if( ( NULL == pwszName ) || ( 0 == _tcslen( pwszName ) ) ) + { + return FALSE; + } + + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup" ), KEY_READ, pwszName ); + DWORD dwDB = key.GetDWORD( _T( "WebServer" ) ); + + return TRUE; + } + catch(...) + { + return FALSE; + } +} + +BOOL CUDDIWebServerNode::Start() +{ + return SetRunState( TRUE ); +} + +BOOL CUDDIWebServerNode::SetRunState( BOOL bStart ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI" ), KEY_ALL_ACCESS, m_szName ); + key.SetValue( _T("Run"), bStart ? 1UL : 0UL ); + } + catch(...) + { + return FALSE; + } + + return TRUE; +} + +BOOL CUDDIWebServerNode::Stop() +{ + return SetRunState( FALSE ); +} + +const BOOL CUDDIWebServerNode::IsRunning() +{ + CPropertyMap::const_iterator it = m_mapProperties.find( UDDI_RUN ); + if( m_mapProperties.end() == it ) + { + return FALSE; + } + else + { + return ( _T("0") == it->second ) ? FALSE : TRUE; + } +} + +const _TCHAR *CUDDIWebServerNode::GetDisplayName( int nCol ) +{ + _TCHAR szRunning[ 256 ]; + memset( szRunning, 0, 256 * sizeof( _TCHAR ) ); + ::LoadString( g_hinst, IDS_WEBSERVER_RUNNING, szRunning, ARRAYLEN(szRunning) ); + + _TCHAR szStopped[ 256 ]; + memset( szStopped, 0, 256 * sizeof( _TCHAR ) ); + ::LoadString( g_hinst, IDS_WEBSERVER_STOPPED, szStopped, ARRAYLEN(szStopped) ); + + BOOL bIsRunning = IsRunning(); + + switch( nCol ) + { + case 0: + { + m_strDisplayName = m_szName; + if( !bIsRunning ) + { + m_strDisplayName += _T(" ("); + m_strDisplayName += szStopped; + m_strDisplayName += _T(")"); + } + break; + } + case 1: + { + m_strDisplayName = bIsRunning ? szRunning : szStopped; + break; + } + default: + m_strDisplayName = _T(""); + } + + return m_strDisplayName.c_str(); +} + +// +// Handle anything special when the user clicks Apply or Ok +// on the property sheet. This sample directly accesses the +// operated-on object, so there's nothing special to do... +// ...except to update all views +// +HRESULT CUDDIWebServerNode::OnPropertyChange( IConsole *pConsole, CComponent *pComponent ) +{ + HRESULT hr = S_FALSE; + + CPropertyMap::iterator it = m_mapChanges.find( UDDI_WRITER_CXN ); + BOOL fWriterChanged = ( m_mapChanges.end() == it ) ? FALSE : TRUE; + + if( TRUE == fWriterChanged ) + { + wstring strDomain, strServer, strInstance; + CUDDIWebServerNode::CrackConnectionString( m_mapChanges[ UDDI_WRITER_CXN ], strDomain, strServer, strInstance ); + + HWND hwndConsole = NULL; + pConsole->GetMainWindow( &hwndConsole ); + + BOOL fSuccess = CUDDISiteNode::AddWebServerToSite( strServer, + m_szName, + ( NULL == m_hwndPropSheet ) ? hwndConsole : m_hwndPropSheet ); + if( fSuccess ) + { + m_fDeleteFromScopePane = TRUE; + + // + // If our parent pointer is not NULL, then this web server node is the child of + // a UDDI Site node. + // + // If our parent pointer is NULL, then this web server node is a child of the + // UDDI Services node. + // + if( NULL != m_pParent ) + { + CUDDIServicesNode *pStaticNode = m_pParent->GetStaticNode(); + if( NULL != pStaticNode ) + { + CUDDISiteNode *pSiteNode = reinterpret_cast( pStaticNode->FindChild( strServer.c_str() ) ); + if( NULL != pSiteNode ) + { + pSiteNode->AddChild( m_szName, pConsole ); + } + } + } + else + { + HSCOPEITEM hsiParent = GetParentScopeItem(); + IConsoleNameSpace *pNS = NULL; + hr = pConsole->QueryInterface( IID_IConsoleNameSpace, reinterpret_cast( &pNS ) ); + if( FAILED(hr) ) + { + return hr; + } + + SCOPEDATAITEM sdi; + memset( &sdi, 0, sizeof( SCOPEDATAITEM ) ); + + sdi.ID = hsiParent; + sdi.mask = SDI_PARAM; + hr = pNS->GetItem( &sdi ); + if( FAILED(hr) ) + { + pNS->Release(); + return hr; + } + + pNS->Release(); + CUDDIServicesNode *pStaticNode = (CUDDIServicesNode *)sdi.lParam; + + CUDDISiteNode *pSiteNode = reinterpret_cast( pStaticNode->FindChild( strServer.c_str() ) ); + if( NULL != pSiteNode ) + { + pSiteNode->AddChild( m_szName, pConsole ); + } + + DeleteFromScopePane( pNS ); + } + } + } + + // + // The SaveData() method communicates any issues. + // + hr = SaveData(); + + hr = pConsole->UpdateAllViews( NULL, GetScopeItemValue(), 0 ); + _ASSERT( S_OK == hr); + + return hr; +} + +HRESULT +CUDDIWebServerNode::OnSelect( CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect ) +{ + if( ( NULL == pComponent ) || ( NULL == pConsole ) ) + { + return E_INVALIDARG; + } + + HRESULT hr = E_FAIL; + if( bSelect ) + { + // + // Enable refresh, and delete verbs + // + IConsoleVerb *pConsoleVerb = NULL; + + hr = pConsole->QueryConsoleVerb( &pConsoleVerb ); + if( FAILED(hr) ) + { + return hr; + } + + hr = pConsoleVerb->SetVerbState( MMC_VERB_REFRESH, ENABLED, TRUE ); + + if( !IsExtension() && !m_bStdSvr ) + { + hr = pConsoleVerb->SetVerbState( MMC_VERB_DELETE, ENABLED, TRUE ); + _ASSERT( S_OK == hr ); + } + + // + // Can't get to properties (via the standard methods) unless + // we tell MMC to display the Properties menu item and + // toolbar button, this will give the user a visual cue that + // there's "something" to do + // + hr = pConsoleVerb->SetVerbState( MMC_VERB_PROPERTIES, ENABLED, TRUE ); + + // + // Also set MMC_VERB_PROPERTIES as the default verb + // + hr = pConsoleVerb->SetDefaultVerb( MMC_VERB_PROPERTIES ); + + pConsoleVerb->Release(); + + } + + return S_FALSE; +} + +BOOL CALLBACK CUDDIWebServerNode::GeneralDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) + { + case WM_INITDIALOG: + { + CUDDIWebServerNode *pWebServer = NULL; + pWebServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, (LONG_PTR)pWebServer ); + + CPropertyMap& m_mapProperties = pWebServer->m_mapProperties; + _TCHAR szComponentName[ 256 ]; + + HWND hwndParent = GetParent( hwndDlg ); + pWebServer->m_hwndPropSheet = hwndParent; + + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_INSTALL_DATE, LocalizedDate( m_mapProperties[ UDDI_SETUP_DATE ] ).c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_UDDI_LANGUAGE, m_mapProperties[ UDDI_SETUP_LANGUAGE ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_FRAMEWORK_VERSION, m_mapProperties[ UDDI_SETUP_FRAMEWORK_VERSION ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_UDDI_VERSION, m_mapProperties[ UDDI_SETUP_VERSION ].c_str() ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_INSTALL_LOCATION, m_mapProperties[ UDDI_SETUP_LOCATION ].c_str() ); + + // + // Build up "Web Server Component on " string for heading + // + LoadString( g_hinst, IDS_WEBSERVER_DISPLAYNAME_TEMPLATE, szComponentName, ARRAYLEN( szComponentName ) - 1 ); + WCHAR wszBuf[ 512 ]; + memset( wszBuf, 0, 512 * sizeof( WCHAR ) ); + + _sntprintf( wszBuf, 512, szComponentName, pWebServer->m_szName ); + wszBuf[ 511 ] = 0x00; + + tstring strDisplayName ( wszBuf ); + SetDlgItemText( hwndDlg, IDC_GENERAL_SITE_TXT_DISPLAYNAME, strDisplayName.c_str() ); + + if( _T("1") == m_mapProperties[ UDDI_SETUP_WEB ] ) + { + LoadString( g_hinst, IDS_WEBSERVER_COMPONENT_DESCRIPTION, szComponentName, ARRAYLEN( szComponentName ) - 1 ); + ListBox_AddString( GetDlgItem( hwndDlg, IDC_GENERAL_SITE_LIST_SERVICES ), szComponentName ); + } + + if( _T("1") == m_mapProperties[ UDDI_SETUP_DB ] ) + { + LoadString( g_hinst, IDS_DATABASE_SERVER_COMPONENT_DESCRIPTION, szComponentName, ARRAYLEN( szComponentName ) - 1 ); + ListBox_AddString( GetDlgItem( hwndDlg, IDC_GENERAL_SITE_LIST_SERVICES ), szComponentName ); + } + + if( _T("1") == m_mapProperties[ UDDI_SETUP_ADMIN ] ) + { + LoadString( g_hinst, IDS_UDDIMMC_COMPONENT_DESCRIPTION, szComponentName, ARRAYLEN( szComponentName ) - 1 ); + ListBox_AddString( GetDlgItem( hwndDlg, IDC_GENERAL_SITE_LIST_SERVICES ), szComponentName ); + } + } + break; + + case WM_NOTIFY: + { + if( PSN_HELP == ((NMHDR *) lParam)->code ) + { + CUDDIWebServerNode *pWebServer = (CUDDIWebServerNode *)GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + if( NULL != pWebServer ) + { + wstring strHelp( pWebServer->GetHelpFile() ); + strHelp += g_wszUddiWebGeneralPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + } + break; + } + + case WM_CLOSE: + { + CUDDIWebServerNode *pWebServer = (CUDDIWebServerNode *)GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + + if( NULL != pWebServer ) + { + pWebServer->m_hwndPropSheet = NULL; + } + + break; + } + + case WM_HELP: + { + CUDDIWebServerNode *pWebServer = (CUDDIWebServerNode *)GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + if( NULL != pWebServer ) + { + wstring strHelp( pWebServer->GetHelpFile() ); + strHelp += g_wszUddiWebGeneralPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + } + break; + } + + return FALSE; +} + +int split( const TCHAR * pszConnection, TCHAR *pszA, TCHAR *pszB, TCHAR *pszC ) +{ + // + // Example: Data Source=localhost;Initial Catalog=uddi;Integrated Security=SSPI + // + TCHAR strConnection[ 512 ]; + strConnection[ 0 ] = 0x00; + _tcsncpy( strConnection, pszConnection, 512 ); + strConnection[ 511 ] = 0x00; + + _tcslwr( strConnection ); + + // + // Get Data Source value + // + PTCHAR begin = _tcsstr( strConnection, _T("data source=") ); + _ASSERT( begin ); + + begin += 12; + PTCHAR end = begin; + int n = 0; + BOOL bDone = FALSE; + + while( !bDone ) + { + if( _T('\\') == *end ) + { + if( 0 == n ) + { + _tcsncpy( pszA, begin, end - begin ); + pszA[ end - begin ] = NULL; + } + else if( 1 == n ) + { + _tcsncpy( pszB, begin, end - begin ); + pszB[ end - begin ] = NULL; + } + else + { + _tcsncpy( pszC, begin, end - begin ); + pszC[ end - begin ] = NULL; + } + begin = end + 1; + end++; + n++; + } + else if( NULL == *end || _T(';') == *end ) + { + if( 0 == n ) + { + _tcsncpy( pszA, begin, end - begin ); + pszA[ end - begin ] = NULL; + } + else if( 1 == n ) + { + _tcsncpy( pszB, begin, end - begin ); + pszB[ end - begin ] = NULL; + } + else + { + _tcsncpy( pszC, begin, end - begin ); + pszC[ end - begin ] = NULL; + } + bDone = TRUE; + n++; + } + else + { + end++; + } + } + + return n; +} + +// +// Cases: +// 1. \\ +// +// 2. \ +// +// 3. \ +// +// 4. +// + +void +CUDDIWebServerNode::CrackConnectionString( const tstring& strConnection, tstring& strDomain, tstring& strServer, tstring& strInstance ) +{ + if( 0 == strConnection.length() ) + { + strDomain = _T( "" ); + strServer = _T( "" ); + strInstance = _T( "" ); + + return; + } + +// TCHAR *pstrs[3] = { new TCHAR[ 256 ], new TCHAR[ 256 ], new TCHAR[ 256 ] }; + TCHAR *pszA, *pszB, *pszC; + pszA = new TCHAR[ 256 ]; + pszB = new TCHAR[ 256 ]; + pszC = new TCHAR[ 256 ]; + + if( ( NULL == pszA ) || ( NULL == pszB ) || ( NULL == pszC ) ) + { + strDomain = _T( "" ); + strServer = _T( "" ); + strInstance = _T( "" ); + + return; + } + + memset( pszA, 0, 256 * sizeof( TCHAR ) ); + memset( pszB, 0, 256 * sizeof( TCHAR ) ); + memset( pszC, 0, 256 * sizeof( TCHAR ) ); + + _TCHAR szConnection[ 512 ]; + memset( szConnection, 0, 512 * sizeof( TCHAR ) ); + _tcscpy( szConnection, strConnection.c_str() ); + + int n = split( szConnection, pszA, pszB, pszC ); + + if( 1 == n ) + { + // + // Case 4: + // + strDomain = _T(""); + strServer = pszA; + strInstance = _T(""); + } + else if( 3 == n ) + { + // + // Case 1 \\ + // + strDomain = pszA; + strServer = pszB; + strInstance = pszC; + } + else + { + // + // TODO: Write code to determine between case 2 and case 3 + // + // Assume case 3: \ + // + strDomain = _T(""); + strServer = pszA; + strInstance = pszB; + } + + delete [] pszA; + delete [] pszB; + delete [] pszC; + + return; +} + +struct DatabaseConnectionData +{ + DatabaseConnectionData( CUDDIWebServerNode *pWeb ) + : pWebServer( pWeb ) + , bReadChanged( false ) + , bWriteChanged( false ){} + + bool bReadChanged; + bool bWriteChanged; + CUDDIWebServerNode *pWebServer; +}; + + +tstring +CUDDIWebServerNode::BuildConnectionString( const wstring& strComputer ) +{ + try + { + tstring strInstanceName; + + BOOL fSuccess = CUDDISiteNode::GetFullyQualifiedInstanceName( strComputer.c_str(), strInstanceName ); + if( !fSuccess ) + { + return _T( "" ); + } + + + tstring strConnection( _T("Data Source=") ); + + strConnection += strInstanceName; + + strConnection += _T(";Initial Catalog=uddi;Integrated Security=SSPI"); + + return strConnection; + } + catch( ... ) + { + return _T( "" ); + } +} + +BOOL CALLBACK CUDDIWebServerNode::DatabaseConnectionDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) + { + case WM_INITDIALOG: + { + // + // Load up the "not found" strings in case of a future failure + // + TCHAR szNoServer[ 256 ], + szNoInstance[ 256 ]; + + ZeroMemory( szNoServer, sizeof szNoServer ); + ZeroMemory( szNoInstance, sizeof szNoInstance ); + + LoadString( g_hinst, IDS_UDDIMMC_NODBSERVER, szNoServer, ARRAYLEN( szNoServer ) - 1 ); + LoadString( g_hinst, IDS_UDDIMMC_NOINSTANCE, szNoInstance, ARRAYLEN( szNoInstance ) - 1 ); + + // + // Catch the "this" pointer so we can actually operate on the object + // + CUDDIWebServerNode *pWebServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + DatabaseConnectionData* pdata = new DatabaseConnectionData( pWebServer ); + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, (LONG_PTR) pdata ); + + // + // User can select a new database to read from/write to ONLY if the machine the web server + // is running on is NOT Windows Server 2003 Standard Server. + // + // EnableWindow( GetDlgItem( hwndDlg, IDC_DB_CONNECTION_BTN_READER_SELECT ), pWebServer->m_bStdSvr ? FALSE : TRUE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_DB_CONNECTION_BTN_WRITER_SELECT ), pWebServer->m_bStdSvr ? FALSE : TRUE ); + + // + // For Heartland RC2, we are removing the distinction between reader & + // writer connection strings. There can be only 1 connection string, + // so we will use just the writer. + // + EnableWindow( GetDlgItem( hwndDlg, IDC_DB_CONNECTION_BTN_READER_SELECT ), FALSE ); + + // + // Example: Data Source=localhost;Initial Catalog=uddi;Integrated Security=SSPI + // + tstring strDomain, strMachine, strInstance; + tstring strReaderConn = pWebServer->m_mapProperties[ UDDI_READER_CXN ]; + tstring strWriterConn = pWebServer->m_mapProperties[ UDDI_WRITER_CXN ]; + + if( strReaderConn.empty() ) + { + strMachine = szNoServer; + strInstance = szNoInstance; + } + else + { + CrackConnectionString( strReaderConn, strDomain, strMachine, strInstance ); + } + + tstring strServer( _T("") ); + + if( !strDomain.empty() ) + { + strServer = strDomain; + strServer += _T("\\"); + strServer += strMachine; + } + else + { + strServer = strMachine; + } + + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_SERVER, strServer.c_str() ); + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_INSTANCE, strInstance.empty() ? DefaultInstanceDisplayName() : strInstance.c_str() ); + + if( strWriterConn.empty() ) + { + strMachine = szNoServer; + strInstance = szNoInstance; + } + else + { + CrackConnectionString( strWriterConn, strDomain, strMachine, strInstance ); + } + + if( !strDomain.empty() ) + { + strServer = strDomain; + strServer += _T("\\"); + strServer += strMachine; + } + else + { + strServer = strMachine; + } + + CUDDISiteNode::GetFullyQualifiedInstanceName( strServer.c_str(), strInstance ); + + WCHAR wszServer[ 128 ]; + WCHAR wszInstance[ 256 ]; + memset( wszServer, 0, 128 * sizeof( WCHAR ) ); + memset( wszInstance, 0, 256 * sizeof( WCHAR ) ); + + wcsncpy( wszServer, strServer.c_str(), strServer.length() ); + wcsncpy( wszInstance, strInstance.c_str(), strInstance.length() ); + + ToUpper( wszServer ); + ToUpper( wszInstance ); + + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_WRITER_SERVER, wszServer ); + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_WRITER_INSTANCE, wszInstance ); + + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_SERVER, wszServer ); + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_INSTANCE, wszInstance ); + } + break; + + case WM_COMMAND: + { + DatabaseConnectionData* pdata = (DatabaseConnectionData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + + switch( LOWORD(wParam) ) + { + case IDC_DB_CONNECTION_BTN_READER_SELECT: + { + DatabaseData data; + data.pBase = pdata->pWebServer; + INT_PTR nResult = DialogBoxParam( g_hinst, MAKEINTRESOURCE( IDD_SITE_CONNECT ), hwndDlg, CUDDISiteNode::NewDatabaseServerDialogProc, (LPARAM) &data ); + + if( nResult ) + { + // + // The user is not allowed to point the connection strings to a database + // instance running on a Windows Server 2003 Standard machine. So, tell them so. + // + BOOL bIsStandard = TRUE; + HRESULT hr = ::IsStandardServer( data.szServerName, &bIsStandard ); + if( FAILED(hr) ) + { + UDDIMsgBox( hwndDlg, + IDS_DOT_NET_SERVER, + IDS_ERROR_TITLE, + MB_ICONEXCLAMATION | MB_OK ); + break; + } + + if( TRUE == bIsStandard ) + { + UDDIMsgBox( hwndDlg, + IDS_DATABASE_STANDARD_SERVER_DETAIL, + IDS_DATABASE_STANDARD_SERVER, + MB_ICONEXCLAMATION | MB_OK ); + } + else + { + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_SERVER, data.szServerName ); + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_INSTANCE, InstanceDisplayName(data.szInstanceName) ); + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + + pdata->bReadChanged = true; + } + } + + break; + } + case IDC_DB_CONNECTION_BTN_WRITER_SELECT: + { + DatabaseData data; + data.pBase = pdata->pWebServer; + INT_PTR nResult = DialogBoxParam( g_hinst, MAKEINTRESOURCE( IDD_SITE_CONNECT ), hwndDlg, CUDDISiteNode::NewDatabaseServerDialogProc, (LPARAM) &data ); + + if( nResult ) + { + // + // The user is not allowed to point the connection strings to a database + // instance running on a Windows Server 2003 Standard machine. So, tell them so. + // + BOOL bIsStandard = TRUE; + HRESULT hr = ::IsStandardServer( data.szServerName, &bIsStandard ); + if( FAILED(hr) ) + { + UDDIMsgBox( hwndDlg, + IDS_DOT_NET_SERVER, + IDS_ERROR_TITLE, + MB_ICONEXCLAMATION | MB_OK ); + break; + } + + if( TRUE == bIsStandard ) + { + UDDIMsgBox( hwndDlg, + IDS_DATABASE_STANDARD_SERVER_DETAIL, + IDS_DATABASE_STANDARD_SERVER, + MB_ICONEXCLAMATION | MB_OK ); + } + else + { + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_WRITER_SERVER, data.szServerName ); + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_WRITER_INSTANCE, InstanceDisplayName(data.szInstanceName) ); + + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_SERVER, data.szServerName ); + SetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_INSTANCE, InstanceDisplayName(data.szInstanceName) ); + + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0 ); + + pdata->bWriteChanged = true; + } + } + break; + } + } + } + break; + + case WM_HELP: + { + DatabaseConnectionData* pdata = (DatabaseConnectionData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + wstring strHelp( pdata->pWebServer->GetHelpFile() ); + strHelp += g_wszUddiDatabaseConnectionPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + break; + } + + case WM_DESTROY: + { + DatabaseConnectionData* pdata = (DatabaseConnectionData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + + // + // Tell MMC that we're done with the property sheet (we got this + // handle in CreatePropertyPages + // + MMCFreeNotifyHandle( pdata->pWebServer->m_ppHandle ); + pdata->pWebServer->m_ppHandle = NULL; + delete pdata; + break; + } + + case WM_NOTIFY: + if( PSN_APPLY == ((NMHDR *) lParam)->code ) + { + DatabaseConnectionData* pdata = (DatabaseConnectionData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + + if( pdata->bReadChanged ) + { + _TCHAR szComputer[ 256 ]; + _TCHAR szInstance[ 256 ]; + GetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_SERVER, szComputer, ARRAYLEN( szComputer ) ); + GetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_READER_INSTANCE, szInstance, ARRAYLEN( szInstance ) ); + + pdata->pWebServer->m_mapChanges[ UDDI_READER_CXN ] = BuildConnectionString( szComputer ); + } + + if( pdata->bWriteChanged ) + { + _TCHAR szComputer[ 256 ]; + _TCHAR szInstance[ 256 ]; + GetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_WRITER_SERVER, szComputer, ARRAYLEN( szComputer ) ); + GetDlgItemText( hwndDlg, IDC_DB_CONNECTION_TXT_WRITER_INSTANCE, szInstance, ARRAYLEN( szInstance ) ); + + pdata->pWebServer->m_mapChanges[ UDDI_WRITER_CXN ] = BuildConnectionString( szComputer ); + } + + // + // Ask MMC to send us a message (on the main thread) so + // we know the Apply button was clicked. + // + HRESULT hr = MMCPropertyChangeNotify( pdata->pWebServer->m_ppHandle, reinterpret_cast(pdata->pWebServer) ); + _ASSERT( SUCCEEDED(hr) ); + + // + // Reset the window data after migration to the change collection + // + pdata->bReadChanged = false; + pdata->bWriteChanged = false; + + return PSNRET_NOERROR; + } + else if( PSN_HELP == ((NMHDR *) lParam)->code ) + { + DatabaseConnectionData* pdata = (DatabaseConnectionData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + wstring strHelp( pdata->pWebServer->GetHelpFile() ); + strHelp += g_wszUddiDatabaseConnectionPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + } + + return FALSE; +} + +HRESULT CUDDIWebServerNode::HasPropertySheets() +{ + // + // Say "yes" when MMC asks if we have pages + // + return S_OK; +} + +HRESULT CUDDIWebServerNode::CreatePropertyPages( IPropertySheetCallback *lpProvider, LONG_PTR handle ) +{ + + if( ( NULL == lpProvider ) || ( 0 == handle ) ) + { + return E_INVALIDARG; + } + + // + // Reinitialize the data before we display the property pages + // + HRESULT hr = GetData(); + _ASSERT( SUCCEEDED( hr ) ); + + PropertyPages pps[] = { + { IDD_GENERAL_WEB_PROPPAGE, GeneralDialogProc }, + { IDD_LOGGING_PROPPAGE, LoggingDialogProc }, + { IDD_DB_CONNECTION_PROPPAGE, DatabaseConnectionDialogProc } }; + + PROPSHEETPAGE psp; + HPROPSHEETPAGE hPage = NULL; + + // + // Cache this handle so we can call MMCPropertyChangeNotify + // + m_ppHandle = handle; + + // + // Create the property page for this node. + // NOTE: if your node has multiple pages, put the following + // in a loop and create multiple pages calling + // lpProvider->AddPage() for each page. + // + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_HASHELP; + psp.hInstance = g_hinst; + psp.lParam = reinterpret_cast(this); + + for( int i = 0; i < ARRAYLEN( pps ); i++ ) + { + psp.pszTemplate = MAKEINTRESOURCE( pps[ i ].id ); + psp.pfnDlgProc = pps[ i ].dlgproc; + + hPage = CreatePropertySheetPage( &psp ); + _ASSERT( hPage ); + + hr = lpProvider->AddPage( hPage ); + if( FAILED(hr) ) + { + break; + } + } + + return hr; +} + +HRESULT +CUDDIWebServerNode::GetWatermarks(HBITMAP *lphWatermark, + HBITMAP *lphHeader, + HPALETTE *lphPalette, + BOOL *bStretch) +{ + return S_FALSE; +} + +HRESULT +CUDDIWebServerNode::OnUpdateItem( IConsole *pConsole, long item, ITEM_TYPE itemtype ) +{ + if( NULL == pConsole ) + { + return E_INVALIDARG; + } + + HRESULT hr = S_OK; + + hr = UpdateScopePaneItem( pConsole, GetScopeItemValue() ); + _ASSERT( S_OK == hr ); + + return hr; +} + +HRESULT +CUDDIWebServerNode::OnRefresh( IConsole *pConsole ) +{ + if( TRUE == m_fDeleteFromScopePane ) + { + IConsoleNameSpace *pNS = NULL; + HRESULT hr = pConsole->QueryInterface( IID_IConsoleNameSpace, reinterpret_cast( &pNS ) ); + if( FAILED(hr) ) + { + return hr; + } + + DeleteFromScopePane( pNS ); + + pNS->Release(); + + return S_OK; + } + + // + // The web server that this node represents might very well live on + // some other machine. The state of that web server might have changed + // since the last time we queried it... ie, m_mapProperties might be + // out of sync with the true state of the web server. So, re-get the + // web server's info. + // + GetData(); + + BOOL bW3SvcRunning = IsW3SvcRunning(); + if( ( FALSE == bW3SvcRunning ) && IsRunning() ) + { + Stop(); + m_mapProperties[ UDDI_RUN ] = _T("0"); + } + + // + // Call IConsole::UpdateAllViews to redraw all views + // owned by the parent scope item + // + + LPDATAOBJECT lpDataObj = new CDataObject( (MMC_COOKIE)this, CCT_SCOPE ); + HRESULT hr; + + UPDATE_VIEWS_HINT hint = ( TRUE == m_isScopeItem ) ? UPDATE_SCOPEITEM : UPDATE_RESULTITEM; + hr = pConsole->UpdateAllViews( lpDataObj, GetScopeItemValue(), hint ); + + _ASSERT( S_OK == hr); + return hr; +} + + +HRESULT +CUDDIWebServerNode::OnDelete( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsoleComp ) +{ + DeleteFromScopePane( pConsoleNameSpace ); + + m_mapChanges[ UDDI_WRITER_CXN ] = _T(""); + m_mapChanges[ UDDI_READER_CXN ] = _T(""); + + SaveData(); + GetData(); + + // + // Now set isDeleted member so that the parent doesn't try to + // to insert it again in CUDDIServicesNode::OnShow. Admittedly, a hack... + // + m_isDeleted = TRUE; + + m_pParent->OnDeleteChild( m_szName ); + return S_OK; +} + +HRESULT +CUDDIWebServerNode::OnSetToolbar( IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect ) +{ + HRESULT hr = S_OK; + + if( bSelect ) + { + pToolbar->SetButtonState( ID_BUTTONSTOP, BUTTONPRESSED, !IsRunning() ); + pToolbar->SetButtonState( ID_BUTTONSTART, BUTTONPRESSED, IsRunning() ); + + pToolbar->SetButtonState( ID_BUTTONSTART, ENABLED, !IsRunning() && IsW3SvcRunning() ); + pToolbar->SetButtonState( ID_BUTTONSTOP, ENABLED, IsRunning() || !IsW3SvcRunning() ); + + // + // Always make sure the menuButton is attached + // + hr = pControlbar->Attach( TOOLBAR, pToolbar ); + + m_isScopeItem = bScope; + + } else + { + // + // Always make sure the toolbar is detached + // + hr = pControlbar->Detach( pToolbar ); + m_pToolbar = NULL; + } + + return hr; +} + +HRESULT +CUDDIWebServerNode::OnToolbarCommand( IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject ) +{ + CDataObject *pDO = GetOurDataObject( pDataObject ); + if( NULL == pDO ) + { + return S_OK; + } + + CDelegationBase *pBase = pDO->GetBaseNodeObject(); + if( NULL == pBase ) + { + return S_OK; + } + + CUDDIWebServerNode *pWSNode = static_cast( pBase ); + UPDATE_VIEWS_HINT hint = ( TRUE == pWSNode->m_isScopeItem ) ? UPDATE_SCOPEITEM : UPDATE_RESULTITEM; + + + switch( verb ) + { + case ID_BUTTONSTART: + Start(); + break; + + case ID_BUTTONSTOP: + Stop(); + break; + } + + + HRESULT hr = GetData(); + if( FAILED( hr ) ) + return hr; + + hr = pConsole->UpdateAllViews( pDataObject, GetScopeItemValue(), hint ); + _ASSERT( S_OK == hr); + + return S_OK; +} + +HRESULT CUDDIWebServerNode::OnShowContextHelp( IDisplayHelp *pDisplayHelp, LPOLESTR helpFile ) +{ + if( ( NULL == pDisplayHelp ) || ( NULL == helpFile ) ) + { + return E_INVALIDARG; + } + + wstring wstrHelpInfo = helpFile; + wstrHelpInfo += g_wszUddiWebServerNodeHelp; + + LPOLESTR pszTopic = static_cast(CoTaskMemAlloc((wstrHelpInfo.length() + 1) * sizeof(WCHAR))); + if( NULL == pszTopic ) + { + return E_OUTOFMEMORY; + } + + wcsncpy( pszTopic, wstrHelpInfo.c_str(), wstrHelpInfo.length() ); + pszTopic[ wstrHelpInfo.length() ] = NULL; + return pDisplayHelp->ShowTopic( pszTopic ); +} + +HRESULT CUDDIWebServerNode::OnAddMenuItems( IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed ) +{ + WCHAR szStartMenuText[ MAX_PATH ]; + WCHAR szStartMenuDescription[ MAX_PATH ]; + + WCHAR szStopMenuText[ MAX_PATH ]; + WCHAR szStopMenuDescription[ MAX_PATH ]; + + LoadStringW( g_hinst, IDS_WEBSERVER_START, szStartMenuText, ARRAYLEN( szStartMenuText ) ); + LoadStringW( g_hinst, IDS_WEBSERVER_START_DESCRIPTION, szStartMenuDescription, ARRAYLEN( szStartMenuDescription ) ); + + LoadStringW( g_hinst, IDS_WEBSERVER_STOP, szStopMenuText, ARRAYLEN( szStopMenuText ) ); + LoadStringW( g_hinst, IDS_WEBSERVER_STOP_DESCRIPTION, szStopMenuDescription, ARRAYLEN( szStopMenuDescription ) ); + + HRESULT hr = S_OK; + CONTEXTMENUITEM menuItemsNew[] = + { + { + szStartMenuText, szStartMenuDescription, + IDM_WEBSERVER_START, CCM_INSERTIONPOINTID_PRIMARY_TOP, 0, 0 + }, + { + szStopMenuText, szStopMenuDescription, + IDM_WEBSERVER_STOP, CCM_INSERTIONPOINTID_PRIMARY_TOP, 0, 0 + }, + { NULL, NULL, 0, 0, 0 } + }; + + menuItemsNew[ IsRunning() ? 0 : 1 ].fFlags = MF_GRAYED; + + if( !IsW3SvcRunning() ) + { + menuItemsNew[ 0 ].fFlags = MF_GRAYED; + } + + // + // Loop through and add each of the menu items, we + // want to add to new menu, so see if it is allowed. + // + if( *pInsertionsAllowed & CCM_INSERTIONALLOWED_TOP ) + { + for( LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++ ) + { + hr = pContextMenuCallback->AddItem( m ); + _ASSERT( SUCCEEDED(hr) ); + } + } + + return hr; +} + +HRESULT CUDDIWebServerNode::OnMenuCommand( IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject ) +{ + switch( lCommandID ) + { + case IDM_WEBSERVER_START: + OnToolbarCommand( pConsole, (MMC_CONSOLE_VERB) ID_BUTTONSTART, pDataObject ); + break; + case IDM_WEBSERVER_STOP: + OnToolbarCommand( pConsole, (MMC_CONSOLE_VERB) ID_BUTTONSTOP, pDataObject ); + break; + } + + return S_OK; +} + +struct LoggingData +{ + LoggingData() + : bEventLogChanged( false ) + , bFileLogChanged( false ) + , pWebServer( NULL ){} + + bool bEventLogChanged; + bool bFileLogChanged; + CUDDIWebServerNode *pWebServer; +}; + +BOOL CALLBACK CUDDIWebServerNode::LoggingDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) + { + case WM_INITDIALOG: + { + // + // Setup the window data + // + CUDDIWebServerNode *pWebServer = reinterpret_cast(reinterpret_cast(lParam)->lParam); + LoggingData *pdata = new LoggingData(); + if( NULL == pdata ) + { + return FALSE; + } + + pdata->pWebServer = pWebServer; + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, (LONG_PTR) pdata ); + + CPropertyMap& m_mapProperties = pWebServer->m_mapProperties; + + int nEventLogLevel = _tstoi( m_mapProperties[ UDDI_EVENTLOG_LEVEL ].c_str() ); + int nFileLogLevel = _tstoi( m_mapProperties[ UDDI_FILELOG_LEVEL ].c_str() ); + + SetDlgItemText( hwndDlg, IDC_LOGGING_TXT_LOGFILE_LOCATION, m_mapProperties[ UDDI_LOG_FILENAME ].c_str() ); + SendDlgItemMessage( hwndDlg, IDC_LOGGING_SLIDER_FILELOG, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG( 0, 6 ) ); + SendDlgItemMessage( hwndDlg, IDC_LOGGING_SLIDER_EVENTLOG, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG( 0, 6 ) ); + SendDlgItemMessage( hwndDlg, IDC_LOGGING_SLIDER_EVENTLOG, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) nEventLogLevel ); + SendDlgItemMessage( hwndDlg, IDC_LOGGING_SLIDER_FILELOG, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) nFileLogLevel ); + break; + } + case WM_DESTROY: + { + // + // Release the window data + // + LoggingData* pData = (LoggingData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + delete pData; + } + break; + + case WM_HELP: + { + LoggingData* pData = (LoggingData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + wstring strHelp( pData->pWebServer->GetHelpFile() ); + strHelp += g_wszUddiLoggingPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + + case WM_HSCROLL: + { + // + // This message indicates that a slider has changed position + // + LoggingData* pData = (LoggingData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + + // + // The handle of slider is in the LPARAM + // + if( IDC_LOGGING_SLIDER_EVENTLOG == GetDlgCtrlID( (HWND) lParam ) ) + { + pData->bEventLogChanged = true; + SendMessage( GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0 ); + } + else if( IDC_LOGGING_SLIDER_FILELOG == GetDlgCtrlID( (HWND) lParam ) ) + { + pData->bFileLogChanged = true; + SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); + } + + break; + } + + case WM_NOTIFY: + if( PSN_APPLY == ( (NMHDR *) lParam )->code ) + { + // + // The Apply button or the OK Button was clicked + // + LoggingData* pdata = (LoggingData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + if( pdata->bEventLogChanged ) + { + _TCHAR szPos[ 34 ]; + int nPos = (int) SendDlgItemMessage( hwndDlg, IDC_LOGGING_SLIDER_EVENTLOG, TBM_GETPOS, 0, 0 ); + + pdata->pWebServer->m_mapChanges[ UDDI_EVENTLOG_LEVEL ] = _itot( nPos, szPos, 10 ); + } + + if( pdata->bFileLogChanged ) + { + _TCHAR szPos[ 34 ]; + int nPos = (int) SendDlgItemMessage( hwndDlg, IDC_LOGGING_SLIDER_FILELOG, TBM_GETPOS, 0, 0 ); + + pdata->pWebServer->m_mapChanges[ UDDI_FILELOG_LEVEL ] = _itot( nPos, szPos, 10 ); + } + + // + // Reset the change indicators so we don't update twice + // + pdata->bEventLogChanged = false; + pdata->bFileLogChanged = false; + + // + // Ask MMC to send us a message (on the main thread) so + // we know the Apply button was clicked. + // + HRESULT hr = MMCPropertyChangeNotify( pdata->pWebServer->m_ppHandle, (LPARAM) pdata->pWebServer ); + _ASSERT(SUCCEEDED(hr)); + return PSNRET_NOERROR; + } + else if( PSN_HELP == ((NMHDR *) lParam)->code ) + { + DatabaseConnectionData* pdata = (DatabaseConnectionData*) GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + tstring strHelp( pdata->pWebServer->GetHelpFile() ); + strHelp += g_wszUddiLoggingPageHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + } + break; + } + return FALSE; +} + +BOOL CALLBACK CUDDIWebServerNode::NewWebServerDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + static WebServerData* pWSData = NULL; + + switch( uMsg ) + { + case WM_INITDIALOG: + { + pWSData = reinterpret_cast(lParam); + + if( NULL == pWSData || NULL == pWSData->pBase ) + { + return FALSE; + } + + WCHAR wszBuf[ MAX_PATH ]; + DWORD dwBufSize = MAX_PATH; + wszBuf[ 0 ] = 0x00; + + if( !GetComputerName( wszBuf, &dwBufSize ) ) + { + return FALSE; + } + + BOOL fChildExists = pWSData->pBase->ChildExists( wszBuf ); + + if( IsWebServer( wszBuf ) && !fChildExists ) + { + // Defaults for the groups of radio buttons are: add this computer, + // and add it as both a reader + writer. + // + SendDlgItemMessage( hwndDlg, IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER, BM_SETCHECK, TRUE, NULL ); + SendDlgItemMessage( hwndDlg, IDC_SITE_CONNECT_RADIO_BOTH, BM_SETCHECK, TRUE, NULL ); + EnableWindow( GetDlgItem( hwndDlg, IDOK ), TRUE ); + + pWSData->connectMode = CM_Both; + } + else + { + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER ), FALSE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_BTN_BROWSE ), TRUE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ), TRUE ); + EnableWindow( GetDlgItem( hwndDlg, IDOK ), FALSE ); + + SetDlgItemText( hwndDlg, IDC_SITE_CONNECT_TXT_DATABASE_INSTANCE, _T("") ); + SendDlgItemMessage( hwndDlg, IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER, BM_SETCHECK, TRUE, NULL ); + SetFocus( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ) ); + } + + break; + } + + case WM_HELP: + { + tstring strHelp( pWSData->pBase->GetHelpFile() ); + strHelp += g_wszUddiAddWebServerHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + break; + } + + case WM_COMMAND: + switch( LOWORD(wParam) ) + { + case IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER: + { + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_BTN_BROWSE ), FALSE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ), FALSE ); + EnableWindow( GetDlgItem( hwndDlg, IDOK ), TRUE ); + + break; + } + + case IDC_SITE_CONNECT_RADIO_ANOTHERCOMPUTER: + { + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_BTN_BROWSE ), TRUE ); + EnableWindow( GetDlgItem( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER ), TRUE ); + + WCHAR wszComputerName[ 256 ]; + wszComputerName[ 0 ] = 0x00; + GetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, wszComputerName, ARRAYLEN( wszComputerName ) ); + + // + // Enable the OK button only if there is some sort of text + // in the edit control where the computer name is supposed + // to be typed in. + // + EnableWindow( GetDlgItem( hwndDlg, IDOK ), 0 == wcslen( wszComputerName ) ? FALSE : TRUE ); + + break; + } + + case IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER: + { + if( EN_CHANGE == HIWORD(wParam) ) + { + WCHAR wszComputerName[ 256 ]; + wszComputerName[ 0 ] = 0x00; + GetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, wszComputerName, ARRAYLEN( wszComputerName ) ); + + // + // Enable the OK button only if there is some sort of text + // in the edit control where the computer name is supposed + // to be typed in. + // + EnableWindow( GetDlgItem( hwndDlg, IDOK ), 0 == wcslen( wszComputerName ) ? FALSE : TRUE ); + } + break; + } + + case IDC_SITE_CONNECT_BTN_BROWSE: + { + _TCHAR szComputerName[ 256 ]; + if( ObjectPicker( hwndDlg, OT_Computer, szComputerName, ARRAYLEN( szComputerName ) ) ) + { + SetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, szComputerName ); + } + + break; + } + + case IDHELP: + { + wstring strHelp( pWSData->pBase->GetHelpFile() ); + strHelp += g_wszUddiAddWebServerHelp; + + ::HtmlHelp( hwndDlg, strHelp.c_str(), HH_DISPLAY_TOPIC, NULL ); + + break; + } + + case IDOK: + { + _TCHAR szBuf[ MAX_PATH + 1 ]; + DWORD dwSize = MAX_PATH + 1; + memset( szBuf, 0, dwSize * sizeof( _TCHAR ) ); + + if( SendDlgItemMessage( hwndDlg, IDC_SITE_CONNECT_RADIO_LOCALCOMPUTER, BM_GETCHECK, NULL, NULL ) ) + { + szBuf[ 0 ] = 0; + ::GetComputerName( szBuf, &dwSize ); + ToUpper( szBuf ); + pWSData->szName = szBuf; + } + else + { + ::GetDlgItemText( hwndDlg, IDC_SITE_CONNECT_EDIT_ANOTHERCOMPUTER, szBuf, dwSize ); + ToUpper( szBuf ); + pWSData->szName = szBuf; + } + + if( !CUDDIWebServerNode::IsWebServer( pWSData->szName.c_str() ) ) + { + _TCHAR szTitle[ 256 ]; + _TCHAR szMessage[ 1024 ]; + LoadString( g_hinst, IDS_WEBSERVER_SELECT_ERROR, szMessage, ARRAYLEN( szMessage ) ); + LoadString( g_hinst, IDS_WEBSERVER_SELECT_ERROR_TITLE, szTitle, ARRAYLEN( szTitle ) ); + MessageBox( hwndDlg, szMessage, szTitle, MB_ICONERROR ); + return FALSE; + } + EndDialog( hwndDlg, TRUE ); + return TRUE; + } + + case IDCANCEL: + { + EndDialog( hwndDlg, FALSE ); + } + } + case WM_DESTROY: + break; + } + + return FALSE; +} + + +HRESULT +CUDDIWebServerNode::UpdateResultPaneItem(IConsole *pConsole, HRESULTITEM item) +{ + HRESULT hr = E_INVALIDARG; + + if( NULL == pConsole ) + { + return E_INVALIDARG; + } + + IResultData *pResultData = NULL; + hr = pConsole->QueryInterface( IID_IResultData, (void **)&pResultData ); + if( S_OK != hr ) + { + return hr; + } + + RESULTDATAITEM rditem; + ZeroMemory( &rditem, sizeof( RESULTDATAITEM ) ); + rditem.itemID = item; + + hr = pResultData->GetItem( &rditem ); + _ASSERT( S_OK == hr ); + + rditem.mask &= RDI_STR; + rditem.str = MMC_CALLBACK; + hr = pResultData->SetItem( &rditem ); + _ASSERT( S_OK == hr ); + + // + // Update the "Status" column. Because we are updating the text, we + // don't change the mask in rditem. + // + rditem.nCol = 1; + hr = pResultData->SetItem( &rditem ); + _ASSERT( S_OK == hr ); + + pResultData->Release(); + + return hr; +} + + +HRESULT +CUDDIWebServerNode::UpdateScopePaneItem( IConsole *pConsole, HSCOPEITEM item ) +{ + HRESULT hr = E_INVALIDARG; + + if( NULL == pConsole ) + { + return E_INVALIDARG; + } + + IConsoleNameSpace *pNameSpace = NULL; + hr = pConsole->QueryInterface( IID_IConsoleNameSpace, (void **)&pNameSpace ); + if( S_OK != hr ) + { + return hr; + } + + SCOPEDATAITEM sditem; + ZeroMemory( &sditem, sizeof( SCOPEDATAITEM ) ); + sditem.ID = item; + + hr = pNameSpace->GetItem( &sditem ); + _ASSERT( S_OK == hr ); + + sditem.mask &= SDI_STR; + sditem.displayname = MMC_CALLBACK; + + hr = pNameSpace->SetItem( &sditem ); + _ASSERT( S_OK == hr ); + + pNameSpace->Release(); + + return hr; +} + + +BOOL +CUDDIWebServerNode::IsW3SvcRunning() +{ + BOOL bRet = FALSE; + + // 1. Open the Service Control Manager on the machine which the + // Web Server is currently running on. + // + SC_HANDLE hSCManager = OpenSCManager( m_szName, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT ); + if( NULL == hSCManager ) + { + return bRet; + } + + // 2. Get a handle to the WWW Service on said machine. Note the + // access permissions that we are using. + // + SC_HANDLE hW3Svc = OpenService( hSCManager, _T("w3svc"), SERVICE_QUERY_STATUS ); + if( NULL == hW3Svc ) + { + CloseServiceHandle( hSCManager ); + return bRet; + } + + // 3. Query the status of the WWW Service. + // + SERVICE_STATUS stW3Svc; + ZeroMemory( &stW3Svc, sizeof( SERVICE_STATUS ) ); + + if( QueryServiceStatus( hW3Svc, &stW3Svc ) ) + { + bRet = ( SERVICE_RUNNING == stW3Svc.dwCurrentState ) ? TRUE : FALSE; + } + + CloseServiceHandle( hSCManager ); + CloseServiceHandle( hW3Svc ); + return bRet; +} + + +BOOL +CUDDIWebServerNode::GetReaderConnectionString( const tstring& szName, tstring &szReader ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Database" ), KEY_READ, szName.c_str() ); + szReader = key.GetString( _T("ReaderConnectionString"), _T("") ); + + return TRUE; + } + catch( ... ) + { + return FALSE; + } +} + +BOOL +CUDDIWebServerNode::GetWriterConnectionString( const tstring& szName, tstring &szWriter ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Database" ), KEY_READ, szName.c_str() ); + szWriter = key.GetString( _T("WriterConnectionString"), _T("") ); + + return TRUE; + } + catch( ... ) + { + return FALSE; + } +} + + +BOOL +CUDDIWebServerNode::SetReaderConnectionString( const tstring& szName, const tstring& szReader ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Database" ), KEY_ALL_ACCESS, szName.c_str() ); + key.SetValue( _T("ReaderConnectionString"), szReader.c_str() ); + return TRUE; + } + catch( ... ) + { + return FALSE; + } +} + + +BOOL +CUDDIWebServerNode::SetWriterConnectionString( const tstring& szName, const tstring& szWriter ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Database" ), KEY_ALL_ACCESS, szName.c_str() ); + key.SetValue( _T("WriterConnectionString"), szWriter.c_str() ); + return TRUE; + } + catch( ... ) + { + return FALSE; + } +} + + +BOOL +CUDDIWebServerNode::IsAssignedToSite( const tstring& szWebServer, const ConnectMode& cm, tstring& szSite ) +{ + try + { + tstring szConnStr = _T( "" ); + tstring szDomain = _T( "" ); + tstring szInstance = _T( "" ); + + szSite = _T( "" ); + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Database" ), KEY_READ, szWebServer.c_str() ); + + tstring szName = ( CM_Reader == cm ) ? _T("ReaderConnectionString") : _T("WriterConnectionString"); + + szConnStr = key.GetString( szName.c_str() ); + if( 0 < szConnStr.length() ) + { + CrackConnectionString( szConnStr, szDomain, szSite, szInstance ); + } + + return ( 0 == szSite.length() ) ? FALSE : TRUE; + } + catch( ... ) + { + return FALSE; + } +} + +BOOL +CUDDIWebServerNode::GetDBSchemaVersion( tstring& szVersion ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup\\WebServer" ), KEY_READ, m_szName ); + + szVersion = key.GetString( _T( "DBSchemaVersion" ) ); + + return ( 0 == szVersion.length() ) ? FALSE : TRUE; + } + catch( ... ) + { + return FALSE; + } +} + + +BOOL +CUDDIWebServerNode::GetDBSchemaVersion( const wstring& strComputer, wstring& strVersion ) +{ + try + { + CUDDIRegistryKey key( _T( "SOFTWARE\\Microsoft\\UDDI\\Setup\\WebServer" ), KEY_READ, strComputer ); + + strVersion = key.GetString( _T( "DBSchemaVersion" ) ); + + return ( 0 == strVersion.length() ) ? FALSE : TRUE; + } + catch( ... ) + { + return FALSE; + } +} + +void +CUDDIWebServerNode::DeleteFromScopePane( IConsoleNameSpace *pConsoleNameSpace ) +{ + if( NULL != pConsoleNameSpace ) + { + pConsoleNameSpace->DeleteItem( GetScopeItemValue(), TRUE ); + m_isDeleted = TRUE; + } +} diff --git a/inetsrv/uddi/source/mmc/webservernode.h b/inetsrv/uddi/source/mmc/webservernode.h new file mode 100644 index 0000000..4dc72e2 --- /dev/null +++ b/inetsrv/uddi/source/mmc/webservernode.h @@ -0,0 +1,109 @@ +#pragma once + +#include "globals.h" +#include "delebase.h" +#include +using namespace std; + +enum ConnectMode +{ + CM_Reader = 0, + CM_Writer, + CM_Both +}; + +struct WebServerData +{ + CDelegationBase *pBase; + tstring szName; + ConnectMode connectMode; +}; + +typedef map CPropertyMap; + +class CUDDISiteNode; + +class CUDDIWebServerNode : public CDelegationBase +{ + friend class CUDDISiteNode; + +public: + CUDDIWebServerNode( const _TCHAR *szName, int id, CUDDISiteNode* parent, BOOL bExtension ); + virtual ~CUDDIWebServerNode(); + + static BOOL IsWebServer( const WCHAR *pwszName ); + static BOOL IsAssignedToSite( const tstring& szWebServer, const ConnectMode& cm, tstring& szSite ); + + static BOOL GetReaderConnectionString( const tstring& szName, tstring &szReader ); + static BOOL GetWriterConnectionString( const tstring& szName, tstring &szWriter ); + static BOOL SetReaderConnectionString( const tstring& szName, const tstring& szReader ); + static BOOL SetWriterConnectionString( const tstring& szName, const tstring& szWriter ); + static void CrackConnectionString( const tstring& strConnection, tstring& strDomain, tstring& strServer, tstring& strInstance ); + static tstring BuildConnectionString( const wstring& strComputer ); + static BOOL GetDBSchemaVersion( const wstring& strComputer, wstring& strVersion ); + static BOOL CALLBACK NewWebServerDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + + HRESULT GetData(); + HRESULT SaveData(); + BOOL Start(); + BOOL Stop(); + BOOL SetRunState( BOOL bStart ); + const BOOL IsRunning(); + const LPCTSTR GetName(); + BOOL GetDBSchemaVersion( tstring& szVersion ); + + virtual const _TCHAR *GetDisplayName(int nCol = 0); + virtual const GUID & getNodeType() { return thisGuid; } + virtual const int GetBitmapIndex() { return INDEX_WEBSERVER; } + virtual BOOL HasChildren() { return FALSE; } + virtual BOOL ChildExists( const WCHAR *pwszName ); + BOOL IsDeleted() { return m_isDeleted; } + void DeleteFromScopePane( IConsoleNameSpace *pConsoleNameSpace ); + + // + // Virtual functions go here (for MMCN_*) + // + virtual HRESULT OnAddMenuItems( IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed ); + virtual HRESULT OnMenuCommand( IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject ); + virtual HRESULT OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect); + virtual HRESULT OnPropertyChange(IConsole *pConsole, CComponent *pComponent); + virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype); + virtual HRESULT OnRefresh(IConsole *pConsole); + virtual HRESULT OnDelete( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsoleComp); + virtual HRESULT OnSetToolbar( IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect ); + virtual HRESULT OnToolbarCommand( IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject ); + virtual HRESULT OnShowContextHelp(IDisplayHelp *pDisplayHelp, LPOLESTR helpFile); + virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle); + virtual HRESULT HasPropertySheets(); + virtual HRESULT GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch ); + +private: + static const GUID thisGuid; + enum WEBSERVER_STATUS { RUNNING, STOPPED } m_nStatus; + enum menuItems { IDM_WEBSERVER_START = 1, IDM_WEBSERVER_STOP = 2 }; + BOOL m_bStdSvr; + + _TCHAR* m_szName; + int m_nId; + LONG_PTR m_ppHandle; + CUDDISiteNode *m_pParent; + BOOL m_isDeleted; + CPropertyMap m_mapProperties; + CPropertyMap m_mapChanges; + IToolbar *m_pToolbar; + BOOL m_isScopeItem; + BOOL m_fDeleteFromScopePane; + tstring m_strDisplayName; + HWND m_hwndPropSheet; + + static BOOL CALLBACK GeneralDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK DatabaseConnectionDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + static BOOL CALLBACK LoggingDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + + HRESULT UpdateScopePaneItem( IConsole *pConsole, HSCOPEITEM item ); + HRESULT UpdateResultPaneItem( IConsole *pConsole, HRESULTITEM item ); + + BOOL IsW3SvcRunning(); + +}; + diff --git a/inetsrv/uddi/source/operator/assemblyinfo.cs b/inetsrv/uddi/source/operator/assemblyinfo.cs new file mode 100644 index 0000000..9c28a92 --- /dev/null +++ b/inetsrv/uddi/source/operator/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("uddi.operator.dll")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/operator/assemblyversioninfo.cs b/inetsrv/uddi/source/operator/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/operator/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/operator/build.log b/inetsrv/uddi/source/operator/build.log new file mode 100644 index 0000000..7c5d411 --- /dev/null +++ b/inetsrv/uddi/source/operator/build.log @@ -0,0 +1,25 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\operator directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\operator directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\operator +Elapsed time [0:00:00.016] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.operator D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.operator not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\operator directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.operator D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.operator not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.operator.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\api\obj\I386\uddi.api.dll assemblyinfo.cs assemblyversioninfo.cs graph.cs messages.cs nodes.cs operator.cs replication.cs types.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\operator\obj\i386\uddi.operator.dll +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:00.891] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/operator/graph.cs b/inetsrv/uddi/source/operator/graph.cs new file mode 100644 index 0000000..3479731 --- /dev/null +++ b/inetsrv/uddi/source/operator/graph.cs @@ -0,0 +1,65 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using UDDI.API; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Replication +{ + public class ControlledMessage + { + public static void Save( string fromOperatorKey, string toOperatorKey, MessageType messageType ) + { + /*Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_replication_controlledMessage_save"; + + sp.Parameters.Add( "@fromOperatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@toOperatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@messageType", SqlDbType.TinyInt ); + + sp.Parameters.SetGuidFromString( "@fromOperatorKey", fromOperatorKey ); + sp.Parameters.SetGuidFromString( "@toOperatorKey", toOperatorKey ); + sp.Parameters.SetShort( "@messageType", (short)messageType ); + + sp.ExecuteNonQuery(); + + Debug.Leave();*/ + } + + public static void Test( string fromOperatorKey, string toOperatorKey, MessageType messageType ) + { + /*Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_replication_controlledMessage_test"; + + sp.Parameters.Add( "@fromOperatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@toOperatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@messageType", SqlDbType.TinyInt ); + + sp.Parameters.SetGuidFromString( "@fromOperatorKey", fromOperatorKey ); + sp.Parameters.SetGuidFromString( "@toOperatorKey", toOperatorKey ); + sp.Parameters.SetShort( "@messageType", (short)messageType ); + + sp.ExecuteNonQuery(); + + Debug.Leave();*/ + } + + public static void Clear() + { + /* + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_replication_controlledMessage_clear"; + sp.ExecuteNonQuery();*/ + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/operator/makefile b/inetsrv/uddi/source/operator/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/operator/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/operator/makefile.inc b/inetsrv/uddi/source/operator/makefile.inc new file mode 100644 index 0000000..47a253a --- /dev/null +++ b/inetsrv/uddi/source/operator/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/operator/messages.cs b/inetsrv/uddi/source/operator/messages.cs new file mode 100644 index 0000000..2db410a --- /dev/null +++ b/inetsrv/uddi/source/operator/messages.cs @@ -0,0 +1,442 @@ +using System; +using System.Collections; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.Serialization; +using UDDI; +using UDDI.API; +using UDDI.API.Binding; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Replication +{ + [XmlRoot( "changeRecords", Namespace=UDDI.Replication.Constants.Namespace )] + public class ChangeRecordDetail + { + [XmlElement( "changeRecord" )] + public ChangeRecordCollection ChangeRecords = new ChangeRecordCollection(); + + public ChangeRecordDetail() + { + } + } + + [XmlRoot( "highWaterMarks", Namespace=UDDI.Replication.Constants.Namespace )] + public class HighWaterMarkDetail + { + [XmlElement( "highWaterMark" )] + public ChangeRecordVectorCollection HighWaterMarks = new ChangeRecordVectorCollection(); + } + + [XmlRoot( "get_changeRecords", Namespace=UDDI.Replication.Constants.Namespace )] + public class GetChangeRecords + { + // + // Element: requestingNode + // + [XmlElement( "requestingNode" )] + public string RequestingNode; + + // + // Element: changesAlreadySeen + // + private ChangeRecordVectorCollection changesAlreadySeen; + + [XmlArray( "changesAlreadySeen" ), XmlArrayItem( "highWaterMark" )] + public ChangeRecordVectorCollection ChangesAlreadySeen + { + get + { + if( null == changesAlreadySeen ) + changesAlreadySeen = new ChangeRecordVectorCollection(); + + return changesAlreadySeen; + } + + set { changesAlreadySeen = value; } + } + + // + // Element: responseLimitCount + // + private int responseLimitCount = -1; + + [XmlElement( "responseLimitCount" ), DefaultValue( -1 )] + public int ResponseLimitCount + { + get { return responseLimitCount; } + set { responseLimitCount = value; } + } + + // + // Element: responseLimitVector + // + private ChangeRecordVectorCollection responseLimitVector; + + [XmlArray( "responseLimitVector" ), XmlArrayItem( "highWaterMark" )] + public ChangeRecordVectorCollection ResponseLimitVectorSerialize + { + get + { + if( -1 != ResponseLimitCount || Utility.CollectionEmpty( responseLimitVector ) ) + return null; + + return responseLimitVector; + } + + set { responseLimitVector = value; } + } + + [XmlIgnore] + public ChangeRecordVectorCollection ResponseLimitVector + { + get + { + if( null == responseLimitVector ) + responseLimitVector = new ChangeRecordVectorCollection(); + + return responseLimitVector; + } + } + + /// **************************************************************** + /// public Get + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public ChangeRecordDetail Get() + { + Debug.VerifySetting( "OperatorKey" ); + + ChangeRecordDetail detail = new ChangeRecordDetail(); + + try + { + // + // Get the list of known operators. + // + StringCollection operators = new StringCollection(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_operators_get"; + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + operators.Add( reader.GetGuidString( "operatorKey" ) ); + } + } + finally + { + reader.Close(); + } + + // + // Set the search criteria for change records. + // + foreach( string operatorKey in operators ) + { + long startUSN; + long stopUSN; + + startUSN = 0; + foreach( ChangeRecordVector mark in ChangesAlreadySeen ) + { + if( 0 == String.Compare( operatorKey, mark.NodeID, true ) ) + { + startUSN = mark.OriginatingUSN + 1; + break; + } + } + + stopUSN = System.Int64.MaxValue; + foreach( ChangeRecordVector mark in ResponseLimitVector ) + { + if( 0 == String.Compare( operatorKey, mark.NodeID, true ) ) + { + stopUSN = mark.OriginatingUSN; + break; + } + } + + FindChangeRecords.SetRange( operatorKey, startUSN, stopUSN ); + } + + // + // Retrieve the change records. + // + int limit = Config.GetInt( "Replication.ResponseLimitCountDefault" ); + + if( ResponseLimitCount >= 0 && ResponseLimitCount <= limit ) + limit = ResponseLimitCount; + + reader = FindChangeRecords.RetrieveResults( limit ); + + try + { + while( reader.Read() ) + { + XmlSerializer serializer = null; + + switch( (ChangeRecordPayloadType)reader.GetShort( "changeTypeID" ) ) + { + case ChangeRecordPayloadType.ChangeRecordNull: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordNull ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordNewData: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordNewData ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordDelete: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordDelete ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordPublisherAssertion: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordPublisherAssertion ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordHide: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordHide ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordDeleteAssertion: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordDeleteAssertion ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordAcknowledgement: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordAcknowledgement ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordCorrection: + serializer = XmlSerializerManager.GetSerializer( typeof( ChangeRecordCorrection ) ); + break; + } + + StringReader stringReader = new StringReader( reader.GetString( "changeData" ) ); + + try + { + ChangeRecord changeRecord = new ChangeRecord(); + + changeRecord.AcknowledgementRequested = ( reader.GetInt( "flag" ) & (int)ChangeRecordFlags.AcknowledgementRequested ) > 0; + changeRecord.ChangeID.NodeID = reader.GetString( "OperatorKey" ); + changeRecord.ChangeID.OriginatingUSN = reader.GetLong( "USN" ); + + ChangeRecordBase changeRecordBase = ( ChangeRecordBase ) serializer.Deserialize( stringReader ); + if( changeRecordBase is ChangeRecordCorrection ) + { + // + // The query to find change records will do correction 'fixups'. That is, the changeData of this + // change record will be replaced with the changeData from the correction. The problem with this is + // that the original change data will now look like a correction. To distinguish these types of + // change records, we look to see if the OriginatingUSN's match. If the OriginatingUSN's match, + // we want they payload of the change record in this correction. This payload will contain the + // corrected data that we want. + // + ChangeRecordCorrection changeRecordCorrection = ( ChangeRecordCorrection ) changeRecordBase; + if( changeRecordCorrection.ChangeRecord.ChangeID.OriginatingUSN == changeRecord.ChangeID.OriginatingUSN ) + { + changeRecordBase = changeRecordCorrection.ChangeRecord.Payload; + } + } + + changeRecord.Payload = changeRecordBase; + + detail.ChangeRecords.Add( changeRecord ); + } + finally + { + stringReader.Close(); + } + } + } + finally + { + reader.Close(); + } + } + catch( Exception e ) + { + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.None, + "Could not retrieve change records:\r\n" + e.ToString() ); + + FindChangeRecords.CleanUp(); + throw; + } + + return detail; + } + + public override string ToString() + { + XmlSerializer serializer = new XmlSerializer( GetType() ); + UTF8EncodedStringWriter stringWriter = new UTF8EncodedStringWriter(); + + try + { + serializer.Serialize( stringWriter, this ); + return stringWriter.ToString(); + } + finally + { + stringWriter.Close(); + } + } + } + + public class FindChangeRecords + { + public static int SetRange( string operatorKey, long startUSN, long stopUSN ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_find_changeRecords"; + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@startUSN", SqlDbType.BigInt ); + sp.Parameters.Add( "@stopUSN", SqlDbType.BigInt ); + sp.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetGuidFromString( "@operatorKey", operatorKey ); + sp.Parameters.SetLong( "@startUSN", startUSN ); + sp.Parameters.SetLong( "@stopUSN", stopUSN ); + + sp.ExecuteNonQuery(); + + return sp.Parameters.GetInt( "@rows" ); + } + + public static SqlDataReaderAccessor RetrieveResults( int maxRows ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_find_changeRecords_commit"; + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@responseLimitCount", SqlDbType.Int ); + + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + sp.Parameters.SetInt( "@responseLimitCount", maxRows ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + return reader; + } + + public static void CleanUp() + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_find_changeRecords_cleanup"; + + sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuid( "@contextID", Context.ContextID ); + + sp.ExecuteNonQuery(); + } + } + + [XmlRoot( "notify_changeRecordsAvailable", Namespace=UDDI.Replication.Constants.Namespace )] + public class NotifyChangeRecordsAvailable + { + // + // Element: notifyingNode + // + [XmlElement( "notifyingNode" )] + public string NotifyingNode; + + // + // Element: changesAvailable + // + private ChangeRecordVectorCollection highWaterMarks; + + [XmlArray( "changesAvailable" ), XmlArrayItem( "highWaterMark" )] + public ChangeRecordVectorCollection HighWaterMarks + { + get + { + if( null == highWaterMarks ) + highWaterMarks = new ChangeRecordVectorCollection(); + + return highWaterMarks; + } + + set { highWaterMarks = new ChangeRecordVectorCollection(); } + } + + public void Notify() + { + ReplicationResult result = new ReplicationResult(); + + result.OperatorNodeID = NotifyingNode; + result.Description = null; + result.LastNodeID = null; + result.LastUSN = 0; + result.LastChange = DateTime.Now.Ticks; + result.ReplicationStatus = ReplicationStatus.Notify; + + result.Save(); + } + } + + [XmlRoot( "do_ping", Namespace=UDDI.Replication.Constants.Namespace )] + public class DoPing + { + public string Ping() + { + Debug.VerifySetting( "OperatorKey" ); + + return Config.GetString( "OperatorKey" ); + } + } + + [XmlRoot( "get_highWaterMarks", Namespace=UDDI.Replication.Constants.Namespace )] + public class GetHighWaterMarks + { + public HighWaterMarkDetail Get() + { + HighWaterMarkDetail detail = new HighWaterMarkDetail(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_highWaterMarks_get"; + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + while( reader.Read() ) + { + detail.HighWaterMarks.Add( + reader.GetString( "operatorKey" ), + reader.GetLong( "USN" ) ); + } + } + finally + { + reader.Close(); + } + + return detail; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/operator/nodes.cs b/inetsrv/uddi/source/operator/nodes.cs new file mode 100644 index 0000000..b923b41 --- /dev/null +++ b/inetsrv/uddi/source/operator/nodes.cs @@ -0,0 +1,246 @@ +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Data; +using System.Xml.Serialization; +using UDDI; +using UDDI.API.Business; +using UDDI.Diagnostics; + +namespace UDDI.Replication +{ + public class OperatorNodeCollection : CollectionBase + { + public void Get() + { + Get( true ); + } + + public void Get( bool activeOperatorsOnly ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_operators_get"; + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + this.Clear(); + + while( reader.Read() ) + { + OperatorStatus operatorStatus = (OperatorStatus)reader.GetShort( "operatorStatusID" ); + string name = reader.GetString( "name" ); + + if( !activeOperatorsOnly || + OperatorStatus.New == operatorStatus || + OperatorStatus.Normal == operatorStatus ) + { + this.Add( + reader.GetGuidString( "operatorKey" ), + operatorStatus, + name, + reader.GetString( "soapReplicationURL" ) ); + } + else + { + Debug.Write( + SeverityType.Info, + CategoryType.Replication, + String.Format( + "Removing operator '{0}' with status '{1}' from list of replication operators", + name, + operatorStatus.ToString() ) ); + } + } + } + finally + { + reader.Close(); + } + } + + public OperatorNode this[ int index ] + { + get { return (OperatorNode)List[ index ]; } + set { List[index] = value; } + } + + public int Add( OperatorNode value ) + { + return List.Add( value ); + } + + public int Add( string operatorNodeID, OperatorStatus operatorStatus, string name, string soapReplicationURL ) + { + return List.Add( new OperatorNode( operatorNodeID, operatorStatus, name, soapReplicationURL ) ); + } + + public void Insert( int index, OperatorNode value ) + { + List.Insert( index, value ); + } + + public int IndexOf( string operatorNodeID ) + { + for( int i = 0; i < this.Count; i ++ ) + { + if( 0 == String.Compare( operatorNodeID, ((OperatorNode)List[ i ]).OperatorNodeID, true ) ) + return i; + } + + return -1; + } + + public bool Contains( string operatorNodeID ) + { + foreach( OperatorNode node in this ) + { + if( 0 == String.Compare( operatorNodeID, node.OperatorNodeID, true ) ) + return true; + } + + return false; + } + + public void Remove( string operatorNodeID ) + { + foreach( OperatorNode node in this ) + { + if( 0 == String.Compare( operatorNodeID, node.OperatorNodeID, true ) ) + { + List.Remove( node ); + return; + } + } + } + + public void CopyTo( OperatorNode[] array, int index ) + { + List.CopyTo( array, index ); + } + } + + /// ******************************************************************** + /// public class OperatorNode + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [XmlRoot( "operator", Namespace=UDDI.Replication.Constants.Namespace )] + public class OperatorNode + { + // + // Element: operatorNodeID + // + [XmlElement( "operatorNodeID" )] + public string OperatorNodeID; + + // + // Element: operatorStatus + // + [XmlElement( "operatorStatus" )] + public UDDI.Replication.OperatorStatus OperatorStatus; + + // + // Element: contact + // + private ContactCollection contacts; + + [XmlElement( "contact" )] + public ContactCollection Contacts + { + get + { + if( null == contacts ) + contacts = new ContactCollection(); + + return contacts; + } + + set { contacts = value; } + } + + // + // Element: operatorCustodyName + // + [XmlElement( "operatorCustodyName" )] + public string Name; + + // + // Element: soapReplicationRootURL + // + [XmlElement( "soapReplicationRootURL" )] + public string SoapReplicationURL; + + // + // Element: certIssuerName + // + [XmlElement( "certIssuerName" )] + public string CertIssuerName; + + // + // Element: certSubjectName + // + [XmlElement( "certSubjectName" )] + public string CertSubjectName; + + // + // Element: certificate + // + [XmlElement( "certificate" )] + public byte[] Certificate; + + public OperatorNode() + { + } + + public OperatorNode( string operatorNodeID ) + { + this.OperatorNodeID = operatorNodeID; + } + + public OperatorNode( string operatorNodeID, OperatorStatus operatorStatus, string name, string soapReplicationURL ) + { + this.OperatorNodeID = operatorNodeID; + this.OperatorStatus = operatorStatus; + this.Name = name; + this.SoapReplicationURL = soapReplicationURL; + } + + public void Get() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_operator_get"; + + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@operatorKey", OperatorNodeID ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + if( reader.Read() ) + { + OperatorStatus = (OperatorStatus)reader.GetShort( "operatorStatusID" ); + Name = reader.GetString( "name" ); + SoapReplicationURL = reader.GetString( "soapReplicationURL" ); + CertIssuerName = reader.GetString( "certIssuer" ); + CertSubjectName = reader.GetString( "certSubject" ); + Certificate = reader.GetBinary( "certificate" ); + } + } + finally + { + reader.Close(); + } + + Debug.Leave(); + } + } +} diff --git a/inetsrv/uddi/source/operator/obj/_objects.mac b/inetsrv/uddi/source/operator/obj/_objects.mac new file mode 100644 index 0000000..ac3b88c --- /dev/null +++ b/inetsrv/uddi/source/operator/obj/_objects.mac @@ -0,0 +1,48 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\graph.obj \ + $(_OBJ_DIR)\i386\messages.obj \ + $(_OBJ_DIR)\i386\nodes.obj \ + $(_OBJ_DIR)\i386\operator.obj \ + $(_OBJ_DIR)\i386\replication.obj \ + $(_OBJ_DIR)\i386\types.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\graph.obj \ + $(_OBJ_DIR)\ia64\messages.obj \ + $(_OBJ_DIR)\ia64\nodes.obj \ + $(_OBJ_DIR)\ia64\operator.obj \ + $(_OBJ_DIR)\ia64\replication.obj \ + $(_OBJ_DIR)\ia64\types.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\graph.obj \ + $(_OBJ_DIR)\amd64\messages.obj \ + $(_OBJ_DIR)\amd64\nodes.obj \ + $(_OBJ_DIR)\amd64\operator.obj \ + $(_OBJ_DIR)\amd64\replication.obj \ + $(_OBJ_DIR)\amd64\types.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\graph.obj \ + $(_OBJ_DIR)\arm\messages.obj \ + $(_OBJ_DIR)\arm\nodes.obj \ + $(_OBJ_DIR)\arm\operator.obj \ + $(_OBJ_DIR)\arm\replication.obj \ + $(_OBJ_DIR)\arm\types.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/operator/obj/i386/uddi.operator.dll b/inetsrv/uddi/source/operator/obj/i386/uddi.operator.dll new file mode 100644 index 0000000..cf4cea7 Binary files /dev/null and b/inetsrv/uddi/source/operator/obj/i386/uddi.operator.dll differ diff --git a/inetsrv/uddi/source/operator/obj/i386/uddi.operator.pdb b/inetsrv/uddi/source/operator/obj/i386/uddi.operator.pdb new file mode 100644 index 0000000..e6b5d71 Binary files /dev/null and b/inetsrv/uddi/source/operator/obj/i386/uddi.operator.pdb differ diff --git a/inetsrv/uddi/source/operator/operator.cs b/inetsrv/uddi/source/operator/operator.cs new file mode 100644 index 0000000..594ae94 --- /dev/null +++ b/inetsrv/uddi/source/operator/operator.cs @@ -0,0 +1,266 @@ +using System; +using System.IO; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml.Serialization; +using UDDI.API; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Replication +{ + [SoapDocumentService( ParameterStyle = SoapParameterStyle.Bare, RoutingStyle = SoapServiceRoutingStyle.RequestElement )] + [WebService( Namespace=UDDI.Replication.Constants.Namespace )] + public class ReplicationMessages + { + /// **************************************************************** + /// public GetChangeRecords + /// ---------------------------------------------------------------- + /// + /// Web method for getting change records + /// + /// ---------------------------------------------------------------- + /// + /// An instance of the get_changeRecords message + /// + /// ---------------------------------------------------------------- + /// + /// Returns a changeRecords element + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod( Action = "\"\"", RequestElementName = "get_changeRecords" )] + [UDDIExtension( transaction = true, https = true, certificate = true, messageType = "get_changeRecords" )] + public ChangeRecordDetail GetChangeRecords( UDDI.Replication.GetChangeRecords message ) + { + // + // Log more information than for a usual message to help diagnose possible replication errors. + // + StartOperatorMessageLog( "GetChangeRecords", message ); + + //Debug.Enter(); + Debug.VerifySetting( "OperatorKey" ); + + // + // Make sure the request is allowed by the communication graph. + // + ControlledMessage.Test( message.RequestingNode, + Config.GetString( "OperatorKey" ), + MessageType.GetChangeRecords ); + + // + // Retrieve the change records. + // + ChangeRecordDetail detail = new ChangeRecordDetail(); + + try + { + detail = message.Get(); + + EndOperatorMessageLog( "GetChangeRecords", detail ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + + EndOperatorMessageLog( "GetChangeRecords", e ); + } + + //Debug.Leave(); + + return detail; + } + + /// **************************************************************** + /// public NotifyChangeRecordsAvailable + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// An instance of the notify_changeRecordsAvailable message. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod( Action = "\"\"", RequestElementName = "notify_changeRecordsAvailable" )] + [UDDIExtension( transaction = true, https = true, certificate = true, messageType = "notify_changeRecordsAvailable" )] + public DispositionReport NotifyChangeRecordsAvailable( UDDI.Replication.NotifyChangeRecordsAvailable message ) + { + // + // Log more information than for a usual message to help diagnose possible replication errors. + // + StartOperatorMessageLog( "NotifyChangeRecordsAvailable", message ); + + //Debug.Enter(); + Debug.VerifySetting( "OperatorKey" ); + + DispositionReport dr = new DispositionReport(); + + // + // Make sure the request is allowed by the communication graph. + // + ControlledMessage.Test( message.NotifyingNode, + Config.GetString( "OperatorKey" ), + MessageType.GetChangeRecords ); + + try + { + message.Notify(); + + EndOperatorMessageLog( "NotifyChangeRecordsAvailable", null ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + EndOperatorMessageLog( "NotifyChangeRecordsAvailable", e ); + } + + //Debug.Leave(); + + return dr; + } + + /// **************************************************************** + /// public DoPing + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// An instance of the do_ping message + /// + /// ---------------------------------------------------------------- + /// + /// Returns an operator element with details on this operator + /// node. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod( Action = "\"\"", RequestElementName = "do_ping" )] + [UDDIExtension( transaction = true, https = true, certificate = true, messageType = "do_ping" )] + [return: XmlElement( "operatorNodeID", Namespace=UDDI.Replication.Constants.Namespace, IsNullable=false )] + public string DoPing( UDDI.Replication.DoPing message ) + { + StartOperatorMessageLog( "DoPing", message ); + + //Debug.Enter(); + + // + // Retrieve the change records. + // + string detail = null; + + try + { + detail = message.Ping(); + + EndOperatorMessageLog( "DoPing", detail ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + + EndOperatorMessageLog( "DoPing", e ); + } + + //Debug.Leave(); + + return detail; + } + + /// **************************************************************** + /// public GetHighWaterMarks + /// ---------------------------------------------------------------- + /// + /// + /// ---------------------------------------------------------------- + /// + /// An instance of the get_highWaterMarks message + /// + /// ---------------------------------------------------------------- + /// + /// Returns a list of high water marks seen by this node. + /// + /// **************************************************************** + /// + [WebMethod, SoapDocumentMethod( Action = "\"\"", RequestElementName = "get_highWaterMarks" )] + [UDDIExtension( transaction = true, https = true, certificate = true, messageType = "get_highWaterMarks" )] + public HighWaterMarkDetail GetHighWaterMarks( UDDI.Replication.GetHighWaterMarks message ) + { + // + // Log more information than for a usual message to help diagnose possible replication errors. + // + StartOperatorMessageLog( "GetHighWaterMarks", message ); + + //Debug.Enter(); + + // + // Retrieve the change records. + // + HighWaterMarkDetail detail = null; + + try + { + detail = message.Get(); + + EndOperatorMessageLog( "GetHighWaterMarks", detail ); + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + + EndOperatorMessageLog( "GetHighWaterMarks", e ); + } + + //Debug.Leave(); + + return detail; + } + + // + // The methods below help us log more information about the replication requests. We need this information in order + // to diagnose any possible problems that we have when replicating with other nodes. + // + private void StartOperatorMessageLog( string operationName, object message ) + { + WriteOperatorMessage( "Started " + operationName + " request at ", message ); + } + + private void EndOperatorMessageLog( string operationName, object response ) + { + WriteOperatorMessage( "Ended " + operationName + " request at ", response ); + } + + private void WriteOperatorMessage( string message, object payload ) + { + UTF8EncodedStringWriter writer = new UTF8EncodedStringWriter(); + + writer.Write( message ); + writer.Write( " " ); + writer.WriteLine( DateTime.Now ); + writer.WriteLine( "\r\nRaw Request:" ); + writer.WriteLine( "" ); + + if( null != payload ) + { + try + { + XmlSerializer serializer = new XmlSerializer( payload.GetType() ); + serializer.Serialize( writer, payload ); + } + catch + { + writer.WriteLine( "Unable to serialize payload." ); + } + finally + { + writer.Close(); + } + } + Debug.OperatorMessage( SeverityType.Info, + CategoryType.Replication, + OperatorMessageType.None, + writer.ToString() ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/operator/operator.csproj b/inetsrv/uddi/source/operator/operator.csproj new file mode 100644 index 0000000..a95d709 --- /dev/null +++ b/inetsrv/uddi/source/operator/operator.csproj @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/operator/operator.snk b/inetsrv/uddi/source/operator/operator.snk new file mode 100644 index 0000000..031a1c0 Binary files /dev/null and b/inetsrv/uddi/source/operator/operator.snk differ diff --git a/inetsrv/uddi/source/operator/placefil.txt b/inetsrv/uddi/source/operator/placefil.txt new file mode 100644 index 0000000..4387c01 --- /dev/null +++ b/inetsrv/uddi/source/operator/placefil.txt @@ -0,0 +1 @@ +uddi.operator.dll uddi\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/operator/replication.cs b/inetsrv/uddi/source/operator/replication.cs new file mode 100644 index 0000000..460dccc --- /dev/null +++ b/inetsrv/uddi/source/operator/replication.cs @@ -0,0 +1,1621 @@ +using System; +using System.Collections; +using System.Data; +using System.IO; +using System.Net; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Web.Services; +using System.Web.Services.Description; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; +using System.Data.SqlClient; + +using UDDI; +using UDDI.API; +using UDDI.Diagnostics; + +namespace UDDI.Replication +{ + /// ******************************************************************** + /// class ReplicationHelper + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class ReplicationHelper + { + private static OperatorNode LocalOperator = null; + private static X509Certificate LocalCertificate = null; + private static OperatorNodeCollection RemoteOperators = null; + private static ChangeRecordVectorCollection ChangesAlreadySeen = null; + private static ReplicationSoapClient SoapClient = null; + private static Hashtable NodeChangeRecordCounts = null; + private static Hashtable SessionChangeRecordCounts = null; + + + /// **************************************************************** + /// private Initialize [static] + /// ---------------------------------------------------------------- + /// + /// Initializes replication variables. + /// + /// **************************************************************** + /// + private static void Initialize() + { + Debug.Enter(); + Debug.VerifySetting( "OperatorKey" ); + + // + // Get information about the local operator node. + // + LocalOperator = new OperatorNode( Config.GetString( "OperatorKey" ) ); + LocalOperator.Get(); + + // + // Get the local certificate. + // + LocalCertificate = new X509Certificate( LocalOperator.Certificate ); + + // + // Get the list of operator nodes to which we can send + // get_changeRecords messages. Remove ourself from the + // list! + // + RemoteOperators = new OperatorNodeCollection(); + + RemoteOperators.Get(); + RemoteOperators.Remove( LocalOperator.OperatorNodeID ); + + // + // Get a ChangesAlreadySeen list for each operator node (not + // just the ones we are replicating with). + // + GetHighWaterMarks(); + + // + // Initialize our soap client. + // + string proxy = Config.GetString( "Proxy", null ); + + SoapClient = new ReplicationSoapClient(); + + SoapClient.ClientCertificates.Add( LocalCertificate ); + + if( !Utility.StringEmpty( proxy ) ) + SoapClient.Proxy = new WebProxy( proxy, true ); + + // + // Setup the context for a replication session. + // + Context.ApiVersionMajor = 2; + Context.ContextType = ContextType.Replication; + Context.LogChangeRecords = false; + + // + // Setup logging. + // + SessionChangeRecordCounts = new Hashtable(); + + foreach( int payloadType in Enum.GetValues( typeof( ChangeRecordPayloadType ) ) ) + { + SessionChangeRecordCounts[ payloadType ] = 0; + } + + Debug.Leave(); + } + + private static void GetHighWaterMarks() + { + try + { + GetHighWaterMarks getHighWaterMarks = new GetHighWaterMarks(); + + HighWaterMarkDetail detail = getHighWaterMarks.Get(); + ChangesAlreadySeen = detail.HighWaterMarks; + } + catch( Exception e ) + { +#if never + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.CannotRetrieveHighWaterMarks, + "Could not retrive high water marks for operator nodes.\r\n\r\nDetail:\r\n" + e.ToString() ); +#endif + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.CannotRetrieveHighWaterMarks, + new UDDIText( "UDDI_ERROR_REPLICATION_HIGHWATER_MARKS", e.ToString() ).GetText() ); + + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_REPLICATION_HIGHWATER_MARKS", e ); + } + } + + /// **************************************************************** + /// public Replicate [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public static void Replicate() + { + // + // Initialize the replication session. + // + Initialize(); + + // + // Verify that we do in fact have operators to replicate + // with. + // + if( RemoteOperators.Count < 1 ) + { +#if never + Debug.OperatorMessage( + SeverityType.Info, + CategoryType.Replication, + OperatorMessageType.NoReplicationOperators, + "There are no operators to replicate with. Please check the replication configuration." ); +#endif + Debug.OperatorMessage( + SeverityType.Info, + CategoryType.Replication, + OperatorMessageType.NoReplicationOperators, + new UDDIText( "UDDI_ERROR_REPLICATION_NO_OPERATORS" ).GetText() ); + + return; + } + + // + // TODO: Get the node id of the last operator we replicated + // with. + // + + // + // TODO: Re-order the operator node list so that we replicate + // in a round-robin fashion. + // + + + // + // Create the start replication session log entry. + // + LogSessionStart(); + + // + // Replicate with each operator node. + // + foreach( OperatorNode remoteNode in RemoteOperators ) + { + ReplicationResult result = null; + + // + // Log the node replication start. + // + LogOperatorStart( remoteNode ); + + // + // Get the branch list for the node. The branch list is + // the remote node itself, plus any alternatives that we + // may try if we have trouble communicating with the first + // node. For now, we don't support alternate nodes, so + // the remote node is the only node we add to this list. + // + OperatorNodeCollection branchNodes = new OperatorNodeCollection(); + + branchNodes.Add( remoteNode ); + + foreach( OperatorNode branchNode in branchNodes ) + { + // + // Get the last replication status for this node. + // + result = ReplicateWithNode( branchNode ); + + if( ReplicationStatus.Success == result.ReplicationStatus ) + break; + + // + // Determine what we should do based on this attempts result + // and the result of the last replication cycle with this + // node. TODO: if it is a communication error, we'll need + // to try alternate edges. This is reserved until alternate + // edges are actually used. + // + } + + // + // Log the node replication end. + // + LogOperatorEnd( remoteNode, result ); + } + + // + // Create the end replication session log entry. + // + LogSessionEnd(); + + Debug.Leave(); + } + + + /// **************************************************************** + /// public ReplicateWithNode [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public static ReplicationResult ReplicateWithNode( string operatorNodeID ) + { + OperatorNode remoteNode = null; + + // + // Initialize the replication session. + // + Initialize(); + + // + // Replicate with the specified node. + // + try + { + remoteNode = new OperatorNode( operatorNodeID ); + remoteNode.Get(); + } + catch( Exception e ) + { +#if never + string message = String.Format( + "Could not get details for operator {{{0}}}.\r\n\r\nDetails:\r\n{1}", + operatorNodeID, + e.ToString() ); + + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.UnknownOperator, + message ); + + throw new Exception( message, e ); +#endif + UDDIText uddiText = new UDDIText( "UDDI_ERROR_REPLICATION_OPERATOR_DETAILS", operatorNodeID, e.ToString() ); + + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.UnknownOperator, + uddiText.GetText() ); + + throw new UDDIException( ErrorType.E_fatalError, uddiText.GetText() ); + } + + // + // Log the node replication start. + // + LogOperatorStart( remoteNode ); + + // + // Replicate + // + ReplicationResult result = ReplicateWithNode( remoteNode ); + + // + // Log the node replication end. + // + LogOperatorEnd( remoteNode, result ); + + return result; + } + + + /// **************************************************************** + /// private ReplicateWithNode [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private static ReplicationResult ReplicateWithNode( OperatorNode remoteNode ) + { + // + // Retrieve the change records from the remote node and process + // them. + // + ChangeRecordCollection changeRecords = null; + + // + // Keep track of the number of times we call GetChangeRecords on each operator. We + // don't want to be in a situation where we call them infinitely if they keep updating + // their data. + // + int maxIterations = Config.GetInt( "Replication.MaxGetChangeIterations", 100 ); + int iterations = 0; + + // + // Keep getting change records until there are no more; we need to do this because some + // operators will limit the number of change records that they send back. + // + do + { + try + { + changeRecords = GetChangeRecords( remoteNode ); + } + catch( Exception e ) + { + return ReplicationResult.LogCommunicationError( remoteNode, e, ChangesAlreadySeen ); + } + + foreach( ChangeRecord changeRecord in changeRecords ) + { + // + // Make sure we haven't seen this change record before. + // + if( ChangesAlreadySeen.IsProcessed( changeRecord.ChangeID ) ) + { + Debug.Write( + SeverityType.Info, + CategoryType.Replication, + String.Format( + "Change already seen.\r\nSkipping record {0}:{1} retrieved from node {2}", + changeRecord.ChangeID.NodeID, + changeRecord.ChangeID.OriginatingUSN, + remoteNode.OperatorNodeID ) ); + + continue; + } + + // + // Make sure we aren't trying to replicate one of our own + // change records. + // + if( 0 == String.Compare( changeRecord.ChangeID.NodeID, LocalOperator.OperatorNodeID, true ) ) + { + Debug.Write( + SeverityType.Info, + CategoryType.Replication, + String.Format( + "Skipping replication of local change record.\r\nSkipping record {0}:{1} retrieved from node {2}", + changeRecord.ChangeID.NodeID, + changeRecord.ChangeID.OriginatingUSN, + remoteNode.OperatorNodeID ) ); + + continue; + } + + // + // Begin a transaction. + // + ConnectionManager.BeginTransaction(); + + try + { + // + // Set user context information and process the + // change record. + // + Context.User.ID = changeRecord.ChangeID.NodeID; + Context.TimeStamp = DateTime.Now; + + // + // Validate the change record, then process it. There is a very good + // reason for doing this validation on a change record by change record + // basis: if there is one error in the incoming change record stream, + // we would reject the entire stream, not just the errant change record. + // + SchemaCollection.Validate( changeRecord ); + + try + { + changeRecord.Process(); + } + catch( Exception innerException ) + { + // + // Exceptions that are related to IN 60 are ignored. + // + if( Context.ExceptionSource == ExceptionSource.PublisherAssertion || + Context.ExceptionSource == ExceptionSource.BrokenServiceProjection ) + { + // + // Log the error + // + ReplicationResult.LogInvalidKeyWarning( remoteNode, changeRecord, innerException ); + } + else + { + // + // Otherwise, throw the exception for real. + // + throw innerException; + } + } + + // + // Commit the transaction. + // + ConnectionManager.Commit(); + + // + // Update our changeAlreadySeen vector for the + // originating node. + // + ChangesAlreadySeen.MarkAsProcessed( changeRecord.ChangeID ); + + // + // Update log counts. + // + LogCounts( changeRecord ); + } + catch( Exception e ) + { + ConnectionManager.Abort(); + + return ReplicationResult.LogValidationError( remoteNode, changeRecord, e, ChangesAlreadySeen ); + } + } + + // + // Refresh our highwater mark vector. We do this instead of calling gethighwatermarks on the + // operator because hitting our DB is faster then making the SOAP call across HTTP. + // + GetHighWaterMarks(); + + iterations++; + + }while( 0 != changeRecords.Count && iterations < maxIterations ); + + // + // Log success! + // + return ReplicationResult.LogSuccess( remoteNode, null ); + } + + /// **************************************************************** + /// private GetChangeRecords [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private static ChangeRecordCollection GetChangeRecords( OperatorNode remoteNode ) + { + GetChangeRecords getChangeRecords = new GetChangeRecords(); + + getChangeRecords.RequestingNode = LocalOperator.OperatorNodeID; + getChangeRecords.ChangesAlreadySeen = ChangesAlreadySeen; + + SoapClient.Url = remoteNode.SoapReplicationURL; + + ChangeRecordDetail detail = SoapClient.GetChangeRecords( getChangeRecords ); + + return detail.ChangeRecords; + } + + + /// **************************************************************** + /// private LogSessionStart [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private static void LogSessionStart() + { + StringWriter log = new StringWriter(); + + try + { + // log.WriteLine( "Replication cycle started." ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_START" ).GetText() ); + + log.WriteLine(); + // log.WriteLine( "REPLICATION NODES:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_NODES" ).GetText() ); + + foreach( OperatorNode operatorNode in RemoteOperators ) + { + log.Write( " " ); + log.WriteLine( operatorNode.Name ); + log.Write( " {" ); + log.Write( operatorNode.OperatorNodeID ); + log.WriteLine( "}" ); + log.Write( " " ); + log.WriteLine( operatorNode.SoapReplicationURL ); + log.WriteLine(); + } + +// log.WriteLine( "CURRENT HIGHWATER MARKS:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_CURRENT_HIGHWATER_MARKS" ).GetText() ); + + foreach( ChangeRecordVector vector in ChangesAlreadySeen ) + { + log.Write( " {" ); + log.Write( vector.NodeID ); + log.Write( "} : " ); + log.WriteLine( vector.OriginatingUSN ); + } + + Debug.OperatorMessage( + SeverityType.Info, + CategoryType.Replication, + OperatorMessageType.StartingReplicationSession, + log.ToString() ); + } + finally + { + log.Close(); + } + } + + + /// **************************************************************** + /// private LogOperatorStart [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private static void LogOperatorStart( OperatorNode remoteNode ) + { + NodeChangeRecordCounts = new Hashtable(); + + foreach( int payloadType in Enum.GetValues( typeof( ChangeRecordPayloadType ) ) ) + { + NodeChangeRecordCounts[ payloadType ] = 0; + } + + StringWriter log = new StringWriter(); + + try + { + // log.WriteLine( "Starting replication with node.\r\n" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_NODE_START" ).GetText() ); + + // log.WriteLine( "REPLICATION NODE:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_NODE" ).GetText() ); + + log.Write( " " ); + log.WriteLine( remoteNode.Name ); + log.Write( " {" ); + log.Write( remoteNode.OperatorNodeID ); + log.WriteLine( "}" ); + log.Write( " " ); + log.WriteLine( remoteNode.SoapReplicationURL ); + log.WriteLine(); + + // log.WriteLine( "CURRENT HIGHWATER MARKS:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_CURRENT_HIGHWATER_MARKS" ).GetText() ); + + foreach( ChangeRecordVector vector in ChangesAlreadySeen ) + { + log.Write( " {" ); + log.Write( vector.NodeID ); + log.Write( "} : " ); + log.WriteLine( vector.OriginatingUSN ); + } + + Debug.OperatorMessage( + SeverityType.Info, + CategoryType.Replication, + OperatorMessageType.StartingReplicationWithNode, + log.ToString() ); + } + finally + { + log.Close(); + } + } + + + /// **************************************************************** + /// private LogOperatorEnd [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private static void LogOperatorEnd( OperatorNode remoteNode, ReplicationResult result ) + { + StringWriter log = new StringWriter(); + + try + { + if( ReplicationStatus.Success == result.ReplicationStatus ) + { + // log.WriteLine( "Replication with node complete." ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_COMPLETE" ).GetText() ); + } + else + { + // log.Write( "Replication with node interrupted\r\n ERROR: " ); + log.Write( new UDDIText( "UDDI_MSG_REPLICATION_INTERRUPTED" ).GetText() ); + + log.WriteLine( result.ReplicationStatus.ToString() ); + } + + log.WriteLine(); + + // log.WriteLine( "REPLICATION NODE:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_NODE" ).GetText() ); + + log.Write( " " ); + log.WriteLine( remoteNode.Name ); + log.Write( " {" ); + log.Write( remoteNode.OperatorNodeID ); + log.WriteLine( "}" ); + log.Write( " " ); + log.WriteLine( remoteNode.SoapReplicationURL ); + log.WriteLine(); + + // log.WriteLine( "CHANGE RECORDS PROCESSED:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_CHANGE_RECORDS_PROCESSED" ).GetText() ); + + foreach( int payloadType in Enum.GetValues( typeof( ChangeRecordPayloadType ) ) ) + { + string name = Enum.GetName( typeof( ChangeRecordPayloadType ), payloadType ) + ":"; + + log.Write( " " ); + log.Write( name.PadRight( 30 ) ); + log.Write( "\t" ); + log.WriteLine( NodeChangeRecordCounts[ payloadType ] ); + } + + log.WriteLine(); + //log.WriteLine( "NEW HIGHWATER MARKS:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_NEW_HIGHWATER_MARKS" ).GetText() ); + + foreach( ChangeRecordVector vector in ChangesAlreadySeen ) + { + log.Write( " {" ); + log.Write( vector.NodeID ); + log.Write( "} : " ); + log.WriteLine( vector.OriginatingUSN ); + } + + SeverityType severity = SeverityType.Info; + + if( ReplicationStatus.Success != result.ReplicationStatus ) + severity = SeverityType.Error; + + string message = log.ToString(); + + // + // Log results + // + Debug.OperatorMessage( + severity, + CategoryType.Replication, + OperatorMessageType.EndingReplicationWithNode, + message ); + + // + // Only send mail on success; if there was a failure, mail will be sent at the point of failure. + // + if( ReplicationStatus.Success == result.ReplicationStatus ) + { + Debug.OperatorMail( + SeverityType.None, + CategoryType.Replication, + OperatorMessageType.EndingReplicationWithNode, + message ); + } + } + finally + { + log.Close(); + } + + // + // Add the operator node counts to the totals. + // + foreach( int payloadType in Enum.GetValues( typeof( ChangeRecordPayloadType ) ) ) + { + SessionChangeRecordCounts[ payloadType ] = (int)SessionChangeRecordCounts[ payloadType ] + (int)NodeChangeRecordCounts[ payloadType ]; + } + } + + /// **************************************************************** + /// private LogSessionEnd [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private static void LogSessionEnd() + { + StringWriter log = new StringWriter(); + + try + { + // log.WriteLine( "Replication cycle complete." ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_END" ).GetText() ); + + log.WriteLine(); + + //log.WriteLine( "CHANGE RECORDS PROCESSED:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_CHANGERECORDS_PROCESSED" ).GetText() ); + + foreach( int payloadType in Enum.GetValues( typeof( ChangeRecordPayloadType ) ) ) + { + string name = Enum.GetName( typeof( ChangeRecordPayloadType ), payloadType ) + ":"; + + log.Write( " " ); + log.Write( name.PadRight( 30 ) ); + log.Write( "\t" ); + log.WriteLine( SessionChangeRecordCounts[ payloadType ] ); + } + + log.WriteLine(); + // log.WriteLine( "NEW HIGHWATER MARKS:" ); + log.WriteLine( new UDDIText( "UDDI_MSG_REPLICATION_NEW_HIGHWATER_MARKS" ).GetText() ); + + foreach( ChangeRecordVector vector in ChangesAlreadySeen ) + { + log.Write( " {" ); + log.Write( vector.NodeID ); + log.Write( "} : " ); + log.WriteLine( vector.OriginatingUSN ); + } + + Debug.OperatorMessage( + SeverityType.Info, + CategoryType.Replication, + OperatorMessageType.EndingReplicationWithNode, + log.ToString() ); + } + finally + { + log.Close(); + } + } + + /// **************************************************************** + /// private LogCounts [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + private static void LogCounts( ChangeRecord changeRecord ) + { + int payloadType = (int)changeRecord.Payload.ChangeRecordPayloadType; + + NodeChangeRecordCounts[ payloadType ] = (int)NodeChangeRecordCounts[ payloadType ] + 1; + } + } + + /// ******************************************************************** + /// class ReplicationResult + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class ReplicationResult + { + public UDDI.Replication.ReplicationStatus ReplicationStatus; + public string OperatorNodeID; + public string Description; + public string LastNodeID; + public long LastUSN; + public long LastChange; + + + /// **************************************************************** + /// public GetLast + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void GetLast( string operatorNodeID, bool inboundStatus ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_operatorLogLast_get"; + + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@inboundStatus", SqlDbType.Bit ); + sp.Parameters.Add( "@replStatusID", SqlDbType.TinyInt, ParameterDirection.Output ); + sp.Parameters.Add( "@description", SqlDbType.NVarChar, UDDI.Constants.Lengths.Description, ParameterDirection.Output ); + sp.Parameters.Add( "@lastOperatorKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output ); + sp.Parameters.Add( "@lastUSN", SqlDbType.BigInt, ParameterDirection.Output ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@operatorKey", operatorNodeID ); + sp.Parameters.SetBool( "@inboundStatus", inboundStatus ); + + sp.ExecuteNonQuery(); + + this.OperatorNodeID = operatorNodeID; + this.ReplicationStatus = (ReplicationStatus)sp.Parameters.GetShort( "@replStatusID" ); + this.Description = sp.Parameters.GetString( "@description" ); + this.LastNodeID = sp.Parameters.GetGuidString( "@lastOperatorKey" ); + this.LastUSN = sp.Parameters.GetLong( "@lastUSN" ); + this.LastChange = sp.Parameters.GetLong( "@lastChange" ); + + Debug.Leave(); + } + + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public void Save() + { + Debug.Enter(); + + try + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_operatorLog_save"; + + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@replStatusID", SqlDbType.TinyInt ); + sp.Parameters.Add( "@description", SqlDbType.NVarChar, UDDI.Constants.Lengths.Description ); + sp.Parameters.Add( "@lastOperatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@lastUSN", SqlDbType.BigInt ); + sp.Parameters.Add( "@lastChange", SqlDbType.BigInt ); + + sp.Parameters.SetGuidFromString( "@operatorKey", OperatorNodeID ); + sp.Parameters.SetShort( "@replStatusID", (short)ReplicationStatus ); + sp.Parameters.SetString( "@description", Description ); + sp.Parameters.SetGuidFromString( "@lastOperatorKey", LastNodeID ); + sp.Parameters.SetLong( "@lastUSN", LastUSN ); + sp.Parameters.SetLong( "@lastChange", LastChange ); + + sp.ExecuteNonQuery(); + } + catch + { +#if never + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.ValidationError, + String.Format( + "Could not store last replication result.\r\n\r\n" + + "REPLICATION NODE:\r\n" + + " {{{0}}}\r\n\r\n" + + "CHANGE RECORD:\r\n" + + " {{{1}}} : {2}", + OperatorNodeID, + LastNodeID, + LastUSN ) ); +#endif + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.ValidationError, + new UDDIText( "UDDI_ERROR_REPLICATION_COULD_NOT_STORE_RESULT", OperatorNodeID, LastNodeID, LastUSN ).GetText() ); + } + + Debug.Leave(); + } + + + /// **************************************************************** + /// public LogSuccess [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public static ReplicationResult LogSuccess( OperatorNode remoteNode, string description ) + { + ReplicationResult result = new ReplicationResult(); + + result.ReplicationStatus = ReplicationStatus.Success; + result.Description = description; + result.OperatorNodeID = remoteNode.OperatorNodeID; + result.LastNodeID = null; + result.LastUSN = 0; + result.LastChange = DateTime.UtcNow.Ticks; + + result.Save(); + + return result; + } + + + /// **************************************************************** + /// public LogCommunicationError [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public static ReplicationResult LogCommunicationError( OperatorNode remoteNode, Exception e, ChangeRecordVectorCollection changesAlreadySeen ) + { + ReplicationResult result = new ReplicationResult(); + + result.ReplicationStatus = ReplicationStatus.CommunicationError; + result.Description = e.ToString(); + result.OperatorNodeID = remoteNode.OperatorNodeID; + result.LastNodeID = null; + result.LastUSN = 0; + result.LastChange = DateTime.UtcNow.Ticks; + + result.Save(); + + string response = e.ToString(); + + if( e is WebException ) + { + WebException we = (WebException)e; + + if( null != we.Response ) + { + StreamReader reader = null; + + try + { + reader = new StreamReader( we.Response.GetResponseStream() ); + + response += "\r\nRESPONSE:\r\n\r\n"; + response += reader.ReadToEnd(); + } + catch + { + } + finally + { + if( null != reader ) + reader.Close(); + } + } + } + else if( e is SoapException ) + { + SoapException se = (SoapException)e; + + if( null != se.Detail ) + { + response += "\r\nSOAP FAULT DETAILS:\r\n\r\n"; + response += se.Detail.OuterXml; + } + } + + // + // Also send the highwater marks. + // + StringWriter highWaterMarks = new StringWriter(); + + foreach( ChangeRecordVector vector in changesAlreadySeen ) + { + highWaterMarks.Write( " {" ); + highWaterMarks.Write( vector.NodeID ); + highWaterMarks.Write( "} : " ); + highWaterMarks.WriteLine( vector.OriginatingUSN ); + } +#if never + // + // Communications Error + // + string message = String.Format( + "Error communicating with operator.\r\n\r\n" + + "REPLICATION NODE:\r\n" + + " {0}\r\n" + + " {{{1}}}\r\n" + + " {2}\r\n\r\n" + + "DETAILS:\r\n\r\n{3}\r\n\r\nCURRENT HIGHWATER MARKS:\r\n\r\n{4}", + remoteNode.Name, + remoteNode.OperatorNodeID, + remoteNode.SoapReplicationURL, + response, + highWaterMarks.ToString() ); +#endif + // + // Communications Error + // + UDDIText message = new UDDIText( "UDDI_ERROR_REPLICATION_OPERATOR_COMMUNICATION_ERROR", + remoteNode.Name, + remoteNode.OperatorNodeID, + remoteNode.SoapReplicationURL, + response, + highWaterMarks.ToString() ); + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.ErrorCommunicatingWithNode, + message.GetText() ); + + Debug.OperatorMail( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.ErrorCommunicatingWithNode, + message.GetText() ); + + return result; + } + + + /// **************************************************************** + /// public LogValidationError [static] + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + public static ReplicationResult LogValidationError( OperatorNode remoteNode, ChangeRecord changeRecord, Exception e, ChangeRecordVectorCollection changesAlreadySeen ) + { + ReplicationResult result = new ReplicationResult(); + + result.ReplicationStatus = ReplicationStatus.ValidationError; + result.Description = e.ToString(); + result.OperatorNodeID = remoteNode.OperatorNodeID; + result.LastNodeID = changeRecord.ChangeID.NodeID; + result.LastUSN = changeRecord.ChangeID.OriginatingUSN; + result.LastChange = DateTime.UtcNow.Ticks; + + result.Save(); + + // + // Also send the highwater marks. + // + StringWriter highWaterMarks = new StringWriter(); + + foreach( ChangeRecordVector vector in changesAlreadySeen ) + { + highWaterMarks.Write( " {" ); + highWaterMarks.Write( vector.NodeID ); + highWaterMarks.Write( "} : " ); + highWaterMarks.WriteLine( vector.OriginatingUSN ); + } +#if never + string message = String.Format( + "Could not process entity from remote operator.\r\n\r\n" + + "REPLICATION NODE:\r\n" + + " {0}\r\n" + + " {{{1}}}\r\n" + + " {2}\r\n\r\n" + + "DETAILS:\r\n\r\n" + + "{3}\r\n\r\n" + + "CHANGE RECORD:\r\n" + + " {{{4}}} : {5}\r\n\r\n" + + "{6}\r\n\r\nCURRENT HIGHWATER MARKS:\r\n\r\n{7}", + remoteNode.Name, + remoteNode.OperatorNodeID, + remoteNode.SoapReplicationURL, + e.ToString(), + changeRecord.ChangeID.NodeID, + changeRecord.ChangeID.OriginatingUSN, + changeRecord.ToString(), + highWaterMarks.ToString() ); +#endif + UDDIText message = new UDDIText( "UDDI_ERROR_REPLICATION_COULD_NOT_PROCESS_ENTITY", + remoteNode.Name, + remoteNode.OperatorNodeID, + remoteNode.SoapReplicationURL, + e.ToString(), + changeRecord.ChangeID.NodeID, + changeRecord.ChangeID.OriginatingUSN, + changeRecord.ToString(), + highWaterMarks.ToString() ); + Debug.OperatorMessage( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.ValidationError, + message.GetText() ); + + Debug.OperatorMail( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.ValidationError, + message.GetText() ); + + return result; + } + + public static void LogInvalidKeyWarning( OperatorNode remoteNode, ChangeRecord changeRecord, Exception e ) + { + ReplicationResult result = new ReplicationResult(); + + result.ReplicationStatus = ReplicationStatus.CommunicationError; + result.Description = e.ToString(); + result.OperatorNodeID = remoteNode.OperatorNodeID; + result.LastNodeID = changeRecord.ChangeID.NodeID; + result.LastUSN = changeRecord.ChangeID.OriginatingUSN; + result.LastChange = DateTime.UtcNow.Ticks; + + result.Save(); +#if never + string message = String.Format( + "Invalid key from remote operator.\r\n\r\n" + + "REPLICATION NODE:\r\n" + + " {0}\r\n" + + " {{{1}}}\r\n" + + " {2}\r\n\r\n" + + "DETAILS:\r\n\r\n" + + "{3}\r\n\r\n" + + "CHANGE RECORD:\r\n" + + " {{{4}}} : {5}\r\n\r\n" + + "{6}", + remoteNode.Name, + remoteNode.OperatorNodeID, + remoteNode.SoapReplicationURL, + e.ToString(), + changeRecord.ChangeID.NodeID, + changeRecord.ChangeID.OriginatingUSN, + changeRecord.ToString() ); +#endif + UDDIText message = new UDDIText( "UDDI_ERROR_REPLICATION_INVALID_KEY", + remoteNode.Name, + remoteNode.OperatorNodeID, + remoteNode.SoapReplicationURL, + e.ToString(), + changeRecord.ChangeID.NodeID, + changeRecord.ChangeID.OriginatingUSN, + changeRecord.ToString() ); + Debug.OperatorMessage( + SeverityType.Warning, + CategoryType.Replication, + OperatorMessageType.InvalidKey, + message.GetText() ); + + // + // TODO for now don't send mail on a warning. + // +#if never + Debug.OperatorMail( + SeverityType.Error, + CategoryType.Replication, + OperatorMessageType.ValidationError, + message ); +#endif + } + } + + + /// ******************************************************************** + /// class ReplicationSoapClient + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + [ WebServiceBinding( Name="ExternalMessagesSoap", Namespace=UDDI.Replication.Constants.Namespace ) ] + internal sealed class ReplicationSoapClient : SoapHttpClientProtocol + { + /// **************************************************************** + /// public GetChangeRecords + /// ---------------------------------------------------------------- + /// + /// + /// **************************************************************** + /// + [ System.Diagnostics.DebuggerStepThrough ] + [ SoapDocumentMethod( "", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare ) ] + [ return: XmlElement( "changeRecords", Namespace=UDDI.Replication.Constants.Namespace, IsNullable=false ) ] + public ChangeRecordDetail GetChangeRecords( GetChangeRecords get_changeRecords ) + { + object[] results = Invoke( "GetChangeRecords", new object[] { get_changeRecords } ); + return (ChangeRecordDetail)results[ 0 ]; + } + + protected override WebRequest GetWebRequest( Uri uri ) + { + WebRequest innerWebRequest = base.GetWebRequest( uri ); + UDDIWebRequest webRequest = new UDDIWebRequest( innerWebRequest ); + + return webRequest; + } + } + + /// + /// UDDIWebResponse allows us to return our own Stream object. + /// + internal class UDDIWebResponse : WebResponse + { + WebResponse innerWebResponse; + UDDIResponseStream uddiResponseStream; + + /// + /// Constructor + /// + /// This object should come from the WebResponse created by HttpSoapClientProtocol. + public UDDIWebResponse( WebResponse innerWebResponse ) + { + this.innerWebResponse = innerWebResponse; + } + + /// + /// Return our response stream (UDDIResponseStream) instead of the Stream associated with our inner response. + /// + /// + public override Stream GetResponseStream() + { + if( null == uddiResponseStream ) + { + uddiResponseStream = new UDDIResponseStream( innerWebResponse.GetResponseStream() ); + } + + return uddiResponseStream; + } + + /// + /// Delegates to the inner web response. + /// + public override void Close() + { + innerWebResponse.Close(); + } + + /// + /// Delegates to the inner web response. + /// + public override long ContentLength + { + get { return innerWebResponse.ContentLength; } + set { innerWebResponse.ContentLength = value; } + } + + /// + /// Delegates to the inner web response. + /// + public override string ContentType + { + get { return innerWebResponse.ContentType; } + set { innerWebResponse.ContentType = value; } + } + + /// + /// Delegates to the inner web response. + /// + public override Uri ResponseUri + { + get { return innerWebResponse.ResponseUri; } + } + + /// + /// Delegates to the inner web response. + /// + public override WebHeaderCollection Headers + { + get { return innerWebResponse.Headers; } + } + } + + /// + /// UDDIResponseStream allows us to manipulate the XML sent back from the web service. + /// + internal class UDDIResponseStream : MemoryStream + { + // + // TODO: at some point it may be necessary to pass in the current version as a parameter if the transforms become + // more complicated. + // + + /// + /// Constructor. We read all the XML sent from the server, do our version manipulation, then write the new XML + /// into our inner responseStream object. + /// + /// This object should be the responseStream from a WebResponse object. + public UDDIResponseStream( Stream responseStream ) + { + try + { + // + // Get the XML the server sent to us. + // + StreamReader reader = new StreamReader( responseStream ); + string responseXml = reader.ReadToEnd(); + reader.Close(); + + // + // Write this transformed XML into ourselves. + // + StreamUtility.WriteStringToStream( this, responseXml ); + + // + // Rewind ourselves + // + this.Position = 0; + + // + // Validate the incoming XML. We have to read the data from the stream first because it is not seekable + // + try + { + SchemaCollection.Validate( this ); + } + catch( XmlSchemaException schemaException ) + { + string message = schemaException.ToString() + "\r\n\r\nResponse XML:\r\n\r\n" + responseXml; + Debug.OperatorMessage( SeverityType.Error, CategoryType.Replication, OperatorMessageType.ValidationError, message ); + + throw schemaException; + } + } + finally + { + // + // Rewind ourselves + // + this.Position = 0; + } + } + } + + /// + /// UDDIWebRequest allows us to return our own request and response objects. + /// + /// + /// UDDIWebRequest allows us to return our own request and response objects. + /// + internal class UDDIWebRequest : WebRequest + { + WebRequest innerWebRequest; + UDDIRequestStream uddiRequestStream; + UDDIWebResponse uddiWebResponse; + + /// + /// Constructor + /// + /// Uri to the web service we are calling + /// UDDI version to use for requests + public UDDIWebRequest( WebRequest innerWebRequest ) + { + this.innerWebRequest = innerWebRequest; + } + + /// + /// Return a UDDIRequestStream object instead of the default one. + /// + /// UDDIRequestStream object + public override Stream GetRequestStream() + { + if( null == uddiRequestStream ) + { + uddiRequestStream = new UDDIRequestStream( innerWebRequest.GetRequestStream() ); + } + + return uddiRequestStream; + } + + /// + /// Return a UDDIWebRequest object instead of the default one. + /// + /// UDDIWebResponse object + public override WebResponse GetResponse() + { + if( null == uddiWebResponse ) + { + uddiWebResponse = new UDDIWebResponse( innerWebRequest.GetResponse() ); + } + return uddiWebResponse; + } + + /// + /// Delegates to our inner WebRequest + /// + public override string Method + { + get { return innerWebRequest.Method; } + set { innerWebRequest.Method = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override Uri RequestUri + { + get { return innerWebRequest.RequestUri; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override string ConnectionGroupName + { + get { return innerWebRequest.ConnectionGroupName; } + set { innerWebRequest.ConnectionGroupName = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override WebHeaderCollection Headers + { + get { return innerWebRequest.Headers; } + set { innerWebRequest.Headers = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override long ContentLength + { + get { return innerWebRequest.ContentLength; } + set { innerWebRequest.ContentLength = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override string ContentType + { + get { return innerWebRequest.ContentType; } + set { innerWebRequest.ContentType = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override ICredentials Credentials + { + get { return innerWebRequest.Credentials; } + set { innerWebRequest.Credentials = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override IWebProxy Proxy + { + get { return innerWebRequest.Proxy; } + set { innerWebRequest.Proxy = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override bool PreAuthenticate + { + get { return innerWebRequest.PreAuthenticate; } + set { innerWebRequest.PreAuthenticate = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override int Timeout + { + get { return innerWebRequest.Timeout; } + set { innerWebRequest.Timeout = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state) + { + return innerWebRequest.BeginGetResponse( callback, state ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override WebResponse EndGetResponse(IAsyncResult asyncResult) + { + return innerWebRequest.EndGetResponse( asyncResult ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, Object state) + { + return innerWebRequest.BeginGetRequestStream( callback, state ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override Stream EndGetRequestStream(IAsyncResult asyncResult) + { + return innerWebRequest.EndGetRequestStream( asyncResult ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override void Abort() + { + innerWebRequest.Abort(); + } + } + + /// + /// UDDIRequestStream allows us to manipulate the XML before we send it to the client. This class will accept all data that + /// is written to it from the ASP.NET web service framework. When the framework closes the stream (ie. wants to send the data), we + /// will manipulate this XML so that it has the right UDDI version, then send it out using our innerStream object. + /// + internal class UDDIRequestStream : MemoryStream + { + Stream innerStream; + + /// + /// Constructor + /// + /// Should be from a WebRequest object. + /// The UDD version we should use to send to the server + public UDDIRequestStream( Stream innerStream ) + { + this.innerStream = innerStream; + } + + /// + /// Before we actually close the request stream, we want to manipulate the XML. + /// + public override void Close() + { + try + { + // + // Rewind ourselves. + // + this.Position = 0; + + // + // Read the XML that was written; this is the XML request that will be sent to the UDDI server. + // + StreamReader reader = new StreamReader( this ); + string requestXml = reader.ReadToEnd(); + + // + // Rewind ourselves. + // + this.Position = 0; + +#if DEBUG + try + { + // + // Validate the XML that we are about to send. + // + SchemaCollection.Validate( this ); + } + catch( XmlSchemaException schemaException ) + { + string message = schemaException.ToString() + "\r\n\r\nRequest XML:\r\n\r\n" + requestXml; + Debug.OperatorMessage( SeverityType.Error, CategoryType.Replication, OperatorMessageType.ValidationError, message ); + + throw schemaException; + } +#endif + // + // Write the transformed data to the 'real' stream. + // + StreamUtility.WriteStringToStream( innerStream, requestXml ); + } + finally + { + // + // Make sure we clean up properly. + // + innerStream.Close(); + base.Close(); + } + } + } + + /// + /// Simple utility class to help us write string data to Stream objects. + /// + internal sealed class StreamUtility + { + public static void WriteStringToStream( Stream stream, string stringToWrite ) + { + StreamWriter writer = new StreamWriter( stream ); + writer.Write( stringToWrite ); + writer.Flush(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/operator/sources b/inetsrv/uddi/source/operator/sources new file mode 100644 index 0000000..90fa368 --- /dev/null +++ b/inetsrv/uddi/source/operator/sources @@ -0,0 +1,24 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=uddi.operator +TARGETPATH=obj +TARGETTYPE=DYNLINK +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES=system.dll, system.data.dll, system.web.dll, system.web.services.dll, system.xml.dll, ..\core\obj\*\uddi.core.dll, ..\api\obj\*\uddi.api.dll + +SOURCES=\ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + graph.cs \ + messages.cs \ + nodes.cs \ + operator.cs \ + replication.cs \ + types.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/operator/types.cs b/inetsrv/uddi/source/operator/types.cs new file mode 100644 index 0000000..747e17d --- /dev/null +++ b/inetsrv/uddi/source/operator/types.cs @@ -0,0 +1,44 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Xml.Serialization; +using UDDI.Diagnostics; + +namespace UDDI.Replication +{ + public class Constants + { + public const string Namespace = "urn:uddi-org:repl"; + } + + public enum OperatorStatus + { + [ XmlEnum( "disabled" ) ] + Disabled = 0, + [ XmlEnum( "new" ) ] + New = 1, + [ XmlEnum( "normal" ) ] + Normal = 2, + [ XmlEnum( "resigned" ) ] + Resigned = 3 + } + + public enum ReplicationStatus + { + // Retrieve replication status + + Success = 0, + CommunicationError = 1, + ValidationError = 2, + + // Inbound replication status + + Notify = 128 + } + + [ Flags ] + public enum ChangeRecordFlags + { + AcknowledgementRequested = 0x01 + } +} diff --git a/inetsrv/uddi/source/operatorweb/assemblyinfo.cs b/inetsrv/uddi/source/operatorweb/assemblyinfo.cs new file mode 100644 index 0000000..9f89a32 --- /dev/null +++ b/inetsrv/uddi/source/operatorweb/assemblyinfo.cs @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/inetsrv/uddi/source/operatorweb/chagerecordsearch.cs b/inetsrv/uddi/source/operatorweb/chagerecordsearch.cs new file mode 100644 index 0000000..6270f13 --- /dev/null +++ b/inetsrv/uddi/source/operatorweb/chagerecordsearch.cs @@ -0,0 +1,440 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Collections; +using System.Xml.Serialization; +using UDDI; +using UDDI.Diagnostics; +using UDDI.Replication; +namespace UDDI.Web +{ + /// + /// Summary description for oepratorsearchcontrols. + /// + [ XmlRoot( "changeRecordCache" ) ] + public class ChangeRecordsSessionCache + { + public ChangeRecordsSessionCache() + { + + } + + private string key;//=Guid.NewGuid().ToString(); + [ XmlAttribute( "key" ) ] + public string Key + { + get{ return key; } + set{ key=value; } + } + + private FindChangeRecordsHelper findCache; + [ XmlElement( "findChangeRecordCache" ) ] + public FindChangeRecordsHelper FindCache + { + get + { + if( null==findCache ) + { + findCache = new FindChangeRecordsHelper(); + } + + return findCache; + } + } + + private GetChangeRecords getCache; + [ XmlElement( "getChangeRecordCache" ) ] + public GetChangeRecords GetCache + { + get{ return getCache; } + set{ getCache = (GetChangeRecords)value; } + } + + private ChangeRecordDetail changes; + [XmlIgnore] + public ChangeRecordDetail Changes + { + get{ return changes; } + } + private ChangeRecordVectorCollection changelist; + [XmlIgnore] + public ChangeRecordVectorCollection ChangeList + { + get{ return changelist; } + } + + + public void GetChanges() + { + if( null!=GetCache ) + { + changes = GetCache.Get(); + } + } + public void FindChanges() + { + + } + public void SaveCache() + { + Debug.Enter(); + + // + // Serialize the data into a stream. + // + XmlSerializer serializer = new XmlSerializer( this.GetType() ); + StringWriter writer = new StringWriter(); + + serializer.Serialize( writer, this ); + + // + // Write the cache object to the database. + // + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "UI_setSessionCache" ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar ); + sp.Parameters.Add( "@cacheValue", SqlDbType.NText ); + sp.Parameters.Add( "@context", SqlDbType.NVarChar ); + + sp.Parameters.SetString( "@PUID",Key ); + sp.Parameters.SetString( "@cacheValue",writer.ToString() ); + sp.Parameters.SetString( "@context","ReplicationServer" ); + + + sp.ExecuteNonQuery(); + + sp.Close(); + writer.Close(); + Debug.Leave(); + } + + public static ChangeRecordsSessionCache RetrieveCache( string key ) + { + ChangeRecordsSessionCache session = RetrieveCacheFromDB( key ); + return session; + } + protected static ChangeRecordsSessionCache RetrieveCacheFromDB( string key ) + { + Debug.Enter(); + + // + // Retrieve the cache object from the database. + // + string data = ""; + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "UI_getSessionCache" ); + + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar ); + sp.Parameters.Add( "@context", SqlDbType.NVarChar ); + + sp.Parameters.SetString( "@PUID" , key ); + sp.Parameters.SetString("@context" , "ReplicationServer" ); + + data = (string)sp.ExecuteScalar(); + + // + // Deserialize into a cache object. + // + ChangeRecordsSessionCache cache = null; + + if( !Utility.StringEmpty( data ) ) + { + XmlSerializer serializer = new XmlSerializer( typeof( ChangeRecordsSessionCache ) ); + StringReader reader = new StringReader( data ); + + cache = (ChangeRecordsSessionCache)serializer.Deserialize( reader ); + cache.Key = key; + } + + Debug.Leave(); + + return cache; + } + } + + [XmlRoot( "findChangeRecordCache" )] + public class FindChangeRecordsHelper + { + public FindChangeRecordsHelper() + { + + } + + [ XmlAttribute( "startUSN" ) ] + protected long StartUSN; + + [ XmlAttribute( "endUSN" ) ] + protected long EndUSN; + + [ XmlAttribute( "maxRows" ) ] + protected long MaxRows; + + [ XmlAttribute( "operatorID" ) ] + protected string OperatorNodeID; + + private FindFilterCollection filters; + [ XmlArray( "filters" ), XmlArrayItem( "filter" ) ] + public FindFilterCollection Filters + { + get{ return filters; } + set{ filters=(FindFilterCollection)value; } + } + + public ChangeRecordCollection GetChangeRecords( ) + { + ChangeRecordCollection crc = new ChangeRecordCollection(); + + + + return crc; + } + } + [ XmlRoot( "filters" ) ] + public class FindFilterCollection : CollectionBase + { + public FindFilter this[ int index ] + { + get{ return (FindFilter)this.List[ index ]; } + set{ this.List[ index] = value; } + } + + public FindFilter Add( string field, FilterOperator oper, string val ) + { + return this.Add( field, + oper, + val, + ( (this.Count > 0) ? FilterConjuctionOperator.And : FilterConjuctionOperator.None ) ); + } + public FindFilter Add( string field, FilterOperator oper, string val, FilterConjuctionOperator conj ) + { + return this.Add( new FindFilter( field,oper, val, conj ) ); + } + public FindFilter Add( FindFilter filter ) + { + this.List.Add( filter ); + return filter; + } + public void Remove( int index ) + { + this.List.RemoveAt( index ); + } + public void Remove( FindFilter filter ) + { + this.List.Remove( filter ); + } + public FindFilter Insert( int index, FindFilter filter ) + { + this.List.Insert( index, filter ); + return filter; + } + + public string GetFullFilterString() + { + string fullstring = ""; + foreach( FindFilter filter in this ) + { + fullstring += filter.GetFilterString(); + } + return fullstring; + } + + } + + [ XmlRoot( "filter" ) ] + public class FindFilter + { + public FindFilter( string field, FilterOperator oper, string val, FilterConjuctionOperator conj ) + { + this.fieldname = field; + this.filteroperator = oper; + this.filtervalue = val; + this.conjuction = conj; + } + + [ XmlAttribute( "conjuction" ) ] + protected FilterConjuctionOperator conjuction; + public FilterConjuctionOperator Conjuction + { + get{ return conjuction; } + } + + [ XmlAttribute( "fieldName" ) ] + protected string fieldname; + public string FieldName + { + get{ return fieldname; } + + } + + [ XmlAttribute( "operator" ) ] + protected FilterOperator filteroperator; + public FilterOperator Operator + { + get{ return filteroperator; } + + } + + [ XmlText ] + protected string filtervalue; + public string FilterValue + { + get{ return filtervalue; } + + } + + + protected bool Validate() + { + return ( IsValidFieldName() && + IsValidOperator() && + IsValidValue() ); + } + + bool IsValidOperator() + { + return true; + } + bool IsValidValue() + { + return true; + } + bool IsValidFieldName() + { + return true; + } + + // + // TODO: Maybe make this a readonly property instead + // and genarte the this string in the ctor. + // + public string GetFilterString() + { + string filter = ""; + + if( Validate() ) + { + // + //if it is a valid filter, then fill the string. + // + + //set the fielname + filter = this.FieldName + " "; + + //set the operator + filter+=GetFilterOperatorString(); + + + //set the value + filter += GetFilterValueString(); + + + //set the conjuction operator + filter += GetFilterConjuctionString(); + } + + return filter; + } + protected string GetFilterConjuctionString() + { + string conj = ""; + + switch( this.Conjuction ) + { + case FilterConjuctionOperator.And: + conj = " AND "; + break; + + case FilterConjuctionOperator.AndNot: + conj = " AND NOT "; + break; + + case FilterConjuctionOperator.Or: + conj = " OR "; + break; + + case FilterConjuctionOperator.OrNot: + conj = " OR NOT "; + break; + } + + return conj; + } + protected string GetFilterValueString() + { + string val = "'"; + if( FilterOperator.Contains==this.Operator ) + { + val += "*" + this.FilterValue + "*"; + } + else + { + val += this.FilterValue ; + } + val += "'"; + + return val; + } + protected string GetFilterOperatorString() + { + switch( this.Operator ) + { + case FilterOperator.EqualTo: + return " = "; + + case FilterOperator.NotEqualTo: + return " <> "; + + case FilterOperator.LessThan: + return " < "; + + case FilterOperator.GreaterThan: + return " > "; + + case FilterOperator.Contains: + + return " LIKE "; + + default: + return ""; + } + } + } + + public enum FilterOperator + { + [ XmlEnum( "equalTo" ) ] + EqualTo, + + [ XmlEnum( "notEqualTo" ) ] + NotEqualTo, + + [ XmlEnum( "greaterThan" ) ] + GreaterThan, + + [ XmlEnum( "lessThan" ) ] + LessThan, + + [ XmlEnum( "contains" ) ] + Contains + } + public enum FilterConjuctionOperator + { + [ XmlEnum( "" ) ] + None, + + [ XmlEnum( "and" ) ] + And, + + [ XmlEnum( "andNot" ) ] + AndNot, + + [ XmlEnum( "or" ) ] + Or, + + [ XmlEnum( "orNot" ) ] + OrNot + + } +} diff --git a/inetsrv/uddi/source/operatorweb/operator.cs b/inetsrv/uddi/source/operatorweb/operator.cs new file mode 100644 index 0000000..3ea1e54 --- /dev/null +++ b/inetsrv/uddi/source/operatorweb/operator.cs @@ -0,0 +1,55 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using UDDI; +using UDDI.Replication; +namespace UDDI.Web +{ + /// + /// Summary description for operatorcontrols. + /// + public class OperatorHelper + { + public static OperatorNodeCollection GetOperators( ) + { + return GetOperators( false, -1 ); + } + public static OperatorNodeCollection GetOperators( OperatorStatus status ) + { + return GetOperators( true, (int)status ); + } + protected static OperatorNodeCollection GetOperators( bool filter, int status ) + { + OperatorNodeCollection operators = new OperatorNodeCollection(); + + + SqlStoredProcedureAccessor sp = null; + SqlDataReaderAccessor data=null; + try + { + sp = new SqlStoredProcedureAccessor( "UI_operatorsList_get" ); + if( filter && -1!=status ) + { + sp.Parameters.Add( "@StatusID",SqlDbType.TinyInt ); + sp.Parameters.SetInt( "@StatusID", status ); + } + data = sp.ExecuteReader(); + while( data.Read() ) + { + operators.Add( data.GetString( "OperatorKey" ), (OperatorStatus)data.GetInt( "OperatorStatusID" ), data.GetString( "Name" ), data.GetString( "soapReplicationUrl" ) ); + } + } + finally + { + if( null!=data ) + data.Close(); + + if( null!=sp ) + sp.Close(); + } + + return operators; + } + + } +} diff --git a/inetsrv/uddi/source/operatorweb/operatorweb.csproj b/inetsrv/uddi/source/operatorweb/operatorweb.csproj new file mode 100644 index 0000000..d25b204 --- /dev/null +++ b/inetsrv/uddi/source/operatorweb/operatorweb.csproj @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/operatorweb/xmlviewer.cs b/inetsrv/uddi/source/operatorweb/xmlviewer.cs new file mode 100644 index 0000000..128d243 --- /dev/null +++ b/inetsrv/uddi/source/operatorweb/xmlviewer.cs @@ -0,0 +1,17 @@ +using System; + +namespace UDDI.Web +{ + /// + /// Summary description for xmlviewer. + /// + public class xmlviewer + { + public xmlviewer() + { + // + // TODO: Add constructor logic here + // + } + } +} diff --git a/inetsrv/uddi/source/replicate/app.ico b/inetsrv/uddi/source/replicate/app.ico new file mode 100644 index 0000000..3a5525f Binary files /dev/null and b/inetsrv/uddi/source/replicate/app.ico differ diff --git a/inetsrv/uddi/source/replicate/assemblyinfo.cs b/inetsrv/uddi/source/replicate/assemblyinfo.cs new file mode 100644 index 0000000..7d4d678 --- /dev/null +++ b/inetsrv/uddi/source/replicate/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("replicate.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/replicate/assemblyversioninfo.cs b/inetsrv/uddi/source/replicate/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/replicate/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/replicate/build.log b/inetsrv/uddi/source/replicate/build.log new file mode 100644 index 0000000..c9cd686 --- /dev/null +++ b/inetsrv/uddi/source/replicate/build.log @@ -0,0 +1,25 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\replicate directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\replicate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\replicate +Elapsed time [0:00:00.016] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module replicate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\replicate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module replicate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\replicate.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs replicate.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\replicate\obj\i386\replicate.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:00.688] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/replicate/makefile b/inetsrv/uddi/source/replicate/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/replicate/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/replicate/makefile.inc b/inetsrv/uddi/source/replicate/makefile.inc new file mode 100644 index 0000000..47a253a --- /dev/null +++ b/inetsrv/uddi/source/replicate/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/replicate/obj/_objects.mac b/inetsrv/uddi/source/replicate/obj/_objects.mac new file mode 100644 index 0000000..0b9a797 --- /dev/null +++ b/inetsrv/uddi/source/replicate/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\replicate.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\replicate.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\replicate.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\replicate.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/replicate/obj/i386/replicate.exe b/inetsrv/uddi/source/replicate/obj/i386/replicate.exe new file mode 100644 index 0000000..e348de5 Binary files /dev/null and b/inetsrv/uddi/source/replicate/obj/i386/replicate.exe differ diff --git a/inetsrv/uddi/source/replicate/obj/i386/replicate.pdb b/inetsrv/uddi/source/replicate/obj/i386/replicate.pdb new file mode 100644 index 0000000..a647e45 Binary files /dev/null and b/inetsrv/uddi/source/replicate/obj/i386/replicate.pdb differ diff --git a/inetsrv/uddi/source/replicate/placefil.txt b/inetsrv/uddi/source/replicate/placefil.txt new file mode 100644 index 0000000..52c984f --- /dev/null +++ b/inetsrv/uddi/source/replicate/placefil.txt @@ -0,0 +1 @@ +replicate.exe uddi\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/replicate/replicate.cs b/inetsrv/uddi/source/replicate/replicate.cs new file mode 100644 index 0000000..437cd60 --- /dev/null +++ b/inetsrv/uddi/source/replicate/replicate.cs @@ -0,0 +1,310 @@ +using System; +using System.Security.Principal; +using System.Threading; +using System.Diagnostics; +using System.Runtime.InteropServices; + +using UDDI; +using UDDI.Replication; + +namespace UDDI.Tools +{ + [ StructLayout( LayoutKind.Sequential ) ] + internal class SECURITY_ATTRIBUTES + { + public int nLength; + public object lpSecurityDescriptor; + public bool bInheritHandle; + + public SECURITY_ATTRIBUTES() + { + nLength = Marshal.SizeOf( typeof( SECURITY_ATTRIBUTES ) ); + lpSecurityDescriptor = null; + bInheritHandle = false; + } + } + + internal enum SystemErrorCodes + { + ERROR_SUCCESS = 0, + ERROR_ALREADY_EXISTS = 183 + } + + // + // TODO add more values as we need them + // + internal enum FileHandleValues + { + INVALID_HANDLE_VALUE = -1 + } + + // + // TODO add more values as we need them + // + internal enum SharedFileProtection : byte + { + PAGE_READONLY = 0x02 + } + + internal class SharedMemory + { + int hSharedMemory; + const int INVALID_HANDLE_VALUE = -1; + + public bool Create( string name ) + { + hSharedMemory = -1; + bool success = false; + + try + { + SECURITY_ATTRIBUTES securityAttributes = new SECURITY_ATTRIBUTES(); + + hSharedMemory = CreateFileMapping( ( int )FileHandleValues.INVALID_HANDLE_VALUE, + securityAttributes, + ( int )SharedFileProtection.PAGE_READONLY, + 0, + 1, + name ); + + if( ( int )SystemErrorCodes.ERROR_SUCCESS == GetLastError() ) + { + success = true; + } + } + catch + { + if( -1 != hSharedMemory ) + { + CloseHandle( hSharedMemory ); + } + } + + return success; + } + + public void Release() + { + if( -1 != hSharedMemory ) + { + CloseHandle( hSharedMemory ); + } + } + + [DllImport( "user32.dll", CharSet=CharSet.Auto )] + private static extern int MessageBox(int hWnd, String text, String caption, uint type); + + [DllImport( "kernel32.dll", SetLastError=true )] + private static extern int CreateFileMapping( int hFile, + SECURITY_ATTRIBUTES lpAttributes, + int flProtect, + int dwMaximumSizeHigh, + int dwMaximumSizeLow, + string lpName ); + + [DllImport( "kernel32.dll" )] + private static extern bool CloseHandle( int hObject ); + + [DllImport( "kernel32.dll" )] + private static extern int GetLastError(); + } + + public class ReplicationUtility + { + public static string OperatorKey = null; + + /// **************************************************************** + /// public Main [static] + /// ---------------------------------------------------------------- + /// + /// Program entry point. + /// + /// ---------------------------------------------------------------- + /// + /// Command-line arguments. + /// + /// **************************************************************** + /// + public static void Main( string[] args ) + { + // + // Use shared memory to make sure that only 1 instance of this process is running. sharedMemory.Release() MUST + // be called when this process exits in order to free up the shared memory. + // + SharedMemory sharedMemory = new SharedMemory(); + + try + { + Console.WriteLine( "Microsoft (R) UDDI Replication Utility" ); + Console.WriteLine( "Copyright (C) Microsoft Corp. 2002. All rights reserved." ); + Console.WriteLine(); + + if( false == sharedMemory.Create( "UDDI_replication_process" ) ) + { + Console.WriteLine( "Only 1 instance of this process can be running." ); + System.Environment.Exit( 1 ); + } + + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal( identity ); + + Context.User.SetRole( principal ); + + if( !Context.User.IsAdministrator ) + { + Console.WriteLine( "Access denied.\r\n\r\nThis program must be executed by a member of the '" + + Config.GetString( "GroupName.Administrators" ) + "'\r\ngroup. The current user '" + + identity.Name + "' is not a member of this group." ); + + return; + } + + ProcessCommandLine( args ); + + ConnectionManager.Open( true, false ); + + try + { + if( null == OperatorKey ) + ReplicationHelper.Replicate(); + else + ReplicationHelper.ReplicateWithNode( OperatorKey ); + } + finally + { + ConnectionManager.Close(); + } + } + catch( CommandLineException e ) + { + if( null != e.Message && e.Message.Length > 0 ) + Console.WriteLine( e.Message ); + else + DisplayUsage(); + } + catch( Exception e ) + { + Console.WriteLine( e.ToString() ); + } + finally + { + sharedMemory.Release(); + } + } + + + /// **************************************************************** + /// internal ProcessCommandLine [static] + /// ---------------------------------------------------------------- + /// + /// Parse the command-line. + /// + /// ---------------------------------------------------------------- + /// + /// Command-line arguments. + /// + /// **************************************************************** + internal static void ProcessCommandLine( string[] args ) + { + int i = 0; + + while( i < args.Length ) + { + if( '-' == args[ i ][ 0 ] || '/' == args[ i ][ 0 ] ) + { + // + // Process the switch. + // + switch( args[ i ].Substring( 1 ).ToLower() ) + { + case "o": + if( i + 1 >= args.Length ) + throw new CommandLineException( "Missing required parameter 'operatorkey'" ); + + i ++; + + try + { + OperatorKey = new Guid( args[ i ] ).ToString(); + } + catch + { + throw new CommandLineException( "Invalid operator key specified." ); + } + + break; + + case "?": + goto case "help"; + + case "help": + throw new CommandLineException( "" ); + + default: + throw new CommandLineException( "Unknown switch '" + args[i] + "'." ); + } + } + + i ++; + } + } + + public static void DisplayUsage() + { + Console.WriteLine( "Syntax:" ); + Console.WriteLine( " replicate.exe " ); + Console.WriteLine(); + Console.WriteLine( "Switches:" ); + Console.WriteLine( " -o Replicates against the specified" ); + Console.WriteLine( " operator only." ); + Console.WriteLine( " -? Displays this help message." ); + Console.WriteLine(); + Console.WriteLine( "Examples:" ); + Console.WriteLine( " replicate.exe" ); + Console.WriteLine( " replicate.exe -o F6D80408-A206-4b85-B2F4-699EFA13A669" ); + Console.WriteLine(); + } + } + + /// **************************************************************** + /// public class CommandLineException + /// ---------------------------------------------------------------- + /// + /// Exception class for errors encountered while parsing the + /// command-line. + /// + /// **************************************************************** + /// + public class CommandLineException : ApplicationException + { + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ************************************************************ + /// + public CommandLineException() + : base() + { + } + + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ------------------------------------------------------------ + /// + /// Exception message. + /// + /// ************************************************************ + /// + public CommandLineException( string message ) + : base( message ) + { + } + } +} diff --git a/inetsrv/uddi/source/replicate/replicate.csproj b/inetsrv/uddi/source/replicate/replicate.csproj new file mode 100644 index 0000000..e618520 --- /dev/null +++ b/inetsrv/uddi/source/replicate/replicate.csproj @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/replicate/replicate.snk b/inetsrv/uddi/source/replicate/replicate.snk new file mode 100644 index 0000000..3b21f76 Binary files /dev/null and b/inetsrv/uddi/source/replicate/replicate.snk differ diff --git a/inetsrv/uddi/source/replicate/sources b/inetsrv/uddi/source/replicate/sources new file mode 100644 index 0000000..2d984d1 --- /dev/null +++ b/inetsrv/uddi/source/replicate/sources @@ -0,0 +1,19 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=replicate +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + +REFERENCES=system.dll, system.data.dll, system.xml.dll, ..\core\obj\*\uddi.core.dll, ..\operator\obj\*\uddi.operator.dll + +SOURCES=\ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + replicate.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/resources/makefile b/inetsrv/uddi/source/resources/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/resources/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/resources/makefile.inc b/inetsrv/uddi/source/resources/makefile.inc new file mode 100644 index 0000000..fd48e62 --- /dev/null +++ b/inetsrv/uddi/source/resources/makefile.inc @@ -0,0 +1,9 @@ + +# +# tell the system how to compile the .resx file +# $(O) resolves to the obj\i386 folder +# + +uddi.resources: uddi.txt + + diff --git a/inetsrv/uddi/source/resources/obj/_objects.mac b/inetsrv/uddi/source/resources/obj/_objects.mac new file mode 100644 index 0000000..8c49520 --- /dev/null +++ b/inetsrv/uddi/source/resources/obj/_objects.mac @@ -0,0 +1,16 @@ +386_OBJECTS= + +PASS0_386_OBJECTS= + +IA64_OBJECTS= + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/resources/placefil.txt b/inetsrv/uddi/source/resources/placefil.txt new file mode 100644 index 0000000..0fabaf5 --- /dev/null +++ b/inetsrv/uddi/source/resources/placefil.txt @@ -0,0 +1,2 @@ + uddi\resources + diff --git a/inetsrv/uddi/source/resources/sources b/inetsrv/uddi/source/resources/sources new file mode 100644 index 0000000..cbad0d1 --- /dev/null +++ b/inetsrv/uddi/source/resources/sources @@ -0,0 +1,13 @@ +TARGETNAME= +TARGETTYPE=NOTARGET +TARGETPATH= +SOURCES= + +# +# tell the system to build the resources file +# +NTTARGETFILE1=uddi.resources + +MISCFILES = + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/resources/uddi.ar.resources b/inetsrv/uddi/source/resources/uddi.ar.resources new file mode 100644 index 0000000..e28aa3c Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.ar.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.cs.resources b/inetsrv/uddi/source/resources/uddi.cs.resources new file mode 100644 index 0000000..f4e8caa Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.cs.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.el.resources b/inetsrv/uddi/source/resources/uddi.el.resources new file mode 100644 index 0000000..7aa4d4d Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.el.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.he.resources b/inetsrv/uddi/source/resources/uddi.he.resources new file mode 100644 index 0000000..8fc7adf Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.he.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.ja.resources b/inetsrv/uddi/source/resources/uddi.ja.resources new file mode 100644 index 0000000..23ee0ee Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.ja.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.ko.resources b/inetsrv/uddi/source/resources/uddi.ko.resources new file mode 100644 index 0000000..118a9f5 Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.ko.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.ru.resources b/inetsrv/uddi/source/resources/uddi.ru.resources new file mode 100644 index 0000000..55a95fb Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.ru.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.txt b/inetsrv/uddi/source/resources/uddi.txt new file mode 100644 index 0000000..89e8e1a --- /dev/null +++ b/inetsrv/uddi/source/resources/uddi.txt @@ -0,0 +1,983 @@ + +############################################################################ +## UDDI Services +## Copyright (c) 2000-2002 Microsoft Corporation +## +## Localization notes: +## +## 1. Replacement strings are of the form {number}, where each number +## represents a specific replacement text. An example of a +## replacement string is User: {0}. Here, {0} would be replaced +## by the user name to provide a string of the form: +## +## User: DOMAIN\User +## +##==Notes are provided whenever replacement strings are used. + +## +############################################################################ + +############################################################################ +## Titles +############################################################################ + +TITLE=UDDI Services +TITLE_ALT=Microsoft UDDI Business Registry (UBR) node +COPYRIGHT=Copyright&copy; 2000-2002 Microsoft Corporation + + +############################################################################ +## Help +############################################################################ + +HELP_BLOCK_HOME=UDDI Services is a Microsoft .NET-based tool that enables Universal Discovery, Description, and Integration (UDDI) for XML Web services. With UDDI Services, you can publish, locate, and invoke services within your enterprise or between business partners. +HELP_BLOCK_GET_STARTED=Before you publish a service, we strongly recommend reading the Step-by-Step guide listed below. For an overview of basic concepts and terminology, or for help with searching, view the Quick Help options above. Visit Additional Resources on the Web for more information about planning, deployment, troubleshooting, or UDDI specifications. +HELP_BLOCK_MY_UDDI=My UDDI enables you to publish and modify your Web service information. To publish a service, you must first publish a provider. You will typically publish a tModel to describe an interface, and then use that tModel in one or more service descriptions when you publish them under the appropriate provider. +HELP_BLOCK_ADMIN=Coordinators can view and manage UDDI Services data. Use the Coordinate options to show or hide categorization schemes on the Browse by Category tab, delete categorizations schemes, review publisher activities, and recalculate statistics. +HELP_BLOCK_ADMIN_DETAILS=As a Coordinator you can manage categorization schemes and view statistical reports for entity counts, publisher activities, and categorizations. + +HELP_BLOCK_SEARCH=UDDI Services Search enables you to locate Web service information. You can search for services, service providers, or tModels by name or by browsing categorizations. +HELP_BLOCK_SEARCH_ALT=Search enables you to locate Web service information. You can search for services, service providers, or tModels by name or by browsing categorizations. + +HELP_BLOCK_SEARCH_BROWSE=Browse categorization schemes, select a category, and then search for services, providers, or tModels defined by that category. +HELP_BLOCK_SEARCH_SERVICE=Type one or more initial characters in the name of the service you want to find. If you do not know the exact name, use % as a wildcard character. You can further refine your search by specifying categorizations or tModels. +HELP_BLOCK_SEARCH_PROVIDER=Type one or more initial characters in the name of the provider you want to find. If you do not know the exact name, use % as a wildcard character. You can further refine your search by specifying categories, identifiers, or tModels. +HELP_BLOCK_SEARCH_TMODEL=Type one or more initial characters in the name of the tModel you want to find. If you do not know the exact name, use % as a wildcard character. You can further refine your search by specifying categories or identifiers. +HELP_BLOCK_PROVIDER=A provider is a party, such as a person, group, or business, that offers and supports a Web service. View services and additional information published for this provider using the tabs below. This information can only be modified by the owner (publisher) listed. +HELP_BLOCK_PROVIDER_DETAILS=Details present the name, owner, and a brief description of this provider. The provider key is unique and is intended for use in programmatic queries. +HELP_BLOCK_PROVIDER_IDENTIFIERS=An identifier is a reference to a company-wide identification scheme that logically groups providers (or tModels) using a common form of identification, such as a cost code or D-U-N-S® Number. Identifiers are optional descriptions intended to enhance the discovery of providers and tModels in Search. +HELP_BLOCK_PROVIDER_CATEGORIES=A categorization scheme is a predefined set of categories, derived from an internal or external hierarchy, that can be used to classify a provider. +HELP_BLOCK_PROVIDER_OVERVIEWDOCS=A discovery URL points to an HTTP-accessible resource that provides additional technical or descriptive information about a provider. For example, a discovery URL might point to an XML representation of the data published for this provider. +HELP_BLOCK_RELATIONSHIPS=A relationship defines a hierarchy between two providers, inside or outside of your enterprise, such as a parent-child relationship or a business-to-business partnership. +HELP_BLOCK_CONTACT=A contact is a human or automated resource that provides support for a provider and its services. Use types define the type of support a contact is intended to provide. +HELP_BLOCK_CONTACTS_DETAILS=View the type of support offered and one or more ways to contact a resource by clicking a contact name. +HELP_BLOCK_CONTACT_DETAILS=Details present the name and a brief description of this resource. The use type specifies the type of support this contact is intended to provide. +HELP_BLOCK_CONTACT_EMAILS=View one or more e-mail addresses and appropriate support requests for this resource. +HELP_BLOCK_CONTACT_PHONES=View one or more phone numbers and appropriate support requests for this resource. +HELP_BLOCK_CONTACT_ADDRESSES=View mailing or physical addresses for this resource. +HELP_BLOCK_BINDING=A binding represents an access point and one or more instances of the service that can be accessed at that point. An Instance Info typically points to an interface description or specification. +HELP_BLOCK_BINDING_DETAILS=Details present the access point, protocol supported, and a brief description of the binding. The binding key is unique and is intended for use in programmatic queries. +HELP_BLOCK_BINDINGS_DETAILS=View one or more access points for this service by clicking a binding name. You can then view interfaces and instance information published for that binding. +HELP_BLOCK_INSTANCEINFO=An Instance Info typically references an interface tModel. It can also provide instance parameters and a reference to technical information, such as a specification document or WSDL file, for an interface. +HELP_BLOCK_BINDING_INSTANCE_INFOS=An Instance Info typically references an interface tModel and can include technical information such as instance parameters and interface specifications. View one or more instances of this service by clicking an Instance Info name. +HELP_BLOCK_INSTANCEINFO_DETAILS=Details present the interface tModel name, which links to a description of that tModel. The UUID is unique and is intended for use in programmatic queries. +HELP_BLOCK_INSTANCEINFO_INSTANCE_DETAILS=Instance details present the instance parameters, or a link to a file containing those parameters, and a brief description. +HELP_BLOCK_INSTANCEINFO_OVERVIEWDOCS=An overview document is an HTTP-accessible resource, such as a WSDL file or interface specification, that typically contains technical information for implementing or interacting with an interface. +HELP_BLOCK_SERVICE=An XML Web service uses standard Web protocols to share data with one or more applications, regardless of how each service is implemented in its native environment. View details, categorizations, and access points (bindings) for a service using the tabs below. +HELP_BLOCK_SERVICE_DETAILS=Details provide the service name and a brief description. The service key is unique and is intended for use in programmatic queries. +HELP_BLOCK_SERVICES_DETAILS=View service details, categorizations, and access points by clicking a service name. +HELP_BLOCK_SERVICE_CATEGORIES=A categorization scheme is a predefined set of categories, derived from an internal or external hierarchy, that can be used to classify a service. View the categorization schemes used to define this service. +HELP_BLOCK_TMODEL=A tModel typically represents a description of an interface and can be referenced as part of the binding and instance information for a service. +HELP_BLOCK_TMODEL_DETAILS=Details present the name, owner, and a brief description of this tModel. The tModel key is unique and is intended for use in programmatic queries. +HELP_BLOCK_TMODEL_IDENTIFIERS=An identifier is a reference to a company-wide identification scheme that logically groups tModels (or providers) using a common form of identification, such as a cost code or D-U-N-S Number. Identifiers are optional descriptions intended to enhance the discovery of providers and tModels in Search. +HELP_BLOCK_TMODEL_CATEGORIES=A categorization scheme is a predefined set of categories, derived from an internal or external hierarchy, that can be used to classify a tModel. +HELP_BLOCK_TMODEL_OVERVIEWDOCS=An overview document is an HTTP-accessible resource, such as a WSDL file or interface specification, that typically contains technical information for implementing or interacting with an interface. + +HELP_BLOCK_PUBLISH_ALT=My UDDI displays only the entities - Web services, providers, and tModels - you publish. Any information you enter is immediately available in Search. +HELP_BLOCK_PUBLISH=My UDDI displays only the entities - Web services, providers, and tModels - you publish. Any information you enter is immediately available in UDDI Services Search. +HELP_BLOCK_PUBLISH_MAKEDEFAULT=(Display this name and language in search results.) +HELP_BLOCK_PUBLISH_PROVIDERS=A provider is a party, such as a person, group, or business, that offers and supports a Web service. To publish a service, you must first publish a service provider. Add or view providers using the options below. +HELP_BLOCK_PUBLISH_PROVIDER=Make providers easy to locate by adding details, identifiers, and categorizations. Publish support contacts, links to additional information, or relationships with other providers by adding contacts, discovery URLs, and relationships. +HELP_BLOCK_PUBLISH_PROVIDER_DETAILS=Name and briefly describe this provider in one or more languages. The provider key is unique and is generated for use in programmatic queries only. +HELP_BLOCK_PUBLISH_PROVIDER_IDENTIFIERS=An identifier is a reference to a company-wide identification scheme that logically groups providers (or tModels) using a common form of identification, such as a cost code or D-U-N-S Number. Identifiers are optional descriptions intended to enhance the discovery of providers and tModels in Search. +HELP_BLOCK_IDENTIFIER_BAG=Select a tModel that represents an appropriate identification scheme and then type a identifier name and value. If you are not familiar with an existing system for name-value pairs, contact a UDDI Services Coordinator. If you create key names and values, make sure your entries are consistent and easy-to-recognize. +HELP_BLOCK_PUBLISH_PROVIDER_CATEGORIES=A categorization scheme is a predefined set of categories, derived from an internal or external hierarchy, that can be used to classify a provider. Add one or more categories by selecting from available schemes. If an appropriate categorization is not available, contact a UDDI Services Coordinator. +HELP_BLOCK_PUBLISH_PROVIDER_OVERVIEWDOCS=A discovery URL points to additional technical or descriptive information about a provider. If you add or edit a discovery URL, make sure it points to an HTTP-accessible resource. You can define use types specific to your enterprise. +HELP_BLOCK_PUBLISH_PROVIDER_RELATIONSHIPS=A relationship defines a hierarchy between two providers, inside or outside of your enterprise, such as a parent-child relationship or a business-to-business partnership. Add one or more relationships for this provider. +HELP_BLOCK_PUBLISH_PROVIDER_SERVICES=An XML Web service uses standard Web protocols to share data with one or more applications, regardless of how each service is implemented in its native environment. If you add a service, make sure you categorize it and provide one or more access points (bindings). You can then provide instance information for each binding. +HELP_BLOCK_PUBLISH_PROVIDER_CONTACTS=A contact is a human or automated resource that provides support for a provider and its services. Publish one or more contacts for each provider. Make sure users can determine the type of support each resource offers and one or more ways to request that support. +HELP_BLOCK_PUBLISH_CONTACT= A support resource can be contacted by phone, e-mail, mailing address, or at a physical address. Use types enable users to identify the type of support a contact offers and one or more appropriate ways to request support. +HELP_BLOCK_PUBLISH_CONTACT_DETAILS=Type a name and a brief description in one or more languages. Although use types and descriptions are optional, it is important that you note the type of support this contact provides, for example: "For sales contacts", "Technical questions", or "Opening new accounts". +HELP_BLOCK_PUBLISH_CONTACT_EMAILS=Add the e-mail addresses available for this contact. If you publish more than one e-mail address, you may want to define their use types, for example: "For sales contacts", "Technical questions", or "Opening new accounts". +HELP_BLOCK_PUBLISH_CONTACT_PHONES=Add the phone numbers available for this contact. If you publish more than one phone number, you may want to define their use types, for example: "Technical support", "Customer Service", or "Mobile/cellular phone". +HELP_BLOCK_PUBLISH_CONTACT_ADDRESSES=Add the addresses available for this contact. If you publish more than on address, you may want to define their use types, for example: "Sales Office", "General mailing address", or "Shipping and Handling". +HELP_BLOCK_PUBLISH_SERVICE=Name, describe, and categorize each Web service, making it easy to locate. Publish one or more access points for a service by adding a binding, and then add instance information for each interface implemented at that access point. + + +HELP_BLOCK_PUBLISH_SERVICE_DETAILS=Name and briefly describe this service in one or more languages. The service key is unique and is intended for use in programmatic queries only. +HELP_BLOCK_PUBLISH_SERVICE_CATEGORIES=A categorization scheme is a predefined set of categories, derived from an internal or external hierarchy, that can be used to classify a service. Add one or more categories by selecting from available schemes. If an appropriate categorization is not available, contact a UDDI Services Coordinator. +HELP_BLOCK_PUBLISH_SERVICE_BINDINGS=A binding represents an access point and one or more instances of the service that can be accessed at that point. Add, edit, or delete bindings for this service. +HELP_BLOCK_PUBLISH_BINDING=A binding represents an access point and one or more instances of the service that can be accessed at that point. You can publish technical descriptions of an instance, such as an interface specification, by adding an Instance Info. +HELP_BLOCK_PUBLISH_BINDING_DETAILS=Type and briefly describe an access point for this service. Specify the protocol (URL type) this binding supports. To publish technical information for an interface, such as parameters or a WSDL file, add an Instance Info. +HELP_BLOCK_PUBLISH_BINDING_INSTANCES=An Instance Info typically contains technical information, such as instance parameters or links to programmatic descriptions, about an interface. Add, edit, or delete Instance Infos for this binding. +HELP_BLOCK_PUBLISH_INSTANCEINFO=An Instance Info typically references an interface tModel. It can also provide instance parameters and a reference to technical information, such as a specification document or WSDL file, for an interface. +HELP_BLOCK_PUBLISH_INSTANCEINFO_ADD=An Instance Info is a reference to a tModel that typically represents an interface. Instance information can also contain parameters and may provide links to one or more overview documents. Overview documents usually provide technical information about implementing or interacting with that interface. +HELP_BLOCK_PUBLISH_INSTANCEINFO_ADD_DETAILS=Type one or more initial characters in the name of the tModel you want to find. If you do not know the exact name, use % as a wildcard character. If an appropriate tModel does not exist, you can publish a new tModel to represent, for example, a description of an interface you want to publish for this service. +HELP_BLOCK_PUBLISH_INSTANCEINFO_DETAILS=To view more information about an interface tModel, click the name. Add a brief description in one or more languages. The interface tModel key is unique and is intended for use in programmatic queries only. +HELP_BLOCK_PUBLISH_INSTANCEINFO_PARAMETERS=Instance parameters can be entered in any format that can be read by users or computers. You can also provide a URL to an HTTP-accessible file containing the appropriate parameters. Add a brief description in one or more languages. +HELP_BLOCK_PUBLISH_INSTANCEINFO_OVERVIEWDOCS=An overview document is an HTTP-accessible resource, such as WSDL file or specification document, that usually contains technical information for implementing or interacting with an interface. Add or edit the overview document URL for this instance. + + +HELP_BLOCK_PUBLISH_TMODELS=A tModel typically represents a description of an interface and can be referenced as part of the binding and instance information for a service. Add or view tModels using the options below. +HELP_BLOCK_PUBLISH_TMODEL=A tModel usually represents a description of an interface. Make tModels easy to locate and reference by adding details, categories, and identifiers. Publish technical information, such as an interface specification or WSDL file, by pointing to one or more overview documents. +HELP_BLOCK_PUBLISH_TMODEL_DETAILS=Name and briefly describe the interface (or other data) that this tModel represents. The tModel key is unique and is intended for use in programmatic queries only. +HELP_BLOCK_PUBLISH_TMODEL_IDENTIFIERS=An identifier is a reference to a company-wide identification scheme that logically groups tModels (or providers) using a common form of identification, such as a cost code or D-U-N-S Number. Identifiers are optional descriptions intended to enhance the discovery of tModels and providers in Search. +HELP_BLOCK_PUBLISH_TMODEL_CATEGORIES=A categorization scheme is a predefined set of categories, derived from an internal or external hierarchy, that can be used to classify a tModel. Add one or more categories by selecting from available schemes. If an appropriate categorization is not available, contact a UDDI Services Coordinator. +HELP_BLOCK_PUBLISH_TMODEL_OVERVIEWDOCS=An overview document is an HTTP-accessible resource, such as WSDL file or specification document, that usually contains technical information for implementing or interacting with an interface. Add or edit the overview document URL for this tModel. + + +HELP_BLOCK_ADMIN_TAXONOMY_DETAILS=UDDI Services hosts the following categorization schemes: +HELP_BLOCK_ADMIN_TAXONOMY_IMPORT=To import a categorization scheme or other data, click Browse, select the appropriate file, and then click Import. You can also import files using the command-line bootstrap utility. For more information, see the UDDI Services MMC Snap-in Help. +HELP_BLOCK_ADMIN_STATISTICS_ENTITIES=UDDI Services hosts the following entity types and counts: +HELP_BLOCK_ADMIN_STATISTICS_PUBLISHERS=The following report lists publisher activities: +HELP_BLOCK_ADMIN_STATISTICS_CATEGORIES=UDDI Services hosts references, by volume, to the following categorizations: + + +HELP_BLOCK_ADMIN_CHANGEOWNER=In UDDI Services, data published for a Web service, provider, or tModel can be modified only by the current owner. After you transfer ownership, previous owners can no longer modify the information. +HELP_BLOCK_ADMIN_CHANGEOWNER_DETAILS=To transfer ownership of this entity to another publisher, click Change Owner, locate and select the publisher name, and then update your changes. +HELP_BLOCK_ADMIN_IMPERSONATE=As a Coordinator, you can view and manage data owned by other publishers. However, you can only view data for one publisher at a time. When you are finished, select another publisher or return to your own data. +HELP_BLOCK_ADMIN_IMPERSONATE_DETAILS=Type one or more initial characters in the name of the publisher you want to find. If you do not know the exact name, use % as a wildcard character. In the search results, select an appropriate publisher name, and then confirm or cancel your changes. + +############################################################################ +## Menu items +############################################################################ + +MENUITEM_ADMIN=Administer +MENUITEM_ADMIN_TAXONOMY=Edit categorization scheme... +MENUITEM_COORDINATE=Coordinate +MENUITEM_EDIT=Publish +MENUITEM_HELP=Help +MENUITEM_HOME=Home +MENUITEM_SEARCH=Search +MENUITEM_SEARCH_BUSINESS=Search for a provider... +MENUITEM_SEARCH_CONTACT=Search for a contact... +MENUITEM_SEARCH_SERVICE=Search for a service... +MENUITEM_SEARCH_BINDING=Search for a binding... +MENUITEM_SEARCH_TMODEL=Search for a tModel... + + +############################################################################ +## User roles +## +## This text is used to display information about the current user's +## security privileges. +## +## Replacement strings: +## {0} = User name in the form "DOMAIN\Username" +## {0} = User role +############################################################################ + +ROLE_ADMINISTRATOR=Administrator +ROLE_COORDINATOR=Coordinator +ROLE_PUBLISHER=Publisher +ROLE_USER=User +ROLE_ANONYMOUS=None + +TAG_USER=User: {0} +TAG_IMPERSONATING_USER=Viewing data owned by: {0} +TAG_IMPERSONATE_USER=Publisher: +TAG_ROLE=Role: {0} + +############################################################################ +## Tabs +## +## This text is used on property sheet tabs. +############################################################################ + +TAB_ADDRESSES=Address +TAB_BINDINGS=Bindings +TAB_BUSINESSES=Providers +TAB_CATEGORIES=Categories +TAB_CHANGE_OWNER=Change Owner +TAB_CONTACTS=Contacts +TAB_DETAILS=Details +TAB_DISCOVERYURLS=Discovery URLs +TAB_EMAILS=E-mail +TAB_EXPLORER=Explorer +TAB_FIND_SERVICE=Services +TAB_FIND_BUSINESS=Providers +TAB_FIND_TMODEL=tModels +TAB_FIND_RESULTS=Results +TAB_FIND_BROWSE=Browse by Category +TAB_IDENTIFIERS=Identifiers +TAB_IMPERSONATE=View data owned by... +TAB_IMPORT=Import +TAB_INSTANCE_DETAILS=Instance Details +TAB_MY_UDDI=My UDDI +TAB_OVERVIEWDOC=Overview Document +TAB_PUBLISHER_ASSERTIONS=Relationships +TAB_PHONES=Phone +TAB_REQUESTS=Requests +TAB_SERVICES=Services +TAB_STATISTICS_ENTITYCOUNTS=Entity Counts +TAB_STATISTICS_PUBLISHERSTATS=Publisher Statistics +TAB_STATISTICS_TAXSTATS=Categorization Statistics +TAB_TMODELS=tModels +TAB_INSTANCES=Instance Info +TAB_INSTANCE_INFOS=Instance Infos + + +############################################################################ +## Headings +############################################################################ + +HEADING_ACCESS_POINT=Access Point +HEADING_ACTIONS=Actions +HEADING_ADDITIONAL_RESOURCES=Additional UDDI Resources on the Web +HEADING_ADDRESS=Address +HEADING_ADDRESSES=Addresses +HEADING_ADMINISTER=Coordinate +HEADING_BINDING=Binding +HEADING_BINDINGS=Bindings +HEADING_BINDING_NAME=Binding Name +HEADING_BINDING_TEMPLATE=Binding Template +HEADING_BUSINESS=Provider +HEADING_BUSINESSES=Providers +HEADING_BUSINESS_NAME=Provider Names +HEADING_CATEGORIES=Categorizations +HEADING_CATEGORIZATION=Categorization Schemes +HEADING_CHANGE_OWNER=Change Owner +HEADING_CHECKED=Checked +HEADING_CONTACT=Contact +HEADING_CONTACTS=Contacts +HEADING_COORDINATE=Coordinate +HEADING_DESCRIPTION=Descriptions +HEADING_DESCRIPTIONS=Descriptions +HEADING_DETAILS=Details +HEADING_DISCOVERYURL=Discovery URL +HEADING_EDIT=Publish +HEADING_EMAIL=E-mail +HEADING_EMAILS=E-mail +HEADING_ERRORS=Errors +HEADING_ERROR_PROCESSING_REQUEST=Error Processing Request +HEADING_GET_STARTED=Getting Started +HEADING_HOME=Home +HEADING_IDENTIFIER=Identifier +HEADING_IDENTIFIERS=Identifiers +HEADING_IMPERSONATE=View data owned by... +HEADING_ADD_INSTANCEINFO=Add Instance Info +HEADING_INSTANCE_INFO=Instance Infos +HEADING_INSTANCE_INFOS=Instance Infos +HEADING_INSTANCE_PARMS=Instance Parameters +HEADING_KEY_NAME=Key Name +HEADING_KEY_VALUE=Key Value +HEADING_KEYED_REFERENCE=Keyed Reference +HEADING_KEYED_REFERENCES=Keyed References +HEADING_LANGUAGE=Language +HEADING_LANGUAGES=Languages +HEADING_MY_ENTRIES=My UDDI +HEADING_ENTRIES=UDDI ({0}) +HEADING_NAME=Name +HEADING_NAMES=Names +HEADING_NO=No +HEADING_NONE=(none) +HEADING_NO_CATEGORIES=No further selections exist. To continue, click an appropriate category in the list above, or click Cancel and try again. +HEADING_OTHER_BUSINESS=Other Provider +HEADING_OVERVIEW_URL=Overview Document URL +HEADING_PUBLISHER=Publisher +HEADING_PUBLISHER_ASSERTION_COMPLETE=Complete +HEADING_PUBLISHER_ASSERTION_PENDING=Pending +HEADING_PUBLISHER_ASSERTION_REQUESTED=Requested +HEADING_PUBLISHER_ASSERTIONS=Relationships +HEADING_REQUESTED_PUBLISHER_ASSERTIONS=Requested Relationships +HEADING_PHONE=Phone Number +HEADING_PHONES=Phone Numbers +HEADING_SERVICE=Service +HEADING_SERVICES=Services +HEADING_SEARCH=Search +HEADING_SERVICE_NAME=Service Name +HEADING_SERVICE_NAMES=Service Names +HEADING_STATUS=Status +HEADING_SEARCH_BROWSEACTIONTITLE=Action +HEADING_SEARCH_BROWSECATEGORYTITLE=Categorization +HEADING_SEARCH_CRITERIA=Search Criteria +HEADING_SEARCH_RESULTS=Search Results +HEADING_SEARCH_FOR_TMODEL=Search for a tModel +HEADING_STATISTICS=Statistics +HEADING_STATISTICS_STATISTIC=Statistic +HEADING_STATISTICS_VALUE=Values +HEADING_STATISTICS_SECTION=Section +HEADING_STATISTICS_SECTION_ENTITYCOUNTS=Entity Counts +HEADING_STATISTICS_SECTION_PUBSTATS=Publisher Statistics +HEADING_STATISTICS_TIMESTAMP=Last recalculated on: +HEADING_STATISTICS_TAXANDVAL=Top 10 Categorization Schemes +HEADING_STATISTICS_ENTITYTYPE=Entity Type +HEADING_STATISTICS_COUNT=Count +HEADING_STATISTICS_LABEL_TMODELCOUNT=tModels +HEADING_STATISTICS_LABEL_BUSINESSCOUNT=Providers +HEADING_STATISTICS_LABEL_SERVICECOUNT=Services +HEADING_STATISTICS_LABEL_BINDINGCOUNT=Bindings +HEADING_STATISTICS_LABEL_PUBCOUNT=Publishers +HEADING_STATISTICS_LABEL_PUBWITHPUB=Total number of publishers with active publications +HEADING_STATISTICS_LABEL_RECALCINPROGRESS=Recalculating data.... To view updated statistics, click Refresh. +HEADING_STATISTICS_LABEL_REFRESH=Refresh +HEADING_STATISTICS_LABEL_TAXREFS=Total references to this scheme +HEADING_STATISTICS_LABEL_TAXVALREFS=Total references to this category +HEADING_STATISTICS_PUBNAME=Publisher +HEADING_STEP_BY_STEP_GUIDE=Step-by-Step Guide +HEADING_TASK=Task +HEADING_TASKS=Tasks +HEADING_TAXONOMY=Data Import +HEADING_TAXONOMY_NAME=Categorization Scheme +HEADING_TAXONOMY_ISBROWSABLE=Browsable +HEADING_TMODEL=tModel +HEADING_TMODELS=tModels +HEADING_TMODEL_NAME=tModel Name +HEADING_UNKNOWN=(Unknown) +HEADING_USE_TYPE=Use Type +HEADING_WELCOME=Welcome to Microsoft UDDI Services +HEADING_YES=Yes +HEADING_SERVICEPROJECTIONS=Service Projections + +############################################################################ +## Tags +############################################################################ + +TAG_ACCESS_POINT=Access Point: +TAG_ACTIONS=Actions: +TAG_ADDRESS=Address: +TAG_AVAILABLE_TAXONOMIES=Select a categorization scheme: +TAG_BINDING=Binding: +TAG_BINDING_KEY=Binding Key: +TAG_BINDING_NAME=Binding Name: +TAG_BUSINESS=Provider: +TAG_BUSINESS_KEY=Provider Key: +TAG_BUSINESS_NAME=Provider Name: +TAG_IDENTIFICATION_SCHEME=Identification Scheme: +TAG_CATEGORIZATION_SCHEME=Categorization Scheme: +TAG_CATEGORIES=Categories: +TAG_CURRENT_OWNER=Current Owner: +TAG_CONTACT=Contact: +TAG_CONTACT_NAME=Contact Name: +TAG_DESCRIPTION=Description: +TAG_DIRECTION=Relationship direction: +TAG_DISCOVERY_URL=Discovery URL: +TAG_EDITING_BUSINESS=Editing Provider: +TAG_EDITING_CONTACT=Editing Contact: +TAG_EDITING_SERVICE=Editing Service: +TAG_EDITING_BINDING=Editing Binding: +TAG_EDITING_TMODEL=Editing tModel: +TAG_EMAIL=E-mail: +TAG_ERROR=Error: {0} +TAG_FIND_SERVICE_BY_NAME=By Service Name: +TAG_FIND_SERVICE_BY_CATEGORY=By Classification: +TAG_FIND_SERVICE_BY_TMODEL=By tModel: +TAG_FIND_BUSINESS_BY_NAME=By Provider Name: +TAG_FIND_BUSINESS_BY_CATEGORY=By Classification: +TAG_FIND_BUSINESS_BY_DISCOVERYURL=By Discovery URL: +TAG_FIND_BUSINESS_BY_IDENTIFIER=By Identifier: +TAG_FIND_BUSINESS_BY_TMODEL=By tModel: +TAG_FIND_TMODEL_BY_NAME=By tModel Name: +TAG_INSTANCE_INFO=Instance Info: +TAG_INSTANCE_PARAMETERS=Instance Parameters: +TAG_INTERFACE_TMODEL=Interface tModel: +TAG_KEY_NAME=Key Name: +TAG_KEY_VALUE=Key Value: +TAG_LANGUAGE=Language: +TAG_LIST_TMODELS=Type one or more initial characters in the name of the tModel you want to find. If you do not know the exact name, use % as a wildcard character. In the search results, select an appropriate tModel name, and then confirm or cancel your changes.
+TAG_NAME=Name: +TAG_NEW_OWNER=New Owner: +TAG_NOTE=Note: +TAG_OVERVIEWDOC_URL=Overview Document URL: +TAG_OWNER=Owner: +TAG_OTHER_BUSINESS=Publish a relationship to: +TAG_PHONE=Phone: +TAG_SHOW_PUBLISHERS=Search for publisher names containing: +TAG_SHOW_TMODELS=Search for tModel names containing: +TAG_SHOW_BUSINESSES=Search for provider names containing: +TAG_RELATIONSHIP=Relationship type: +TAG_SELECT_TMODEL=Select a tModel: +TAG_SERVICE=Service: +TAG_SERVICE_NAME=Service Name: +TAG_SELECTED_CATEGORY=Categorization scheme: +TAG_SERVICE_KEY=Service Key: +TAG_STACK_TRACE=Stack Trace: +TAG_STATS_BUSYWAIT=Recalculating Statistics, Please Wait +TAG_SUBCATEGORIES=Select a category or subcategory: +TAG_TAXONOMY_FILE=Data File: +TAG_TMODEL=tModel: +TAG_TMODEL_KEY=tModel Key: +TAG_TMODEL_NAME=tModel Name: +TAG_URL_TYPE=URL Type: +TAG_USE_TYPE=Use Type: +TAG_SELECT_BUSINESS_FOR_RELATIONSHIP=Type one or more initial characters in the name of the provider you want to find. If you do not know the exact name, use % as a wildcard character. In the search results, select an appropriate provider name, and then confirm or cancel your changes.
+TAG_QUICK_HELP=Quick Help +TAG_VERSION=Version: {0} +TAG_COPYRIGHT=2002 Microsoft Corporation. +TAG_ALLRIGHTSRESERVED=All rights reserved. +TAG_TERMSOFUSE=Terms of use. + +############################################################################ +## Taxonomy types +############################################################################ + +TAXONOMY_TYPE_CHECKED=Checked +TAXONOMY_TYPE_UNCHECKED=Unchecked +TAXONOMY_MISC=(Miscellaneous) + + +############################################################################ +## Text +############################################################################ + +TEXT_ADMIN_STATISTICS=Click to view current statistics for UDDI Services, including the number and type of entities published. +TEXT_ADMIN_TAXONOMY=Click to import data or categorization schemes. +TEXT_ADMIN_CATEGORIZATION=Click to view categorization schemes hosted in this installation of UDDI Services. +TEXT_DESCRIPTION=TEXT_DESCRIPTION=Description +TEXT_LOADING=Loading... +TEXT_NO_SEARCH=To begin searching, browse for an appropriate categorization or search for services, providers, or tModels by name. +TEXT_PUBLISHER_ASSERTION_REQUESTS=View and accept requests to publish a relationship with this provider using the options below. +TEXT_RECORD_COUNT={0} record(s) found. +TEXT_QUERY_COUNT={0} item(s) match your search criteria. +TEXT_NO_REQUESTS=No requests to publish a relationship to this provider were found. +TEXT_NO_RESULTS=*No results matched your criteria. Select alternate criteria and try your search again. +TEXT_STATISTICS_ENTITYCOUNTS=TEXT_STATISTICS_ENTITYCOUNTS=The current UDDI Services publications count is: +TEXT_STATISTICS_PUBSTATS=TEXT_STATISTICS_PUBSTATS=The following report lists publisher activities: +TEXT_STATISTICS_TAXSTATS=TEXT_STATISTICS_TAXSTATS=UDDI Services currently references the following categorization schemes: +TEXT_STATISTICS_TOPPUBS=The following report lists entity volumes by publisher and type: +TEXT_STATISTICS_NOREPORT=There are no reports available for this section. Please try again later. +TEXT_TAXONOMY_HOSTED=UDDI Services currently hosts the following categorization schemes: +TEXT_TAXONOMY_UNHOSTED_TMODELS=TEXT_TAXONOMY_UNHOSTED_TMODELS=The following tModels have been classified as categorization schemes although UDDI Services does not host a corresponding category value for each scheme: +TEXT_TAXONOMY_IMPORT=Text TBD +TEXT_TAXONOMY_IMPORT_CAUTION=(Files cannot exceed 6 MB) +TEXT_TAXONOMY_BROWSABLE_CONFIM=Are you sure you want to change browsability for '{0}' +TEXT_STATS_BUSYWAIT=UDDI Services statistics are now being generated. On large systems, this may take several minutes. You can continue to wait, or return to this page later to view the results. + +### +# {0} = Total Completed tasks (Integer) +# {1} = Total tasks (Integer) +### +TEXT_STATS_BUSYWAIT_STATUS={0} of {1} Complete. +TEXT_DELETE_CONFIRMATION=Are you sure you want to permanently delete '{0}'? +TEXT_EMPTY_QUERY=No records match your search criteria. Select alternate criteria and try your search again. +TEXT_MULTIPLE_REQUIRES_USETYPE=If you want to publish more than one e-mail address, address, or phone number for this contact, you must provide a use type for each entry. +TEXT_SELECT_NEW_OWNER=Type one or more initial characters in the name of the publisher you want to find. If you do not know the exact name, use % as a wildcard character. In the search results, select an appropriate publisher name, and then confirm or cancel your changes. +TEXT_CONFIRM_IMPERSONATION=Are you sure you want to view or modify the entities owned by this publisher? To continue, click Apply, or cancel and select a different publisher. +TEXT_VERIFY_CHANGES=Are you sure you want to transfer ownership to this publisher? To continue, click Update, or cancel and select a different publisher. +TEXT_OWNER_CHANGED=You have successfully transferred ownership of this entity to the publisher you selected. +TEXT_STEP_BY_STEP_GUIDE=View a step-by-step guide to publishing a Web service in UDDI Services. +TEXT_ADDITIONAL_RESOURCES=View additional resources for planning, deploying, publishing, and troubleshooting with UDDI Services. +TEXT_BLOCK_PUBLISHER_DESCRIPTION=(*Maximum 255 characters; text only) +TEXT_MY_UDDI_IMPERSONATE=As a Coordinator, you can view and modify data owned by other publishers. Select an appropriate option below. +TEXT_IMPORT_SUCCESS_MESSAGE=Your data was successfully imported into UDDI Services. +TEXT_IMPORT_ANOTHER_TAXONOMY=Import another file. +TEXT_IMPORT_VIEW_CATEGORIZATION=View and manage categorization schemes. + +############################################################################ +## Tooltips +############################################################################ + +TOOLTIP_CANNOT_DELETE_LAST_ITEM=You cannot delete the only entry in this list. Edit the entry, or add another item before you try to delete this one. +TOOLTIP_MYUDDI=Click to view or modify your published data +TOOLTIP_PUBLISH_PROVIDERS=Right-click to add a provider +TOOLTIP_PUBLISH_PROVIDER=Right-click to add a service or support contact +TOOLTIP_PUBLISH_CONTACT=Click to view contact and support information +TOOLTIP_PUBLISH_SERVICE=Right-click to add an access point for a service (binding) +TOOLTIP_PUBLISH_BINDING=Right-click to add instance information +TOOLTIP_PUBLISH_INSTANCE_INFO=Right-click to delete this Instance Info +TOOLTIP_PUBLISH_TMODELS=Right-click to add a tModel +TOOLTIP_PUBLISH_TMODEL=Right-click to delete this tModel +TOOLTIP_SEARCH_PROVIDER=Click to view descriptions and additional information for this provider +TOOLTIP_SEARCH_CONTACT=Click to view contact and support information +TOOLTIP_SEARCH_SERVICE=Click to view descriptions, categorizations, and access points for this service +TOOLTIP_SEARCH_SERVICEPROJECTION=Click to view descriptions, categorizations, and access points for this projected service +TOOLTIP_SEARCH_BINDING=Click to view an access point and corresponding interfaces for this service +TOOLTIP_SEARCH_INSTANCE_INFO=Click to view interface specifications, parameters, and additional technical information for this instance +TOOLTIP_SEARCH_TMODEL=Click to view descriptions and additional information for this tModel +TOOLTIP_COORDINATE=Click to view reports and statistics or import data +TOOLTIP_COORDINATE_CATSCHEMES=Click to view or delete categorization schemes +TOOLTIP_COORDINATE_STATISTICS=Click to view or recalculate entity, publisher, and category statistics +TOOLTIP_COORDINATE_DATA_IMPORT=Click to import categorization schemes +TOOLTIP_PROJECTIONBROKEN=Can not view this data because the projected service has been deleted. + + +############################################################################ +## Buttons +############################################################################ + +BUTTON_ACCEPT=Accept +BUTTON_DELETE_INSTANCE_INFO=Delete Instance Info +BUTTON_FIND=Find +BUTTON_FIND_PROVIDERS=Find Providers +BUTTON_FIND_SERVICES=Find Services +BUTTON_FIND_TMODELS=Find tModels +BUTTON_SEARCH=Search +BUTTON_UP=Up +BUTTON_EDIT=Edit +BUTTON_APPLY=Apply +BUTTON_OK=OK +BUTTON_CANCEL=Cancel +BUTTON_CONTINUE=Continue +BUTTON_YES=Yes +BUTTON_NO=No +BUTTON_NEXT=Next +BUTTON_PREV=Previous +BUTTON_FINISH=Finish +BUTTON_DELETE=Delete +BUTTON_RETURN=Return +BUTTON_UPDATE=Update +BUTTON_HELP=Help +BUTTON_IMPORT=Import +BUTTON_REFRESH=Refresh +BUTTON_RECALCULATE=Recalculate +BUTTON_SELECT=Select +BUTTON_SELECT_ELIPSE=&Select... +BUTTON_SHOW=Show +BUTTON_HIDE=Hide +BUTTON_PUBLISH=Publish +BUTTON_BROWSE=Browse +BUTTON_SUBMIT=Submit +BUTTON_EDIT_BUSINESS=Edit Provider +BUTTON_EDIT_CONTACT=Edit Contact +BUTTON_EDIT_SERVICE=Edit Service +BUTTON_EDIT_BINDING=Edit Binding +BUTTON_EDIT_INSTANCE_INFO=Edit Instance Info +BUTTON_EDIT_TMODEL=Edit tModel +BUTTON_EDIT_PUBLISHER_ASSERTIONS=Edit Relationships +BUTTON_CHANGE_OWNER=Change Owner +BUTTON_IMPERSONATE_USER=View data owned by... +BUTTON_ADD=Add +BUTTON_ADD_ASSERTION=Add Relationship +BUTTON_ADD_BUSINESS=Add Provider +BUTTON_ADD_CONTACT=Add Contact +BUTTON_ADD_EMAIL=Add E-mail +BUTTON_ADD_PHONE=Add Phone +BUTTON_ADD_ADDRESS=Add Address +BUTTON_ADD_SERVICE=Add Service +BUTTON_ADD_BINDING=Add Binding +BUTTON_ADD_TMODEL=Add tModel +BUTTON_ADD_INSTANCE_INFO=Add Instance Info +BUTTON_ADD_DESCRIPTION=Add Description +BUTTON_ADD_IDENTIFIER=Add Identifier +BUTTON_ADD_CATEGORY=Add Category +BUTTON_ADD_DISCOVERYURL=Add URL +BUTTON_ADD_NAME=Add Name +BUTTON_CANCEL_IMPERSONATE=View my data +BUTTON_DELETE_BUSINESS=Delete Provider +BUTTON_DELETE_CONTACT=Delete Contact +BUTTON_DELETE_SERVICE=Delete Service +BUTTON_DELETE_BINDING=Delete Binding +BUTTON_DELETE_TMODEL=Delete tModel +BUTTON_IMPERSONATE=Apply +BUTTON_IMPORT_TAXONOMY=Import Data +BUTTON_MAKE_DEFAULT=Use this as the name displayed in search results. +BUTTON_NEW_SEARCH=New Search +BUTTON_VIEW=View +BUTTON_CHANGE=Change +BUTTON_TRY_AGAIN=Retry +BUTTON_GO=Go +BUTTON_MY_UDDI_MY_DATA=View my data +BUTTON_MY_UDDI_IMPERSONATE=View data owned by... +BUTTON_VIEW_SERVICE_PROJECTION=View Projected Service +BUTTON_DELETE_SERVICE_PROJECTION=Deleted Projected Service +BUTTON_PROJECTIONBROKEN=(Service Missing) + +############################################################################ +## Default names +############################################################################ + +DEFAULT_BUSINESS_NAME=(New Provider Name) +DEFAULT_CONTACT_NAME=(New Contact Name) +DEFAULT_SERVICE_NAME=(New Service Name) +DEFAULT_TMODEL_NAME=(New tModel Name) + + +############################################################################ +## Quick Help menu +############################################################################ + +QUICKHELP_PUBLISH_TOC=UDDI Services Help +QUICKHELP_PUBLISH_TOC_ALT=UDDI Help +QUICKHELP_PUBLISH_PROVIDER=Publishing a provider +QUICKHELP_PUBLISH_SERVICE=Publishing a service +QUICKHELP_PUBLISH_TMODEL=Publishing a tModel +QUICKHELP_SEARCH=Searching UDDI Services +QUICKHELP_SEARCH_ALT=Searching UDDI + +############################################################################ +## Error descriptions +############################################################################ + +ERROR_ACCOUNT_LIMIT_EXCEEDED=You cannot save this data because your account storage has been exceeded. To request changes to your account limit, contact a system administrator. +ERROR_BUSY=High traffic volume on the server is preventing the system from processing your request. Please wait a few moments and try again. +ERROR_CATEGORIZATION_NOT_ALLOWED=The data or data structure provided does not meet requirements for this categorization scheme. +ERROR_FATAL_ERROR=A technical error occurred while processing your request. +ERROR_INVALID_KEY_PASSED=The key you are attempting to reference no longer exists. +ERROR_INVALID_CATEGORY=The category you specified does not exist in this categorization scheme. Please select a new category and try again. +ERROR_KEY_RETIRED=The entity you are attempting to reference has been deleted from UDDI Services. +ERROR_LANGUAGE_ERROR=An error occurred while processing the description elements for a language. +ERROR_USER_MISMATCH=You do not have permission to modify data for this entity. To request changes, contact the owner (publisher) of the entity or a UDDI Services Coordinator. +ERROR_OPERATOR_MISMATCH=You cannot modify this data from this site. Data can only be modified from the site where it was originally published. +ERROR_NAME_TOO_LONG=The name you entered exceeds the maximum number of characters allowed. Type a new name, using fewer characters, and try again. +ERROR_CONTACT_SYSTEM_ADMINISTRATOR=An unidentified error has occurred. If the problem persists, please contact a system administrator. +ERROR_MMC_REGISTRATION_FAILED="Unable to RegisterPropertyPage" +ERROR_FIELD_REQUIRED=(Required) +ERROR_FINISH_EDIT=Your changes have not been applied. To continue, add or update the information in the highlighted pane below, or click Cancel. +ERROR_SITESTOP=UDDI Services is Currently Stopped. Please check with your System Administrator. +ERROR_HTTPSREQUIRED=Access denied. This page requires a HTTPS secure connection. +ERROR_DATAIMPORT=The file you are attempting to import is not valid. Please check that the file exists, and that it is a valid UDDI resources file. +ERROR_DATAIMPORT_INVALIDKEY=The file you are attempting to import is not valid. Please check that entity keys are unique and not already registered in this UDDI Service site. +ERROR_ADDRESS_TMODELKEY_NOEDIT=This address has been categorized and cannot be modified through the UDDI Services Web interface. +ERROR_NOTMODELS_FOR_IDENTIFIERBAG=UDDI Services does not currently have any TModels classified for use as Identifiers. +ERROR_IMPERSONATE_NOTADMIN=Current User is not a member of the Administrators Role. You must be to impersonate 'system'. +ERROR_MISSINGPARAM=Missing required parameter 'key'. +############################################################################ +## Add Web Reference Dialog pages +############################################################################ + +### +# AWR Errors. +### +AWR_SEARCH_SERVICE_ERROR=Error, please enter a service name to search by. Use % as a wildcard character. +AWR_SEARCH_PROVIDER_ERROR=Error, please enter a provider name to search by. Use % as a wildcard character. +AWR_BROWSE_PROVIDER_ERROR=Error, unable to browse by categorization scheme. +AWR_BROWSE_SERVICE_ERROR=Error, unable to browse by categorization scheme. + +### +# AWR Messages. +### +AWR_NO_WSDLS=No WSDL interfaces have been registered. +AWR_NO_CATEGORIES=No categorization schemes are currently available for browsing. +AWR_TITLE=UDDI Services - Add Web Reference +AWR_INTRO_MSG=This tool searches for services and providers in this UDDI Services site with WSDL described services. Search by name or browse through available categorization schemas. +AWR_SEARCH_AGAIN=Click here to search again. +AWR_ADD_MSG=To add references, click on the service you would like, then click on that service's corresponding interface definition, and then click the 'Add Reference' button below. +AWR_NO_RESULTS=No matching results were found. + +### +# AWR Search Results +# {0} = the number of results +# {1} = the string used in search. +### +AWR_SEARCH_FOUND_RESULTS={0} result(s) were found that begin with '{1}'. +AWR_BROWSE_FOUND_RESULTS={0} result(s) were found. + +### +# AWR Tags. +### +AWR_SERVICE_NAME=Service name: +AWR_PROVIDER_NAME=Provider name: +AWR_ACCESS_POINT=Access Point: +AWR_DESCRIPTION=Description: +AWR_ID=Interface definitions: +AWR_SERVICE_DESCRIPTION=Service Description: +AWR_BINDINGS=Bindings: + +### +# AWR Control Text (Buttons, menus, etc) +### +AWR_BUTTON_SEARCH=Search +AWR_BUTTON_CANCEL=Cancel + +### +# The following 2 strings are used together. +# AWR_HELP_LINKTEXT is first formatted as a Hyperlink +# Then it is inserted into {0} in AWR_HELP +### +AWR_HELP_LINKTEXT=assistance +AWR_HELP=Get {0} if you cannot find services that have been published. + +### +# The following 2 strings are used together. +# AWR_ERROR_CLICKHERE is first formatted as a Hyperlink +# Then it is inserted into {0} in AWR_ERROR +### +AWR_ERROR=An error has occurred, please {0} to restart your search. +AWR_ERROR_CLICKHERE=click here + + +############################################################################ +## Performance Counter Help Text +############################################################################ +## +# {0} = name of SOAP Message type +## +AVERAGE_DURATION_COUNT_HELP=The average number of milliseconds that it took to execute the {0} API. +AVERAGE_DURATION_COUNT_BASE=Base average value for: {0} +CUMULATIVE_ACCESS_COUNT_HELP=The number of executions of the {0} API since the service was started. + + +############################################################################ +## bootstrap.exe +############################################################################ + +BOOTSTRAP_ACCESS_DENIED=Access denied. +BOOTSTRAP_ADMIN_GROUP_ONLY=This program must be executed by a member of the UDDI Services Administrator's Group. +BOOTSTRAP_USAGE_1=Loads XML data into the UDDI Services database +BOOTSTRAP_USAGE_2=BOOTSTRAP /f [drive:][path]filename [/u user] +BOOTSTRAP_USAGE_3= [drive:][path]filename Specifies drive, directory, and file to load. +BOOTSTRAP_USAGE_4= user Specifies user name. +BOOTSTRAP_COPYRIGHT_1=Microsoft (R) UDDI Services Bootstrap Utility +BOOTSTRAP_COPYRIGHT_2=Copyright (C) Microsoft Corp. 2002. All rights reserved. +BOOTSTRAP_PROCESSING_MSG=Publishing data from file '{0}' under '{1}' +BOOTSTRAP_USER_NOT_ADMIN=The current user '{0}' is not a member of this group. +BOOTSTRAP_USER_NOT_REGISTERED=The specified user '{0}' is not a registered publisher in UDDI Services. +BOOTSTRAP_FAILED=Bootstrap failed: {0} +BOOTSTRAP_COMPLETE=Job Complete +BOOTSTRAP_SAVING=Saving: +BOOTSTRAP_TMODELS={0} tModels +BOOTSTRAP_CATEGORIZATION_SCHEMES={0} categorization schemes +BOOTSTRAP_PROVIDERS={0} providers +BOOTSTRAP_SERVICES={0} services +BOOTSTRAP_BINDINGS={0} bindings +BOOTSTRAP_DB_CONNECT_FAILED=Unable to connect to the database + +############################################################################ +## resetkey.exe +############################################################################ + +RESETKEY_COPYRIGHT_1=Microsoft (R) UDDI Services Resetkey Utility +RESETKEY_COPYRIGHT_2=Copyright (C) Microsoft Corp. 2002. All rights reserved. +RESETKEY_USAGE_1=Resets expired cryptography keys used to generate UDDI Authentication tickets +RESETKEY_USAGE_2=RESETKEY [/now] +RESETKEY_USAGE_3= now: forces immediate reset even when keys have not expired +RESETKEY_EXISTING_SETTINGS=Existing configuration settings: +RESETKEY_AUTO_RESET_1=Key auto reset is currently disabled. Set Security.KeyAutoReset to 1 to enable key auto reset. +RESETKEY_AUTO_RESET_2=No new configuration settings will be saved. +RESETKEY_KEY_EXPIRE_NOTE_2=No new configuration settings will be saved. +RESETKEY_FAILED=Resetkey failed: {0} +RESETKEY_SUCCEEDED=Cryptographic key successfully reset. + +### +# {0} = the date the key will expire +### +RESETKEY_KEY_EXPIRE_NOTE_1=The current key will not expire until {0} + +############################################################################ +## recalcstats.exe +############################################################################ + +RECALCSTATS_COPYRIGHT_1=Microsoft (R) UDDI Services Recalcstats Utility +RECALCSTATS_COPYRIGHT_2=Copyright (C) Microsoft Corp. 2002. All rights reserved. +RECALCSTATS_USAGE_1=Regenerates UDDI Services statistics. +RECALCSTATS_USAGE_2=RECALCSTATS +RECALCSTATS_FAILED=Recalcstats failed: {0} +RECALCSTATS_SUCCEEDED=Statistics successfully regenerated. +RECALCSTATS_GETTINGENTITYCOUNTS=Getting entity counts... +RECALCSTATS_GETTINGPUBLISHERSTATS=Getting publisher statistics... +RECALCSTATS_GETTINGTOPPUBLISHERS=Getting top publisher counts... +RECALCSTATS_GETTINGTAXONOMYSTATS=Getting taxonomy statistics... +RECALCSTATS_DONE=done. + +############################################################################ +## dbca.dll +############################################################################ +### +# Removed all strings for DBCA that were used only for logging purposes. +# We don't want to localize our logs. It would make Support of the product +# very difficult on foreign locals. +### +DBCA_UDDI_DESC_SITE=A Microsoft UDDI Services site. + +############################################################################ +## webca.dll +############################################################################ +### +# Removed all strings for WEBCA that were used only for logging purposes. +# We don't want to localize our logs. It would make Support of the product +# very difficult on foreign locals. +### + +WEBCA_UDDI_SERVICE_NAME=UDDI Services +WEBCA_UDDI_DESC_SERVICE=Web Service supporting UDDI specifications +WEBCA_UDDI_DESC_PUBGENERIC=This binding supports the UDDI Programmer's API Specification for publication +WEBCA_UDDI_DESC_PUBVER1=This binding supports the UDDI Version 1.0 Programmer's API Specification for publication +WEBCA_UDDI_DESC_PUBVER2=This binding supports the UDDI Version 2.0 Programmer's API Specification for publication +WEBCA_UDDI_DESC_HTTP=This binding's access point is an HTTP accessible resource +WEBCA_UDDI_DESC_WINAUTH=This binding supports Windows style authentication +WEBCA_UDDI_DESC_HOMEPAGE=This binding's access point is the browser accessible URL for the service's user interface homepage +WEBCA_UDDI_DESC_ANONAUTH=This binding supports anonymous authentication +WEBCA_UDDI_DESC_ADDREF=This binding supports the Visual Sudio .NET Add Web Reference functionality +WEBCA_UDDI_DESC_UDDIAUTH=This binding supports UDDI style authentication +WEBCA_UDDI_DESC_INQUIRYV1=This access point supports the UDDI Version 1.0 Programmer's API Specification for inquiry +WEBCA_UDDI_DESC_INQUIRYV2=This access point supports the UDDI Version 2.0 Programmer's API Specification for inquiry +WEBCA_UDDI_DESC_INQUIRYGENERIC=This binding supports the UDDI Programmer's API Specification for inquiry +WEBCA_UDDI_DESC_MSCOM_EXT=Microsoft extensions to UDDI API +WEBCA_UDDI_DESC_MSCOM_EXTV2=This binding supports Microsoft-specific extensions to Version 2.0 of UDDI API + +############################################################################ +## Active Directory Publication strings also used by the webca.dll +############################################################################ + +WEBCA_ADTAG_UDDI_INQUIRE=Inquire +WEBCA_ADTAG_UDDI_PUBLISH=Publish +WEBCA_ADTAG_UDDI_WEBSITE=Web Site +WEBCA_ADTAG_UDDI_DISCOVERY=Discovery URL +WEBCA_ADTAG_UDDI_ADDWEBREF=Add Web Reference +WEBCA_ADTAG_UDDI_AUTHWIN_DESC={0}, binding supports Windows Authentication Model +WEBCA_ADTAG_UDDI_AUTHUDDI_DESC={0}, binding supports UDDI Authentication Model +WEBCA_ADTAG_UDDI_AUTHANON_DESC={0}, binding supports Anonymous Authentication Model +WEBCA_ADTAG_UDDI_INQUIREDESC=UDDI Inquire API for {0} +WEBCA_ADTAG_UDDI_PUBLISHDESC=UDDI Publish API for {0} +WEBCA_ADTAG_UDDI_WEBSITEDESC=Web Site for {0} +WEBCA_ADTAG_UDDI_DISCOVERYDESC=Discovery URL for {0} +WEBCA_ADTAG_UDDI_ADDWEBREFDESC=Add Web Reference for {0} + +############################################################################ +## API/UI Error Messages +############################################################################ +UDDI_ERROR_UNEXPECTED_PARENT_ENTITY_TYPE=Unexpected parent entity type {0}. +UDDI_ERROR_NAME_TOO_LONG=A name specified in the search exceeded the allowable length. +UDDI_ERROR_NAME_IS_A_REQUIRED_ELEMENT=Name is a required element. +UDDI_ERROR_MORE_THAN_ONE_NAME_UNASSIGNED=More than one name was found to have an unassigned language. +UDDI_ERROR_MORE_THAN_ONE_NAME_FOR_LANGUAGE=More than one name found for language {0}. +UDDI_ERROR_USER_FAILED_AUTHENTICATION=User failed authentication. +UDDI_ERROR_NOT_A_VALID_PUBLISHER=Not a valid publisher. +UDDI_ERROR_PASSPORT_CONFIGURATION_ERROR=CONFIGURATION ERROR: Passport Identity Expected. \r\nYou are currently running in Passport Authentication Mode. \r\nCheck the setting in web.config and try again. +UDDI_ERROR_AUTHENTICATION_CONFIGURATION_ERROR=This UDDI Services site is not configured to accept the requested form of authentication. +UDDI_ERROR_SERVICE_PROJECTIONS_NOT_ENABLED=Service projections are not enabled. +UDDI_ERROR_SERVICE_PROJECTIONS_NOT_ENABLED_FOR_VERSION=Service projection support is only available with the UDDI v2.0 API, and cannot be used with the UDDI v1.0 API. +UDDI_ERROR_INVALID_SERVICEKEY_FOR_PROJECTION=The serviceKey associated with a service projection cannot be referenced in a subsequent serviceDetail that is not itself a service projection. serviceKey = {0} +UDDI_ERROR_MAXROW_CANNOT_BE_LESS_THAN_0=maxRows cannot be less than 0 +UDDI_ERROR_PUBLISHER_LIMIT_FOR_TMODELS_EXCEEDED=Publisher limit for tModel exceeded (limit={0}, count={1}). +UDDI_ERROR_NODE_DOES_NOT_SUPPORT_UPLOAD=This node does not support the upload register facility. +UDDI_ERROR_SCHEMA_MISMATCH=The version of the schema being used by the Web server ({0}) is not compatible with the version of the schema being used by the database server ({1}). +UDDI_ERROR_SERVER_CONFIGURATION_ERROR=Server configuration error.\r\n\r\n{0} +UDDI_ERROR_CONFIG_DB_WRITER_CONNECTION_STRING=Unable to read the Database.WriterConnectionString configuration setting. +UDDI_ERROR_CONFIG_SETTING_MISSING=Configuration setting {0} does not exist. +UDDI_ERROR_FIELD_TOO_SHORT=Value for {0} does not meet the minimum length requirements of {1}. +UDDI_ERROR_FIELD_TOO_LONG=Field {0} exceeds the maximum length. +UDDI_ERROR_INVALID_TMODEL_KEY=Only TModel Keys can start with UUID:. +UDDI_ERROR_INVALID_KEY_FORMAT=Invalid key format. +UDDI_ERROR_INVALID_KEY=Invalid key. +UDDI_ERROR_INVALID_UDDI_SITE=This Web server cannot process UDDI requests because it is not part of a UDDI Services site, or the site is not valid. Verify that the ReaderConnectionString and WriterConnectionString registry keys specify a valid UDDI Services site and try again. +UDDI_ERROR_UKNOWN_ENTITY_TYPE=Unknown entity type {0}. +UDDI_ERROR_SERVICES_NOT_AVAILABLE=UDDI Services is currently unavailable. +UDDI_ERROR_ACCESS_DENIED=Access denied. +UDDI_ERROR_USER_LOGIN_FAILED=User login failed. +UDDI_ERROR_UNABLE_TO_RECALC_STATS=Unable to recalculate statistics:{0} +UDDI_ERROR_MISSING_REQUIRED_KEY_PARAMETER=Missing required parameter key. +UDDI_ERROR_MISSING_REQUIRED_INDEX_PARAMETER=Missing required parameter index. +UDDI_ERROR_NO_PUBLISHER_CREDENTIALS=The user account {0} does not have publisher credentials. +UDDI_ERROR_INVALID_SERVICE_PROJECTION_KEY=You must specify a valid serviceKey when saving a service projection. +UDDI_ERROR_NO_NAME_ON_FIND_QUALIFIER=Cannot specify a find qualifier for names without specifying a name. +UDDI_ERROR_ADMIN_REQUIRED=Administrator credentials required. +UDDI_ERROR_TRANSACTION_BEGIN_CONNECTION_MANAGER=The connection manager was not initialized. +UDDI_ERROR_TRANSACTION_BEGIN_CONNECTION=The database connection was not initialized. +UDDI_ERROR_ALREADY_IN_TRANSACTION=Cannot create a new transaction until the current transaction has completed. +UDDI_ERROR_TRANSACTION_COMMIT_CONNECTION=The database connection was not initialized. +UDDI_ERROR_TRANSACTION_COMMIT_TRANSACTION=The database transaction was not created correctly. +UDDI_ERROR_TRANSACTION_ABORT_CONNECTION=The database connection was not initialized correctly. +UDDI_ERROR_TRANSACTION_ABORT_TRANSACTION=The database connection was not initialized correctly. +UDDI_ERROR_INVALIDKEYPASSED_ADDRESS_BLANKTMODELKEY=The specified tModelKey value does not match any known key value. +UDDI_ERROR_FATALERROR_ADDRESS_MISSINGKEYNAMEKEYVALUE=keyName and keyValue attributes must be specified on each addressLine when tModelKey is specified on the address tag. +UDDI_ERROR_ACCOUNTLIMITEXCEEDED_ASSERTION=Publisher limit for publisherAssertion exceeded (limit={0}, count={1}). +UDDI_ERROR_FATALERROR_FINDRELATEDBE_MAXROWSLESSTHANZERO=MaxRows cannot be less than 0. +UDDI_ERROR_INVALIDCOMPLETIONSTATUS_GETASSERTIONSTATUSREPORT=The specified completion status was not recognized. +UDDI_ERROR_FATALERROR_LOGINFAILED=User login failed. +UDDI_ERROR_UNKNOWNUSER_BADFORMAT=Invalid user ID format. +UDDI_ERROR_UNKNOWNUSER_FAILED=Login failed. +UDDI_ERROR_UNKNOWNUSER_AUTHENTICATIONFAILED=Error authenticating user. +UDDI_ERROR_AUTHTOKENREQUIRED_INVALIDOREXPIRED=Ticket is invalid or has expired. +UDDI_ERROR_AUTHTOKENREQUIRED_INVALIDFORMAT=Invalid authToken format. +UDDI_ERROR_FATALERROR_ERRORRETRIEVINGPROFILEDATA=Could not retrieve user profile data: {0} +UDDI_ERROR_FATALERROR_ERRORAUTHENTICATINGINDOMAIN=Could not authenticate user from domain {0}. +UDDI_ERROR_FATALERROR_ERRORCOMMUNICATINGWITHPASSPORT=Error communicating with Passport. User could not be authenticated. +UDDI_ERROR_FATALERROR_USERIDANDPASSINWINAUTH=Do not specify userid and password when using Windows Integrated authentication. +UDDI_ERROR_AUTHTOKENREQUIRED_NOTOKENPUBLISHATTEMPT=An authToken is required for UDDI publication requests. +UDDI_ERROR_FATALERROR_NULLUSERID=UserId cannot be null. +UDDI_ERROR_FATALERROR_NULLPASSWORD=Password cannot be null. +UDDI_ERROR_FATALERROR_NULLAUTHINFO=AuthInfo cannot be null. +UDDI_ERROR_FATALERROR_BINDING_APVALUEMISSING=A value is required for either accessPoint or hostingRedirector\\@bindingTemplate. +UDDI_ERROR_FATALERROR_BINDING_HRSELFREFERENCE=The hostingRedirector field cannot refer to the containing binding template. +UDDI_ERROR_FATALERROR_FINDBINDING_MAXROWSLESSTHANZERO=MaxRows cannot be less than 0. +UDDI_ERROR_INVALIDKEYPASSED_BINDINGPROJECTION=A bindingTemplate's serviceKey must be the same as its parent service. +UDDI_ERROR_ACCOUNTLIMITEXCEEDED_BUSINESS=Publisher limit for businessEntity exceeded (limit={0}, count={1}). +UDDI_ERROR_FATALERROR_FINDBE_MAXROWSLESSTHANZERO=MaxRows cannot be less than 0. +UDDI_ERROR_UNSUPPORTED_UPLOADREGISTER=This node does not support the upload register facility. +UDDI_ERROR_UNSUPPORTED_FINDBE_NAMEFQNONAMES=Cannot specify a find qualifier for names without specifying a name. +UDDI_ERROR_INVALIDVALUE_VALUENOTFOUND=The category specified was not found. +UDDI_ERROR_FATALERROR_UDDISCHEMANOTFOUND=The API schema was not found. +UDDI_ERROR_FATALERROR_UDDIRESOURCESCHEMANOTFOUND=The UDDI Services data resource schema was not found. +UDDI_ERROR_FATALERROR_PARENTKEYEQUALSVALUE=KeyValue and ParentKeyValue cannot be identical. Use empty strings for root. +UDDI_ERROR_FATALERROR_DESCRPTION_INVALIDPARENTTYPE=Unexpected parent entity type: {0}. +UDDI_ERROR_LANGUAGEERROR_MULTIPLEBLANKLANG=Cannot have more than one description with an unassigned language. +UDDI_ERROR_LANGUAGEERROR_MULTIPLESAMELANG=Cannot have more than one description for language {0}. +UDDI_ERROR_UNKNOWNUSER_UNKOWNCERT=Unknown certificate. +UDDI_ERROR_FATALERROR_PASSPORTBADCONFIG= CONFIGURATION ERROR: Passport Identity Expected. \r\nYou are currently running in Passport Authentication Mode. \r\nCheck the setting in web.config and try again. +UDDI_ERROR_UNSUPPORTED_BADAUTHENTICATIONCONFIG=This UDDI Services site is not configured to support the requested form of authentication. +UDDI_ERROR_UNKNOWNUSER_NOTREGISTERED=User not registered. +UDDI_ERROR_FATALERROR_UNKNOWNEXTSTAGE=The server encountered an invalid SoapExtension stage. +UDDI_ERROR_BUSY_SERVICENOTAVAILABLE=UDDI Services is currently unavailable. +UDDI_ERROR_FATALERROR_SCHEMAVALIDATIONFAILED=The request failed validation. Details:\n{0} +UDDI_ERROR_UNKNOWNVERSION_GENERICNAMESPACEMISMATCH=The XML namespace or generic attribute is invalid. +UDDI_ERROR_FATALERROR_FAILEDDESERIALIZATION=The request failed validation because the server was unable to de-serialize the message. +UDDI_ERROR_FATALERROR_SOAP_MUSTUNDERSTANDATT=The soap:MustUnderstand value cannot be set. +UDDI_ERROR_FATALERROR_SOAP_ACTORATT=The SOAP Actor attribute cannot be set. +UDDI_ERROR_FATALERROR_MISSINGUDDINS=The request failed validation because it did not contain a UDDI namespace. +UDDI_ERROR_FATALERROR_SOAP_MULTIPLEREQUEST=The request failed validation because only single requests are allowed. +UDDI_ERROR_FATALERROR_SOAP_INVALIDELEMENT=The request failed validation because it contained invalid elements. +UDDI_ERROR_FATALERROR_HTTPSREQUIREDFORPUBLISH=HTTPS is required for all publisher API's. +UDDI_ERROR_FATALERROR_CLIENTCERTREQUIRED=Client certificate required. +UDDI_ERROR_FATALERROR_CLIENTCERTNOTSTORED=Certificate not stored in the database for operator: {{{0}}} +UDDI_ERROR_FATALERROR_USERNOPUBLISHERCRED=The user account {0} does not have publisher credentials. +UDDI_ERROR_FATALERROR_VERSIONCHECKERROR=An error occurred while performing a version check. +UDDI_ERROR_UNSUPPORTED_CONTENTTYPEHEADERMISSING=Invalid HTTP header./r/nContent-Type must be: text/xml; charset="utf-8" +UDDI_ERROR_FATALERROR_NOUSERCREDS=The user account {0} does not have user credentials. +UDDI_ERROR_UNSUPPORTED_FINDQUALIFIER=Unsupported find qualifier {0}. +UDDI_ERROR_FATALERROR_UNEXPECTEDKRTYPE=Unexpected keyed reference type {0}. +UDDI_ERROR_FATALERROR_UNEXPECTEDENTITYTYPE=Unexpected entity type {0}. +UDDI_ERROR_UNSUPPORTED_NAMEASCANDDESC=Cannot specify both sortByNameAsc and sortByNameDesc in a find qualifier. +UDDI_ERROR_UNSUPPORTED_DATEASCANDDESC=Cannot specify both sortByDateAsc and sortByDateDesc in a find qualifier. +UDDI_ERROR_UNSUPPORTED_KEYSORAND=Cannot specify orLikeKeys with orAllKeys or andAllKeys in a find qualifier. +UDDI_ERROR_FATALERROR_KROWNINGBE=A keyedReference that contains the uddi-org:owningBusiness tModelKey must be contained in a categoryBag or indentifierBag. +UDDI_ERROR_FATALERROR_KROWNINGBETMODELCHILD=A keyedReference that contains the uddi-org:owningBusiness tModelKey must be contained in a categoryBag or indentifierBag that is the child of a tModel. +UDDI_ERROR_FATALERROR_INVALIDEVALUEORPUBLISHER=Invalid keyValue or publisher specified for this keyedReference. +UDDI_ERROR_FATALERROR_IDBAG_MISSINGTMODELKEY=TModelKey cannot be empty for an IdentifierBag keyed reference. +UDDI_ERROR_FATALERROR_GENERALKEYWORDS_BLANKNAME=The keyName cannot be blank or null when using general keywords. +UDDI_ERROR_FATALERROR_ASSERTION_MISSINGTMODELKEYORNAME=TModelKey and KeyName are required for publisher assertions. +UDDI_ERROR_FATALERROR_ASSERTION_MISSINGKEYNAMEORVALUE=TModelKey, KeyName, and KeyValue are required for a publisher assertions. +UDDI_ERROR_FATALERROR_AWR_NULLHELPLINKTEXT=HelpLinkText Cannot be Null. +UDDI_ERROR_FATALERROR_AWR_NULLHELPSTRING=HelpString Cannot be Null. +UDDI_ERROR_INVALIDKEYPASSED_INVALIDTMODELKEY=A valid tModelKey is required. +UDDI_ERROR_INVALIDKEYPASSED_NOUUIDONTMODELKEY=The specified tModelKey does not begin with UUID:. +UDDI_ERROR_INVALIDKEYPASSED_INVALIDTMODELKEYLENGTH=The specified tModelKey is not the correct length. +UDDI_ERROR_FATALERROR_DELETE_MULTIPLEKEYS=ChangeRecordDelete cannot contain more than one key. +UDDI_ERROR_FATALERROR_CONTEXT_SETLOGCHANGESNOTADMIN=Administrator credentials are required to log change records. +UDDI_ERROR_FATALERROR_SCHEAMAS_LOADING=SchemaCollection did not initialize properly because of missing or invalid schema files. +UDDI_ERROR_FATALERROR_SCHEMEMISSING=Could not find schema file {0}. +UDDI_ERROR_FATALERROR_TOOLS_VALIDATE_MISSIGFILE=Could not find the file {0}. +UDDI_ERROR_CONFIG_COMMUNICATION_ERROR=The Web server is unable to communicate with the UDDI Services database due to a configuration error. Please contact your UDDI Services administrator to resolve this issue. +UDDI_ERROR_FATALERROR_UNKNOWN=An unknown fatal error has occurred. +UDDI_ERROR_SQL_EXCEPTION=SQL Exception: {0} +UDDI_ERROR_COULD_NOT_RETRIEVE_OPERATING_SYSTEM_VERSION=Unable to determine operating system version. +UDDI_ERROR_UNSUPPORTED_PLATFORM=Cannot install UDDI Services to this operating system version. +UDDI_ERROR_SID_CONVERSION_FAILED=Attempt to convert security ID to group name failed. ConvertStringSidToSid failed. +UDDI_ERROR_SID_LOOKUP_FAILED=Attempt to convert security ID to group name failed. LookupAccountSid failed. +UDDI_ERROR_CREDENTIALS_EXPIRED=Credentials have expired. + +############################################################################ +## Operator Messages +############################################################################ + +UDDI_ERROR_OPERMSG_INVALIDUSERNAMEFORMAT=Invalid format for user ID. Expected user@domain: {0}. +UDDI_ERROR_OPERMSG_AUTHERRORBASE=Error authenticating user.\r\n\r\n {0} #{0}and{1} are the extended information for the error. +UDDI_ERROR_OPERMSG_AUTHERROR_PASSPORTDESC=Passport error: {0} +UDDI_ERROR_OPERMSG_AUTHERROR_RESPDESC=Response stream: {0} +UDDI_ERROR_OPERMSG_AUTHERROR_PASSPORTUNKNOWN=Unknown error communicating with Passport. +UDDI_ERROR_OPERMSG_AUTHENTICATIONFAILED=Error authenticating user. {0} +UDDI_ERROR_OPERMSG_INVALIDTICKETFORMAT=Invalid ticket format: {0} +UDDI_ERROR_OPERMSG_PARTNERXMLERROR=Error retrieving Client.xml from {0}\n\nDetails:\n{1} +UDDI_ERROR_OPERMSG_PERFCOUNTERREGERROR=An error occurred while attempting to publish a performance counter. +UDDI_ERROR_OPERMSG_ERRORRETRIEVINGCR=Could not retrieve change records:\r\n{0} +UDDI_ERROR_OPERMSG_DELASSERTFROMANDTOFALSE=FromBusinessCheck and ToBusinessCheck cannot both be false in a ChangeRecordDeleteAssertion message. +UDDI_ERROR_OPERMSG_PUBASSERTFROMANDTOFALSE=FromBusinessCheck and ToBusinessCheck cannot both be false in a ChangeRecordPublisherAssertion message. +UDDI_ERROR_OPERMSG_ERRORSENDMAIL=Could not send operator mail.\r\n\r\nDetails:\r\n\r\n{0} +UDDI_ERROR_OPERATOR_MESSAGE_UNABLE_TO_INIT_CONFIG_SETTINGS=Unable to initialize configuration settings.\r\n\r\nDetails:\r\n{0} +UDDI_ERROR_OPERATOR_MESSAGE_CONFIG_INVALID_STATE=The configuration table is in an invalid state.\r\n\r\n{0} +UDDI_ERROR_OPERATOR_MESSAGE_ERROR_READING_CONFIG_SETTINGS=Error reading configuration settings:\r\n{0} +UDDI_ERROR_OPERATOR_MESSAGE_CANNOT_IMPERSONATE=The configuration refresh thread was unable inherit the identity of the creating thread (thread={0}).\r\n\r\nDetails:\r\n{1} +UDDI_ERROR_OPERATOR_MESSAGE_UNABLE_TO_ACCESS_REGISTRY=Unable to access registry root {0}. +UDDI_ERROR_OPERATOR_MESSAGE_UNABLE_TO_REFRESH=Unable to refresh configuration settings from the registry monitor thread.\r\n\r\nDetails:\r\n{0} + +############################################################################ +## Replication Messages +############################################################################ +UDDI_MSG_REPLICATION_NODE_START=Starting replication with node.\r\n +UDDI_MSG_REPLICATION_NODE=REPLICATION NODE: +UDDI_MSG_REPLICATION_CURRENT_HIGHWATER_MARKS=CURRENT HIGHWATER MARKS: +UDDI_MSG_REPLICATION_COMPLETE=Replication with node complete. +UDDI_MSG_REPLICATION_INTERRUPTED=Replication with node interrupted\r\n ERROR: +UDDI_MSG_REPLICATION_CHANGE_RECORDS_PROCESSED=CHANGE RECORDS PROCESSED: +UDDI_MSG_REPLICATION_NEW_HIGHWATER_MARKS=NEW HIGHWATER MARKS: +UDDI_MSG_REPLICATION_START=Replication cycle started. +UDDI_MSG_REPLICATION_NODES=REPLICATION NODES: +UDDI_MSG_REPLICATION_END=Replication cycle complete. +UDDI_MSG_REPLICATION_CHANGERECORDS_PROCESSED=CHANGE RECORDS PROCESSED: +UDDI_ERROR_REPLICATION_COULD_NOT_STORE_RESULT=Could not store last replication result.\r\n\r\nREPLICATION NODE:\r\n{0}\r\n\r\nCHANGE RECORD:\r\n{1} : {2} +UDDI_ERROR_REPLICATION_OPERATOR_COMMUNICATION_ERROR=Error communicating with operator.\r\n\r\nREPLICATION NODE:\r\n\t{0}\r\n\t{1}\r\n\t{2}\r\n\r\nDETAILS:\r\n\r\n{3}\r\n\r\nCURRENT HIGHWATER MARKS:\r\n\r\n{4} +UDDI_ERROR_REPLICATION_COULD_NOT_PROCESS_ENTITY=Could not process entity from remote operator.\r\n\r\nREPLICATION NODE:\r\n\t{0}\r\n\t{1}\r\n\t{2}\r\n\r\nDETAILS:\r\n\r\n{3}\r\n\r\nCHANGE RECORD:\r\n\t{4} : {5}\r\n\r\n{6}\r\n\r\nCURRENT HIGHWATER MARKS:\r\n\r\n{7} +UDDI_ERROR_REPLICATION_INVALID_KEY=Invalid key from remote operator.\r\n\r\nREPLICATION NODE:\r\n\t{0}\r\n\t{1}\r\n\t{2}\r\n\r\nDETAILS:\r\n\r\n{3}\r\n\r\nCHANGE RECORD:\r\n\t{4} : {5}\r\n\r\n{6} +UDDI_ERROR_REPLICATION_HIGHWATER_MARKS=Could not retrieve high water marks for operator nodes.\r\n\r\nDetail:\r\n{0}. +UDDI_ERROR_REPLICATION_NO_OPERATORS=There are no operators to replicate with. Please check the replication configuration. +UDDI_ERROR_REPLICATION_OPERATOR_DETAILS=Could not get details for operator {{{0}}}.\r\n\r\nDetails:\r\n{1}. \ No newline at end of file diff --git a/inetsrv/uddi/source/resources/uddi.zh-chs.resources b/inetsrv/uddi/source/resources/uddi.zh-chs.resources new file mode 100644 index 0000000..104c33a Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.zh-chs.resources differ diff --git a/inetsrv/uddi/source/resources/uddi.zh-cht.resources b/inetsrv/uddi/source/resources/uddi.zh-cht.resources new file mode 100644 index 0000000..5ef518d Binary files /dev/null and b/inetsrv/uddi/source/resources/uddi.zh-cht.resources differ diff --git a/inetsrv/uddi/source/sd_clean.js b/inetsrv/uddi/source/sd_clean.js new file mode 100644 index 0000000..db553ec --- /dev/null +++ b/inetsrv/uddi/source/sd_clean.js @@ -0,0 +1,152 @@ +//////////////////////////////////////////////////////////////////////////////////// +// +// Script to manage file that are written offline +// +//////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////// +// +// + + var c_sdfiles = "sd files -d "; //used to get the local files that need to get added recurively + var c_sdwhere = "sd where "; //used to get local sd mappings + var c_defaultpath = ".\\"; + //var c_sdscorch = "del ";//used to add a file to sd, requires filename to be appended + var c_test = false; + + var c_help = "Command Line Help for sd_scortch.js\r\n\r\n" + + "This file will DELETE all files that are not checked in" + + "cscript.exe sd_scortch.js [directory] [options]\r\n\r\n" + + "directory Directory to search( must end with '\' )\r\n\r\n " + + "options:\r\n"+ + "test Display Actions with out doing them( short form 't' )"; + + + + var g_allerrors = ""; + var g_fso = new ActiveXObject( "Scripting.FileSystemObject" ); + var g_sdfilelist; + var g_shell = new ActiveXObject( "Wscript.Shell" ); +// +//////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////// +// +// + + function ProcessCommandArgs( ) + { + var i =0; + try + { + if( WScript.Arguments.Length>0 ) + { + + if( WScript.Arguments( 0 ) =="-?"||WScript.Arguments( 0 ) =="/?" ) + { + WScript.Echo( c_help ); + WScript.Quit( 0 ); + } + + for( i=0;i + /// The address structure is a simple list of AddressLine elements within the address container. + /// Each addressLine element is a simple string. Uddi compliant registries are responsible for + /// preserving the order of any addressLine data provided. Address structures also have two optional + /// attributes for recording the useType (freeform text) and sortCode data. The sortCode values + /// are not significant within a Uddi registry, but may be used by user interfaces that present + /// address information in some ordered fashion using the values provided in the sortCode attribute. + /// + public class Address : UddiCore + { + private string sortCode; + private string useType; + private string tModelKey; + private AddressLineCollection addressLines; + + /// + /// Optional attribute that can be used to drive the behavior of external display mechanisms + /// that sort addresses. The suggested values for sortCode include numeric ordering values + /// (e.g. 1, 2, 3), alphabetic character ordering values (e.g. a, b, c) or the first n positions + /// of relevant data within the address. + /// + [XmlAttribute("sortCode")] + public string SortCode + { + get { return sortCode; } + set { sortCode = value; } + } + + /// + /// Optional attribute that is used to describe the type of address in freeform text. + /// Suggested examples include “headquarters”, “sales office”, “billing department”, etc. + /// + [XmlAttribute("useType")] + public string UseType + { + get { return useType; } + set { useType = value; } + } + + /// + /// Optional attribute that is used to describe the address using a tModel. + /// + [XmlAttribute("tModelKey")] + public string TModelKey + { + get { return tModelKey; } + set { tModelKey = value; } + } + + /// + /// AddressLine elements contain string data with a suggested line length limit of + /// 40 character positions. Address line order is significant and will always be + /// returned by the Uddi compliant registry in the order originally provided during + /// a call to save_business. + /// + [XmlElement("addressLine")] + public AddressLineCollection AddressLines + { + get + { + if( null == addressLines ) + { + addressLines = new AddressLineCollection(); + } + + return addressLines; + } + + set { addressLines = value; } + } + + public Address() : this( "", "" ) + {} + + public Address( string sortCode, string useType ) + { + SortCode = sortCode; + UseType = useType; + } + + public Address( string tModelKey ) + { + SortCode = sortCode; + TModelKey = tModelKey; + } + } + + public class AddressLine : UddiCore + { + private string keyName; + private string keyValue; + private string text; + + public AddressLine() : this( "", null, null ) + {} + + public AddressLine( string text ) : this( text, null, null ) + {} + + public AddressLine( string text, string keyName, string keyValue ) + { + Text = text; + KeyName = keyName; + KeyValue = keyValue; + } + + [ XmlAttribute( "keyName" ) ] + public string KeyName + { + get { return keyName; } + set { keyName = value; } + } + + [ XmlAttribute( "keyValue" ) ] + public string KeyValue + { + get { return keyValue; } + set { keyValue = value; } + } + + [ XmlText ] + public string Text + { + get { return text; } + set { text = value; } + } + } + + public class AddressCollection : CollectionBase + { + public Address this[ int index ] + { + get { return (Address)List[ index ]; } + set { List[ index ] = value; } + } + + public int Add( string sortCode, string useType ) + { + return List.Add( new Address( sortCode, useType ) ); + } + + public int Add( string tModelKey ) + { + return List.Add( new Address( tModelKey ) ); + } + + public int Add( Address value ) + { + return List.Add( value ); + } + + public void Insert( int index, Address value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Address value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Address value ) + { + return List.Contains( value ); + } + + public void Remove( Address value ) + { + List.Remove( value ); + } + + public void CopyTo( Address[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new AddressEnumerator GetEnumerator() + { + return new AddressEnumerator( List.GetEnumerator() ); + } + } + + public sealed class AddressEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public AddressEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Address Current + { + get { return ( Address ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class AddressLineCollection : CollectionBase + { + public AddressLine this[ int index ] + { + get { return (AddressLine)List[ index ]; } + set { List[ index ] = value; } + } + + public int Add( string text ) + { + return List.Add( new AddressLine( text ) ); + } + + public int Add( string text, string keyName, string keyValue ) + { + return List.Add( new AddressLine( text, keyName, keyValue ) ); + } + + public int Add( AddressLine value ) + { + return List.Add( value ); + } + + public void Insert( int index, AddressLine value ) + { + List.Insert( index, value ); + } + + public int IndexOf( AddressLine value ) + { + return List.IndexOf( value ); + } + + public bool Contains( AddressLine value ) + { + return List.Contains( value ); + } + + public void Remove( AddressLine value ) + { + List.Remove( value ); + } + + public void CopyTo( AddressLine[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new AddressLineEnumerator GetEnumerator() + { + return new AddressLineEnumerator( List.GetEnumerator() ); + } + } + + public sealed class AddressLineEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public AddressLineEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public AddressLine Current + { + get { return ( AddressLine ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/assemblyinfo.cs b/inetsrv/uddi/source/sdk/assemblyinfo.cs new file mode 100644 index 0000000..46290d9 --- /dev/null +++ b/inetsrv/uddi/source/sdk/assemblyinfo.cs @@ -0,0 +1,40 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("Microsoft.Uddi")] +[assembly: AssemblyDescription("Assembly for processing Uddi SOAP messages")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("Uddi")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile(@"..\..\sdk.snk")] +[assembly: AssemblyKeyName("")] +[assembly: CLSCompliantAttribute(true)] \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/assertion.cs b/inetsrv/uddi/source/sdk/assertion.cs new file mode 100644 index 0000000..31755b1 --- /dev/null +++ b/inetsrv/uddi/source/sdk/assertion.cs @@ -0,0 +1,748 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.ComponentModel; +using System.Xml.Serialization; + +using Microsoft.Uddi; +using Microsoft.Uddi.Business; +using Microsoft.Uddi.Service; +using Microsoft.Uddi.ServiceType; +using Microsoft.Uddi.VersionSupport; + +namespace Microsoft.Uddi.Business +{ + [XmlRoot( "assertionStatusReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class AssertionStatusReport : UddiCore + { + private string node; + private AssertionStatusItemCollection assertionStatusItems; + + [XmlAttribute( "operator" )] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlElement( "assertionStatusItem" )] + public AssertionStatusItemCollection AssertionStatusItems + { + get + { + if( null == assertionStatusItems ) + { + assertionStatusItems = new AssertionStatusItemCollection(); + } + + return assertionStatusItems; + } + + set { assertionStatusItems = value; } + } + } + + [XmlRoot( "publisherAssertions", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class PublisherAssertionDetail : UddiCore + { + private string node; + private string authorizedName; + private PublisherAssertionCollection publisherAssertions; + + [XmlAttribute( "operator" )] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute( "authorizedName" )] + public string AuthorizedName + { + get { return authorizedName; } + set { authorizedName = value; } + } + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + { + publisherAssertions = new PublisherAssertionCollection(); + } + + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + } + + [XmlRoot( "relatedBusinessesList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class RelatedBusinessList : UddiCore + { + private string operatorValue; + private string businessKey; + private bool truncated; + private RelatedBusinessInfoCollection relatedBusinessInfos; + + [XmlAttribute( "operator" )] + public string Operator + { + get { return operatorValue; } + set { operatorValue = value; } + } + + [XmlAttribute( "businessKey" )] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlAttribute( "truncated" )] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [ XmlArray( "relatedBusinessInfos" ), XmlArrayItem( "relatedBusinessInfo" ) ] + public RelatedBusinessInfoCollection RelatedBusinessInfos + { + get + { + if( null == relatedBusinessInfos ) + { + relatedBusinessInfos = new RelatedBusinessInfoCollection(); + } + return relatedBusinessInfos; + } + + set { relatedBusinessInfos = value; } + } + } + + [XmlRoot( "add_publisherAssertions", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class AddPublisherAssertions : UddiSecureMessage + { + private PublisherAssertionCollection publisherAssertions; + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + { + publisherAssertions = new PublisherAssertionCollection(); + } + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + } + + [XmlRoot( "delete_publisherAssertions", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class DeletePublisherAssertions : UddiSecureMessage + { + private PublisherAssertionCollection publisherAssertions; + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + { + publisherAssertions = new PublisherAssertionCollection(); + } + + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + } + + [XmlRoot( "find_relatedBusinesses", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class FindRelatedBusinesses : UddiQueryMessage + { + // + // TODO this normally does not have max rows default 0, is that going to be a problem? + // + + private string businessKey; + private KeyedReference keyedReference; + + [XmlElement( "businessKey" )] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlElement( "keyedReference" )] + public KeyedReference KeyedReference + { + get + { + if( null == keyedReference ) + { + keyedReference = new KeyedReference(); + } + + return keyedReference; + } + + set { keyedReference = value; } + } + } + + [XmlRoot( "get_assertionStatusReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class GetAssertionStatusReport : UddiSecureMessage + { + private CompletionStatusType completionStatus; + + [XmlElement( "completionStatus" )] + public CompletionStatusType CompletionStatus + { + get { return completionStatus; } + set { completionStatus = value; } + } + } + + [XmlRoot( "get_publisherAssertions", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class GetPublisherAssertions : UddiSecureMessage + { + } + + [XmlRoot( "set_publisherAssertions", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + public class SetPublisherAssertions : UddiSecureMessage + { + private PublisherAssertionCollection publisherAssertions; + + [XmlElement( "publisherAssertion" )] + public PublisherAssertionCollection PublisherAssertions + { + get + { + if( null == publisherAssertions ) + { + publisherAssertions = new PublisherAssertionCollection(); + } + + return publisherAssertions; + } + + set { publisherAssertions = value; } + } + } + + public class PublisherAssertion : UddiCore + { + private string fromKey; + private string toKey; + private KeyedReference keyedReference; + + public PublisherAssertion() + {} + + public PublisherAssertion( PublisherAssertion assertion ) + { + this.FromKey = assertion.FromKey; + this.ToKey = assertion.ToKey; + this.KeyedReference = assertion.KeyedReference; + } + + public PublisherAssertion( string fromKey, string toKey, KeyedReference keyedReference ) + { + this.FromKey = fromKey; + this.ToKey = toKey; + this.KeyedReference = keyedReference; + } + + public PublisherAssertion( string fromKey, string toKey, string keyName, string keyValue, string tModelKey ) + { + this.FromKey = fromKey; + this.ToKey = toKey; + this.KeyedReference = new KeyedReference( keyName, keyValue, tModelKey ); + } + + [XmlElement( "fromKey" )] + public string FromKey + { + get { return fromKey; } + set { fromKey = value; } + } + + [XmlElement( "toKey" )] + public string ToKey + { + get { return toKey; } + set { toKey = value; } + } + + [XmlElement( "keyedReference" )] + public KeyedReference KeyedReference + { + get + { + if( null == keyedReference ) + { + keyedReference = new KeyedReference(); + } + + return keyedReference; + } + + set { keyedReference = value; } + } + } + + public class AssertionStatusItem : UddiCore + { + private string fromKey; + private string toKey; + private CompletionStatusType completionStatus; + private KeyedReference keyedReference; + private KeysOwned keysOwned; + + public AssertionStatusItem() + {} + + public AssertionStatusItem( CompletionStatusType completionStatus, + string fromKey, + string toKey, + KeyedReference keyedReference, + KeysOwned keysOwned ) + { + this.CompletionStatus = completionStatus; + this.FromKey = fromKey; + this.ToKey = toKey; + this.KeyedReference = keyedReference; + this.KeysOwned = keysOwned; + } + + [XmlAttribute( "completionStatus" )] + public CompletionStatusType CompletionStatus + { + get { return completionStatus; } + set { completionStatus = value; } + } + + [XmlElement( "fromKey" )] + public string FromKey + { + get { return fromKey; } + set { fromKey = value; } + } + + [XmlElement( "toKey" )] + public string ToKey + { + get { return toKey; } + set { toKey = value; } + } + + [XmlElement( "keyedReference" )] + public KeyedReference KeyedReference + { + get { return keyedReference; } + set { keyedReference = value; } + } + + [XmlElement( "keysOwned" )] + public KeysOwned KeysOwned + { + get + { + if( null == keysOwned ) + { + keysOwned = new KeysOwned(); + } + + return keysOwned; + } + + set { keysOwned = value; } + } + } + + public class KeysOwned : UddiCore + { + private string fromKey; + private string toKey; + + public KeysOwned() + {} + + public KeysOwned( string fromKey, string toKey ) + { + this.FromKey = fromKey; + this.ToKey = toKey; + } + + [XmlElement( "fromKey" )] + public string FromKey + { + get { return fromKey; } + set { fromKey = value; } + } + + [XmlElement( "toKey" )] + public string ToKey + { + get { return toKey; } + set { toKey = value; } + } + } + + public class RelatedBusinessInfo : UddiCore + { + private string businessKey; + private NameCollection names; + private DescriptionCollection descriptions; + private SharedRelationships[] sharedRelationships; + + public RelatedBusinessInfo() + {} + + public RelatedBusinessInfo( string businessKey ) + { + this.BusinessKey = businessKey; + } + + [XmlElement( "businessKey" )] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlElement( "name" )] + public NameCollection Names + { + get + { + if( null == names ) + { + names = new NameCollection(); + } + + return names; + } + + set { names = value; } + } + + [XmlElement( "description" )] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlElement( "sharedRelationships" )] + public SharedRelationships[] SharedRelationships + { + get + { + if( null == sharedRelationships ) + { + sharedRelationships = new SharedRelationships[ 2 ]; + } + + return sharedRelationships; + } + + set { sharedRelationships = value; } + } + } + + public class SharedRelationships : UddiCore + { + private DirectionType direction; + private KeyedReferenceCollection keyedReferences; + + [XmlAttribute( "direction" )] + public DirectionType Direction + { + get { return direction; } + set { direction = value; } + } + + [XmlElement( "keyedReference" )] + public KeyedReferenceCollection KeyedReferencesSerialize + { + get + { + if( null == keyedReferences ) + { + keyedReferences = new KeyedReferenceCollection(); + } + + return keyedReferences; + } + set { keyedReferences = value; } + } + } + + public class PublisherAssertionCollection : CollectionBase + { + public PublisherAssertion this[ int index ] + { + get { return (PublisherAssertion)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new PublisherAssertion() ); + } + + public int Add( PublisherAssertion value ) + { + return List.Add( value ); + } + + public int Add( string fromKey, string toKey, KeyedReference keyedReference ) + { + return List.Add( new PublisherAssertion( fromKey, toKey, keyedReference ) ); + } + + public int Add( string fromKey, string toKey, string keyName, string keyValue, string tModelKey ) + { + return List.Add( new PublisherAssertion( fromKey, toKey, keyName, keyValue, tModelKey ) ); + } + + public void Insert( int index, PublisherAssertion value ) + { + List.Insert( index, value ); + } + + public int IndexOf( PublisherAssertion value ) + { + return List.IndexOf( value ); + } + + public bool Contains( PublisherAssertion value ) + { + return List.Contains( value ); + } + + public void Remove( PublisherAssertion value ) + { + List.Remove( value ); + } + + public void CopyTo( PublisherAssertion[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new PublisherAssertionEnumerator GetEnumerator() + { + return new PublisherAssertionEnumerator( List.GetEnumerator() ); + } + } + + public sealed class PublisherAssertionEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public PublisherAssertionEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public PublisherAssertion Current + { + get { return ( PublisherAssertion ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class AssertionStatusItemCollection : CollectionBase + { + public AssertionStatusItem this[ int index ] + { + get { return (AssertionStatusItem)List[index]; } + set { List[ index ] = value; } + } + + public int Add() + { + return List.Add( new AssertionStatusItem() ); + } + + public int Add( AssertionStatusItem value ) + { + return List.Add( value ); + } + + public void Insert( int index, AssertionStatusItem value ) + { + List.Insert( index, value ); + } + + public int IndexOf( AssertionStatusItem value ) + { + return List.IndexOf( value ); + } + + public bool Contains( AssertionStatusItem value ) + { + return List.Contains( value ); + } + + public void Remove( AssertionStatusItem value ) + { + List.Remove( value ); + } + + public void CopyTo( AssertionStatusItem[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new AssertionStatusItemEnumerator GetEnumerator() + { + return new AssertionStatusItemEnumerator( List.GetEnumerator() ); + } + } + + public sealed class AssertionStatusItemEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public AssertionStatusItemEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public AssertionStatusItem Current + { + get { return ( AssertionStatusItem ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class RelatedBusinessInfoCollection : CollectionBase + { + public RelatedBusinessInfo this[ int index ] + { + get { return (RelatedBusinessInfo)List[index]; } + set { List[ index ] = value; } + } + + public int Add( RelatedBusinessInfo relatedBusinessInfo ) + { + return List.Add( relatedBusinessInfo ); + } + + public int Add( string businessKey ) + { + return List.Add( new RelatedBusinessInfo( businessKey ) ); + } + + public void Insert( int index, RelatedBusinessInfo relatedBusinessInfo ) + { + List.Insert( index, relatedBusinessInfo ); + } + + public int IndexOf( RelatedBusinessInfo relatedBusinessInfo ) + { + return List.IndexOf( relatedBusinessInfo ); + } + + public bool Contains( RelatedBusinessInfo relatedBusinessInfo ) + { + return List.Contains( relatedBusinessInfo ); + } + + public void Remove( RelatedBusinessInfo relatedBusinessInfo ) + { + List.Remove( relatedBusinessInfo ); + } + + public void CopyTo( RelatedBusinessInfo[] array, int index ) + { + List.CopyTo( array, index ); + } + public new RelatedBusinessInfoEnumerator GetEnumerator() + { + return new RelatedBusinessInfoEnumerator( List.GetEnumerator() ); + } + } + + public sealed class RelatedBusinessInfoEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public RelatedBusinessInfoEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public RelatedBusinessInfo Current + { + get { return ( RelatedBusinessInfo ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/authentication.cs b/inetsrv/uddi/source/sdk/authentication.cs new file mode 100644 index 0000000..0cd0ab8 --- /dev/null +++ b/inetsrv/uddi/source/sdk/authentication.cs @@ -0,0 +1,94 @@ +using System; +using System.Xml.Serialization; + +using Microsoft.Uddi; + +namespace Microsoft.Uddi.Authentication +{ + /// + /// The discard_authToken message is used to inform an Operator Site that the + /// authentication token can be discarded. Subsequent calls that use the same + /// authToken may be rejected. This message is optional for Operator Sites that + /// do not manage session state or that do not support the get_authToken message. + /// + [XmlRootAttribute("discard_authToken", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class DiscardAuthToken : UddiSecureMessage + { + } + + /// + /// The get_authToken message is used to obtain an authentication token. + /// This message returns the authentication information that should be used + /// in subsequent calls to the publishers API messages. + /// + [XmlRootAttribute("get_authToken", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class GetAuthToken : UddiMessage + { + private string userId; + private string credentials; + + /// + /// This required attribute argument is the user that an individual authorized user was assigned + /// by an Operator Site. Operator Sites will each provide a way for individuals to obtain a + /// UserID and password that will be valid only at the given Operator Site. + /// + [XmlAttribute("userID")] + public string UserID + { + get { return userId; } + set { userId = value; } + } + + /// + /// This required attribute argument is the password or credential that is associated with the user. + /// + [XmlAttribute("cred")] + public string Credentials + { + // + // TODO store this value using CryptProtectMemory + // + get { return credentials; } + set { credentials = value; } + } + } + + /// + /// The authToken message contains a single authInfo element that contains an access token + /// that is to be passed back in all of the publisher API messages that change data. This + /// message is always returned using SSL encryption as a synchronous response to the + /// get_authToken message + /// + [XmlRootAttribute("authToken", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class AuthToken : UddiCore + { + private string node; + private string authInfo; + private GetAuthToken originatingGetAuthToken; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + /// + /// This element contains the requested authentication token. Authentication tokens are opaque + /// values that are required for all other publisher API calls. + /// + [XmlElement("authInfo")] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + + [XmlIgnore] + internal GetAuthToken OriginatingAuthToken + { + get { return originatingGetAuthToken; } + set { originatingGetAuthToken = value; } + } + } +} diff --git a/inetsrv/uddi/source/sdk/binding.cs b/inetsrv/uddi/source/sdk/binding.cs new file mode 100644 index 0000000..9ef3d41 --- /dev/null +++ b/inetsrv/uddi/source/sdk/binding.cs @@ -0,0 +1,421 @@ +using System; +using System.Diagnostics; +using System.Collections; +using System.ComponentModel; +using System.Xml.Serialization; +using System.Collections.Specialized; + +using Microsoft.Uddi; +using Microsoft.Uddi.ServiceType; +using Microsoft.Uddi.Binding; + +namespace Microsoft.Uddi.Binding +{ + [XmlRootAttribute("delete_binding", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class DeleteBinding : UddiSecureMessage + { + private StringCollection bindingKeys; + + [XmlElement("bindingKey")] + public StringCollection BindingKeys + { + get + { + if( null == bindingKeys ) + { + bindingKeys = new StringCollection(); + } + + return bindingKeys; + } + + set { bindingKeys = value; } + } + } + + [XmlRootAttribute("find_binding", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class FindBinding : UddiQueryMessage + { + private string serviceKey; + private StringCollection tModelKeys; + + [XmlAttribute("serviceKey")] + public string ServiceKey + { + get { return serviceKey; } + set { serviceKey = value; } + } + + [XmlArray("tModelBag"), XmlArrayItem("tModelKey")] + public StringCollection TModelKeys + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( tModelKeys ) ) + { + return null; + } + + if( null == tModelKeys ) + { + tModelKeys = new StringCollection(); + } + + return tModelKeys; + } + + set { tModelKeys = value; } + } + } + + [XmlRootAttribute("save_binding", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class SaveBinding : UddiSecureMessage + { + private BindingTemplateCollection bindingTemplates; + + [XmlElement("bindingTemplate")] + public BindingTemplateCollection BindingTemplates + { + get + { + if( null == bindingTemplates ) + { + bindingTemplates = new BindingTemplateCollection(); + } + + return bindingTemplates; + } + + set { bindingTemplates = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( false == Utility.CollectionEmpty( bindingTemplates ) ) + { + foreach( BindingTemplate binding in bindingTemplates ) + { + binding.SerializeMode = value; + } + } + base.SerializeMode = value; + } + } + } + + [XmlRootAttribute("get_bindingDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class GetBindingDetail : UddiMessage + { + private StringCollection bindingKeys; + + [XmlElement("bindingKey")] + public StringCollection BindingKeys + { + get + { + if( null == bindingKeys ) + { + bindingKeys = new StringCollection(); + } + + return bindingKeys; + } + + set { bindingKeys = value; } + } + } + + [XmlRootAttribute("bindingDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class BindingDetail : UddiCore + { + private string node; + private bool truncated; + private BindingTemplateCollection bindingTemplates; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlElement("bindingTemplate")] + public BindingTemplateCollection BindingTemplates + { + get + { + if( null == bindingTemplates ) + { + bindingTemplates = new BindingTemplateCollection(); + } + + return bindingTemplates; + } + + set { bindingTemplates = value; } + } + } + + public class BindingTemplate : UddiCore + { + private string serviceKey; + private string bindingKey; + private AccessPoint accessPoint; + private HostingRedirector hostingRedirector; + private DescriptionCollection descriptions; + private TModelInstanceDetail tModelInstanceDetail; + + public BindingTemplate() : this( "", "" ) + {} + + public BindingTemplate( string serviceKey ) : this( serviceKey, "" ) + {} + + public BindingTemplate( string serviceKey, string bindingKey ) + { + ServiceKey = serviceKey; + BindingKey = bindingKey; + } + + [XmlAttribute("serviceKey")] + public string ServiceKey + { + get { return serviceKey; } + set { serviceKey = value; } + } + + [XmlAttribute("bindingKey")] + public string BindingKey + { + get { return bindingKey; } + set { bindingKey = value; } + } + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlElement("accessPoint")] + public AccessPoint AccessPoint + { + get + { + if( true == SerializeMode && + ( null == accessPoint || Utility.StringEmpty( accessPoint.Text ) ) ) + { + return null; + } + + if( null == accessPoint ) + { + accessPoint = new AccessPoint(); + } + + return accessPoint; + } + + set { accessPoint = value; } + } + + [XmlElement("hostingRedirector")] + public HostingRedirector HostingRedirector + { + get + { + if( true == SerializeMode && + ( null == hostingRedirector || Utility.StringEmpty( hostingRedirector.BindingKey ) ) ) + { + return null; + } + + if( null == hostingRedirector ) + { + hostingRedirector = new HostingRedirector(); + } + + return hostingRedirector; + } + + set { hostingRedirector = value; } + } + + [XmlElement("tModelInstanceDetails")] + public TModelInstanceDetail TModelInstanceDetail + { + get + { + if( null == tModelInstanceDetail ) + { + tModelInstanceDetail = new TModelInstanceDetail(); + } + + return tModelInstanceDetail; + } + set { tModelInstanceDetail = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( null != tModelInstanceDetail ) + { + tModelInstanceDetail.SerializeMode = value; + } + base.SerializeMode = value; + } + } + } + + public class AccessPoint : UddiCore + { + private UrlType urlType; + private string text; + + public AccessPoint() + {} + + public AccessPoint( UrlType urlType ) : this( urlType, "" ) + {} + + public AccessPoint( UrlType urlType, string accessPoint ) + { + UrlType = urlType; + Text = accessPoint; + } + + [XmlAttribute( "urlType" )] + public UrlType UrlType + { + get { return urlType; } + set { urlType = value; } + } + + [XmlText] + public string Text + { + get { return text; } + set { text = value; } + } + } + + public class HostingRedirector : UddiCore + { + private string bindingKey; + + [XmlAttribute("bindingKey")] + public string BindingKey + { + get { return bindingKey; } + set { bindingKey = value; } + } + } + + public class BindingTemplateCollection : CollectionBase + { + public BindingTemplate this[ int index ] + { + get { return (BindingTemplate)List[index]; } + set { List[index] = value; } + } + + public int Add( BindingTemplate bindingTemplate ) + { + return List.Add(bindingTemplate); + } + + public int Add( string serviceKey ) + { + return List.Add( new BindingTemplate( serviceKey ) ); + } + + public int Add( string serviceKey, string bindingKey ) + { + return List.Add( new BindingTemplate( serviceKey, bindingKey ) ); + } + + public void Insert(int index, BindingTemplate value) + { + List.Insert(index, value); + } + + public int IndexOf(BindingTemplate value) + { + return List.IndexOf(value); + } + + public bool Contains(BindingTemplate value) + { + return List.Contains(value); + } + + public void Remove(BindingTemplate value) + { + List.Remove(value); + } + + public void CopyTo(BindingTemplate[] array, int index) + { + List.CopyTo(array, index); + } + + public new BindingTemplateEnumerator GetEnumerator() + { + return new BindingTemplateEnumerator( List.GetEnumerator() ); + } + } + + public sealed class BindingTemplateEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public BindingTemplateEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public BindingTemplate Current + { + get { return ( BindingTemplate ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/business.cs b/inetsrv/uddi/source/sdk/business.cs new file mode 100644 index 0000000..25f1e87 --- /dev/null +++ b/inetsrv/uddi/source/sdk/business.cs @@ -0,0 +1,984 @@ +using System; +using System.IO; +using System.Collections; +using System.Collections.Specialized; +using System.Diagnostics; +using System.ComponentModel; +using System.Xml.Serialization; + +using Microsoft.Uddi; +using Microsoft.Uddi.Business; +using Microsoft.Uddi.Service; +using Microsoft.Uddi.ServiceType; + +namespace Microsoft.Uddi.Business +{ + [XmlRootAttribute("delete_business", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class DeleteBusiness : UddiSecureMessage + { + private StringCollection businessKeys; + + [XmlElement("businessKey")] + public StringCollection BusinessKeys + { + get + { + if( null == businessKeys ) + { + businessKeys = new StringCollection(); + } + + return businessKeys; + } + + set { businessKeys = value; } + } + } + + [XmlRootAttribute("find_business", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class FindBusiness : UddiQueryMessage + { + private NameCollection names; + private KeyedReferenceCollection identifierBag; + private KeyedReferenceCollection categoryBag; + private StringCollection tModelKeys; + private DiscoveryUrlCollection discoveryUrls; + + [XmlElement("name")] + public NameCollection Names + { + get + { + if( null == names ) + { + names = new NameCollection(); + } + return names; + } + + set { names = value; } + } + + [XmlArray("identifierBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection IdentifierBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( identifierBag ) ) + { + return null; + } + + if( null == identifierBag ) + { + identifierBag = new KeyedReferenceCollection(); + } + + return identifierBag; + } + + set { identifierBag = value; } + } + + [XmlArray("categoryBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection CategoryBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( categoryBag ) ) + { + return null; + } + + if( null == categoryBag ) + { + categoryBag = new KeyedReferenceCollection(); + } + + return categoryBag; + } + + set { categoryBag = value; } + } + + [XmlArray("tModelBag"), XmlArrayItem("tModelKey")] + public StringCollection TModelKeys + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( tModelKeys ) ) + { + return null; + } + + if( null == tModelKeys ) + { + tModelKeys = new StringCollection(); + } + + return tModelKeys; + } + + set { tModelKeys = value; } + } + + [XmlArray("discoveryURLs"), XmlArrayItem("discoveryURL")] + public DiscoveryUrlCollection DiscoveryUrls + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( discoveryUrls ) ) + { + return null; + } + + if( null == discoveryUrls ) + { + discoveryUrls = new DiscoveryUrlCollection(); + } + + return discoveryUrls; + } + + set { discoveryUrls = value; } + } + } + + [XmlRootAttribute("get_businessDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class GetBusinessDetail : UddiMessage + { + private StringCollection businessKeys; + + [XmlElement("businessKey")] + public StringCollection BusinessKeys + { + get + { + if( null == businessKeys ) + { + businessKeys = new StringCollection(); + } + + return businessKeys; + } + + set { businessKeys = value; } + } + } + + [XmlRootAttribute("save_business", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class SaveBusiness : UddiSecureMessage + { + private BusinessEntityCollection businessEntities; + private StringCollection uploadRegisters; + + [XmlElement("businessEntity")] + public BusinessEntityCollection BusinessEntities + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( businessEntities ) ) + { + return null; + } + + if( null == businessEntities ) + { + businessEntities = new BusinessEntityCollection(); + } + + return businessEntities; + } + + set { businessEntities = value; } + } + + [XmlElement("uploadRegister")] + public StringCollection UploadRegisters + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( uploadRegisters ) ) + { + return null; + } + + if( null == uploadRegisters ) + { + uploadRegisters = new StringCollection(); + } + + return uploadRegisters; + } + set { uploadRegisters = value; } + } + + public override bool SerializeMode + { + get + { + return base.SerializeMode; + } + set + { + if( !Utility.CollectionEmpty( businessEntities ) ) + { + foreach( BusinessEntity business in businessEntities ) + { + business.SerializeMode = value; + } + } + base.SerializeMode = value; + } + } + } + + [XmlRootAttribute("get_businessDetailExt", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class GetBusinessDetailExt : UddiMessage + { + private StringCollection businessKeys; + + [XmlElement("businessKey")] + public StringCollection BusinessKeys + { + get + { + if( null == businessKeys ) + { + businessKeys = new StringCollection(); + } + + return businessKeys; + } + + set { businessKeys = value; } + } + } + + [XmlRootAttribute("get_registeredInfo", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class GetRegisteredInfo : UddiSecureMessage + { + } + + [XmlRootAttribute("businessDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class BusinessDetail : UddiCore + { + private string node; + private bool truncated; + private BusinessEntityCollection businessEntities; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlElement("businessEntity")] + public BusinessEntityCollection BusinessEntities + { + get + { + if( null == businessEntities ) + { + businessEntities = new BusinessEntityCollection(); + } + + return businessEntities; + } + + set { businessEntities = value; } + } + } + + [XmlRootAttribute("businessDetailExt", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class BusinessDetailExt : UddiCore + { + private string node; + private bool truncated; + private BusinessEntityExtCollection businessEntitiesExt; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlElement("businessEntityExt")] + public BusinessEntityExtCollection BusinessEntitiesExt + { + get + { + if( null == businessEntitiesExt ) + { + businessEntitiesExt = new BusinessEntityExtCollection(); + } + + return businessEntitiesExt; + } + + set { businessEntitiesExt = value; } + } + } + + [XmlRootAttribute("businessList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class BusinessList : UddiCore + { + private string node; + private bool truncated; + private BusinessInfoCollection businessInfos; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlArray("businessInfos"), XmlArrayItem("businessInfo")] + public BusinessInfoCollection BusinessInfos + { + get + { + if( null == businessInfos ) + { + businessInfos = new BusinessInfoCollection(); + } + + return businessInfos; + } + + set { businessInfos = value; } + } + } + + public class BusinessEntity : UddiCore + { + private string businessKey; + private string node; + private string authorizedName; + private DiscoveryUrlCollection discoveryUrls; + private NameCollection names; + private DescriptionCollection descriptions; + private ContactCollection contacts; + private BusinessServiceCollection businessServices; + private KeyedReferenceCollection identifierBag; + private KeyedReferenceCollection categoryBag; + + public BusinessEntity() : this( "" ) + {} + + public BusinessEntity( string businessKey ) + { + BusinessKey = businessKey; + } + + [XmlAttribute("businessKey")] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("authorizedName")] + public string AuthorizedName + { + get { return authorizedName; } + set { authorizedName = value; } + } + + [XmlArray("discoveryURLs"), XmlArrayItem("discoveryURL")] + public DiscoveryUrlCollection DiscoveryUrls + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( discoveryUrls ) ) + { + return null; + } + + if( null == discoveryUrls ) + { + discoveryUrls = new DiscoveryUrlCollection(); + } + + return discoveryUrls; + } + + set { discoveryUrls = value; } + } + + [XmlElement("name")] + public NameCollection Names + { + get + { + if( null == names ) + { + names = new NameCollection(); + } + + return names; + } + + set { names = value; } + } + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( descriptions ) ) + { + return null; + } + + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlArray("contacts"),XmlArrayItem("contact")] + public ContactCollection Contacts + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( contacts ) ) + { + return null; + } + + if( null == contacts ) + { + contacts = new ContactCollection(); + } + + return contacts; + } + + set { contacts = value; } + } + + [XmlArray("businessServices"), XmlArrayItem("businessService")] + public BusinessServiceCollection BusinessServices + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( businessServices ) ) + { + return null; + } + + if( null == businessServices ) + { + businessServices = new BusinessServiceCollection(); + } + + return businessServices; + } + + set { businessServices = value; } + } + + [XmlArray("identifierBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection IdentifierBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( identifierBag ) ) + { + return null; + } + + if( null == identifierBag ) + { + identifierBag = new KeyedReferenceCollection(); + } + + return identifierBag; + } + + set { identifierBag = value; } + } + + [XmlArray("categoryBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection CategoryBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( categoryBag ) ) + { + return null; + } + + if( null == categoryBag ) + { + categoryBag = new KeyedReferenceCollection(); + } + + return categoryBag; + } + + set { categoryBag = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( !Utility.CollectionEmpty( businessServices ) ) + { + foreach( BusinessService service in businessServices ) + { + service.SerializeMode = value; + } + } + base.SerializeMode = value; + } + + } + } + + public class BusinessEntityExt : UddiCore + { + private BusinessEntity businessEntity; + + public BusinessEntityExt() : this( "" ) + {} + + public BusinessEntityExt( string businessKey ) + { + BusinessEntity.BusinessKey = businessKey; + } + + [XmlElement("businessEntity")] + public BusinessEntity BusinessEntity + { + get + { + if( null == businessEntity ) + { + businessEntity = new BusinessEntity(); + } + + return businessEntity; + } + + set { businessEntity = value; } + } + } + + public class BusinessInfo : UddiCore + { + private string businessKey; + private string name; + private DescriptionCollection descriptions; + private ServiceInfoCollection serviceInfos; + + public BusinessInfo() : this( "", "" ) + {} + + public BusinessInfo( string businessKey, string name ) + { + BusinessKey = businessKey; + Name = name; + } + + [XmlAttribute("businessKey")] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlElement("name")] + public string Name + { + get { return name; } + set { name = value; } + } + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlArray("serviceInfos"), XmlArrayItem("serviceInfo")] + public ServiceInfoCollection ServiceInfos + { + get + { + if( null == serviceInfos ) + { + serviceInfos = new ServiceInfoCollection(); + } + + return serviceInfos; + } + + set { serviceInfos = value; } + } + } + + [XmlRootAttribute("registeredInfo", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class RegisteredInfo : UddiCore + { + private string node; + private bool truncated; + private BusinessInfoCollection businessInfos; + private TModelInfoCollection tModelInfos; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlArray("businessInfos"), XmlArrayItem("businessInfo")] + public BusinessInfoCollection BusinessInfos + { + get + { + if( null == businessInfos ) + { + businessInfos = new BusinessInfoCollection(); + } + + return businessInfos; + } + + set { businessInfos = value; } + } + + [XmlArray("tModelInfos"), XmlArrayItem("tModelInfo")] + public TModelInfoCollection TModelInfos + { + get + { + if( null == tModelInfos ) + { + tModelInfos = new TModelInfoCollection(); + } + + return tModelInfos; + } + + set { tModelInfos = value; } + } + } + + public class BusinessInfoCollection : CollectionBase + { + public BusinessInfo this[int index] + { + get { return (BusinessInfo)List[index]; } + set { List[index] = value; } + } + + public int Add() + { + return List.Add( new BusinessInfo() ); + } + + public int Add( string businessKey, string name ) + { + return List.Add( new BusinessInfo( businessKey, name ) ); + } + + public int Add(BusinessInfo businessInfo) + { + return List.Add(businessInfo); + } + + public void Insert(int index, BusinessInfo value) + { + List.Insert(index, value); + } + + public int IndexOf(BusinessInfo value) + { + return List.IndexOf(value); + } + + public bool Contains(BusinessInfo value) + { + return List.Contains(value); + } + + public void Remove(BusinessInfo value) + { + List.Remove(value); + } + + public void CopyTo(BusinessInfo[] array, int index) + { + List.CopyTo(array, index); + } + + public new BusinessInfoEnumerator GetEnumerator() + { + return new BusinessInfoEnumerator( List.GetEnumerator() ); + } + } + + public sealed class BusinessInfoEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public BusinessInfoEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public BusinessInfo Current + { + get { return ( BusinessInfo ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class BusinessEntityCollection : CollectionBase + { + public BusinessEntity this[int index] + { + get { return (BusinessEntity)List[index]; } + set { List[index] = value; } + } + + public int Add() + { + return List.Add( new BusinessEntity() ); + } + + public int Add( string businessKey ) + { + return List.Add( new BusinessEntity( businessKey ) ); + } + + public int Add( BusinessEntity businessEntity ) + { + return List.Add( businessEntity ); + } + + public void Insert( int index, BusinessEntity value ) + { + List.Insert( index, value ); + } + + public int IndexOf( BusinessEntity value ) + { + return List.IndexOf( value ); + } + + public bool Contains( BusinessEntity value ) + { + return List.Contains( value ); + } + + public void Remove( BusinessEntity value ) + { + List.Remove( value ); + } + + public void CopyTo( BusinessEntity[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new BusinessEntityEnumerator GetEnumerator() + { + return new BusinessEntityEnumerator( List.GetEnumerator() ); + } + } + + public sealed class BusinessEntityEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public BusinessEntityEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public BusinessEntity Current + { + get { return ( BusinessEntity ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class BusinessEntityExtCollection : CollectionBase + { + public BusinessEntityExt this[ int index ] + { + get { return ( BusinessEntityExt)List[index]; } + set { List[ index ] = value; } + } + + public int Add( string businessKey ) + { + return List.Add( new BusinessEntityExt( businessKey ) ); + } + + public int Add( BusinessEntityExt businessEntityExt ) + { + return List.Add( businessEntityExt ); + } + + public void Insert( int index, BusinessEntityExt value ) + { + List.Insert( index, value ); + } + + public int IndexOf( BusinessEntityExt value ) + { + return List.IndexOf( value ); + } + + public bool Contains( BusinessEntityExt value ) + { + return List.Contains( value ); + } + + public void Remove( BusinessEntityExt value ) + { + List.Remove( value ); + } + + public void CopyTo( BusinessEntityExt[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new BusinessEntityExtEnumerator GetEnumerator() + { + return new BusinessEntityExtEnumerator( List.GetEnumerator() ); + } + } + + public sealed class BusinessEntityExtEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public BusinessEntityExtEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public BusinessEntityExt Current + { + get { return ( BusinessEntityExt ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/category.cs b/inetsrv/uddi/source/sdk/category.cs new file mode 100644 index 0000000..188ca19 --- /dev/null +++ b/inetsrv/uddi/source/sdk/category.cs @@ -0,0 +1,579 @@ +using System; +using System.Web; +using System.IO; +using System.Xml; +using System.Xml.Schema; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; + +using Microsoft.Uddi; +using Microsoft.Uddi.Business; +using Microsoft.Uddi.ServiceType; +using Microsoft.Uddi.Service; +using Microsoft.Uddi.Binding; +using Microsoft.Uddi.VersionSupport; + +namespace Microsoft.Uddi.Extensions +{ + public enum RelationshipQualifier + { + root = 1, + parent = 2, + child = 3 + } + + [XmlRoot( "get_relatedCategories", Namespace=Microsoft.Uddi.Extensions.Namespaces.GetRelatedCategories)] + public class GetRelatedCategories : UddiCore + { + private CategoryCollection categories; + + [XmlElement("category")] + public CategoryCollection Categories + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( categories ) ) + { + return null; + } + + if( null == categories ) + { + categories = new CategoryCollection(); + } + + return categories; + } + set + { + categories = value; + } + } + } + + [XmlRoot( "categoryList", Namespace=Microsoft.Uddi.Extensions.Namespaces.GetRelatedCategories)] + public class CategoryList : UddiCore + { + private bool truncated; + private string operatorValue; + private CategoryInfoCollection categoryInfos; + + public CategoryList() + { + truncated = false; + } + + [XmlAttribute( "truncated" )] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlAttribute( "operator" )] + public string Operator + { + get { return operatorValue; } + set { operatorValue = value; } + } + + [XmlElement( "categoryInfo" )] + public CategoryInfoCollection CategoryInfosSerialize + { + get + { + if( null == categoryInfos ) + { + categoryInfos = new CategoryInfoCollection(); + } + + return categoryInfos; + } + set { categoryInfos = value; } + } + } + + [XmlRoot("category", Namespace=Microsoft.Uddi.Extensions.Namespaces.GetRelatedCategories)] + public class CategoryInfo : CategoryValue + { + private CategoryValueCollection roots; + private CategoryValueCollection parents; + private CategoryValueCollection children; + + public CategoryInfo() + {} + + public CategoryInfo( string tmodelkey, string keyvalue ) : base( tmodelkey, keyvalue ) + {} + + [XmlArray( "rootRelationship" ), XmlArrayItem( "categoryValue" )] + public CategoryValueCollection Roots + { + get + { + if( null == roots ) + { + roots = new CategoryValueCollection(); + } + + return roots; + } + set { roots = value; } + } + + [XmlArray( "parentRelationship" ), XmlArrayItem( "categoryValue" )] + public CategoryValueCollection Parents + { + get + { + if( null == parents ) + { + parents = new CategoryValueCollection(); + } + + return parents; + } + set { parents = value; } + } + + [XmlArray( "childRelationship" ), XmlArrayItem( "categoryValue" )] + public CategoryValueCollection Children + { + get + { + if( null == children ) + { + children = new CategoryValueCollection(); + } + + return children; + } + set { children = value; } + } + } + + [XmlInclude( typeof( CategoryInfo ) )] + public class CategoryValue : UddiCore + { + private bool isValid; + private string tModelKey; + private string keyName; + private string keyValue; + private string parentKeyValue; + + public CategoryValue() + {} + + public CategoryValue( string tModelKey, string keyValue ) + { + TModelKey = tModelKey; + KeyValue = keyValue; + } + + public CategoryValue( string keyName, string keyValue, string parentKeyValue, bool isValid ) + { + KeyName = keyName; + KeyValue = keyValue; + ParentKeyValue = parentKeyValue; + IsValid = isValid; + } + + [XmlAttribute( "tModelKey" )] + public string TModelKey + { + get { return tModelKey; } + set { tModelKey = value; } + } + + [XmlAttribute( "keyName" )] + public string KeyName + { + get { return keyName; } + set { keyName = value; } + } + + [XmlAttribute( "keyValue" )] + public string KeyValue + { + get { return keyValue; } + set { keyValue = value; } + } + + [XmlAttribute( "parentKeyValue" )] + public string ParentKeyValue + { + get { return parentKeyValue; } + set { parentKeyValue = value; } + } + + [XmlAttribute( "isValid" )] + public bool IsValid + { + get { return isValid; } + set { isValid = value; } + } + } + + public class Category : UddiCore + { + private string tModelKey; + private string keyValue; + private RelationshipQualifierCollection relationshipQualifiers; + + [XmlElement( "relationshipQualifier" )] + public RelationshipQualifierCollection RelationshipQualifiers + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( relationshipQualifiers ) ) + { + return null; + } + + if( null == relationshipQualifiers ) + { + relationshipQualifiers = new RelationshipQualifierCollection(); + } + + return relationshipQualifiers; + } + set { relationshipQualifiers = value; } + } + + [XmlAttribute( "tModelKey" )] + public string TModelKey + { + get { return tModelKey; } + set { tModelKey = value; } + } + + [XmlAttribute( "keyValue" )] + public string KeyValue + { + get { return keyValue; } + set { keyValue = value; } + } + } + + public class RelationshipQualifierCollection : CollectionBase + { + public RelationshipQualifierCollection() + {} + + public RelationshipQualifier this[int index] + { + get { return (RelationshipQualifier)List[index]; } + set { List[index] = value; } + } + + public int Add( RelationshipQualifier relationshipQualifier ) + { + return List.Add( relationshipQualifier ); + } + + public void Insert( int index, CategoryValue value ) + { + List.Insert(index, value); + } + + public int IndexOf( RelationshipQualifier value ) + { + return List.IndexOf( value ); + } + + public bool Contains( RelationshipQualifier value ) + { + return List.Contains( value ); + } + + public void Remove( RelationshipQualifier value ) + { + List.Remove( value ); + } + + public void CopyTo(RelationshipQualifier[] array, int index) + { + List.CopyTo( array, index ); + } + + public new RelationshipQualifierEnumerator GetEnumerator() + { + return new RelationshipQualifierEnumerator( List.GetEnumerator() ); + } + } + + public sealed class RelationshipQualifierEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public RelationshipQualifierEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public RelationshipQualifier Current + { + get { return ( RelationshipQualifier ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + + public class CategoryValueCollection : CollectionBase + { + public CategoryValueCollection() + {} + + public CategoryValue this[int index] + { + get { return (CategoryValue)List[index]; } + set { List[index] = value; } + } + + public int Add( string keyname, string keyvalue, string parent, bool isvalid ) + { + return List.Add( new CategoryValue( keyname, keyvalue, parent, isvalid ) ); + } + + public int Add(CategoryValue value) + { + return List.Add(value); + } + + public void Insert(int index, CategoryValue value) + { + List.Insert(index, value); + } + + public int IndexOf( CategoryValue value ) + { + return List.IndexOf( value ); + } + + public bool Contains( CategoryValue value ) + { + return List.Contains( value ); + } + + public void Remove( CategoryValue value ) + { + List.Remove( value ); + } + + public void CopyTo(CategoryValue[] array, int index) + { + List.CopyTo( array, index ); + } + + public new CategoryValueEnumerator GetEnumerator() + { + return new CategoryValueEnumerator( List.GetEnumerator() ); + } + } + + public sealed class CategoryValueEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public CategoryValueEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public CategoryValue Current + { + get { return ( CategoryValue ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class CategoryCollection : CollectionBase + { + public CategoryCollection() + {} + + public Category this[int index] + { + get { return (Category)List[index]; } + set { List[index] = value; } + } + + public int Add(Category value) + { + return List.Add(value); + } + + public void Insert(int index, Category value) + { + List.Insert(index, value); + } + + public int IndexOf( Category value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Category value ) + { + return List.Contains( value ); + } + + public void Remove( Category value ) + { + List.Remove( value ); + } + + public void CopyTo(Category[] array, int index) + { + List.CopyTo( array, index ); + } + + public new CategoryEnumerator GetEnumerator() + { + return new CategoryEnumerator( List.GetEnumerator() ); + } + } + + public sealed class CategoryEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public CategoryEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Category Current + { + get { return ( Category ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class CategoryInfoCollection : CollectionBase + { + public CategoryInfoCollection() + {} + + public CategoryInfo this[int index] + { + get { return (CategoryInfo)List[index]; } + set { List[index] = value; } + } + + public int Add(CategoryInfo value) + { + return List.Add(value); + } + + public void Insert(int index, CategoryInfo value) + { + List.Insert(index, value); + } + + public int IndexOf( CategoryInfo value ) + { + return List.IndexOf( value ); + } + + public bool Contains( CategoryInfo value ) + { + return List.Contains( value ); + } + + public void Remove( CategoryInfo value ) + { + List.Remove( value ); + } + + public void CopyTo(CategoryInfo[] array, int index) + { + List.CopyTo( array, index ); + } + + public CategoryInfo[] ToArray() + { + return (CategoryInfo[]) InnerList.ToArray( typeof( CategoryInfo ) ); + } + + public new CategoryInfoEnumerator GetEnumerator() + { + return new CategoryInfoEnumerator( List.GetEnumerator() ); + } + } + + public sealed class CategoryInfoEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public CategoryInfoEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public CategoryInfo Current + { + get { return ( CategoryInfo ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/contact.cs b/inetsrv/uddi/source/sdk/contact.cs new file mode 100644 index 0000000..48d8e6f --- /dev/null +++ b/inetsrv/uddi/source/sdk/contact.cs @@ -0,0 +1,190 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; + +using Microsoft.Uddi; + +namespace Microsoft.Uddi.Business +{ + public class Contact : UddiCore + { + private string useType; + private string personName; + private DescriptionCollection descriptions; + private PhoneCollection phones; + private EmailCollection emails; + private AddressCollection addresses; + + public Contact() : this( "", "" ) + {} + + public Contact( string personName, string useType ) + { + PersonName = personName; + UseType = useType; + } + + [XmlAttribute("useType")] + public string UseType + { + get { return useType; } + set { useType = value; } + } + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlElement("personName")] + public string PersonName + { + get { return personName; } + set { personName = value; } + } + + [XmlElement("phone")] + public PhoneCollection Phones + { + get + { + if( null == phones ) + { + phones = new PhoneCollection(); + } + + return phones; + } + + set { phones = value; } + } + + [XmlElement("email")] + public EmailCollection Emails + { + get + { + if( null == emails ) + { + emails = new EmailCollection(); + } + + return emails; + } + + set { emails = value; } + } + + [XmlElement("address")] + public AddressCollection Addresses + { + get + { + if( null == addresses ) + { + addresses = new AddressCollection(); + } + + return addresses; + } + + set { addresses = value; } + } + } + + public class ContactCollection : CollectionBase + { + public Contact this[ int index ] + { + get { return ( Contact)List[index]; } + set { List[ index ] = value; } + } + + public int Add( string personName ) + { + return List.Add( new Contact( personName, null ) ); + } + + public int Add( string personName, string useType ) + { + return List.Add( new Contact( personName, useType ) ); + } + + public int Add( Contact value ) + { + return List.Add( value ); + } + + public void Insert( int index, Contact value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Contact value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Contact value ) + { + return List.Contains( value ); + } + + public void Remove( Contact value ) + { + List.Remove( value ); + } + + public void CopyTo( Contact[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new ContactEnumerator GetEnumerator() + { + return new ContactEnumerator( List.GetEnumerator() ); + } + } + + public sealed class ContactEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public ContactEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Contact Current + { + get { return ( Contact ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/context.cs b/inetsrv/uddi/source/sdk/context.cs new file mode 100644 index 0000000..e69de29 diff --git a/inetsrv/uddi/source/sdk/coretypes.cs b/inetsrv/uddi/source/sdk/coretypes.cs new file mode 100644 index 0000000..c22dc7f --- /dev/null +++ b/inetsrv/uddi/source/sdk/coretypes.cs @@ -0,0 +1,466 @@ +using System; +using System.IO; +using System.Collections; +using System.Diagnostics; +using System.ComponentModel; +using System.Xml; +using System.Xml.Serialization; +using System.Collections.Specialized; + +using Microsoft.Uddi.VersionSupport; + +namespace Microsoft.Uddi +{ + public enum AuthenticationMode + { + None = 0, + UddiAuthentication = 1, + WindowsAuthentication = 2 + } + + public enum CompletionStatusType + { + [XmlEnum( "status:fromKey_incomplete" )] + FromKeyIncomplete, + [XmlEnum( "status:toKey_incomplete" )] + ToKeyIncomplete, + [XmlEnum( "status:complete" )] + Complete, + } + + public enum DirectionType + { + [XmlEnum( "fromKey" )] + FromKey, + [XmlEnum( "toKey" )] + ToKey + } + + public enum KeyType + { + [XmlEnum( "" )] + Uninitialized, + [XmlEnum( "businessKey" )] + BusinessKey, + [XmlEnum( "tModelKey" )] + TModelKey, + [XmlEnum( "serviceKey" )] + ServiceKey, + [XmlEnum( "bindingKey" )] + BindingKey, + } + + public enum UrlType + { + [XmlEnum( "mailto" )] + Mailto = 1, + [XmlEnum( "http" )] + Http = 2, + [XmlEnum( "https" )] + Https = 3, + [XmlEnum( "ftp" )] + Ftp = 4, + [XmlEnum( "fax" )] + Fax = 5, + [XmlEnum( "phone" )] + Phone = 6, + [XmlEnum( "other" )] + Other = 7, + } + + public class UddiCore + { + private bool serializeMode; + + public UddiCore() + { + serializeMode = false; + } + + // + // This property should be internal virtual, but that will generate a warning CS0679 because the CLR does not support it. + // See (http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q317129) for more information. + // + [XmlIgnore] + public virtual bool SerializeMode + { + get { return serializeMode; } + set { serializeMode = value; } + } + } + + public class UddiMessage : UddiCore + { + private string generic; + + public UddiMessage() + { + generic = UddiVersionSupport.CurrentGeneric; + } + + [XmlAttribute("generic")] + public string Generic + { + get { return generic; } + set { generic = value; } + } + } + + public class UddiSecureMessage : UddiMessage + { + string authInfo; + + [XmlElement( "authInfo" )] + public string AuthInfo + { + get { return authInfo; } + set { authInfo = value; } + } + } + + public class UddiQueryMessage : UddiMessage + { + protected int maxQueryRows; + protected FindQualifierCollection queryFindQualifiers; + + public UddiQueryMessage() + { + maxQueryRows = Constants.DefaultMaxRows; + } + + [XmlAttribute("maxRows")] + public int MaxRows + { + get { return maxQueryRows; } + set { maxQueryRows = value; } + } + + [XmlArray("findQualifiers"), XmlArrayItem("findQualifier")] + public FindQualifierCollection FindQualifiers + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( queryFindQualifiers ) ) + { + return null; + } + + if( null == queryFindQualifiers ) + { + queryFindQualifiers = new FindQualifierCollection(); + } + + return queryFindQualifiers; + } + + set { queryFindQualifiers = value; } + } + } + + public class FindQualifier + { + public static readonly FindQualifier ExactNameMatch = new FindQualifier( "exactNameMatch" ); + public static readonly FindQualifier CaseSensitiveMatch = new FindQualifier( "caseSensitiveMatch" ); + public static readonly FindQualifier SortByNameAsc = new FindQualifier( "sortByNameAsc" ); + public static readonly FindQualifier SortByNameDesc = new FindQualifier( "sortByNameDesc" ); + public static readonly FindQualifier SortByDateAsc = new FindQualifier( "sortByDateAsc" ); + public static readonly FindQualifier SortByDateDesc = new FindQualifier( "sortByDateDesc" ); + public static readonly FindQualifier OrLikeKeys = new FindQualifier( "orLikeKeys" ); + public static readonly FindQualifier OrAllKeys = new FindQualifier( "orAllKeys" ); + public static readonly FindQualifier CombineCategoryBags = new FindQualifier( "combineCategoryBags" ); + public static readonly FindQualifier ServiceSubset = new FindQualifier( "serviceSubset" ); + public static readonly FindQualifier AndAllKeys = new FindQualifier( "andAllKeys" ); + + private string findQualifier; + + public FindQualifier() + {} + + public FindQualifier( string findQualifier ) + { + this.Value = findQualifier; + } + + [XmlText] + public string Value + { + get { return findQualifier; } + set { findQualifier = value; } + } + } + + public class ErrInfo + { + private string errCode; + private string text; + + [XmlAttribute( "errCode" )] + public string ErrCode + { + get { return errCode; } + set { errCode = value; } + } + + [XmlText] + public string Text + { + get { return text; } + set { text = value; } + } + } + + public class Result + { + private KeyType keyType; + private int errNo; + private ErrInfo errInfo; + + public Result() + { + keyType = KeyType.Uninitialized; + errNo = 0; + errInfo = new ErrInfo(); + } + + [XmlAttribute( "keyType" )] + public KeyType KeyType + { + get { return keyType; } + set { keyType = value; } + } + + [XmlAttribute( "errno" )] + public int Errno + { + get { return errNo; } + set { errNo = value; } + } + + [XmlElement( "errInfo" )] + public ErrInfo ErrInfo + { + get{ return errInfo; } + set { errInfo = value; } + } + } + + [XmlRootAttribute("dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class DispositionReport + { + private string node; + private bool truncated; + private ResultCollection results; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlElement("result")] + public ResultCollection Results + { + get + { + if( null == results ) + { + results = new ResultCollection(); + } + + return results; + } + + set { results = value; } + } + } + + internal sealed class Constants + { + public const int DefaultMaxRows = 1000; + + private Constants() + { + // + // Don't let anyone construct an instance of this class. + // + } + } + + internal sealed class Utility + { + internal static bool CollectionEmpty( StringCollection col ) + { + return null == col || 0 == col.Count; + } + + internal static bool CollectionEmpty( CollectionBase col ) + { + return null == col || 0 == col.Count; + } + + internal static bool StringEmpty( string str ) + { + return null == str || 0 == str.Length; + } + + private Utility() + { + // + // Don't let anyone construct an instance of this class. + // + } + } + + public class FindQualifierCollection : CollectionBase, IEnumerator + { + public FindQualifierCollection() + {} + + public FindQualifier this[int index] + { + get { return (FindQualifier)List[index]; } + set { List[index] = value; } + } + + public int Add( string findQualifier ) + { + return List.Add( new FindQualifier( findQualifier ) ); + } + + public int Add( FindQualifier findQualifier ) + { + return List.Add( findQualifier ); + } + + public void Insert(int index, FindQualifier value) + { + List.Insert(index, value); + } + + public int IndexOf(FindQualifier value) + { + return List.IndexOf(value); + } + + public bool Contains(FindQualifier value) + { + return List.Contains(value); + } + + public void Remove(FindQualifier value) + { + List.Remove(value); + } + + public void CopyTo(FindQualifier[] array, int index) + { + InnerList.CopyTo(array, index); + } + + // + // IEnumerator methods + // + public FindQualifier Current + { + get { return ( FindQualifier ) base.GetEnumerator().Current; } + } + + object IEnumerator.Current + { + get{ return base.GetEnumerator().Current; } + } + + public bool MoveNext() + { + return base.GetEnumerator().MoveNext(); + } + + public void Reset() + { + base.GetEnumerator().Reset(); + } + } + + public class ResultCollection : CollectionBase + { + public Result this[int index] + { + get { return (Result)List[index]; } + set { List[index] = value; } + } + + public int Add(Result value) + { + return List.Add(value); + } + + public void Insert(int index, Result value) + { + List.Insert(index, value); + } + + public int IndexOf(Result value) + { + return List.IndexOf(value); + } + + public bool Contains(Result value) + { + return List.Contains(value); + } + + public void Remove(Result value) + { + List.Remove(value); + } + + public void CopyTo(Result[] array, int index) + { + List.CopyTo(array, index); + } + + public new ResultEnumerator GetEnumerator() + { + return new ResultEnumerator( List.GetEnumerator() ); + } + } + + public sealed class ResultEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public ResultEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Result Current + { + get { return ( Result ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/description.cs b/inetsrv/uddi/source/sdk/description.cs new file mode 100644 index 0000000..01209f0 --- /dev/null +++ b/inetsrv/uddi/source/sdk/description.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; + +namespace Microsoft.Uddi +{ + public class Description : UddiCore + { + private string isoLanguageCode; + private string text; + + public Description() : this( "", "" ) + {} + + public Description( string description ) : this( "en", description ) + {} + + public Description( string languageCode, string description ) + { + IsoLanguageCode = languageCode; + Text = description; + } + + [XmlAttribute("xml:lang")] + public string IsoLanguageCode + { + get { return isoLanguageCode; } + set { isoLanguageCode = value; } + } + + [XmlText] + public string Text + { + get { return text; } + set { text = value; } + } + } + + public class DescriptionCollection : CollectionBase + { + public Description this[int index] + { + get { return (Description)List[index]; } + set { List[index] = value; } + } + + public int Add(Description value) + { + return List.Add(value); + } + + public int Add(string value) + { + return List.Add( new Description(value) ); + } + + public int Add(string langCode, string description) + { + return List.Add( new Description(langCode, description) ); + } + + public void Insert(int index, Description value) + { + List.Insert(index, value); + } + + public int IndexOf(Description value) + { + return List.IndexOf(value); + } + + public bool Contains(Description value) + { + return List.Contains(value); + } + + public void Remove(Description value) + { + List.Remove(value); + } + + public void CopyTo(Description[] array, int index) + { + List.CopyTo(array, index); + } + + public new DescriptionEnumerator GetEnumerator() + { + return new DescriptionEnumerator( List.GetEnumerator() ); + } + } + + public sealed class DescriptionEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public DescriptionEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Description Current + { + get { return ( Description ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/discoveryurl.cs b/inetsrv/uddi/source/sdk/discoveryurl.cs new file mode 100644 index 0000000..b675409 --- /dev/null +++ b/inetsrv/uddi/source/sdk/discoveryurl.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; + +using Microsoft.Uddi; + +namespace Microsoft.Uddi.Business +{ + public class DiscoveryUrl : UddiCore + { + private string text; + private string useType; + + public DiscoveryUrl() : this( "", "" ) + {} + + public DiscoveryUrl( string url ) : this( url, "" ) + {} + + public DiscoveryUrl( string url, string useType ) + { + Text = url; + UseType = useType; + } + + [XmlText] + public string Text + { + get { return text; } + set { text = value; } + } + + [XmlAttribute("useType")] + public string UseType + { + get { return useType; } + set { useType = value; } + } + } + + public class DiscoveryUrlCollection : CollectionBase + { + public DiscoveryUrl this[int index] + { + get { return (DiscoveryUrl)List[index]; } + set { List[index] = value; } + } + + public int Add( DiscoveryUrl value ) + { + return List.Add( value ); + } + + public int Add( string strUrl ) + { + return List.Add( new DiscoveryUrl( strUrl ) ); + } + + public int Add( string strUrl, string strUseType ) + { + return List.Add( new DiscoveryUrl( strUrl, strUseType ) ); + } + + public void Insert( int index, DiscoveryUrl value ) + { + List.Insert( index, value ); + } + + public int IndexOf( DiscoveryUrl value ) + { + return List.IndexOf( value ); + } + + public bool Contains( DiscoveryUrl value ) + { + return List.Contains( value ); + } + + public void Remove( DiscoveryUrl value ) + { + List.Remove(value); + } + + public void CopyTo( DiscoveryUrl[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new DiscoveryUrlEnumerator GetEnumerator() + { + return new DiscoveryUrlEnumerator( List.GetEnumerator() ); + } + } + + public sealed class DiscoveryUrlEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public DiscoveryUrlEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public DiscoveryUrl Current + { + get { return ( DiscoveryUrl ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/email.cs b/inetsrv/uddi/source/sdk/email.cs new file mode 100644 index 0000000..3734d9e --- /dev/null +++ b/inetsrv/uddi/source/sdk/email.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; + +using Microsoft.Uddi; + +namespace Microsoft.Uddi.Business +{ + public class Email : UddiCore + { + private string useType; + private string text; + + public Email() : this( "", "" ) + {} + + public Email( string email, string useType ) + { + Text = email; + UseType = useType; + } + + [XmlAttribute("useType")] + public string UseType + { + get { return useType; } + set { useType = value; } + } + + [XmlText()] + public string Text + { + get { return text; } + set { text = value; } + } + } + + public class EmailCollection : CollectionBase + { + public Email this[ int index ] + { + get { return (Email)List[index]; } + set { List[ index ] = value; } + } + + public int Add( Email emailObject ) + { + return List.Add( emailObject ); + } + + public int Add( string email ) + { + return ( Add( email, null ) ); + } + + public int Add( string email, string useType ) + { + return List.Add( new Email( email, useType ) ); + } + + public void Insert( int index, Email value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Email value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Email value ) + { + return List.Contains( value ); + } + + public void Remove( Email value ) + { + List.Remove( value ); + } + + public void CopyTo( Email[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new EmailEnumerator GetEnumerator() + { + return new EmailEnumerator( List.GetEnumerator() ); + } + } + + public sealed class EmailEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public EmailEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Email Current + { + get { return ( Email ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/exception.cs b/inetsrv/uddi/source/sdk/exception.cs new file mode 100644 index 0000000..40a91c5 --- /dev/null +++ b/inetsrv/uddi/source/sdk/exception.cs @@ -0,0 +1,130 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using System.Web.Services.Protocols; + +using Microsoft.Uddi.VersionSupport; + +namespace Microsoft.Uddi +{ + public class UddiException : ApplicationException + { + private DispositionReport dispositionReport; + private bool hasDispositionReportData; + private static XmlSerializer serializer = null; + + public enum ErrorType + { + E_success = 0, + E_nameTooLong = 10020, + E_tooManyOptions = 10030, + E_unrecognizedVersion = 10040, + E_unsupported = 10050, + E_languageError = 10060, + E_authTokenExpired = 10110, + E_authTokenRequired = 10120, + E_operatorMismatch = 10130, + E_userMismatch = 10140, + E_unknownUser = 10150, + E_accountLimitExceeded = 10160, + E_invalidKeyPassed = 10210, + E_invalidURLPassed = 10220, + E_keyRetired = 10310, + E_busy = 10400, + E_fatalError = 10500, + E_invalidCategory = 20000, + E_categorizationNotAllowed = 20100 + } + + + public UddiException( string message ) : base( message ) + { + dispositionReport = null; + hasDispositionReportData = false; + } + + public UddiException( Exception exception ) : base( "", exception ) + { + dispositionReport = null; + hasDispositionReportData = false; + + } + + public UddiException( SoapException soapException ) : base( "", soapException ) + { + dispositionReport = null; + hasDispositionReportData = false; + + // + // The soap exception passed in SHOULD contain a disposition report. + // Deserialize it into an object and use the error number in this exception + // + if( false == Utility.StringEmpty( soapException.Detail.InnerXml ) ) + { + // + // Translate the XML into the current version. + // + string dispositionReportXml = UddiVersionSupport.Translate( soapException.Detail.InnerXml, UddiVersionSupport.CurrentVersion ); + + StringReader reader = new StringReader( dispositionReportXml ); + if( null == serializer ) + { + serializer = new XmlSerializer( typeof( DispositionReport ) ); + } + + dispositionReport = ( DispositionReport ) serializer.Deserialize( reader ); + reader.Close(); + } + + hasDispositionReportData = ( null != dispositionReport )&& + ( null != dispositionReport.Results ) && + ( dispositionReport.Results.Count > 0 ); + } + + // + // This property makes what we expect to be a commonly used piece of information more visible. + // + public ErrorType Type + { + get + { + if( true == hasDispositionReportData ) + { + // + // Only return the first result, this is the most common case. The use can access the + // full DispositionReport object if they are interested in the full results. + // + return ( ErrorType )dispositionReport.Results[0].Errno; + } + else + { + return ErrorType.E_fatalError; + } + } + } + + public override string Message + { + get + { + if( true == hasDispositionReportData ) + { + // + // Only return the first result, this is the most common case. The use can access the + // full DispositionReport object if they are interested in the full results. + // + return dispositionReport.Results[0].ErrInfo.Text; + } + else + { + return InnerException.Message; + } + } + } + + public DispositionReport DispositionReport + { + get { return dispositionReport; } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/extensions.cs b/inetsrv/uddi/source/sdk/extensions.cs new file mode 100644 index 0000000..32dcdfb --- /dev/null +++ b/inetsrv/uddi/source/sdk/extensions.cs @@ -0,0 +1,28 @@ +using System; +using System.Web; +using System.IO; +using System.Xml; +using System.Xml.Schema; +using System.Collections; +using System.Data.SqlClient; +using System.Xml.Serialization; + +using Microsoft.Uddi; + +namespace Microsoft.Uddi.Extensions +{ + // + // All Extension namespaces should go in here + // + public sealed class Namespaces + { + public const string GetRelatedCategories = "urn:uddi-microsoft-com:api_v2_extensions"; + + private Namespaces() + { + // + // Don't let anyone construct an instance of this class + // + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/find.cs b/inetsrv/uddi/source/sdk/find.cs new file mode 100644 index 0000000..e69de29 diff --git a/inetsrv/uddi/source/sdk/keyedreference.cs b/inetsrv/uddi/source/sdk/keyedreference.cs new file mode 100644 index 0000000..c0dafd2 --- /dev/null +++ b/inetsrv/uddi/source/sdk/keyedreference.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; + +namespace Microsoft.Uddi +{ + public class KeyedReference : UddiCore + { + private string tModelKey; + private string keyName; + private string keyValue; + + public KeyedReference() : this( "", "", "" ) + {} + + public KeyedReference(string keyName, string keyValue) : this( keyName, keyValue, "" ) + {} + + public KeyedReference(string keyName, string keyValue, string tModelKey ) + { + KeyName = keyName; + KeyValue = keyValue; + TModelKey = tModelKey; + } + + [XmlAttribute("tModelKey")] + public string TModelKey + { + get { return tModelKey; } + set { tModelKey = value; } + } + + [XmlAttribute("keyName")] + public string KeyName + { + get { return keyName; } + set { keyName = value; } + } + + [XmlAttribute("keyValue")] + public string KeyValue + { + get { return keyValue; } + set { keyValue = value; } + } + } + + public class KeyedReferenceCollection : CollectionBase + { + public KeyedReference this[int index] + { + get { return (KeyedReference)List[index]; } + set { List[index] = value; } + } + + public int Add(KeyedReference value) + { + return List.Add(value); + } + + public int Add( string name, string value ) + { + return List.Add( new KeyedReference( name, value ) ); + } + + public int Add( string name, string value, string key ) + { + return List.Add( new KeyedReference( name, value, key ) ); + } + + public void Insert(int index, KeyedReference value) + { + List.Insert(index, value); + } + + public int IndexOf(KeyedReference value) + { + return List.IndexOf(value); + } + + public bool Contains(KeyedReference value) + { + return List.Contains(value); + } + + public void Remove(KeyedReference value) + { + List.Remove(value); + } + + public void CopyTo(KeyedReference[] array, int index) + { + InnerList.CopyTo(array, index); + } + + public new KeyedReferenceEnumerator GetEnumerator() + { + return new KeyedReferenceEnumerator( List.GetEnumerator() ); + } + } + + public sealed class KeyedReferenceEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public KeyedReferenceEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public KeyedReference Current + { + get { return ( KeyedReference ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/makefile b/inetsrv/uddi/source/sdk/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/sdk/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/sdk/makefile.inc b/inetsrv/uddi/source/sdk/makefile.inc new file mode 100644 index 0000000..9c9da33 --- /dev/null +++ b/inetsrv/uddi/source/sdk/makefile.inc @@ -0,0 +1,2 @@ +foo.cs: + ..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs diff --git a/inetsrv/uddi/source/sdk/name.cs b/inetsrv/uddi/source/sdk/name.cs new file mode 100644 index 0000000..be12a66 --- /dev/null +++ b/inetsrv/uddi/source/sdk/name.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; + +namespace Microsoft.Uddi +{ + public class Name : UddiCore + { + private string isoLanguageCode; + private string text; + + public Name() : this( "", "" ) + {} + + public Name( string name ) : this( "en", name ) + {} + + public Name( string languageCode, string name ) + { + IsoLanguageCode = languageCode; + Text = name; + } + + [ XmlAttribute( "xml:lang" ) ] + public string IsoLanguageCode + { + get { return isoLanguageCode; } + set { isoLanguageCode = value; } + } + + [ XmlText ] + public string Text + { + get { return text; } + set { text = value; } + } + } + + public class NameCollection : CollectionBase + { + public Name this[ int index ] + { + get { return (Name)List[ index ]; } + set { List[ index ] = value; } + } + + public int Add( Name value ) + { + return List.Add( value ); + } + + public int Add( string value ) + { + return List.Add( new Name( value ) ); + } + + public int Add( string langCode, string name ) + { + return List.Add( new Name( langCode, name ) ); + } + + public void Insert( int index, Name value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Name value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Name value ) + { + return List.Contains( value ); + } + + public void Remove( Name value ) + { + List.Remove( value ); + } + + public void CopyTo( Name[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new NameEnumerator GetEnumerator() + { + return new NameEnumerator( List.GetEnumerator() ); + } + } + + public sealed class NameEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public NameEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Name Current + { + get { return ( Name ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/phone.cs b/inetsrv/uddi/source/sdk/phone.cs new file mode 100644 index 0000000..54d2d0b --- /dev/null +++ b/inetsrv/uddi/source/sdk/phone.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.Xml.Serialization; + +namespace Microsoft.Uddi.Business +{ + public class Phone : UddiCore + { + private string text; + private string useType; + + public Phone() : this( "", "" ) + {} + + public Phone(string phone, string useType) + { + Text = phone; + UseType = useType; + } + + [XmlText] + public string Text + { + get { return text; } + set { text = value; } + } + + [XmlAttribute("useType")] + public string UseType + { + get { return useType; } + set { useType = value; } + } + } + + public class PhoneCollection : CollectionBase + { + public Phone this[int index] + { + get { return ( Phone )List[ index]; } + set { List[ index ] = value; } + } + + public int Add( Phone phoneObject ) + { + return List.Add( phoneObject ); + } + + public int Add( string phone ) + { + return( Add( phone, null ) ); + } + + public int Add( string phone, string useType ) + { + return List.Add( new Phone( phone, useType ) ); + } + + public void Insert( int index, Phone value ) + { + List.Insert( index, value ); + } + + public int IndexOf( Phone value ) + { + return List.IndexOf( value ); + } + + public bool Contains( Phone value ) + { + return List.Contains( value ); + } + + public void Remove( Phone value ) + { + List.Remove( value ); + } + + public void CopyTo( Phone[] array, int index ) + { + List.CopyTo( array, index ); + } + + public new PhoneEnumerator GetEnumerator() + { + return new PhoneEnumerator( List.GetEnumerator() ); + } + } + + public sealed class PhoneEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public PhoneEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public Phone Current + { + get { return ( Phone ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/sdk.csproj b/inetsrv/uddi/source/sdk/sdk.csproj new file mode 100644 index 0000000..8cc4d9b --- /dev/null +++ b/inetsrv/uddi/source/sdk/sdk.csproj @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/sdk/sdk.snk b/inetsrv/uddi/source/sdk/sdk.snk new file mode 100644 index 0000000..2fba77b Binary files /dev/null and b/inetsrv/uddi/source/sdk/sdk.snk differ diff --git a/inetsrv/uddi/source/sdk/service.cs b/inetsrv/uddi/source/sdk/service.cs new file mode 100644 index 0000000..fd35650 --- /dev/null +++ b/inetsrv/uddi/source/sdk/service.cs @@ -0,0 +1,577 @@ +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Diagnostics; +using System.ComponentModel; +using System.Xml.Serialization; + +using Microsoft.Uddi; +using Microsoft.Uddi.Binding; +using Microsoft.Uddi.Service; +using Microsoft.Uddi.ServiceType; + +namespace Microsoft.Uddi.Service +{ + [XmlRootAttribute("delete_service", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class DeleteService : UddiSecureMessage + { + private StringCollection serviceKeys; + + [XmlElement("serviceKey")] + public StringCollection ServiceKeys + { + get + { + if( null == serviceKeys ) + { + serviceKeys = new StringCollection(); + } + + return serviceKeys; + } + + set { serviceKeys = value; } + } + } + + [XmlRootAttribute("find_service", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class FindService : UddiQueryMessage + { + private string businessKey; + private NameCollection names; + private KeyedReferenceCollection categoryBag; + private StringCollection tModelKeys; + + [XmlAttribute("businessKey")] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlElement("name")] + public NameCollection Names + { + get + { + if( null == names ) + { + names = new NameCollection(); + } + + return names; + } + + set { names = value; } + } + + [XmlArray("categoryBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection CategoryBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( categoryBag ) ) + { + return null; + } + + if( null == categoryBag ) + { + categoryBag = new KeyedReferenceCollection(); + } + + return categoryBag; + } + + set { categoryBag = value; } + } + + [XmlArray("tModelBag"), XmlArrayItem("tModelKey")] + public StringCollection TModelKeys + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( tModelKeys ) ) + { + return null; + } + + if( null == tModelKeys ) + { + tModelKeys = new StringCollection(); + } + + return tModelKeys; + } + + set { tModelKeys = value; } + } + } + + [XmlRootAttribute("get_serviceDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class GetServiceDetail : UddiMessage + { + private StringCollection serviceKeys; + + [XmlElement("serviceKey")] + public StringCollection ServiceKeys + { + get + { + if( null == serviceKeys ) + { + serviceKeys = new StringCollection(); + } + + return serviceKeys; + } + + set { serviceKeys = value; } + } + } + + [XmlRootAttribute("save_service", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class SaveService : UddiSecureMessage + { + private BusinessServiceCollection businessServices; + + [XmlElement("businessService")] + public BusinessServiceCollection BusinessServices + { + get + { + if( null == businessServices ) + { + businessServices = new BusinessServiceCollection(); + } + + return businessServices; + } + + set { businessServices = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( false == Utility.CollectionEmpty( businessServices ) ) + { + foreach( BusinessService service in businessServices ) + { + service.SerializeMode = value; + } + } + base.SerializeMode = value; + } + } + } + + [XmlRootAttribute("serviceDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class ServiceDetail : UddiCore + { + private string node; + private bool truncated; + private BusinessServiceCollection businessServices; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlElement("businessService")] + public BusinessServiceCollection BusinessServices + { + get + { + if( null == businessServices ) + { + businessServices = new BusinessServiceCollection(); + } + + return businessServices; + } + + set { businessServices = value; } + } + } + + [XmlRootAttribute("serviceList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class ServiceList : UddiCore + { + private string node; + private bool truncated; + private ServiceInfoCollection serviceInfos; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlArray("serviceInfos"), XmlArrayItem("serviceInfo")] + public ServiceInfoCollection ServiceInfos + { + get + { + if( null == serviceInfos ) + { + serviceInfos = new ServiceInfoCollection(); + } + + return serviceInfos; + } + + set { serviceInfos = value; } + } + } + + public class BusinessService : UddiCore + { + private string serviceKey; + private string businessKey; + private NameCollection names; + private DescriptionCollection descriptions; + private BindingTemplateCollection bindingTemplates; + private KeyedReferenceCollection categoryBag; + + public BusinessService() : this( "", "" ) + {} + + public BusinessService( string businessKey ) : this( businessKey, "" ) + {} + + public BusinessService(string businessKey, string serviceKey ) + { + BusinessKey = businessKey; + ServiceKey = serviceKey; + } + + [XmlAttribute("serviceKey")] + public string ServiceKey + { + get { return serviceKey; } + set { serviceKey = value; } + } + + [XmlAttribute("businessKey")] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlElement("name")] + public NameCollection Names + { + get + { + if( null == names ) + { + names = new NameCollection(); + } + + return names; + } + + set { names = value; } + } + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( descriptions ) ) + { + return null; + } + + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlArray("bindingTemplates"), XmlArrayItem("bindingTemplate")] + public BindingTemplateCollection BindingTemplates + { + get + { + if( null == bindingTemplates ) + { + bindingTemplates = new BindingTemplateCollection(); + } + + return bindingTemplates; + } + + set { bindingTemplates = value; } + } + + [XmlArray("categoryBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection CategoryBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( categoryBag ) ) + { + return null; + } + + if( null == categoryBag ) + { + categoryBag = new KeyedReferenceCollection(); + } + + return categoryBag; + } + + set { categoryBag = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( false == Utility.CollectionEmpty( bindingTemplates ) ) + { + foreach( BindingTemplate binding in bindingTemplates ) + { + binding.SerializeMode = value; + } + } + base.SerializeMode = value; + } + } + } + + public class ServiceInfo : UddiCore + { + private string serviceKey; + private string businessKey; + private string name; + + public ServiceInfo() + {} + + public ServiceInfo( string businessKey, string serviceKey, string name ) + { + BusinessKey = businessKey; + ServiceKey = serviceKey; + Name = name; + } + + [XmlAttribute("serviceKey")] + public string ServiceKey + { + get { return serviceKey; } + set { serviceKey = value; } + } + + [XmlAttribute("businessKey")] + public string BusinessKey + { + get { return businessKey; } + set { businessKey = value; } + } + + [XmlElement("name")] + public string Name + { + get { return name; } + set { name = value; } + } + } + + public class BusinessServiceCollection : CollectionBase + { + public BusinessService this[int index] + { + get { return (BusinessService)List[index]; } + set { List[index] = value; } + } + + public int Add(BusinessService businessService) + { + return List.Add(businessService); + } + + public int Add( string businessKey ) + { + return List.Add( new BusinessService( businessKey ) ); + } + + public int Add( string businessKey, string serviceKey ) + { + return List.Add( new BusinessService( businessKey, serviceKey ) ); + } + + public void Insert(int index, BusinessService value) + { + List.Insert(index, value); + } + + public int IndexOf(BusinessService value) + { + return List.IndexOf(value); + } + + public bool Contains(BusinessService value) + { + return List.Contains(value); + } + + public void Remove(BusinessService value) + { + List.Remove(value); + } + + public void CopyTo(BusinessService[] array, int index) + { + List.CopyTo(array, index); + } + + public new BusinessServiceEnumerator GetEnumerator() + { + return new BusinessServiceEnumerator( List.GetEnumerator() ); + } + } + + public sealed class BusinessServiceEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public BusinessServiceEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public BusinessService Current + { + get { return ( BusinessService ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class ServiceInfoCollection : CollectionBase + { + public ServiceInfo this[int index] + { + get { return (ServiceInfo)List[index]; } + set { List[index] = value; } + } + + public int Add( string businessKey, string serviceKey, string name ) + { + return List.Add( new ServiceInfo( businessKey, serviceKey, name ) ); + } + + public int Add(ServiceInfo serviceInfo) + { + return List.Add(serviceInfo); + } + + public void Insert(int index, ServiceInfo value) + { + List.Insert(index, value); + } + + public int IndexOf(ServiceInfo value) + { + return List.IndexOf(value); + } + + public bool Contains(ServiceInfo value) + { + return List.Contains(value); + } + + public void Remove(ServiceInfo value) + { + List.Remove(value); + } + + public void CopyTo(ServiceInfo[] array, int index) + { + List.CopyTo(array, index); + } + + public new ServiceInfoEnumerator GetEnumerator() + { + return new ServiceInfoEnumerator( List.GetEnumerator() ); + } + } + + public sealed class ServiceInfoEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public ServiceInfoEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public ServiceInfo Current + { + get { return ( ServiceInfo ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/sources b/inetsrv/uddi/source/sdk/sources new file mode 100644 index 0000000..0fd535e --- /dev/null +++ b/inetsrv/uddi/source/sdk/sources @@ -0,0 +1,38 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=microsoft.uddi +TARGETPATH=obj +TARGETTYPE=DYNLINK +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES=system.dll, system.data.dll, system.web.dll, system.web.services.dll, system.xml.dll + +SOURCES = \ + address.cs \ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + assertion.cs \ + authentication.cs \ + binding.cs \ + business.cs \ + contact.cs \ + coretypes.cs \ + description.cs \ + discoveryurl.cs \ + email.cs \ + exception.cs \ + keyedreference.cs \ + name.cs \ + phone.cs \ + service.cs \ + tmodel.cs \ + uddioperator.cs \ + uddiweb.cs \ + versionsupport.cs \ + category.cs \ + extensions.cs + diff --git a/inetsrv/uddi/source/sdk/tmodel.cs b/inetsrv/uddi/source/sdk/tmodel.cs new file mode 100644 index 0000000..a3e6df7 --- /dev/null +++ b/inetsrv/uddi/source/sdk/tmodel.cs @@ -0,0 +1,903 @@ +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Diagnostics; +using System.ComponentModel; +using System.Xml.Serialization; + +using Microsoft.Uddi; + +namespace Microsoft.Uddi.ServiceType +{ + [XmlRootAttribute("delete_tModel", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class DeleteTModel : UddiSecureMessage + { + private StringCollection tModelKeys; + + [XmlElement("tModelKey")] + public StringCollection TModelKeys + { + get + { + if( null == tModelKeys ) + { + tModelKeys = new StringCollection(); + } + + return tModelKeys; + } + + set { tModelKeys = value; } + } + } + + [XmlRootAttribute("find_tModel", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class FindTModel : UddiQueryMessage + { + private string name; + private KeyedReferenceCollection identifierBag; + private KeyedReferenceCollection categoryBag; + + [XmlElement("name")] + public string Name + { + get { return name; } + set { name = value; } + } + + [XmlArray("identifierBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection IdentifierBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( identifierBag ) ) + { + return null; + } + + if( null == identifierBag ) + { + identifierBag = new KeyedReferenceCollection(); + } + + return identifierBag; + } + + set { identifierBag = value; } + } + + [XmlArray("categoryBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection CategoryBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( categoryBag ) ) + { + return null; + } + + if( null == categoryBag ) + { + categoryBag = new KeyedReferenceCollection(); + } + + return categoryBag; + } + + set { categoryBag = value; } + } + } + + [XmlRootAttribute("get_tModelDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class GetTModelDetail : UddiMessage + { + private StringCollection tModelKeys; + + [XmlElement("tModelKey")] + public StringCollection TModelKeys + { + get + { + if( null == tModelKeys ) + { + tModelKeys = new StringCollection(); + } + + return tModelKeys; + } + + set { tModelKeys = value; } + } + } + + [XmlRootAttribute("save_tModel", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class SaveTModel : UddiSecureMessage + { + private TModelCollection tModels; + private StringCollection uploadRegisters; + + [XmlElement("tModel")] + public TModelCollection TModels + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( tModels ) ) + { + return null; + } + + if( null == tModels ) + { + tModels = new TModelCollection(); + } + + return tModels; + } + + set { tModels = value; } + } + + [XmlElement("uploadRegister")] + public StringCollection UploadRegisters + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( uploadRegisters ) ) + { + return null; + } + + if( null == uploadRegisters ) + { + uploadRegisters = new StringCollection(); + } + + return uploadRegisters; + } + set { uploadRegisters = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( false == Utility.CollectionEmpty( tModels ) ) + { + foreach( TModel tModel in tModels ) + { + tModel.SerializeMode = value; + } + } + base.SerializeMode = value; + } + } + } + + [XmlRootAttribute("tModelDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class TModelDetail : UddiCore + { + private string node; + private bool truncated; + private TModelCollection tModels; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlElement("tModel")] + public TModelCollection TModels + { + get + { + if( null == tModels ) + { + tModels = new TModelCollection(); + } + + return tModels; + } + + set { tModels = value; } + } + } + + [XmlRootAttribute("tModelList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)] + public class TModelList : UddiCore + { + private string node; + private bool truncated; + private TModelInfoCollection tModelInfos; + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("truncated")] + public bool Truncated + { + get { return truncated; } + set { truncated = value; } + } + + [XmlArray("tModelInfos"), XmlArrayItem("tModelInfo")] + public TModelInfoCollection TModelInfos + { + get + { + if( null == tModelInfos ) + { + tModelInfos = new TModelInfoCollection(); + } + + return tModelInfos; + } + + set { tModelInfos = value; } + } + } + + public class TModel : UddiCore + { + private string tModelKey; + private string node; + private string authorizedName; + private string name; + private OverviewDoc overviewDoc; + private DescriptionCollection descriptions; + private KeyedReferenceCollection identifierBag; + private KeyedReferenceCollection categoryBag; + + public TModel() : this( "" ) + {} + + public TModel( string tModelKey ) + { + TModelKey = tModelKey; + } + + [XmlAttribute("tModelKey")] + public string TModelKey + { + get { return tModelKey; } + set { tModelKey = value; } + } + + [XmlAttribute("operator")] + public string Operator + { + get { return node; } + set { node = value; } + } + + [XmlAttribute("authorizedName")] + public string AuthorizedName + { + get { return authorizedName; } + set { authorizedName = value; } + } + + [XmlElement("name")] + public string Name + { + get { return name; } + set { name = value; } + } + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( descriptions ) ) + { + return null; + } + + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlElement("overviewDoc")] + public OverviewDoc OverviewDoc + { + get + { + if( true == SerializeMode && + ( null == overviewDoc || + true == Utility.StringEmpty( overviewDoc.OverviewUrl )&& + true == Utility.CollectionEmpty( overviewDoc.Descriptions ) + ) ) + { + return null; + } + + if( null == overviewDoc ) + { + overviewDoc = new OverviewDoc(); + } + + return overviewDoc; + } + + set { overviewDoc = value; } + } + + [XmlArray("identifierBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection IdentifierBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( identifierBag ) ) + { + return null; + } + + if( null == identifierBag ) + { + identifierBag = new KeyedReferenceCollection(); + } + + return identifierBag; + } + + set { identifierBag = value; } + } + + [XmlArray("categoryBag"), XmlArrayItem("keyedReference")] + public KeyedReferenceCollection CategoryBag + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( categoryBag ) ) + { + return null; + } + + if( null == categoryBag ) + { + categoryBag = new KeyedReferenceCollection(); + } + + return categoryBag; + } + + set { categoryBag = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( null != overviewDoc ) + { + overviewDoc.SerializeMode = value; + } + base.SerializeMode = value; + } + } + } + + public class TModelInstanceDetail : UddiCore + { + private TModelInstanceInfoCollection tModelInstanceInfos; + + [XmlElement("tModelInstanceInfo")] + public TModelInstanceInfoCollection TModelInstanceInfos + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( tModelInstanceInfos ) ) + { + return null; + } + + if( null == tModelInstanceInfos ) + { + tModelInstanceInfos = new TModelInstanceInfoCollection(); + } + + return tModelInstanceInfos; + } + + set { tModelInstanceInfos = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( false == Utility.CollectionEmpty( tModelInstanceInfos ) ) + { + foreach( TModelInstanceInfo instanceInfo in tModelInstanceInfos ) + { + instanceInfo.SerializeMode = value; + } + } + + base.SerializeMode = value; + } + } + } + + public class TModelInstanceInfo : UddiCore + { + private string tModelKey; + private DescriptionCollection descriptions; + private InstanceDetail instanceDetails; + + [XmlAttribute("tModelKey")] + public string TModelKey + { + get { return tModelKey; } + set { tModelKey = value; } + } + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( descriptions ) ) + { + return null; + } + + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlElement("instanceDetails")] + public InstanceDetail InstanceDetail + { + get + { + if( true == SerializeMode && + ( null == instanceDetails || instanceDetails.IsEmpty() ) ) + { + return null; + } + + if( null == instanceDetails ) + { + instanceDetails = new InstanceDetail(); + } + + return instanceDetails; + } + + set { instanceDetails = value; } + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( null != instanceDetails ) + { + instanceDetails.SerializeMode = value; + } + base.SerializeMode = value; + } + } + } + + public class TModelInfo : UddiCore + { + private string tModelKey; + private string name; + + public TModelInfo() : this( "", "" ) + {} + + public TModelInfo( string tModelKey, string name ) + { + TModelKey = tModelKey; + Name = name; + } + + [XmlAttribute("tModelKey")] + public string TModelKey + { + get { return tModelKey; } + set { tModelKey = value; } + } + + [XmlElement("name")] + public string Name + { + get { return name; } + set { name = value; } + } + } + + public class InstanceDetail : UddiCore + { + private string instanceParms; + private DescriptionCollection descriptions; + private OverviewDoc overviewDoc; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( true == SerializeMode && + true == Utility.CollectionEmpty( descriptions ) ) + { + return null; + } + + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlElement("overviewDoc")] + public OverviewDoc OverviewDoc + { + get + { + if( true == SerializeMode && + ( null == overviewDoc || overviewDoc.IsEmpty() ) ) + { + return null; + } + + if( null == overviewDoc ) + { + overviewDoc = new OverviewDoc(); + } + + return overviewDoc; + } + + set { overviewDoc = value; } + } + + [XmlElement("instanceParms")] + public string InstanceParm + { + get { return instanceParms; } + set { instanceParms = value; } + } + + internal bool IsEmpty() + { + return Utility.CollectionEmpty( descriptions ) && + Utility.StringEmpty( instanceParms ) && + ( null == overviewDoc || overviewDoc.IsEmpty() ); + } + + public override bool SerializeMode + { + get { return base.SerializeMode; } + set + { + if( null != overviewDoc ) + { + overviewDoc.SerializeMode = value; + } + base.SerializeMode = value; + } + } + } + + public class OverviewDoc : UddiCore + { + private string overviewUrl; + private DescriptionCollection descriptions; + + [XmlElement("description")] + public DescriptionCollection Descriptions + { + get + { + if( true == SerializeMode && + Utility.CollectionEmpty( descriptions ) ) + { + return null; + } + + if( null == descriptions ) + { + descriptions = new DescriptionCollection(); + } + + return descriptions; + } + + set { descriptions = value; } + } + + [XmlElement("overviewURL")] + public string OverviewUrl + { + get { return overviewUrl; } + set { overviewUrl = value; } + } + + internal bool IsEmpty() + { + return Utility.StringEmpty( overviewUrl ) && + Utility.CollectionEmpty( descriptions ); + } + } + + public class TModelCollection : CollectionBase + { + public TModel this[int index] + { + get { return (TModel)List[index]; } + set { List[index] = value; } + } + + public int Add(TModel tModel) + { + return List.Add(tModel); + } + + public int Add( string tModelKey ) + { + return List.Add( new TModel( tModelKey ) ); + } + + public void Insert(int index, TModel value) + { + List.Insert(index, value); + } + + public int IndexOf(TModel value) + { + return List.IndexOf(value); + } + + public bool Contains(TModel value) + { + return List.Contains(value); + } + + public void Remove(TModel value) + { + List.Remove(value); + } + + public void CopyTo(TModel[] array, int index) + { + InnerList.CopyTo(array, index); + } + + public new TModelEnumerator GetEnumerator() + { + return new TModelEnumerator( List.GetEnumerator() ); + } + } + + public sealed class TModelEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public TModelEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public TModel Current + { + get { return ( TModel ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class TModelInfoCollection : CollectionBase + { + public TModelInfo this[int index] + { + get { return (TModelInfo)List[index]; } + set { List[index] = value; } + } + + public int Add( string tModelKey, string name ) + { + return List.Add( new TModelInfo( tModelKey, name ) ); + } + + public int Add(TModelInfo tModelInfo) + { + return List.Add(tModelInfo); + } + + public void Insert(int index, TModelInfo value) + { + List.Insert(index, value); + } + + public int IndexOf(TModelInfo value) + { + return List.IndexOf(value); + } + + public bool Contains(TModelInfo value) + { + return List.Contains(value); + } + + public void Remove(TModelInfo value) + { + List.Remove(value); + } + + public void CopyTo(TModelInfo[] array, int index) + { + List.CopyTo(array, index); + } + + public new TModelInfoEnumerator GetEnumerator() + { + return new TModelInfoEnumerator( List.GetEnumerator() ); + } + } + + public sealed class TModelInfoEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public TModelInfoEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public TModelInfo Current + { + get { return ( TModelInfo ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } + + public class TModelInstanceInfoCollection : CollectionBase + { + public TModelInstanceInfo this[int index] + { + get { return (TModelInstanceInfo)List[index]; } + set { List[index] = value; } + } + + public int Add(TModelInstanceInfo tModelInstanceInfo) + { + return List.Add(tModelInstanceInfo); + } + + public void Insert( int index, TModelInstanceInfo tModelInstanceInfo ) + { + List.Insert(index, tModelInstanceInfo ); + } + + public int IndexOf(TModelInstanceInfo value) + { + return List.IndexOf(value); + } + + public bool Contains(TModelInstanceInfo value) + { + return List.Contains(value); + } + + public void Remove(TModelInstanceInfo value) + { + List.Remove(value); + } + + public void CopyTo(TModelInstanceInfo[] array, int index) + { + List.CopyTo(array, index); + } + + public new TModelInstanceInfoEnumerator GetEnumerator() + { + return new TModelInstanceInfoEnumerator( List.GetEnumerator() ); + } + } + + public sealed class TModelInstanceInfoEnumerator : IEnumerator + { + private IEnumerator enumerator; + + public TModelInstanceInfoEnumerator( IEnumerator enumerator ) + { + this.enumerator = enumerator; + } + + public TModelInstanceInfo Current + { + get { return ( TModelInstanceInfo ) enumerator.Current; } + } + + object IEnumerator.Current + { + get{ return enumerator.Current; } + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + } +} diff --git a/inetsrv/uddi/source/sdk/types.cs b/inetsrv/uddi/source/sdk/types.cs new file mode 100644 index 0000000..e69de29 diff --git a/inetsrv/uddi/source/sdk/uddioperator.cs b/inetsrv/uddi/source/sdk/uddioperator.cs new file mode 100644 index 0000000..c5199cf --- /dev/null +++ b/inetsrv/uddi/source/sdk/uddioperator.cs @@ -0,0 +1,772 @@ +using System; +using System.IO; +using System.Diagnostics; +using System.Net; +using System.Web.Services; +using System.Web.Services.Description; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; +using System.Xml.Xsl; +using System.Xml.XPath; +using System.Text; + +using Microsoft.Uddi; +using Microsoft.Uddi.Authentication; +using Microsoft.Uddi.VersionSupport; +using Microsoft.Uddi.Binding; +using Microsoft.Uddi.Business; +using Microsoft.Uddi.Service; +using Microsoft.Uddi.ServiceType; +using Microsoft.Uddi.Extensions; +using Microsoft.Uddi.Web; + +namespace Microsoft.Uddi +{ + /// + /// UddiOperator is the class the user will use to send their Uddi messages. + /// + public class UddiOperator + { + private SoapClient soapClient; + private AuthenticationMode authenticationMode; + private bool refreshAuthToken; + + public UddiOperator() + { + soapClient = new SoapClient(); + } + + public string Url + { + get { return soapClient.Url; } + set { soapClient.Url = value; } + } + + public SoapHttpClientProtocol HttpClient + { + get { return ( SoapHttpClientProtocol ) soapClient; } + } + + public bool RefreshAuthToken + { + get { return refreshAuthToken; } + set { refreshAuthToken = value; } + } + + public UddiVersion Version + { + get { return soapClient.Version; } + set { soapClient.Version = value; } + } + + public AuthenticationMode AuthenticationMode + { + get { return authenticationMode; } + set + { + authenticationMode = value; + + if( Microsoft.Uddi.AuthenticationMode.WindowsAuthentication == authenticationMode ) + { + soapClient.Credentials = CredentialCache.DefaultCredentials; + soapClient.PreAuthenticate = true; + } + } + } + + ///////////////////////////////////////////////////////////////////////////////////////////////// + /// Uddi Authentication API messages + ///////////////////////////////////////////////////////////////////////////////////////////////// + public DispositionReport Send( DiscardAuthToken discardAuthToken, AuthToken authToken ) + { + if( discardAuthToken.AuthInfo != authToken.AuthInfo ) + { + discardAuthToken.AuthInfo = authToken.AuthInfo; + } + + return soapClient.DiscardAuthToken( discardAuthToken ); + } + + public AuthToken Send( GetAuthToken getAuthToken) + { + AuthToken authToken = soapClient.GetAuthToken( getAuthToken ); + authToken.OriginatingAuthToken = getAuthToken; + + return authToken; + } + + ///////////////////////////////////////////////////////////////////////////////////////////////// + /// Uddi Publish API messages + ///////////////////////////////////////////////////////////////////////////////////////////////// + public RegisteredInfo Send( GetRegisteredInfo getRegisteredInfo, AuthToken authToken ) + { + SetAuthToken( getRegisteredInfo, authToken ); + + try + { + return soapClient.GetRegisteredInfo( getRegisteredInfo ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.GetRegisteredInfo( getRegisteredInfo ); + } + } + + public DispositionReport Send( DeleteBinding deleteBinding, AuthToken authToken ) + { + SetAuthToken( deleteBinding, authToken ); + + try + { + return soapClient.DeleteBinding( deleteBinding ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.DeleteBinding( deleteBinding ); + } + } + + public DispositionReport Send( DeleteBusiness deleteBusiness, AuthToken authToken ) + { + SetAuthToken( deleteBusiness, authToken ); + + try + { + return soapClient.DeleteBusiness( deleteBusiness ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.DeleteBusiness( deleteBusiness ); + } + } + + public DispositionReport Send( DeleteService deleteService, AuthToken authToken ) + { + SetAuthToken( deleteService, authToken ); + + try + { + return soapClient.DeleteService( deleteService ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.DeleteService( deleteService ); + } + } + + public DispositionReport Send( DeleteTModel deleteTModel, AuthToken authToken ) + { + SetAuthToken( deleteTModel, authToken ); + + try + { + return soapClient.DeleteTModel( deleteTModel ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.DeleteTModel( deleteTModel ); + } + } + + public BindingDetail Send( SaveBinding saveBinding, AuthToken authToken ) + { + SetAuthToken( saveBinding, authToken ); + + try + { + return soapClient.SaveBinding( saveBinding ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.SaveBinding( saveBinding ); + } + } + + public BusinessDetail Send( SaveBusiness saveBusiness, AuthToken authToken ) + { + SetAuthToken( saveBusiness, authToken ); + + try + { + return soapClient.SaveBusiness( saveBusiness ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.SaveBusiness( saveBusiness ); + } + } + + public ServiceDetail Send( SaveService saveService, AuthToken authToken ) + { + SetAuthToken( saveService, authToken ); + + try + { + return soapClient.SaveService( saveService ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.SaveService( saveService ); + } + } + + public TModelDetail Send( SaveTModel saveTModel, AuthToken authToken ) + { + SetAuthToken( saveTModel, authToken ); + + try + { + return soapClient.SaveTModel( saveTModel ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.SaveTModel( saveTModel ); + } + } + + public DispositionReport Send( AddPublisherAssertions addPublisherAssertions, AuthToken authToken) + { + SetAuthToken( addPublisherAssertions, authToken ); + + try + { + return soapClient.AddPublisherAssertions( addPublisherAssertions ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.AddPublisherAssertions( addPublisherAssertions ); + } + } + + public DispositionReport Send( DeletePublisherAssertions deletePublisherAssertions, AuthToken authToken ) + { + SetAuthToken( deletePublisherAssertions, authToken ); + + try + { + return soapClient.DeletePublisherAssertions( deletePublisherAssertions ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.DeletePublisherAssertions( deletePublisherAssertions ); + } + } + + public AssertionStatusReport Send( GetAssertionStatusReport getAssertionStatusReport, AuthToken authToken ) + { + SetAuthToken( getAssertionStatusReport, authToken ); + + try + { + return soapClient.GetAssertionStatusReport( getAssertionStatusReport ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.GetAssertionStatusReport( getAssertionStatusReport ); + } + } + + public PublisherAssertionDetail Send( GetPublisherAssertions getPublisherAssertions, AuthToken authToken ) + { + SetAuthToken( getPublisherAssertions, authToken ); + + try + { + return soapClient.GetPublisherAssertions( getPublisherAssertions ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.GetPublisherAssertions( getPublisherAssertions ); + } + } + + public PublisherAssertionDetail Send( SetPublisherAssertions setPublisherAssertions, AuthToken authToken ) + { + SetAuthToken( setPublisherAssertions, authToken ); + + try + { + return soapClient.SetPublisherAssertions( setPublisherAssertions ); + } + catch( UddiException uddiException ) + { + AttemptRefreshAuthInfo( uddiException, authToken ); + + return soapClient.SetPublisherAssertions( setPublisherAssertions ); + } + } + + ///////////////////////////////////////////////////////////////////////////////////////////////// + /// Uddi Inquire API messages + ///////////////////////////////////////////////////////////////////////////////////////////////// + public BindingDetail Send( FindBinding findBinding ) + { + return soapClient.FindBinding( findBinding ); + } + + public BusinessList Send( FindBusiness findBusiness ) + { + return soapClient.FindBusiness( findBusiness ); + } + + public RelatedBusinessList Send( FindRelatedBusinesses findRelatedBusinesses ) + { + return soapClient.FindRelatedBusinesses( findRelatedBusinesses ); + } + + public ServiceList Send( FindService findService ) + { + return soapClient.FindService( findService ); + } + + public TModelList Send( FindTModel findTModel ) + { + return soapClient.FindTModel( findTModel ); + } + + public BindingDetail Send( GetBindingDetail getBindingDetail ) + { + return soapClient.GetBindingDetail( getBindingDetail ); + } + + public BusinessDetail Send( GetBusinessDetail getBusinessDetail ) + { + return soapClient.GetBusinessDetail( getBusinessDetail ); + } + + public BusinessDetailExt Send( GetBusinessDetailExt getBusinessDetailExt ) + { + return soapClient.GetBusinessDetailExt( getBusinessDetailExt ); + } + + public ServiceDetail Send( GetServiceDetail getServiceDetail ) + { + return soapClient.GetServiceDetail( getServiceDetail ); + } + + public TModelDetail Send( GetTModelDetail getTModelDetail ) + { + return soapClient.GetTModelDetail( getTModelDetail ); + } + + ///////////////////////////////////////////////////////////////////////////////////////////////// + /// Uddi Extensions API messages + ///////////////////////////////////////////////////////////////////////////////////////////////// + public CategoryList Send( GetRelatedCategories getRelatedCategories ) + { + return soapClient.GetRelatedCategories( getRelatedCategories ); + } + + private void SetAuthToken( UddiSecureMessage uddiSecureMessage, AuthToken authToken ) + { + if( uddiSecureMessage.AuthInfo != authToken.AuthInfo ) + { + uddiSecureMessage.AuthInfo = authToken.AuthInfo; + } + } + + private void AttemptRefreshAuthInfo( UddiException uddiException, AuthToken authToken ) + { + if( UddiException.ErrorType.E_authTokenExpired == uddiException.Type && + true == RefreshAuthToken ) + { + authToken = Send( authToken.OriginatingAuthToken ); + } + else + { + throw uddiException; + } + } + } + + [System.Web.Services.WebServiceBindingAttribute( Name="MessageHandlersSoap", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace )] + internal class SoapClient : SoapHttpClientProtocol + { + private static readonly string UddiUserAgent; + + private UddiVersion uddiVersion; + + public SoapClient() + { + uddiVersion = UddiVersion.Negotiate; + UserAgent = UddiUserAgent; + } + + static SoapClient() + { + System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); + + // + // + // The assembly.FullName looks like this + // Microsoft.Uddi.Sdk, Version=1.1.1.1, Culture=neutral, PublicKeyToken=a48752033f5d4384 + // I just want to use the first 2 sections. + // To convert this: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.0.3328.4) + // To this: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.0.3328.4; MS Uddi .Net SDK 1.0.xxxx.1) + // + + UddiUserAgent = new Char[] { ' ', ')' } + "; MS Uddi .Net SDK " + FileVersionInfo.GetVersionInfo( assembly.Location ).FileVersion + ")"; + } + + public UddiVersion Version + { + get { return uddiVersion; } + set { uddiVersion = value; } + } + + protected override WebRequest GetWebRequest( Uri uri ) + { + UddiWebRequest webRequest = new UddiWebRequest( base.GetWebRequest( uri ), uddiVersion ); + + return webRequest; + } + + private object[] InvokeWebMethod( string webMethodName, object[] parameters ) + { + object[] results = null; + + // + // The first (and only) parameter is the Uddi message we are about to send. + // + UddiCore uddiMessage = parameters[ 0 ] as UddiCore; + + try + { + uddiMessage.SerializeMode = true; + results = Invoke( webMethodName, parameters ); + + } + catch( SoapException soapException ) + { + // + // We have no meaningful results at this point. + // + results = null; + UddiException uddiException = new UddiException( soapException ); + UddiVersion originalVersion = uddiVersion; + + // + // If the exception is either a fatal error or a unrecognized version error, we will + // assume that the exception had something to do with a versioning problem. This is about + // the most reliable way to do this, since there is no standard way of reporting a version + // mismatch. If IterateOverVersions still does not return results, then we use the original + // exception and assume that that exception was indeed not version related. + // + if( ( uddiException.Type == UddiException.ErrorType.E_unrecognizedVersion || + uddiException.Type == UddiException.ErrorType.E_fatalError ) && + uddiVersion == UddiVersion.Negotiate ) + { + results = InvokeForVersions( webMethodName, parameters, ref uddiException); + + // + // Restore the original version. TODO: should we just keep this version as is? + // + uddiVersion = originalVersion; + } + + if( null == results ) + { + throw uddiException; + } + } + finally + { + uddiMessage.SerializeMode = false; + } + + return results; + } + + private object[] InvokeForVersions( string webMethodName, object[] parameters, ref UddiException returnException ) + { + object[] results = null; + + // + // Try to invoke this web method for each supported version + // + int numVersions = UddiVersionSupport.SupportedVersions.Length; + int index = 0; + + while( index < numVersions && null == results ) + { + try + { + UddiVersion versionToTry = UddiVersionSupport.SupportedVersions[ index++ ]; + + // + // Don't repeat versions. + // + if( versionToTry != uddiVersion ) + { + uddiVersion = versionToTry; + } + + results = Invoke( webMethodName, parameters ); + } + catch( UddiException uddiException ) + { + returnException = uddiException; + } + catch( Exception exception ) + { + returnException = new UddiException( exception ); + } + } + + return results; + } + + ///////////////////////////////////////////////////////////////////////////////////////////////// + /// Uddi Publish API messages + ///////////////////////////////////////////////////////////////////////////////////////////////// + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("registeredInfo", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public RegisteredInfo GetRegisteredInfo([XmlElement( Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] GetRegisteredInfo getRegisteredInfo) + { + object[] results = InvokeWebMethod("GetRegisteredInfo", new object[] {getRegisteredInfo}); + return ((RegisteredInfo)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public DispositionReport DeleteBinding([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] DeleteBinding deleteBinding) + { + object[] results = InvokeWebMethod("DeleteBinding", new object[] {deleteBinding}); + return ((DispositionReport)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public DispositionReport DeleteBusiness([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] DeleteBusiness deleteBusiness) + { + object[] results = InvokeWebMethod("DeleteBusiness", new object[] {deleteBusiness}); + return ((DispositionReport)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public DispositionReport DeleteService([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] DeleteService deleteService) + { + object[] results = InvokeWebMethod("DeleteService", new object[] {deleteService}); + return ((DispositionReport)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public DispositionReport DeleteTModel([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] DeleteTModel deleteTModel) + { + object[] results = InvokeWebMethod("DeleteTModel", new object[] {deleteTModel}); + return ((DispositionReport)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("bindingDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public BindingDetail SaveBinding([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] SaveBinding saveBinding) + { + object[] results = InvokeWebMethod("SaveBinding", new object[] {saveBinding}); + return ((BindingDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("businessDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public BusinessDetail SaveBusiness([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] SaveBusiness saveBusiness) + { + object[] results = InvokeWebMethod("SaveBusiness", new object[] {saveBusiness}); + return ((BusinessDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("serviceDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public ServiceDetail SaveService([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] SaveService saveService) + { + object[] results = InvokeWebMethod("SaveService", new object[] {saveService}); + return ((ServiceDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("tModelDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public TModelDetail SaveTModel([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] SaveTModel saveTModel) + { + object[] results = InvokeWebMethod("SaveTModel", new object[] {saveTModel}); + return ((TModelDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public DispositionReport DiscardAuthToken([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] DiscardAuthToken discardAuthToken) + { + object[] results = InvokeWebMethod("DiscardAuthToken", new object[] {discardAuthToken}); + return ((DispositionReport)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("authToken", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public AuthToken GetAuthToken([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] GetAuthToken getAuthToken) + { + object[] results = InvokeWebMethod("GetAuthToken", new object[] {getAuthToken}); + return ((AuthToken)results[0]); + } + + [SoapDocumentMethod( "", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare )] + [return: XmlElement( "dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] + public DispositionReport AddPublisherAssertions( [XmlElement( Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] AddPublisherAssertions addPublisherAssertions) + { + object[] results = InvokeWebMethod( "AddPublisherAssertions", new object[] { addPublisherAssertions }); + return ( (DispositionReport)results[ 0 ] ); + } + + [SoapDocumentMethod( "", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare )] + [return: XmlElement( "dispositionReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] + public DispositionReport DeletePublisherAssertions( [XmlElement( Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] DeletePublisherAssertions deletePublisherAssertions ) + { + object[] results = InvokeWebMethod( "DeletePublisherAssertions", new object[] { deletePublisherAssertions } ); + return ( (DispositionReport)results[ 0 ] ); + } + + [SoapDocumentMethod( "", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare )] + [return: XmlElement( "assertionStatusReport", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] + public AssertionStatusReport GetAssertionStatusReport( [XmlElement( Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] GetAssertionStatusReport getAssertionStatusReport ) + { + object[] results = InvokeWebMethod( "GetAssertionStatusReport", new object[] { getAssertionStatusReport } ); + return ( (AssertionStatusReport)results[ 0 ] ); + } + + [SoapDocumentMethod( "", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare )] + [return: XmlElement( "publisherAssertions", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] + public PublisherAssertionDetail GetPublisherAssertions( [XmlElement( Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] GetPublisherAssertions getPublisherAssertions ) + { + object[] results = InvokeWebMethod( "GetPublisherAssertions", new object[] { getPublisherAssertions } ); + return ( (PublisherAssertionDetail)results[ 0 ] ); + } + + [SoapDocumentMethod( "", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare )] + [return: XmlElement("publisherAssertions", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public PublisherAssertionDetail SetPublisherAssertions( [XmlElement( Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] SetPublisherAssertions setPublisherAssertions ) + { + object[] results = InvokeWebMethod( "SetPublisherAssertions", new object[] { setPublisherAssertions } ); + return ( (PublisherAssertionDetail)results[ 0 ] ); + } + + ///////////////////////////////////////////////////////////////////////////////////////////////// + /// Uddi Inquire API messages + ///////////////////////////////////////////////////////////////////////////////////////////////// + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("bindingDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public BindingDetail FindBinding([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] FindBinding findBinding) + { + object[] results = InvokeWebMethod("FindBinding", new object[] {findBinding}); + return ((BindingDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("businessList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public BusinessList FindBusiness([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] FindBusiness findBusiness) + { + object[] results = InvokeWebMethod( "FindBusiness", new object[] { findBusiness } ); + + return ( ( BusinessList )results[0] ); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("relatedBusinessesList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public RelatedBusinessList FindRelatedBusinesses([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] FindRelatedBusinesses findRelatedBusinesses ) + { + object[] results = InvokeWebMethod( "FindRelatedBusinesses", new object[] { findRelatedBusinesses }); + return ((RelatedBusinessList)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("serviceList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public ServiceList FindService([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] FindService findService) + { + object[] results = InvokeWebMethod("FindService", new object[] {findService}); + return ((ServiceList)results[0]); + } + + [SoapDocumentMethod( "", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare )] + [return: XmlElement( "tModelList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] + public TModelList FindTModel( [XmlElement( Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false )] FindTModel findTModel ) + { + object[] results = InvokeWebMethod( "FindTModel", new object[] { findTModel } ); + return ( (TModelList)results[ 0 ] ); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("bindingDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public BindingDetail GetBindingDetail([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] GetBindingDetail getBindingDetail) + { + object[] results = InvokeWebMethod("GetBindingDetail", new object[] {getBindingDetail}); + return ((BindingDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("businessDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public BusinessDetail GetBusinessDetail([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] GetBusinessDetail getBusinessDetail) + { + object[] results = InvokeWebMethod("GetBusinessDetail", new object[] {getBusinessDetail}); + return ((BusinessDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("businessDetailExt", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public BusinessDetailExt GetBusinessDetailExt([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] GetBusinessDetailExt getBusinessDetailExt ) + { + object[] results = InvokeWebMethod("GetBusinessDetailExt", new object[] {getBusinessDetailExt}); + return ((BusinessDetailExt)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("serviceDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public ServiceDetail GetServiceDetail([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] GetServiceDetail getServiceDetail) + { + object[] results = InvokeWebMethod("GetServiceDetail", new object[] {getServiceDetail}); + return ((ServiceDetail)results[0]); + } + + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("tModelDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] + public TModelDetail GetTModelDetail([XmlElement(Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable=false)] GetTModelDetail getTModelDetail) + { + object[] results = InvokeWebMethod("GetTModelDetail", new object[] {getTModelDetail}); + return ((TModelDetail)results[0]); + } + + ///////////////////////////////////////////////////////////////////////////////////////////////// + /// Uddi Extensions API messages + ///////////////////////////////////////////////////////////////////////////////////////////////// + [SoapDocumentMethod("", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)] + [return: XmlElement("tModelDetail", Namespace=Microsoft.Uddi.Extensions.Namespaces.GetRelatedCategories, IsNullable=false)] + public CategoryList GetRelatedCategories( GetRelatedCategories getRelatedCategories ) + { + object[] results = InvokeWebMethod("GetRelatedCategories", new object[] {getRelatedCategories}); + return ((CategoryList)results[0]); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/uddiweb.cs b/inetsrv/uddi/source/sdk/uddiweb.cs new file mode 100644 index 0000000..b736b9d --- /dev/null +++ b/inetsrv/uddi/source/sdk/uddiweb.cs @@ -0,0 +1,413 @@ +using System; +using System.IO; +using System.Diagnostics; +using System.Net; +using System.Web.Services; +using System.Web.Services.Description; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; +using System.Xml.Xsl; +using System.Xml.XPath; +using System.Text; + +using Microsoft.Uddi; +using Microsoft.Uddi.Authentication; +using Microsoft.Uddi.VersionSupport; + +namespace Microsoft.Uddi.Web +{ + /// + /// UddiWebResponse allows us to return our own Stream object. + /// + internal class UddiWebResponse : WebResponse + { + private WebResponse innerWebResponse; + private UddiResponseStream uddiResponseStream; + private UddiVersion uddiVersion; + + /// + /// Constructor + /// + /// This object should come from the WebResponse created by HttpSoapClientProtocol. + public UddiWebResponse( WebResponse innerWebResponse ) + { + this.innerWebResponse = innerWebResponse; + this.uddiVersion = uddiVersion; + } + + /// + /// Return our response stream (UddiResponseStream) instead of the Stream associated with our inner response. + /// + /// + public override Stream GetResponseStream() + { + if( null == uddiResponseStream ) + { + uddiResponseStream = new UddiResponseStream( innerWebResponse.GetResponseStream() ); + } + + return uddiResponseStream; + } + + /// + /// Delegates to the inner web response. + /// + public override void Close() + { + innerWebResponse.Close(); + } + + /// + /// Delegates to the inner web response. + /// + public override long ContentLength + { + get { return innerWebResponse.ContentLength; } + set { innerWebResponse.ContentLength = value; } + } + + /// + /// Delegates to the inner web response. + /// + public override string ContentType + { + get { return innerWebResponse.ContentType; } + set { innerWebResponse.ContentType = value; } + } + + /// + /// Delegates to the inner web response. + /// + public override Uri ResponseUri + { + get { return innerWebResponse.ResponseUri; } + } + + /// + /// Delegates to the inner web response. + /// + public override WebHeaderCollection Headers + { + get { return innerWebResponse.Headers; } + } + } + + /// + /// UddiResponseStream allows us to manipulate the XML sent back from the web service. + /// + internal class UddiResponseStream : MemoryStream + { + // + // TODO: at some point it may be necessary to pass in the current version as a parameter if the transforms become + // more complicated. + // + + /// + /// Constructor. We read all the XML sent from the server, do our version manipulation, then write the new XML + /// into our inner responseStream object. + /// + /// This object should be the responseStream from a WebResponse object. + public UddiResponseStream( Stream responseStream ) + { + try + { + // + // Get the XML the server sent to us. + // + StreamReader reader = new StreamReader( responseStream ); + string responseXml = reader.ReadToEnd(); + reader.Close(); + + // + // TODO: Consider making this class more generic, ie. have a IUddiResponseHandler interface: + // IUddiResponseHandler + // string HandleResponse( string xml ); + // + + // + // Translate the incoming XML into the current version. + // + string transformedXml = UddiVersionSupport.Translate( responseXml, UddiVersionSupport.CurrentVersion ); + + // + // Write this transformed XML into the 'real' stream. + // + StreamUtility.WriteStringToStream( this, transformedXml ); + } + finally + { + this.Position = 0; + } + } + } + + /// + /// UddiWebRequest allows us to return our own request and response objects. + /// + internal class UddiWebRequest : WebRequest + { + private WebRequest innerWebRequest; + private UddiRequestStream uddiRequestStream; + private UddiWebResponse uddiWebResponse; + private UddiVersion uddiVersion; + + /// + /// Constructor + /// + /// Uri to the web service we are calling + /// Uddi version to use for requests + public UddiWebRequest( WebRequest innerWebRequest, UddiVersion uddiVersion ) + { + this.innerWebRequest = innerWebRequest; + this.uddiVersion = uddiVersion; + } + + /// + /// Return a UddiRequestStream object instead of the default one. + /// + /// UddiRequestStream object + public override Stream GetRequestStream() + { + if( null == uddiRequestStream ) + { + uddiRequestStream = new UddiRequestStream( innerWebRequest.GetRequestStream(), uddiVersion ); + } + + return uddiRequestStream; + } + + /// + /// Return a UddiWebRequest object instead of the default one. + /// + /// UddiWebResponse object + public override WebResponse GetResponse() + { + if( null == uddiWebResponse ) + { + uddiWebResponse = new UddiWebResponse( innerWebRequest.GetResponse() ); + } + return uddiWebResponse; + } + + /// + /// Delegates to our inner WebRequest + /// + public override string Method + { + get { return innerWebRequest.Method; } + set { innerWebRequest.Method = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override Uri RequestUri + { + get { return innerWebRequest.RequestUri; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override string ConnectionGroupName + { + get { return innerWebRequest.ConnectionGroupName; } + set { innerWebRequest.ConnectionGroupName = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override WebHeaderCollection Headers + { + get { return innerWebRequest.Headers; } + set { innerWebRequest.Headers = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override long ContentLength + { + get { return innerWebRequest.ContentLength; } + set { innerWebRequest.ContentLength = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override string ContentType + { + get { return innerWebRequest.ContentType; } + set { innerWebRequest.ContentType = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override ICredentials Credentials + { + get { return innerWebRequest.Credentials; } + set { innerWebRequest.Credentials = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override IWebProxy Proxy + { + get { return innerWebRequest.Proxy; } + set { innerWebRequest.Proxy = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override bool PreAuthenticate + { + get { return innerWebRequest.PreAuthenticate; } + set { innerWebRequest.PreAuthenticate = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override int Timeout + { + get { return innerWebRequest.Timeout; } + set { innerWebRequest.Timeout = value; } + } + + /// + /// Delegates to our inner WebRequest + /// + public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state) + { + return innerWebRequest.BeginGetResponse( callback, state ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override WebResponse EndGetResponse(IAsyncResult asyncResult) + { + return innerWebRequest.EndGetResponse( asyncResult ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, Object state) + { + return innerWebRequest.BeginGetRequestStream( callback, state ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override Stream EndGetRequestStream(IAsyncResult asyncResult) + { + return innerWebRequest.EndGetRequestStream( asyncResult ); + } + + /// + /// Delegates to our inner WebRequest + /// + public override void Abort() + { + innerWebRequest.Abort(); + } + } + + /// + /// UddiRequestStream allows us to manipulate the XML before we send it to the client. This class will accept all data that + /// is written to it from the ASP.NET web service framework. When the framework closes the stream (ie. wants to send the data), we + /// will manipulate this XML so that it has the right Uddi version, then send it out using our innerStream object. + /// + internal class UddiRequestStream : MemoryStream + { + private Stream innerStream; + private UddiVersion uddiVersion; + + /// + /// Constructor + /// + /// Should be from a WebRequest object. + /// The UDD version we should use to send to the server + public UddiRequestStream( Stream innerStream, UddiVersion uddiVersion ) + { + this.innerStream = innerStream; + this.uddiVersion = uddiVersion; + } + + /// + /// Before we actually close the request stream, we want to manipulate the XML. + /// + public override void Close() + { + try + { + // + // Rewind ourselves. + // + this.Position = 0; + + // + // Read the XML that was written; this is the XML request that will be sent to the Uddi server. + // + StreamReader reader = new StreamReader( this ); + string requestXml = reader.ReadToEnd(); + + // + // TODO: Consider making this class more generic, ie. have a IUddiRequestHandler interface: + // IUddiResponseHandler + // string HandleRequest( string xml ); + // + + // + // Transform the content to a correct version on the server if we are not using the current version. + // + string transformedXml = requestXml; + if( uddiVersion != UddiVersionSupport.CurrentVersion ) + { + transformedXml = UddiVersionSupport.Translate( requestXml, uddiVersion ); + } + + // + // Write the transformed data to the 'real' stream. + // + StreamUtility.WriteStringToStream( innerStream, transformedXml ); + } + finally + { + // + // Make sure we clean up properly. + // + innerStream.Close(); + base.Close(); + } + } + } + + /// + /// Simple utility class to help us write string data to Stream objects. + /// + internal sealed class StreamUtility + { + public static void WriteStringToStream( Stream stream, string stringToWrite ) + { + for ( int i = 0; i < stringToWrite.Length; i++ ) + { + stream.WriteByte( Convert.ToByte( stringToWrite[ i ] ) ); + } + } + + private StreamUtility() + { + // + // Don't let anyone instantiate this class + // + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/sdk/versionsupport.cs b/inetsrv/uddi/source/sdk/versionsupport.cs new file mode 100644 index 0000000..45a213c --- /dev/null +++ b/inetsrv/uddi/source/sdk/versionsupport.cs @@ -0,0 +1,219 @@ +using System; +using System.Collections; +using System.IO; +using System.Diagnostics; +using System.Net; +using System.Web.Services; +using System.Web.Services.Description; +using System.Web.Services.Protocols; +using System.Xml; +using System.Xml.Serialization; +using System.Xml.Xsl; +using System.Xml.XPath; +using System.Text; +using System.Globalization; + +using Microsoft.Uddi; +using Microsoft.Uddi.Web; + +namespace Microsoft.Uddi +{ + public enum UddiVersion + { + V1, + V2, + Negotiate + } +} + +namespace Microsoft.Uddi.VersionSupport +{ + internal abstract class IUddiVersion + { + public abstract string Generic + { get; } + + public abstract string Namespace + { get; } + + public abstract string Translate( string xml ); + } + + internal sealed class UddiVersionSupport + { + internal readonly static UddiVersion[] SupportedVersions; + internal readonly static UddiVersion CurrentVersion; + + // + // This is a bit awkward to store the current namespace and generic separately rather than using the UddiVersion class. But, we need + // to use these values in our XmlRoot attribute declaration that each serialize-able class uses. Only const values can be used + // in attribute declarations. Make sure to update these values when you change the current version + // + internal const string CurrentNamespace = "urn:uddi-org:api_v2"; + internal const string CurrentGeneric = "2.0"; + + private static Hashtable UddiVersions; + + private UddiVersionSupport() + { + // + // Don't let anyone construct an instance of this class. + // + } + + internal static string Translate( string xml, UddiVersion version ) + { + // + // Use the current version in this case + // + if( version == UddiVersion.Negotiate ) + { + version = CurrentVersion; + } + + IUddiVersion uddiVersion = ( IUddiVersion ) UddiVersions[ version ]; + + return uddiVersion.Translate( xml ); + } + + static UddiVersionSupport() + { + // + // Increase this array if you want to support more previous versions. Do not include + // the current version in this array. + // + SupportedVersions = new UddiVersion[1]; + + // + // Add our supported previous versions + // + SupportedVersions[0] = UddiVersion.V1; + + // + // Current version is version 2.0 + // + CurrentVersion = UddiVersion.V2; + + // + // Store instances to versions + // + UddiVersions = new Hashtable(); + + UddiVersions[ UddiVersion.V1 ] = new UddiVersion1(); + UddiVersions[ UddiVersion.V2 ] = new UddiVersion2(); + } + } + + internal class UddiVersion1 : IUddiVersion + { + private XmlDocument input; + + public UddiVersion1() + { + input = new XmlDocument(); + } + + public override string Generic + { + get { return "1.0"; } + } + + public override string Namespace + { + get { return "urn:uddi-org:api"; } + } + + public override string Translate( string xml ) + { + // + // Load up the input into a DOM so we can make some queries to do replacements. I considered + // using a XSTL stylesheet here, but there didn't appear to be a good way of only replacing select items. + // You pretty much have to take the input, and specify how every element in the output should look (or + // do an exact copy); this results in too much error-prone XSLT code. + // + input.LoadXml( xml ); + + // + // There are a number of messages that version 1 just does not support. Kick out now if we are trying to + // call any of these messages. + // + + // + // Replace generic attribute value and default namespace + // + XmlNodeList nodes = input.SelectNodes( "descendant::*[@generic]" ); + foreach( XmlNode node in nodes ) + { + node.Attributes.GetNamedItem( "generic" ).Value = Generic; + + XmlNode xmlnsAttribute = node.Attributes.GetNamedItem( "xmlns" ); + if( null != xmlnsAttribute ) + { + xmlnsAttribute.Value = Namespace; + } + } + + // + // Remove name@xml:lang values + // + nodes =input.SelectNodes( "descendant::*[@xml:lang]" , new XmlNamespaceManager( input.NameTable ) ); + foreach( XmlNode node in nodes ) + { + if( node.LocalName.ToLower( CultureInfo.CurrentCulture ).Equals( "name" ) ) + { + node.Attributes.RemoveNamedItem( "xml:lang" ); + } + } + + return input.OuterXml; + } + } + + internal class UddiVersion2 : IUddiVersion + { + private XmlDocument input; + + public UddiVersion2() + { + input = new XmlDocument(); + } + + public override string Generic + { + get { return "2.0"; } + } + + public override string Namespace + { + get { return "urn:uddi-org:api_v2"; } + } + + public override string Translate( string xml ) + { + // + // Load up the input into a DOM so we can make some queries to do replacements. I considered + // using a XSTL stylesheet here, but there didn't appear to be a good way of only replacing select items. + // You pretty much have to take the input, and specify how every element in the output should look (or + // do an exact copy); this results in too much error-prone XSLT code. + // + input.LoadXml( xml ); + + // + // Replace generic attribute value and default namespace + // + XmlNodeList nodes = input.SelectNodes( "descendant::*[@generic]" ); + foreach( XmlNode node in nodes ) + { + node.Attributes.GetNamedItem( "generic" ).Value = Generic; + + XmlNode xmlnsAttribute = node.Attributes.GetNamedItem( "xmlns" ); + if( null != xmlnsAttribute ) + { + xmlnsAttribute.Value = Namespace; + } + } + + return input.OuterXml; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/admin/dirs b/inetsrv/uddi/source/setup/admin/dirs new file mode 100644 index 0000000..1af497d --- /dev/null +++ b/inetsrv/uddi/source/setup/admin/dirs @@ -0,0 +1 @@ +dirs = wsi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/admin/wsi/makefile b/inetsrv/uddi/source/setup/admin/wsi/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/admin/wsi/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/admin/wsi/obj/_objects.mac b/inetsrv/uddi/source/setup/admin/wsi/obj/_objects.mac new file mode 100644 index 0000000..8c49520 --- /dev/null +++ b/inetsrv/uddi/source/setup/admin/wsi/obj/_objects.mac @@ -0,0 +1,16 @@ +386_OBJECTS= + +PASS0_386_OBJECTS= + +IA64_OBJECTS= + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/admin/wsi/placefil.txt b/inetsrv/uddi/source/setup/admin/wsi/placefil.txt new file mode 100644 index 0000000..adaa0b2 --- /dev/null +++ b/inetsrv/uddi/source/setup/admin/wsi/placefil.txt @@ -0,0 +1 @@ +uddiadm.msi uddi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/admin/wsi/sources b/inetsrv/uddi/source/setup/admin/wsi/sources new file mode 100644 index 0000000..e3c9e52 --- /dev/null +++ b/inetsrv/uddi/source/setup/admin/wsi/sources @@ -0,0 +1,8 @@ +TARGETNAME= +TARGETTYPE=NOTARGET +TARGETPATH=. +SOURCES= + +MISCFILES = uddiadm.msi + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/admin/wsi/uddiadm.msi b/inetsrv/uddi/source/setup/admin/wsi/uddiadm.msi new file mode 100644 index 0000000..f461617 Binary files /dev/null and b/inetsrv/uddi/source/setup/admin/wsi/uddiadm.msi differ diff --git a/inetsrv/uddi/source/setup/admin/wsi/uddiadm.wsi b/inetsrv/uddi/source/setup/admin/wsi/uddiadm.wsi new file mode 100644 index 0000000..0bac089 Binary files /dev/null and b/inetsrv/uddi/source/setup/admin/wsi/uddiadm.wsi differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/apppool.cpp b/inetsrv/uddi/source/setup/db/ca.unmanaged/apppool.cpp new file mode 100644 index 0000000..62be2fc --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/apppool.cpp @@ -0,0 +1 @@ +#include "..\..\shared\apppool.cpp" diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/common.cpp b/inetsrv/uddi/source/setup/db/ca.unmanaged/common.cpp new file mode 100644 index 0000000..873d552 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/common.cpp @@ -0,0 +1 @@ +#include "..\..\shared\common.cpp" diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.cpp b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.cpp new file mode 100644 index 0000000..2b78848 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.cpp @@ -0,0 +1,913 @@ + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#include +#include +#include +#include +#include + +#include +#include + +#include "dbcaum.h" +#include "..\..\shared\apppool.h" +#include "..\..\shared\common.h" + + +#define DIM(x) (sizeof x)/(sizeof x[0]) + +#define ROOT_REGPATH "Software\\Microsoft\\UDDI" +#define INSTROOT_REGPATH "InstallRoot" +#define RESROOT_REGPATH "ResourceRoot" +#define BOOTSTRAP_DIR "bootstrap" + +// +// Forward declarations. +// +static int AddSharedDllRef( LPCSTR szFullPath ); +static int ReleaseSharedDll ( LPCSTR szFullPath ); +static bool AddAccessRights( TCHAR *lpszFileName, TCHAR *szUserName, DWORD dwAccessMask ); +static LONG GetServiceStartupAccount( const TCHAR *pwszServiceName, TCHAR *pwszServiceAccount, int iLen ); +static void GetUDDIDBServiceName( const TCHAR *pwszInstanceName, TCHAR *pwszServiceName, int iLen ); +static void AddAccessRightsVerbose( TCHAR *pwszFileName, TCHAR *pwszUserName, DWORD dwMask ); +//-------------------------------------------------------------------------- + +BOOL APIENTRY DllMain( HANDLE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + return TRUE; +} + +//-------------------------------------------------------------------------- +// +// Install custom action used by the DB component installer to recycle the app pool +// This function is exported +// +UINT _stdcall Install( MSIHANDLE hInstall ) +{ + ENTER(); + // + // stop and start the app pool + // + CUDDIAppPool apppool; + apppool.Recycle(); + + return ERROR_SUCCESS; +} + +UINT __stdcall InstallTaxonomy( LPCSTR szSrcResource, LPCSTR szDestResource ) +{ + // + // Now we parse the path out of the Source and copy the Destination right by it + // + CHAR szPath[ _MAX_PATH + 1 ] = {0}; + + PCHAR pSlash = strrchr( szSrcResource, '\\' ); + if ( pSlash ) + { + strncpy( szPath, szSrcResource, pSlash - szSrcResource + 1 ); + int iLen = _MAX_PATH - strlen( szPath ); + strncat( szPath, szDestResource, iLen ); + } + else + { + strncpy( szPath, szDestResource, _MAX_PATH + 1 ); + } + + szPath[ _MAX_PATH ] = 0; + +#if defined( DBG ) || defined( _DEBUG ) + TCHAR wszPath[ _MAX_PATH + 1 ]; + int iwszCount = _MAX_PATH; + int ipszCount = strlen( szPath ); + + memset( wszPath, 0, _MAX_PATH * sizeof( TCHAR ) ); + ::MultiByteToWideChar( CP_THREAD_ACP, MB_ERR_INVALID_CHARS, szPath, ipszCount, wszPath, iwszCount ); + + Log( _T( "Installing taxonomy file: %s." ), wszPath ); +#endif + + if ( !CopyFileA( szSrcResource, szPath, FALSE ) ) + return ERROR_INSTALL_FAILURE; + + DeleteFileA( szSrcResource ); + + return ERROR_SUCCESS; +} + +UINT __stdcall InstallResource( LPCSTR szCultureID, LPCSTR szDefCulture, + LPCSTR szSrcResource, LPCSTR szDestResource ) +{ + // + // Get the properties and then do the file manipulation + // + if ( _stricmp( szCultureID, szDefCulture ) ) + { + // + // Now we parse the path out of the Source and copy the Destination right by it + // + CHAR szPath[ _MAX_PATH + 1 ] = {0}; + + PCHAR pSlash = strrchr( szSrcResource, '\\' ); + if ( pSlash ) + { + strncpy( szPath, szSrcResource, pSlash - szSrcResource + 1 ); + int iLen = _MAX_PATH - strlen( szPath ); + strncat( szPath, szDestResource, iLen ); + } + else + { + strncpy( szPath, szDestResource, _MAX_PATH + 1 ); + } + + szPath[ _MAX_PATH ] = 0; + +#if defined( DBG ) || defined( _DEBUG ) + TCHAR wszPath[ _MAX_PATH + 1 ]; + int iwszCount = _MAX_PATH; + int ipszCount = strlen( szPath ); + + memset( wszPath, 0, _MAX_PATH * sizeof( TCHAR ) ); + ::MultiByteToWideChar( CP_THREAD_ACP, MB_ERR_INVALID_CHARS, szPath, ipszCount, wszPath, iwszCount ); + + Log( _T( "Installing resource file: %s." ), wszPath ); +#endif + + if ( !CopyFileA( szSrcResource, szPath, FALSE ) ) + return ERROR_INSTALL_FAILURE; + + AddSharedDllRef( szPath ); + } + + DeleteFileA( szSrcResource ); + + return ERROR_SUCCESS; +} + + +UINT __stdcall RemoveResource( LPCSTR szDestResource ) +{ + HKEY hUddiKey = NULL; + try + { + CHAR szPath[ _MAX_PATH + 1 ] = {0}; + DWORD cbPath = DIM( szPath ); + size_t iLen = 0; + + LONG iRes = RegOpenKeyA( HKEY_LOCAL_MACHINE, ROOT_REGPATH, &hUddiKey ); + if ( iRes != ERROR_SUCCESS ) + return ERROR_INSTALL_FAILURE; + + iRes = RegQueryValueExA( hUddiKey, RESROOT_REGPATH, NULL, NULL, (LPBYTE)szPath, &cbPath ); + if ( iRes != ERROR_SUCCESS ) + return ERROR_INSTALL_FAILURE; + + RegCloseKey( hUddiKey ); + hUddiKey = NULL; + + iLen = strlen( szPath ); + if ( ( iLen < _MAX_PATH ) && ( szPath[ iLen - 1 ] != '\\' ) ) + { + strncat( szPath, "\\", 2 ); + } + + iLen = _MAX_PATH - strlen( szPath ); + strncat( szPath, szDestResource, iLen ); + + szPath[ _MAX_PATH ] = 0; + +#if defined( DBG ) || defined( _DEBUG ) + TCHAR wszPath[ _MAX_PATH + 1 ]; + int iwszCount = _MAX_PATH; + int ipszCount = strlen( szPath ); + + memset( wszPath, 0, _MAX_PATH * sizeof( TCHAR ) ); + ::MultiByteToWideChar( CP_THREAD_ACP, MB_ERR_INVALID_CHARS, szPath, ipszCount, wszPath, iwszCount ); + + Log( _T( "Removing resource file: %s." ), wszPath ); +#endif + + if ( ReleaseSharedDll( szPath ) == 0 ) + DeleteFileA( szPath ); + } + catch (...) + { + if ( hUddiKey ) + RegCloseKey( hUddiKey ); + + return ERROR_INSTALL_FAILURE; + } + + return ERROR_SUCCESS; +} + +UINT __stdcall RemoveTaxonomy( LPCSTR szDestResource ) +{ + HKEY hUddiKey = NULL; + + try + { + CHAR szPath[ _MAX_PATH + 1 ] = {0}; + DWORD cbPath = DIM( szPath ); + size_t iLen = 0; + + LONG iRes = RegOpenKeyA( HKEY_LOCAL_MACHINE, ROOT_REGPATH, &hUddiKey ); + if ( iRes != ERROR_SUCCESS ) + return ERROR_INSTALL_FAILURE; + + iRes = RegQueryValueExA( hUddiKey, INSTROOT_REGPATH, NULL, NULL, (LPBYTE)szPath, &cbPath ); + if ( iRes != ERROR_SUCCESS ) + return ERROR_INSTALL_FAILURE; + + RegCloseKey( hUddiKey ); + hUddiKey = NULL; + + iLen = strlen( szPath ); + if ( ( iLen < _MAX_PATH ) && ( szPath[ iLen - 1 ] != '\\' ) ) + { + strncat( szPath, "\\", 2 ); + } + + // + // Append \bootstrap\ to InstallRoot + // + iLen = _MAX_PATH - strlen( szPath ); + strncat( szPath, BOOTSTRAP_DIR, iLen ); + + strncat( szPath, "\\", 2 ); + + iLen = _MAX_PATH - strlen( szPath ); + strncat( szPath, szDestResource, iLen ); + + szPath[ _MAX_PATH ] = 0; + +#if defined( DBG ) || defined( _DEBUG ) + TCHAR wszPath[ _MAX_PATH + 1 ]; + int iwszCount = _MAX_PATH; + int ipszCount = strlen( szPath ); + + memset( wszPath, 0, _MAX_PATH * sizeof( TCHAR ) ); + ::MultiByteToWideChar( CP_THREAD_ACP, MB_ERR_INVALID_CHARS, szPath, ipszCount, wszPath, iwszCount ); + + Log( _T( "Removing taxonomy file: %s." ), wszPath ); +#endif + + DeleteFileA( szPath ); + } + catch (...) + { + if ( hUddiKey ) + RegCloseKey( hUddiKey ); + + return ERROR_INSTALL_FAILURE; + } + + return ERROR_SUCCESS; +} + +UINT __stdcall GrantExecutionRights( LPCSTR pszInstanceNameOnly ) +{ + ENTER(); + + TCHAR wszInstanceName[ 256 ]; + int iwszCount = 256; + int ipszCount = strlen( pszInstanceNameOnly ); + + memset( wszInstanceName, 0, 256 * sizeof( TCHAR ) ); + + ::MultiByteToWideChar( CP_THREAD_ACP, MB_ERR_INVALID_CHARS, pszInstanceNameOnly, ipszCount, wszInstanceName, iwszCount ); + Log( _T( "Instance Name only = %s" ), wszInstanceName ); + + TCHAR wszServiceName[ 128 ]; + GetUDDIDBServiceName( wszInstanceName, wszServiceName, 128 ); + + TCHAR wszServiceAccount[ 128 ]; + GetServiceStartupAccount( wszServiceName, wszServiceAccount, 128 ); + + // + // Get the UDDI installation point. ie, C:\Inetpub\uddi\ + // + HKEY hKey = NULL; + LONG lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Microsoft\\UDDI\\Setup\\DBServer" ), 0, KEY_QUERY_VALUE, &hKey ); + if( ERROR_SUCCESS != lRet ) + { + Log( _T( "Call to RegOpenKeyEx failed." ) ); + return ERROR_SUCCESS; + } + + DWORD dwType = 0; + TCHAR wszUDDIRoot[ _MAX_PATH ]; + DWORD dwSize = _MAX_PATH * sizeof( TCHAR ); + memset( wszUDDIRoot, 0, dwSize ); + + lRet = RegQueryValueEx( hKey, _T( "TargetDir" ), NULL, &dwType, (LPBYTE)wszUDDIRoot, &dwSize ); + RegCloseKey( hKey ); + if( ERROR_SUCCESS != lRet ) + { + Log( _T( "Call to RegQueryValueEx failed." ) ); + return ERROR_SUCCESS; + } + + // + // Build the full path to the 3 files whose ACLs are being modified. + // + dwSize = _MAX_PATH + _MAX_FNAME; + TCHAR wszResetKeyExe[ _MAX_PATH + _MAX_FNAME ]; + TCHAR wszRecalcStatsExe[ _MAX_PATH + _MAX_FNAME ]; + TCHAR wszXPDLL[ _MAX_PATH + _MAX_FNAME ]; + + memset( wszResetKeyExe, 0, dwSize * sizeof( TCHAR ) ); + memset( wszRecalcStatsExe, 0, dwSize * sizeof( TCHAR ) ) ; + memset( wszXPDLL, 0, dwSize * sizeof( TCHAR ) ) ; + + _tcscat( wszResetKeyExe, wszUDDIRoot ); + _tcscat( wszResetKeyExe, _T( "bin\\resetkey.exe" ) ); + + _tcscat( wszRecalcStatsExe, wszUDDIRoot ); + _tcscat( wszRecalcStatsExe, _T( "bin\\recalcstats.exe" ) ); + + _tcscat( wszXPDLL, wszUDDIRoot ); + _tcscat( wszXPDLL, _T( "bin\\uddi.xp.dll" ) ); + + // + // If the service startup account is a local account, it will be prefixed + // with ".\" For example: ".\Administrator". + // + // For some reason, LookupAccountName (which we rely on just below) wants + // local accounts not to be prefixed with ".\". + // + TCHAR wszAccount[ 256 ]; + memset( wszAccount, 0, 256 * sizeof( TCHAR ) ); + if( 0 == _tcsnicmp( _T( ".\\" ), wszServiceAccount, 2 ) ) + { + _tcsncpy( wszAccount, &wszServiceAccount[ 2 ], _tcslen( wszServiceAccount ) - 2 ); + } + else + { + _tcsncpy( wszAccount, wszServiceAccount, _tcslen( wszServiceAccount ) ); + } + + Log( _T( "Account we will attempt to grant execute privilege = %s." ), wszAccount ); + + // + // We add an "execute" ACE to the ACL only if: + // + // 1. There is some content in the wszAccount variable. + // 2. The content is not "LocalSystem". We don't need to add an ACE if this is the case. + // + if( ( 0 != _tcslen( wszAccount ) ) && ( 0 != _tcsicmp( wszAccount, _T( "LocalSystem" ) ) ) ) + { + DWORD dwAccessMask = GENERIC_EXECUTE; + AddAccessRightsVerbose( wszResetKeyExe, wszAccount, dwAccessMask ); + AddAccessRightsVerbose( wszRecalcStatsExe, wszAccount, dwAccessMask ); + AddAccessRightsVerbose( wszXPDLL, wszAccount, dwAccessMask ); + } + + return ERROR_SUCCESS; +} + +//************************************************************************************* +// Helper functions. Manage the Shared Dll counters +// +int AddSharedDllRef( LPCSTR szFullPath ) +{ + LPCSTR szRegPath = "Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs"; + HKEY hReg = NULL; + DWORD dwCount = 0; + + if ( IsBadStringPtrA( szFullPath, MAX_PATH ) ) + return E_INVALIDARG; + + try + { + DWORD cbData = sizeof dwCount; + + LONG iRes = RegOpenKeyA( HKEY_LOCAL_MACHINE, szRegPath, &hReg ); + if ( iRes != ERROR_SUCCESS ) + return iRes; + + iRes = RegQueryValueExA( hReg, szFullPath, NULL, NULL, (LPBYTE)&dwCount, &cbData ); + if ( iRes != ERROR_SUCCESS && iRes != ERROR_FILE_NOT_FOUND && iRes != ERROR_PATH_NOT_FOUND ) + { + RegCloseKey( hReg ); + return iRes; + } + + dwCount++; + cbData = sizeof dwCount; + iRes = RegSetValueExA( hReg, szFullPath, 0, REG_DWORD, (LPBYTE)&dwCount, cbData ); + + RegCloseKey( hReg ); + } + catch (...) + { + if ( hReg ) + RegCloseKey( hReg ); + return E_FAIL; + } + + return dwCount; +} + + +int ReleaseSharedDll ( LPCSTR szFullPath ) +{ + LPCSTR szRegPath = "Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs"; + HKEY hReg = NULL; + DWORD dwCount = 0; + + if ( IsBadStringPtrA( szFullPath, MAX_PATH ) ) + return E_INVALIDARG; + + try + { + DWORD cbData = sizeof dwCount; + + LONG iRes = RegOpenKeyA( HKEY_LOCAL_MACHINE, szRegPath, &hReg ); + if ( iRes != ERROR_SUCCESS ) + return iRes; + + iRes = RegQueryValueExA( hReg, szFullPath, NULL, NULL, (LPBYTE)&dwCount, &cbData ); + if ( iRes != ERROR_SUCCESS ) + { + RegCloseKey( hReg ); + return iRes; + } + + if ( dwCount > 1 ) + { + dwCount--; + cbData = sizeof dwCount; + iRes = RegSetValueExA( hReg, szFullPath, 0, REG_DWORD, (LPBYTE)&dwCount, cbData ); + } + else + { + dwCount = 0; + iRes = RegDeleteValueA( hReg, szFullPath ); + } + + RegCloseKey( hReg ); + } + catch (...) + { + if ( hReg ) + RegCloseKey( hReg ); + return E_FAIL; + } + + return dwCount; +} + + +bool AddAccessRights( TCHAR *lpszFileName, TCHAR *szUserName, DWORD dwAccessMask ) +{ + // + // SID variables. + // + SID_NAME_USE snuType; + TCHAR * szDomain = NULL; + DWORD cbDomain = 0; + + // + // User name variables. + // + LPVOID pUserSID = NULL; + DWORD cbUserSID = 0; + DWORD cbUserName = 0; + + // + // File SD variables. + // + PSECURITY_DESCRIPTOR pFileSD = NULL; + DWORD cbFileSD = 0; + + // + // New SD variables. + // + PSECURITY_DESCRIPTOR pNewSD = NULL; + + // + // ACL variables. + // + PACL pACL = NULL; + BOOL fDaclPresent; + BOOL fDaclDefaulted; + ACL_SIZE_INFORMATION AclInfo; + + // + // New ACL variables. + // + PACL pNewACL = NULL; + DWORD cbNewACL = 0; + + // + // Temporary ACE. + // + LPVOID pTempAce = NULL; + UINT CurrentAceIndex; + bool fResult = false; + BOOL fAPISuccess; + + // error code + DWORD lastErr = 0; + + try + { + // + // Call this API once to get the buffer sizes ( it will return ERROR_INSUFFICIENT_BUFFER ) + // + fAPISuccess = LookupAccountName( NULL, szUserName, pUserSID, &cbUserSID, szDomain, &cbDomain, &snuType ); + + if( fAPISuccess ) + { + throw E_FAIL; // we throw some fake error to skip through to the exit door + } + else if( GetLastError() != ERROR_INSUFFICIENT_BUFFER ) + { + lastErr = GetLastError(); + LogError( TEXT( "LookupAccountName() failed" ), lastErr ); + throw lastErr; + } + + // + // allocate the buffers + // + pUserSID = calloc( cbUserSID, 1 ); + if( !pUserSID ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for UserSID failed" ), lastErr ); + throw lastErr; + } + + szDomain = ( TCHAR * ) calloc( cbDomain + sizeof TCHAR, sizeof TCHAR ); + if( !szDomain ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for szDomain failed" ), lastErr ); + throw lastErr; + } + + // + // The LookupAccountName function accepts the name of a system and an account as input. + // It retrieves a security identifier ( SID ) for the account and + // the name of the domain on which the account was found + // + fAPISuccess = LookupAccountName( NULL /* = local computer */, szUserName, pUserSID, &cbUserSID, szDomain, &cbDomain, &snuType ); + if( !fAPISuccess ) + { + lastErr = GetLastError(); + LogError( TEXT( "LookupAccountName() failed" ), lastErr ); + throw lastErr; + } + + // + // call this API once to get the buffer sizes + // API should have failed with insufficient buffer. + // + fAPISuccess = GetFileSecurity( lpszFileName, DACL_SECURITY_INFORMATION, pFileSD, 0, &cbFileSD ); + if( fAPISuccess ) + { + throw E_FAIL; + } + else if( GetLastError() != ERROR_INSUFFICIENT_BUFFER ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetFileSecurity() failed" ), lastErr ); + throw lastErr; + } + + // + // allocate the buffers + // + pFileSD = calloc( cbFileSD, 1 ); + if( !pFileSD ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for pFileSD failed" ), lastErr ); + throw lastErr; + } + + // + // call the api to get the actual data + // + fAPISuccess = GetFileSecurity( lpszFileName, DACL_SECURITY_INFORMATION, pFileSD, cbFileSD, &cbFileSD ); + if( !fAPISuccess ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetFileSecurity() failed" ), lastErr ); + throw lastErr; + } + + // + // Initialize new SD. + // + pNewSD = calloc( cbFileSD, 1 ); // Should be same size as FileSD. + if( !pNewSD ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for pNewDS failed" ), GetLastError() ); + throw lastErr; + } + + if( !InitializeSecurityDescriptor( pNewSD, SECURITY_DESCRIPTOR_REVISION ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "InitializeSecurityDescriptor() failed" ), lastErr ); + throw lastErr; + } + + // + // Get DACL from SD. + // + if( !GetSecurityDescriptorDacl( pFileSD, &fDaclPresent, &pACL, &fDaclDefaulted ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetSecurityDescriptorDacl() failed" ), lastErr ); + throw lastErr; + } + + // + // Get size information for DACL. + // + AclInfo.AceCount = 0; // Assume NULL DACL. + AclInfo.AclBytesFree = 0; + AclInfo.AclBytesInUse = sizeof( ACL ); // If not NULL DACL, gather size information from DACL. + if( fDaclPresent && pACL ) + { + if( !GetAclInformation( pACL, &AclInfo, sizeof( ACL_SIZE_INFORMATION ), AclSizeInformation ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetAclInformation() failed" ), lastErr ); + throw lastErr; + } + } + + // + // Compute size needed for the new ACL. + // + cbNewACL = AclInfo.AclBytesInUse + sizeof( ACCESS_ALLOWED_ACE ) + GetLengthSid( pUserSID ); + + // + // Allocate memory for new ACL. + // + pNewACL = ( PACL ) calloc( cbNewACL, 1 ); + if( !pNewACL ) + { + lastErr = GetLastError(); + LogError( TEXT( "HeapAlloc() failed" ), lastErr ); + throw lastErr; + } + + // + // Initialize the new ACL. + // + if( !InitializeAcl( pNewACL, cbNewACL, ACL_REVISION2 ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "InitializeAcl() failed" ), lastErr ); + throw lastErr; + } + + // + // Add the access-allowed ACE to the new DACL. + // + ACE_HEADER aceheader = {0}; + aceheader.AceFlags = CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE; + aceheader.AceSize = sizeof( ACE_HEADER ); + aceheader.AceType = ACCESS_ALLOWED_OBJECT_ACE_TYPE; + if( !AddAccessAllowedAceEx( pNewACL, ACL_REVISION2, aceheader.AceFlags, dwAccessMask, pUserSID ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "AddAccessAllowedAce() failed" ), lastErr ); + throw lastErr; + } + + // + // If DACL is present, copy it to a new DACL. + // + if( fDaclPresent ) + { + // + // Copy the file's ACEs to the new ACL + // + if( AclInfo.AceCount ) + { + for( CurrentAceIndex = 0; CurrentAceIndex < AclInfo.AceCount; CurrentAceIndex++ ) + { + // + // Get an ACE. + // + if( !GetAce( pACL, CurrentAceIndex, &pTempAce ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetAce() failed" ), lastErr ); + throw lastErr; + } + + // + // Add the ACE to the new ACL. + // + if( !AddAce( pNewACL, ACL_REVISION, MAXDWORD, pTempAce, ( ( PACE_HEADER ) pTempAce )->AceSize ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "AddAce() failed" ), lastErr ); + throw lastErr; + } + } + } + } + + // + // Set the new DACL to the file SD. + // + if( !SetSecurityDescriptorDacl( pNewSD, TRUE, pNewACL, FALSE ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "SetSecurityDescriptorDacl() failed" ), lastErr ); + lastErr; + } + + // + // Set the SD to the File. + // + if( !SetFileSecurity( lpszFileName, DACL_SECURITY_INFORMATION, pNewSD ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "SetFileSecurity() failed" ), lastErr ); + throw lastErr; + } + + fResult = TRUE; + } + catch (...) + { + fResult = FALSE; + } + + // + // Free allocated memory + // + if( pUserSID ) + free( pUserSID ); + if( szDomain ) + free( szDomain ); + if( pFileSD ) + free( pFileSD ); + if( pNewSD ) + free( pNewSD ); + if( pNewACL ) + free( pNewACL ); + + return fResult; +} + +// +// This function takes in the name of a Service (ie, MSSQL$DAVESEBESTA), and +// fills a buffer with the name of the startup account for said Service. +// +// It does this by opening the Service Control Manager, getting a handle to +// said Service, and then querying the properties of the service. +// +// returns: ERROR_SUCCESS if everything goes well. +// +LONG +GetServiceStartupAccount( const TCHAR *pwszServiceName, TCHAR *pwszServiceAccount, int iLen ) +{ + memset( pwszServiceAccount, 0, iLen * sizeof( TCHAR ) ); + + // + // 1. Open the Service Control Manager. + // + SC_HANDLE hSCM = OpenSCManager( NULL, NULL, SC_MANAGER_CONNECT ); + if( NULL == hSCM ) + { + Log( _T( "Could not open the Service Control Manager." ) ); + return ERROR_SUCCESS; + } + else + { + Log( _T( "Successfully opened a handle to the Service Control Manager." ) ); + } + + // + // 2. Get a handle to the Service. + // + DWORD dwAccess = SERVICE_QUERY_CONFIG; + SC_HANDLE hSvc = OpenService( hSCM, pwszServiceName, dwAccess ); + if( NULL == hSvc ) + { + Log( _T( "Could not open a handle to the service %s." ), pwszServiceName ); + CloseServiceHandle( hSCM ); + return ERROR_SUCCESS; + } + else + { + Log( _T( "Successfully opened a handle to the service %s." ), pwszServiceName ); + } + + // + // 3. Call QueryServiceConfig. This get us, among other things, the name of + // the account that is used to start the Service. + // + DWORD dwSizeNeeded = 0; + BOOL b = QueryServiceConfig( hSvc, NULL, 0, &dwSizeNeeded ); + DWORD d = GetLastError(); + if( !b && ( ERROR_INSUFFICIENT_BUFFER == d ) ) + { + Log( _T( "About to allocate memory for service config info..." ) ); + } + else + { + Log( _T( "Something went wrong during the call to QueryServiceConfig." ) ); + CloseServiceHandle( hSvc ); + CloseServiceHandle( hSCM ); + return ERROR_SUCCESS; + } + + LPQUERY_SERVICE_CONFIG pSvcQuery = (LPQUERY_SERVICE_CONFIG)malloc( dwSizeNeeded ); + if( NULL == pSvcQuery ) + { + Log( _T( "Ran out of memory." ) ); + CloseServiceHandle( hSvc ); + CloseServiceHandle( hSCM ); + return ERROR_SUCCESS; + } + + b = QueryServiceConfig( hSvc, pSvcQuery, dwSizeNeeded, &dwSizeNeeded ); + if( !b ) + { + Log( _T( "Call to QueryServiceConfig failed." ) ); + free( (void *)pSvcQuery ); + CloseServiceHandle( hSvc ); + CloseServiceHandle( hSCM ); + return ERROR_SUCCESS; + } + + + Log( _T( "Service startup account = %s" ), pSvcQuery->lpServiceStartName ); + + // + // 4. Copy the account into our output buffer, free up memory, and exit. + // + _tcsncpy( pwszServiceAccount, pSvcQuery->lpServiceStartName, iLen ); + + free( (void *)pSvcQuery ); + CloseServiceHandle( hSvc ); + CloseServiceHandle( hSCM ); + return ERROR_SUCCESS; +} + + +// +// Use the instance name to determine the name of the SQL Service. +// +// From the database instance name, you can infer the name of the Service +// for that particular instance. +// +// Instance Name Service Name +// =========================================== +// (default) MSSQLSERVER +// NULL MSSQLSERVER +// MSSQL$ +// +void +GetUDDIDBServiceName( const TCHAR *pwszInstanceName, TCHAR *pwszServiceName, int iLen ) +{ + memset( pwszServiceName, 0, iLen * sizeof( TCHAR ) ); + _tcscpy( pwszServiceName, _T( "MSSQL" ) ); + + if( ( 0 == _tcslen( pwszInstanceName ) ) || + ( 0 == _tcsicmp( pwszInstanceName, _T( "----" ) ) ) || + ( 0 == _tcsicmp( pwszInstanceName, _T( "(default)" ) ) ) ) + { + _tcsncat( pwszServiceName, _T( "SERVER" ), iLen ); + } + else + { + _tcsncat( pwszServiceName, _T( "$" ), iLen ); + _tcsncat( pwszServiceName, pwszInstanceName, iLen ); + } + + Log( _T( "Database service name = %s" ), pwszServiceName ); +} + + +void +AddAccessRightsVerbose( TCHAR *pwszFileName, TCHAR *pwszUserName, DWORD dwMask ) +{ + BOOL b = AddAccessRights( pwszFileName, pwszUserName, dwMask ); + if( !b ) + { + Log( _T( "ACL for file %s was NOT modified." ), pwszFileName ); + } + else + { + Log( _T( "User: %s now has execute permissions on file: %s." ), pwszUserName, pwszFileName ); + } +} diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.def b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.def new file mode 100644 index 0000000..7544edc --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.def @@ -0,0 +1,9 @@ +EXPORTS + Install @1 + InstallResource @2 + RemoveResource @3 + GrantExecutionRights @4 + InstallTaxonomy @5 + RemoveTaxonomy @6 + + diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.h b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.h new file mode 100644 index 0000000..3f59c93 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.h @@ -0,0 +1,2 @@ +#pragma once + diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.rc b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.rc new file mode 100644 index 0000000..0ba18d4 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.rc @@ -0,0 +1,77 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +// +// +// +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "uddiocm Module" +#define VER_INTERNALNAME_STR "UDDIOCM.DLL" +#define VER_ORIGINALFILENAME_STR "UDDIOCM.DLL" + +#include "common.ver" + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.vcproj b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.vcproj new file mode 100644 index 0000000..16645e4 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/dbcaum.vcproj @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/makefile b/inetsrv/uddi/source/setup/db/ca.unmanaged/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/_objects.mac b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/_objects.mac new file mode 100644 index 0000000..bcfdbfd --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/_objects.mac @@ -0,0 +1,32 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\dbcaum.res \ + $(_OBJ_DIR)\i386\apppool.obj \ + $(_OBJ_DIR)\i386\common.obj \ + $(_OBJ_DIR)\i386\dbcaum.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\dbcaum.res \ + $(_OBJ_DIR)\ia64\apppool.obj \ + $(_OBJ_DIR)\ia64\common.obj \ + $(_OBJ_DIR)\ia64\dbcaum.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\dbcaum.res \ + $(_OBJ_DIR)\amd64\apppool.obj \ + $(_OBJ_DIR)\amd64\common.obj \ + $(_OBJ_DIR)\amd64\dbcaum.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\dbcaum.res \ + $(_OBJ_DIR)\arm\apppool.obj \ + $(_OBJ_DIR)\arm\common.obj \ + $(_OBJ_DIR)\arm\dbcaum.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/apppool.obj b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/apppool.obj new file mode 100644 index 0000000..c3d8225 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/apppool.obj differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/common.obj b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/common.obj new file mode 100644 index 0000000..e1ccad1 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/common.obj differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.dll b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.dll new file mode 100644 index 0000000..c0a5f1a Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.dll differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.exp b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.exp new file mode 100644 index 0000000..295e53c Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.exp differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.lib b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.lib new file mode 100644 index 0000000..a5c2418 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.lib differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.obj b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.obj new file mode 100644 index 0000000..2b236a4 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.obj differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.pdb b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.pdb new file mode 100644 index 0000000..b2b96de Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.pdb differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.res b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.res new file mode 100644 index 0000000..d8ad992 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca.unmanaged/obj/i386/dbcaum.res differ diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/placefil.txt b/inetsrv/uddi/source/setup/db/ca.unmanaged/placefil.txt new file mode 100644 index 0000000..a3032b3 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/placefil.txt @@ -0,0 +1 @@ +dbcaum.dll uddi\bin diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/resource.h b/inetsrv/uddi/source/setup/db/ca.unmanaged/resource.h new file mode 100644 index 0000000..2025c73 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by webcaum.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/inetsrv/uddi/source/setup/db/ca.unmanaged/sources b/inetsrv/uddi/source/setup/db/ca.unmanaged/sources new file mode 100644 index 0000000..8bb129a --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca.unmanaged/sources @@ -0,0 +1,52 @@ +TARGETNAME=dbcaum +TARGETPATH=obj +TARGETTYPE=DYNLINK +DLLDEF=dbcaum.def +DLLENTRY=_DllMainCRTStartup + +# +# Added include path of $(FROOT)\src\common for using ocmres.h +# +INCLUDES=$(INCLUDES);$(_NTROOT)\public\sdk\inc\atl30;$(_NTROOT)\public\sdk\inc\mfc42; + + +#PRECOMPILED_CXX=1 +#PRECOMPILED_OBJ=pch.obj +#PRECOMPILED_INCLUDE=stdafx.h +USE_MFCUNICODE=1 +USE_STL=1 +USE_ATL=1 +USE_MSVCRT=1 +ATL_VER=30 + + +TARGETLIBS=\ + $(SDK_LIB_PATH)\atl.lib \ + $(SDK_LIB_PATH)\adsiid.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\oleaut32.lib \ + $(SDK_LIB_PATH)\ole32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\rpcrt4.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\gdi32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\netapi32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\Secur32.lib \ + $(SDK_LIB_PATH)\msi.lib \ + $(SDK_LIB_PATH)\wbemuuid.lib + +SOURCES=\ + apppool.cpp \ + common.cpp \ + dbcaum.cpp \ + dbcaum.rc + +C_DEFINES= $(C_DEFINES) -DDBCAUM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/setup/db/ca/assemblyinfo.cs b/inetsrv/uddi/source/setup/db/ca/assemblyinfo.cs new file mode 100644 index 0000000..0eec67e --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/assemblyinfo.cs @@ -0,0 +1,45 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("dbca.dll")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright (c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/inetsrv/uddi/source/setup/db/ca/assemblyversioninfo.cs b/inetsrv/uddi/source/setup/db/ca/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/setup/db/ca/build.log b/inetsrv/uddi/source/setup/db/ca/build.log new file mode 100644 index 0000000..ed89ff1 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/build.log @@ -0,0 +1,67 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\setup\db\ca directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\setup\db\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\db\ca +Elapsed time [0:00:00.015] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 dbca D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module dbca not found in D:\OpenXP\Tools\coffbase.txt +1> resgen.exe .\dbca.resx obj\i386\dbca.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> echo. +1> +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\setup\db\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 dbca D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module dbca not found in D:\OpenXP\Tools\coffbase.txt +1> resgen.exe .\dbca.resx obj\i386\dbca.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\dbca.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- @cscresponse.txt /r:interop.sqldmo.dll,..\..\..\api\obj\I386\uddi.api.dll,..\..\..\api\PassportLib.dll,..\..\..\core\obj\I386\uddi.core.dll assemblyinfo.cs assemblyversioninfo.cs dbca.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\setup\db\ca\obj\i386\dbca.dll +1> echo. +1> +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:04.000] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/setup/db/ca/createbackupsched.vbs b/inetsrv/uddi/source/setup/db/ca/createbackupsched.vbs new file mode 100644 index 0000000..c458997 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/createbackupsched.vbs @@ -0,0 +1,213 @@ +' Script: createBackupSched.vbs +' Description: Implements backup schedule for UDDI database +' Author: L. Roger Doherty (lrdohert@microsoft.com) +' Date: 10/11/00 + +' Changes: +' 11-13-2000: lrdohert - added WITH INIT option to backup jobs as per bug 712 + +Option Explicit + +Dim oXML +Dim oSQLServer, oBackupDevice, oJobServer, oJob, oJobSchedule, oJobStep +Dim strServer, strDatabase, strBackupDir +Dim strDbBackupDevName, strDbJobName, strBaseLogBackupDevName, strBaseLogJobName +Dim dtNow + +strDbBackupDevName = "UDDI_DB_BACKUP_DEV" +strDbJobName = "UDDI_DB_BACKUP_JOB" + +strBaseLogBackupDevName = "UDDI_LOG_BACKUP_DEV" +strBaseLogJobName = "UDDI_LOG_BACKUP_JOB" + +WScript.Echo "Starting createBackupSched.vbs exection....." +Err.Clear + +If WScript.arguments.Count <> 3 Then + WScript.Echo "Msg: Invalid number of arguments passed." + WScript.Quit +End If + +strServer = WScript.Arguments(0) +strDatabase = WScript.Arguments(1) +strBackupDir = WScript.Arguments(2) + +' Connect to SQL Server +Set oSQLServer = CreateObject("SQLDMO.SQLServer2") + +With oSQLServer + .LoginSecure = True + .Connect strServer +End With + +' Delete old backup devices +For Each oBackupDevice In oSQLServer.BackupDevices + If oBackupDevice.Name = strDbBackupDevName Then + oBackupDevice.Remove + End If +Next + +' Create new database backup device +Set oBackupDevice = CreateObject("SQLDMO.BackupDevice") + +With oBackupDevice + .Name = strDbBackupDevName + .Type = 2 ' SQLDMO_Device_DiskDump + .PhysicalLocation = strBackupDir + "\" + strDbBackupDevName + ".bak" +End With + +oSQLServer.BackupDevices.Add(oBackupDevice) + +' Create transaction log backup devices +CreateLogDumpDevices strBackupDir, strBaseLogBackupDevName, 23 + +' +' Connect to SQL Agent +' + +Set oJobServer = oSQLServer.JobServer + +' Check to see if SQL Agent is running +If oJobServer.Status <> 1 Then + WScript.Echo "Msg: SQL Agent is not running. Cannot create backup schedule." + WScript.Quit +End If + +' Delete old jobs if they exist +For Each oJob In oJobServer.Jobs + If oJob.Name = strDbJobName Then + oJob.Remove + End If +Next + +' Create new Database Backup Job +Set oJob = CreateObject("SQLDMO.Job") + +With oJob + .Name = strDbJobName +End With + +oJobServer.Jobs.Add(oJob) +Set oJob=oJobServer.Jobs(strDbJobName) + +Set oJobSchedule = CreateObject("SQLDMO.JobSchedule") + +dtNow = Now() + +With oJobSchedule + .Name = "Daily" + .Schedule.ActiveStartDate=(DatePart("yyyy",dtNow) * 10000) + (DatePart("m",dtNow) * 100) + DatePart("d",dtNow) + .Schedule.ActiveStartTimeOfDay=000000 + .Schedule.FrequencyType=4 ' SQLDMOFreq_Daily + .Schedule.FrequencyInterval=1 +End With + +oJob.JobSchedules.Add(oJobSchedule) + +Set oJobStep = CreateObject("SQLDMO.JobStep") + +With oJobStep + .Name="BACKUP DATABASE" + .Command="BACKUP DATABASE " + strDatabase + " TO " + strDbBackupDevName + " WITH INIT" + .StepID=1 +End With + +oJob.JobSteps.Add(oJobStep) +oJob.ApplyToTargetServer "(local)" + +' Create the backup log jobs +CreateLogBackupJobs strDatabase, strBaseLogJobName, strBaseLogBackupDevName, 23 + +' Run the database backup job +Set oJob = oJobServer.Jobs(strDbJobName) +oJob.Invoke + +WScript.Echo "Ending createBackupSched.vbs exection......" + +Sub CreateLogDumpDevices(strBackupDir, strBaseName, intNumLogs) + Dim i + Dim strI + + For i = 1 to intNumLogs + If Len(CStr(i)) = 1 Then + strI = "0" + CStr(i) + Else + strI = Cstr(i) + End If + + ' Delete backup device if it exists + For Each oBackupDevice In oSQLServer.BackupDevices + If oBackupDevice.Name = (strBaseName + "_" + strI) Then + oBackupDevice.Remove + End If + Next + + Set oBackupDevice = CreateObject("SQLDMO.BackupDevice") + + With oBackupDevice + .Name = strBaseName + "_" + strI + .Type = 2 ' SQLDMO_Device_DiskDump + .PhysicalLocation = strBackupDir + "\" + strBaseName + "_" + strI + ".bak" + End With + + oSQLServer.BackupDevices.Add(oBackupDevice) + Next +End Sub + +Sub CreateLogBackupJobs(strDatabase, strBaseJobName, strBaseDevName, intNumJobs) + Dim i + Dim strJobName, strDevName + Dim dtNow + + For i = 1 to intNumJobs + If Len(CStr(i)) = 1 Then + strJobName = strBaseJobName + "_0" + CStr(i) + strDevName = strBaseDevName + "_0" + CStr(i) + Else + strJobName = strBaseJobName + "_" + CStr(i) + strDevName = strBaseDevName + "_" + CStr(i) + End If + + ' Delete old jobs if they exist + For Each oJob In oJobServer.Jobs + If oJob.Name = strJobName Then + oJob.Remove + End If + Next + + ' Create new Log Backup Job + Set oJob = CreateObject("SQLDMO.Job") + + With oJob + .Name = strJobName + End With + + oJobServer.Jobs.Add(oJob) + Set oJob=oJobServer.Jobs(strJobName) + + Set oJobSchedule = CreateObject("SQLDMO.JobSchedule") + + dtNow = Now() + + With oJobSchedule + .Name = "Daily" + .Schedule.ActiveStartDate=(DatePart("yyyy",dtNow) * 10000) + (DatePart("m",dtNow) * 100) + DatePart("d",dtNow) + .Schedule.ActiveStartTimeOfDay=(i * 10000) + .Schedule.FrequencyType=4 ' SQLDMOFreq_Daily + .Schedule.FrequencyInterval=1 + End With + + oJob.JobSchedules.Add(oJobSchedule) + + Set oJobStep = CreateObject("SQLDMO.JobStep") + + With oJobStep + .Name=strDevName + .Command="BACKUP LOG " + strDatabase + " TO " + strDevName + " WITH INIT" + .StepID=1 + End With + + oJob.JobSteps.Add(oJobStep) + oJob.ApplyToTargetServer "(local)" + Next +End Sub \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/ca/cscresponse.txt b/inetsrv/uddi/source/setup/db/ca/cscresponse.txt new file mode 100644 index 0000000..f9e39c9 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/cscresponse.txt @@ -0,0 +1,19 @@ + +/res:uddi.v2.admin.sql +/res:uddi.v2.bindingTemplate.sql +/res:uddi.v2.businessEntity.sql +/res:uddi.v2.businessService.sql +/res:uddi.v2.ddl.sql +/res:uddi.v2.dml.sql +/res:uddi.v2.func.sql +/res:uddi.v2.messages.sql +/res:uddi.v2.publisher.sql +/res:uddi.v2.repl.sql +/res:uddi.v2.ri.sql +/res:uddi.v2.sec.sql +/res:uddi.v2.sp.sql +/res:uddi.v2.tableopts.sql +/res:uddi.v2.tModel.sql +/res:uddi.v2.uisp.sql +/res:uddi.v2.trig.sql +/res:uddi.v2.xp.uninstall.sql \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/ca/dbca.cs b/inetsrv/uddi/source/setup/db/ca/dbca.cs new file mode 100644 index 0000000..95a0501 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/dbca.cs @@ -0,0 +1,1811 @@ +/// ************************************************************************ +/// Microsoft UDDI version 2.0 +/// Copyright (c) 2000-2002 Microsoft Corporation +/// All rights reserved +/// +/// ** Microsoft Confidential ** +/// ------------------------------------------------------------------------ +/// +/// +/// ************************************************************************ +/// +using System; +using System.IO; +using System.Data; +using Microsoft.Win32; +using System.DirectoryServices; +using System.Diagnostics; +using System.Reflection; +using System.Globalization; +using System.Collections; +using System.Collections.Specialized; +using System.Data.SqlClient; +using System.ComponentModel; +using System.Configuration.Install; +using System.ServiceProcess; +using System.Security.Cryptography; +using System.Runtime.InteropServices; +using System.Windows.Forms; +using System.Security.Principal; + +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.ActiveDirectory; + + +namespace UDDI.DBCA +{ + [ RunInstaller( true ) ] + public class Installer : System.Configuration.Install.Installer + { + private SQLDMO.SQLServer2 server = null; + private SQLDMO.Database2 database = null; + private SQLDMO.Database2 masterdb = null; + + private const string dbName = "uddi"; //name of the uddi database + private const string dataFolderName = "data"; //name of the uddi data folder + private const string resetkeyfile = @"bin\resetkey.exe"; + private const string uddiXPFile = @"bin\uddi.xp.dll"; + private const int SQL_ALREADY_STARTED = -2147023840; + private StringCollection uninstDataFiles = null; + + private const string busEntityParamName = "UPRV"; // context value expected + private const string clustNodeTypeParam = "CNTYPE"; // cluster node type + private const string busEntityKeyName = "Site.Key"; // we use this name to save the key in the Config + private const string siteVerKeyName = "Site.Version"; // we use this name to save the product vesrion in the Config + private const string siteLangKeyName = "Site.Language"; // we use this name to save the default product language in the Config + private const string defaultOperatorkey = "Operator"; + + private const string clustNodeActive = "A"; // Denotes an "active" node + private const string clustNodePassive = "P"; // Denotes a "passive" aka non-owning node + + private const string regDBServerKeyName = "SOFTWARE\\Microsoft\\UDDI\\Setup\\DBServer"; + private const string regVersionKeyName = "ProductVersion"; + + private const string tmodelUddiOrgOpers = "uuid:327a56f0-3299-4461-bc23-5cd513e95c55"; + private const string tokenOBEKeyValue = "operationalBusinessEntity"; + + // + // Database path and file name variables + // + private const string propSysFilePath = "SFP"; + private const string propCoreFilePath_1 = "C1P"; + private const string propCoreFilePath_2 = "C2P"; + private const string propJournalFilePath = "JRNLP"; + private const string propStagingFilePath = "STGP"; + private const string propXactLogFilePath = "XLP"; + + private string SystemFilePath; + private string SystemFileSpec; + private string Core1FilePath; + private string Core1FileSpec; + private string Core2FilePath; + private string Core2FileSpec; + private string JournalFilePath; + private string JournalFileSpec; + private string StagingFilePath; + private string StagingFileSpec; + private string LogFilePath; + private string LogFileSpec; + + const string RegisterXpSqlFormat = @" +IF EXISTS (SELECT * FROM sysobjects where name = 'xp_reset_key' and type = 'X') + EXEC sp_dropextendedproc 'xp_reset_key' +GO + +EXEC sp_addextendedproc 'xp_reset_key', '{0}' +GO + +IF EXISTS (SELECT * FROM sysobjects where name= 'xp_recalculate_statistics' and type = 'X') + EXEC sp_dropextendedproc 'xp_recalculate_statistics' +GO + +EXEC sp_addextendedproc 'xp_recalculate_statistics', '{0}' +GO"; + + // + // These sql scripts will get executed in the master database after the + // database is created. + // + string[] masterInstallScripts = { "uddi.v2.messages.sql" }; + + // + // These sql scripts will get executed in the master database when the + // database is being uninstalled. + // + string[] masterUninstallScripts = { "uddi.v2.xp.uninstall.sql" }; + + // + // These sql scripts will get executed in the uddi database + // after the master database scripts are run + // + string[] uddiScripts = + { + "uddi.v2.ddl.sql", + "uddi.v2.tableopts.sql", + "uddi.v2.ri.sql", + "uddi.v2.dml.sql", + "uddi.v2.func.sql", + "uddi.v2.sp.sql", + "uddi.v2.admin.sql", + "uddi.v2.repl.sql", + "uddi.v2.trig.sql", + "uddi.v2.uisp.sql", + "uddi.v2.tModel.sql", + "uddi.v2.businessEntity.sql", + "uddi.v2.businessService.sql", + "uddi.v2.bindingTemplate.sql", + "uddi.v2.publisher.sql", + "uddi.v2.sec.sql" }; + + private System.ComponentModel.Container components = null; + + public Installer() + { + Enter(); + + try + { + // + // This call is required by the Designer. + // + InitializeComponent(); + uninstDataFiles = new StringCollection(); + } + catch ( Exception e ) + { + LogException( "Installer()", e ); + throw e; + } + finally + { + Leave(); + } + } + + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + Enter(); + + try + { + components = new System.ComponentModel.Container(); + } + catch ( Exception e ) + { + Debug.WriteLine( "Exception in 'InitializeComponent()': " + e.Message ); + } + finally + { + Leave(); + } + } + #endregion + + + private void InitializeSQLDMO() + { + Enter(); + + try + { + server = new SQLDMO.SQLServer2Class(); + } + catch( Exception e ) + { + Log( "The database installer failed to construct an instance of the SQLDMO.SQLServer2 class. SQL Server may not be installed." ); + + + + throw new InstallException( string.Format( "Exception occured during database install: '{0}'", "InitializeSQLDMO" ) , e ); + + } + finally + { + Leave(); + } + } + + + public override void Install( System.Collections.IDictionary state ) + { + Enter(); + + try + { + // System.Windows.Forms.MessageBox.Show( "UDDI Application Installer Stop", "UDDI.Debug" ); + + InitializeSQLDMO(); + InitializeDataFiles(); + + // + // Set up the cleanup data + // + uninstDataFiles.Clear(); + uninstDataFiles.Add( SystemFileSpec ); + uninstDataFiles.Add( Core1FileSpec ); + uninstDataFiles.Add( Core2FileSpec ); + uninstDataFiles.Add( JournalFileSpec ); + uninstDataFiles.Add( StagingFileSpec ); + uninstDataFiles.Add( LogFileSpec ); + + // + // Proceed with the base installer routine + // + base.Install( state ); + + // + // First, are we on a cluster node ? + // + bool bActiveNode = false; + bool bStandalone = true; + string sClusterNodeType = Context.Parameters[ clustNodeTypeParam ]; + + if ( sClusterNodeType == null || sClusterNodeType == "" ) + { + bActiveNode = false; + bStandalone = true; + } + else if ( String.Compare( sClusterNodeType, clustNodeActive, true ) == 0 ) + { + bActiveNode = true; + bStandalone = false; + } + else + { + bActiveNode = false; + bStandalone = false; + } + + // + // On a "passive" node we do not do most of the CA operations + // + + if ( bActiveNode || bStandalone ) + { + bool bDatabaseFound = false; + + // + // Do the custom action here. Start with cleaning the stage + // + if ( bStandalone ) + CleanupDataFiles(); + + // + // Now proceed with the installation itself + // + StartSQLService(); + ConnectToDatabase(); + CheckDatabaseConfiguration(); + + // + // If we are on an active cluster node, we should not attempt + // to overwrite the database + // + if ( bActiveNode ) + { + bDatabaseFound = FindUDDIDatabase(); + } + + if ( !bDatabaseFound ) + { + WriteDatabase(); + LocateDatabase(); + + // + // Register our extended stored procedures. Need to do this first since our scripts refer to these. + // + RegisterExtendedStoredProcedures(); + + // + // Run the scripts. + // + foreach( string scriptName in masterInstallScripts ) + { + string script = GetResource( scriptName ); + + Log( string.Format( "Executing {0} SQL script.", scriptName ) ) ; + + masterdb.ExecuteImmediate( script, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default, script.Length ); + } + + foreach( string scriptName in uddiScripts ) + { + string script = GetResource( scriptName ); + + Log( string.Format( "Executing {0} SQL script.", scriptName ) ) ; + + database.ExecuteImmediate( script, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default, script.Length ); + } + + // + // Configure the database + // + SQLDMO.DBOption2 dboption2 = ( SQLDMO.DBOption2 ) database.DBOption; + dboption2.RecoveryModel = SQLDMO.SQLDMO_RECOVERY_TYPE.SQLDMORECOVERY_Simple; + + SetSSLRequired(); + + ImportBootstrapData(); + GenerateCryptoKey(); + + string szSiteDesc = Localization.GetString( "DBCA_UDDI_DESC_SITE" ); + AssignOperator( Context.Parameters[ busEntityParamName ] ); + CreateBusinessEntity( Context.Parameters[ busEntityParamName ], szSiteDesc ); + // RegisterWithActiveDirectory(); + + RecalculateStatistics(); + UpdateVersionFromRegistry(); + UpdateSiteLanguage( 0 ); + } + } // active Node + + try + { + StartService( "RemoteRegistry", 30 ); + } + catch ( Exception e ) + { + LogException( string.Format( "Exception occured during database install: '{0}'", "RemoteRegistry Start" ) , e ); + } + } + catch( Exception e ) + { + throw new InstallException( LogException( string.Format( "Exception occured during database install: '{0}'", "Installer.Install" ) , e ) ); + } + finally + { + Leave(); + } + } + + public override void Uninstall( System.Collections.IDictionary state ) + { + Enter(); + // System.Windows.Forms.MessageBox.Show( "UDDI Application Installer Stop Uninstall", "UDDI.Debug" ); + + try + { + try + { + string userName = WindowsIdentity.GetCurrent().Name; + Log( "Execuring uninstall as " + userName ); + } + catch (Exception) + { + } + // + // try to shut down the database + // + try + { + InitializeSQLDMO(); + uninstDataFiles.Clear(); + + base.Uninstall( state ); + + // + // First, are we on a cluster node ? + // + bool bActiveNode = false; + string sClusterNodeType = Context.Parameters[ clustNodeTypeParam ]; + + if ( sClusterNodeType == null || sClusterNodeType == "" ) + bActiveNode = true; // we are not on a node, assume "active" mode + else if ( String.Compare( sClusterNodeType, clustNodeActive, true ) == 0 ) + bActiveNode = true; + else + bActiveNode = false; + + + if ( bActiveNode ) + { + StartSQLService(); + ConnectToDatabase(); + } + + // + // Attempt to remove the AD entry + // + try + { + RemoveADSiteEntry(); + } + catch ( Exception ) + { + } + + if ( bActiveNode ) + { + LocateDatabase(); + + // + // Run the uninstall SQL scripts + // + foreach( string scriptName in masterUninstallScripts ) + { + string script = GetResource( scriptName ); + + Log( string.Format( "Executing {0} SQL script.", scriptName ) ) ; + + masterdb.ExecuteImmediate( script, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default, script.Length ); + } + + CollectDatafilePaths(); + TakeDatabaseOffline(); + DetachDatabase(); + + CleanupDataFiles(); + } + } + catch + { + // do not throw exceptions on uninstall + } + + } + finally + { + Leave(); + } + } + + public override void Rollback( System.Collections.IDictionary state ) + { + Enter(); + base.Rollback( state ); + Uninstall( state ); + Leave(); + } + + protected void StartSQLService() + { + Enter(); + + string instanceName = ""; + + try + { + // get the instance name from the registry + instanceName = ( string ) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstanceName" ); + server.Name = instanceName; + + Log( string.Format( "Attempting to start database {0}.", instanceName ) ); + + + server.Start( false, instanceName, null, null ); + + WaitForSQLServiceStartup(); + + Log( string.Format( "Database server {0} successfully started.", instanceName ) ); + } + catch( COMException e ) + { + if( SQL_ALREADY_STARTED != e.ErrorCode ) + { + string excepstr = string.Format( "Unable to start the UDDI database server {0}.", ((""!=instanceName)?instanceName:"(UNKNOWN)" )); + + throw new InstallException( LogException( excepstr , e ) ); + } + else + { + Log( string.Format( "Database {0} already started.", instanceName ) ); + } + } + catch( Exception e ) + { + string excepstr = string.Format( "Unable to start the UDDI database server {0}.", ((null!=instanceName)?instanceName:"(UNKNOWN)" )); + + throw new InstallException( LogException( excepstr , e ) ); + } + finally + { + Leave(); + } + } + + protected void WaitForSQLServiceStartup() + { + Enter(); + + try + { + // + // wait for a while for the serice to start + // + + Log( "Waiting for SQL Service to start..." ); + + for( int i=0; i<15; i++ ) + { + try + { + if( server.Status == SQLDMO.SQLDMO_SVCSTATUS_TYPE.SQLDMOSvc_Running ) + break; + } + catch( Exception e ) + { + Log( string.Format( "Error testing the DB server status: {0}", e.Message ) ); + } + + System.Threading.Thread.Sleep( 3000 ); + } + + if( server.Status != SQLDMO.SQLDMO_SVCSTATUS_TYPE.SQLDMOSvc_Running ) + { + throw new InstallException( "Unable to start the SQL database." ); + } + + Log( "SQL Service Started!" ); + } + finally + { + Leave(); + } + } + + protected void ConnectToDatabase() + { + Enter(); + + server.LoginSecure = true; + string instanceName = null; + try + { + server.LoginTimeout = ( int ) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI\Database" ).GetValue( "Timeout", 90 ); + + instanceName = ( string ) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstanceName" ); + + Log( string.Format( "Attempting to connect to database server: {0}", instanceName ) ); + + server.Connect( instanceName, null, null ); + } + catch( Exception e ) + { + string excepstr = string.Format( "Unable to connect to database server {0}.", ( (null!=instanceName)?instanceName:"(UNKNOWN)" ) ); + throw new InstallException( LogException( excepstr, e ) ); + } + finally + { + Leave(); + } + } + + protected void CheckDatabaseConfiguration() + { + Enter(); + + try + { + string errStr = ""; + + if( !server.Issysadmin ) + { + errStr = "The current user does not have administrative privileges."; + LogError( errStr ); + throw new InstallException( errStr ); + } + + if( server.VersionMajor < 8 ) + { + errStr = "Unsupported release of SQL Server."; + throw new InstallException( LogError( errStr ) ); + } + } + finally + { + Leave(); + } + } + + + protected bool FindUDDIDatabase() + { + Enter(); + + bool found = false; + try + { + for( int k=1; k <= server.Databases.Count; k++ ) + { + string tempName = server.Databases.Item( k, null ).Name; + + if( tempName.Equals( dbName ) ) + { + found = true; + break; + } + } + } + catch( Exception e ) + { + LogException( "FindUDDIDatabase", e ); + } + finally + { + Leave(); + } + + return found; + } + + + protected void LocateDatabase() + { + Enter(); + + try + { + for( int k=1; k <= server.Databases.Count; k++ ) + { + string tempName = server.Databases.Item( k, null ).Name; + + if( tempName.Equals( dbName ) ) + { + database = ( SQLDMO.Database2 ) server.Databases.Item( k, null ); + } + else if( tempName.Equals( "master" ) ) + { + masterdb = ( SQLDMO.Database2 ) server.Databases.Item( k, null ); + } + } + + if( null == ( object ) database ) + { + string errstr = string.Format( "Couldn't find the database: {0}", dbName ); + throw new InstallException( LogError( errstr ) ); + } + if( null == ( object ) masterdb ) + { + string errstr = string.Format( "Couldn't find the database: {0}", "master" ); + throw new InstallException( LogError( errstr ) ); + } + } + finally + { + Leave(); + } + } + + protected string CheckForSlash( string str ) + { + if( !str.EndsWith( @"\" ) ) + { + return ( str + @"\" ); + } + + return str; + } + + protected void WriteDatabase() + { + Enter(); + + try + { + // + // Create directories, clean up old files if they exist + // + Log( "SystemFilePath=" + SystemFilePath ); + if( !Directory.Exists( SystemFilePath ) ) + Directory.CreateDirectory( SystemFilePath ); + + Log( "Core1FilePath=" + Core1FilePath ); + if( !Directory.Exists( Core1FilePath ) ) + Directory.CreateDirectory( Core1FilePath ); + + Log( "Core2FilePath=" + Core2FilePath ); + if( !Directory.Exists( Core2FilePath ) ) + Directory.CreateDirectory( Core2FilePath ); + + Log( "JournalFilePath=" + JournalFilePath ); + if( !Directory.Exists( JournalFilePath ) ) + Directory.CreateDirectory( JournalFilePath ); + + Log( "StagingFilePath=" + StagingFilePath ); + if( !Directory.Exists( StagingFilePath ) ) + Directory.CreateDirectory( StagingFilePath ); + + Log( "LogFilePath=" + LogFilePath ); + if( !Directory.Exists( LogFilePath ) ) + Directory.CreateDirectory( LogFilePath ); + + // + // Create database + // + + try + { + database = new SQLDMO.Database2Class(); + database.Name = dbName; + + // + // Create the system file in the primary filegroup + // + Log( "System database file = " + SystemFileSpec ); + + SQLDMO.DBFile dbFile = new SQLDMO.DBFileClass(); + dbFile.Name = "UDDI_SYS"; + dbFile.PhysicalName = SystemFileSpec; + database.FileGroups.Item( "PRIMARY" ).DBFiles.Add( dbFile ); + + // + // Create the database log file + // + Log( "Setting UDDI log file = " + LogFileSpec ); + + SQLDMO.LogFile logFile = new SQLDMO.LogFileClass(); + logFile.Name = "UDDI_LOG"; + logFile.PhysicalName = LogFileSpec; + database.TransactionLog.LogFiles.Add( logFile ); + + server.Databases.Add( database ); + + LocateDatabase(); + + // + // Create the core filegroup + // + + SQLDMO.FileGroup2 corefilegroup = new SQLDMO.FileGroup2Class(); + corefilegroup.Name = "UDDI_CORE"; + database.FileGroups.Add( corefilegroup ); + + // + // Create the Core 1 file + // + + Log( "Core 1 database file = " + Core1FileSpec ); + + SQLDMO.DBFile core1file = new SQLDMO.DBFileClass(); + core1file.Name = "UDDI_CORE_1"; + core1file.PhysicalName = Core1FileSpec; + database.FileGroups.Item( "UDDI_CORE" ).DBFiles.Add( core1file ); + + // + // Create the Core 2 file + // + + Log( "Core 2 database file = " + Core2FileSpec ); + + SQLDMO.DBFile core2file = new SQLDMO.DBFileClass(); + core2file.Name = "UDDI_CORE_2"; + core2file.PhysicalName = Core2FileSpec; + database.FileGroups.Item( "UDDI_CORE" ).DBFiles.Add( core2file ); + + // + // Create the journal filegroup + // + + SQLDMO.FileGroup2 journalfilegroup = new SQLDMO.FileGroup2Class(); + journalfilegroup.Name = "UDDI_JOURNAL"; + database.FileGroups.Add( journalfilegroup ); + + // + // Create the journal file + // + + Log( "Journal database file = " + JournalFileSpec ); + + SQLDMO.DBFile journalfile = new SQLDMO.DBFileClass(); + journalfile.Name = "UDDI_JOURNAL_1"; + journalfile.PhysicalName = JournalFileSpec; + database.FileGroups.Item( "UDDI_JOURNAL" ).DBFiles.Add( journalfile ); + + // + // Create the staging filegroup + // + + SQLDMO.FileGroup2 stagingfilegroup = new SQLDMO.FileGroup2Class(); + stagingfilegroup.Name = "UDDI_STAGING"; + database.FileGroups.Add( stagingfilegroup ); + + // + // Create the staging file + // + + Log( "Staging database file = " + StagingFileSpec ); + + SQLDMO.DBFile stagingfile = new SQLDMO.DBFileClass(); + stagingfile.Name = "UDDI_STAGING_1"; + stagingfile.PhysicalName = StagingFileSpec; + database.FileGroups.Item( "UDDI_STAGING" ).DBFiles.Add( stagingfile ); + } + catch ( Exception e ) + { + string errstr = string.Format( "Unable to add the database: {0}", database ); + throw new InstallException( LogException( errstr, e ) ); + } + } + finally + { + Leave(); + } + } + + protected void TakeDatabaseOffline() + { + Enter(); + + Debug.Assert( null != masterdb, "masterdb is null" ); + Debug.Assert( null != dbName, "dbName is null" ); + + string commandBatch = "ALTER DATABASE " + dbName + " SET OFFLINE WITH ROLLBACK IMMEDIATE"; + + try + { + masterdb.ExecuteImmediate( commandBatch, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default, commandBatch.Length ); + } + catch ( Exception e ) + { + string errstr = string.Format( "Couldn't take the following database offline: {0}",dbName ); + throw new InstallException( LogException( errstr, e ) ); + } + finally + { + Leave(); + } + } + + protected void DetachDatabase() + { + Enter(); + + Debug.Assert( null != server, "server is null" ); + Debug.Assert( null != dbName, "dbName is null" ); + + try + { + string status = server.DetachDB( dbName, false ); + Log( "DetachDatabase() returned: " + status ); + } + catch ( Exception e ) + { + string errstr = string.Format( "Couldn't detach the following database: {0}", dbName ); + throw new InstallException( LogException( errstr, e ) ); + } + finally + { + Leave(); + } + } + + + protected void CleanupDataFiles() + { + Enter(); + + foreach ( string fileName in uninstDataFiles ) + { + try + { + CleanupDatabaseFile( fileName ); + } + catch (Exception) + { + } + } + + Leave(); + } + + + protected void CleanupDatabaseFile( string filespec ) + { + Enter(); + + try + { + Log( "Cleaning up: " + filespec ); + + MoveDatabaseFile( filespec ); + DeleteDatabaseFile( filespec ); + } + catch + { + string errstr = string.Format( "These file must be renamed or moved: '{0}'", filespec ); + throw new InstallException( LogError( errstr ) ); + } + finally + { + Leave(); + } + + return; + } + + protected void MoveDatabaseFile( string filespec ) + { + Enter(); + + // + // rename data file + // + try + { + string fname = filespec.Trim(); + + if ( !File.Exists( fname ) ) + { + Log( "File not found: " + fname ); + return; + } + + Log( "Renaming..." ); + + for ( int i = 0; i < 10000; i++ ) + { + string fileRename = fname; + + if ( i < 10 ) + fileRename += ".0" + i.ToString(); + else + fileRename += "." + i.ToString(); + + if( !File.Exists( fileRename ) ) + { + File.Copy( fname, fileRename, /* overwrite= */ true ); + break; + } + } + } + catch( Exception e ) + { + string errstr = string.Format( "Error renaming data file: '{0}'",filespec ); + throw new InstallException( LogException( errstr, e ) ); + } + finally + { + Leave(); + } + } + + protected void DeleteDatabaseFile( string filespec ) + { + Enter(); + + try + { + string fname = filespec.Trim(); + + // + // delete data file + // + if( File.Exists( fname ) ) + { + Log( "Deleting..." ); + File.Delete( fname ); + } + + } + catch( Exception e ) + { + throw new InstallException( LogException( "Error deleting database files.", e ) ); + } + finally + { + Leave(); + } + } + + protected void SetSSLRequired() + { + Enter(); + + string connectionString = ""; + + try + { + // + // The SSL setting (0 or 1) is passed to this custom action on the command line + // + string sslrequired = Context.Parameters[ "SSL" ]; + + // + // get the connection string and connect to the db + // + connectionString = ( string ) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI\Database" ).GetValue( "WriterConnectionString" ); + SqlConnection conn = new SqlConnection( connectionString ); + SqlCommand cmd = new SqlCommand( "net_config_save", conn ); + + conn.Open(); + + try + { + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.Add( new SqlParameter( "@configName", SqlDbType.NVarChar, UDDI.Constants.Lengths.ConfigName ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@configValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.ConfigValue ) ).Direction = ParameterDirection.Input; + + cmd.Parameters[ "@configName" ].Value = "Security.HTTPS"; + cmd.Parameters[ "@configValue" ].Value = sslrequired; + cmd.ExecuteNonQuery(); + } + finally + { + conn.Close(); + } + } + catch( Exception e ) + { + string logstr = string.Format( "Exception occured during database install: '{0}'", "SetSSLRequired()", connectionString ); + Log( logstr ); + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "SetSSLRequired()", connectionString ) ); + + string errstr = string.Format( "Error setting value for: {0}", "Security.HTTPS" ); + throw new InstallException( LogException( errstr, e ) ); + } + finally + { + Leave(); + } + } + + + public void SetStartType( string svcName, ServiceStartMode startType ) + { + Enter(); + + try + { + // + // open the registry entry for the service + // + RegistryKey HKLM = Registry.LocalMachine; + RegistryKey svcKey = HKLM.OpenSubKey( "SYSTEM\\CurrentControlSet\\Services\\" + svcName, true ); + + // + // now set the start type + // + switch( startType ) + { + case ServiceStartMode.Automatic: + svcKey.SetValue ( "Start", 2 ); + break; + + case ServiceStartMode.Manual: + svcKey.SetValue ( "Start", 3 ); + break; + + case ServiceStartMode.Disabled: + svcKey.SetValue ( "Start", 4 ); + break; + } + + svcKey.Close(); + HKLM.Close(); + } + catch( Exception e ) + { + throw new InstallException( LogException( string.Format( "Error setting value for: {0}", svcName ), e ) ); + } + finally + { + Leave(); + } + } + + + public void StartService ( string svcName, int timeoutSec ) + { + Enter(); + + try + { + ServiceController controller; + ServiceControllerStatus srvStatus; + TimeSpan timeout = new TimeSpan ( 0, 0, timeoutSec ); + + // + // first, connect to the SCM on the local box + // and attach to the service, then get its status + // + controller = new ServiceController ( svcName ); + srvStatus = controller.Status; + + // + // what is the service state? + // + switch ( srvStatus) + { + // + // stopped ? + // + case ServiceControllerStatus.Stopped: + controller.Start(); + break; + + // + // are we trying to start? + // + case ServiceControllerStatus.StartPending: + case ServiceControllerStatus.ContinuePending: + break; + + // + // are we trying to stop? + // + case ServiceControllerStatus.StopPending: + controller.WaitForStatus( ServiceControllerStatus.Stopped, timeout ); + controller.Start(); + break; + + // + // pausing ? + // + case ServiceControllerStatus.PausePending: + controller.WaitForStatus ( ServiceControllerStatus.Paused, timeout ); + controller.Continue(); + break; + + default: // the service is already running. Just leave it alone + break; + } + + // + // wait 'till the service wakes up + // + controller.WaitForStatus ( ServiceControllerStatus.Running, timeout ); + } + catch( Exception e ) + { + throw new InstallException( LogException( string.Format( "Unable to start the service: {0}", svcName ), e ) ); + } + finally + { + Leave(); + } + } + + + public void RegisterWithActiveDirectory() + { + try + { + } + catch( Exception e ) + { + LogException( "RegisterWithActiveDirectory", e ); + throw e; + } + } + + public void ImportBootstrapData() + { + Enter(); + + try + { + // + // load all the bootstrap files found in the \uddi\bootstrap folder + // + string targetDir = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstallRoot" ).ToString(); + string bootstrapdir = CheckForSlash(targetDir) + "bootstrap"; + string bootstrapexe = CheckForSlash(targetDir) + @"bin\bootstrap.exe"; + + Log( "Getting list of bootstrap files from directory '" + bootstrapdir + "'" ); + + // + // 751411 - Explicitly sort the files we receive in alphabetical order. + // + BootStrapFileOrder fileOrder = new BootStrapFileOrder(); + string[] filepaths = Directory.GetFiles( bootstrapdir, "*.xml" ); + + // + // Log if we could not obtain an expected order. We can continue since BootStrapFileOrder + // will use a default order. + // + if( false == fileOrder.UsingExpectedOrder ) + { + Log( "Warning, bootstrap files were not sorted with the expected culture information (en-US). This may cause incomplete data to be stored in the UDDI Services database, or cause the installation to fail." ); + } + Array.Sort( filepaths, fileOrder ); + + Log( "Writing " + filepaths.Length + " baseline resources to database." ); + + foreach( string filepath in filepaths ) + { + Log( "Importing bootstrap data from: " + filepath ); + + ProcessStartInfo startInfo = new ProcessStartInfo( bootstrapexe, "/f \""+ filepath + "\""); + + startInfo.CreateNoWindow = true; + startInfo.UseShellExecute = false; + startInfo.RedirectStandardOutput = true; + + Process p = new Process(); + p = Process.Start( startInfo ); + + // + // grab the stdout string + // + string bootstrapOutput = p.StandardOutput.ReadToEnd(); + + // + // wait for bootstrap.exe to complete + // + p.WaitForExit(); + + // + // write the stdout string to the log + // + Log( bootstrapOutput ); + + if( p.ExitCode != 0 ) + { + LogError( "ImportBootstrapData failed!" ); + } + } + } + catch( Exception e ) + { + throw new InstallException( LogException( "Error importing the Bootstrap data.", e ) ); + } + finally + { + Leave(); + } + } + + protected void GenerateCryptoKey() + { + Enter(); + + try + { + Log( "Generating cryptography key" ); + + // + // get the path to the exe we run + // + string targetDir = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstallRoot" ).ToString(); + string resetkeypath = targetDir + resetkeyfile; + + // + // make sure that the resetkey.exe was installed ok + // + if( !File.Exists( resetkeypath ) ) + { + throw new InstallException( LogError( string.Format( "Unable to find the following file: '{0}'", resetkeypath ) ) ); + } + + ProcessStartInfo startInfo = new ProcessStartInfo( resetkeypath ); + + startInfo.Arguments = "/now"; + startInfo.CreateNoWindow = true; + startInfo.UseShellExecute = false; + startInfo.RedirectStandardOutput = true; + + Process p = new Process(); + p = Process.Start( startInfo ); + + // + // grab the stdout string + // + string output = p.StandardOutput.ReadToEnd(); + + // + // wait for exe to complete + // + p.WaitForExit(); + + // + // write the stdout string to the log + // + // don't put this data into the log! + // Log( output ); + + if( p.ExitCode != 0 ) + { + throw new InstallException( LogError( string.Format( "Exception occured during database install: '{0}'", "resetkey.exe" ) ) ); + } + } + catch( Exception e ) + { + throw new InstallException( LogException( "Unable to generate a crypto key.", e) ); + } + finally + { + Leave(); + } + } + + protected void RecalculateStatistics () + { + Enter(); + + string connectionString = ""; + + try + { + // System.Windows.Forms.MessageBox.Show( "RecalculateStatistics" ); + + // + // get the connection string and connect to the db + // + connectionString = ( string ) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI\Database" ).GetValue( "WriterConnectionString" ); + SqlConnection conn = new SqlConnection( connectionString ); + SqlCommand cmd = new SqlCommand( "net_statistics_recalculate", conn ); + cmd.CommandType = CommandType.StoredProcedure; + + conn.Open(); + + try + { + cmd.ExecuteNonQuery(); + } + finally + { + conn.Close(); + } + } + catch( Exception e ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "RecalculateStatistics()", connectionString ) ); + throw new InstallException( LogException( "Unable to recalculate statistics.", e ) ); + } + finally + { + Leave(); + } + } + + + protected void AssignOperator( string name ) + { + Enter(); + + try + { + // + // set up the connection and other environment settings + // + ConnectionManager.Open( true, true ); + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + UDDI.Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + + UDDI.Config.SetString( defaultOperatorkey, name ); + + ConnectionManager.Commit(); + } + catch ( Exception e ) + { + ConnectionManager.Abort(); + LogException( "AssignOperator", e ); + Log( string.Format( "Unable to change the Operator Name to '{0}'. Reason: {1}", name, e.Message ) ); + throw e; + } + finally + { + ConnectionManager.Close(); + Leave(); + } + + } + + + protected void CreateBusinessEntity( string name, string description ) + { + Enter(); + + try + { + // + // set up the connection and other environment settings + // + ConnectionManager.Open( true, true ); + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + UDDI.Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + + // + // set up the new entity attributes + // + BusinessEntity busEntity = new BusinessEntity(); + busEntity.Names.Add( name ); + busEntity.Descriptions.Add( description ); + busEntity.AuthorizedName = UDDI.Context.User.ID; + busEntity.Operator = ""; // let it be default + + // now add the uddi-org:operators keyed reference + busEntity.IdentifierBag.Add( "", tokenOBEKeyValue, tmodelUddiOrgOpers ); + + // + // Persist the business entity + // + busEntity.Save(); + + // + // now store the key value for future use + // + string key = busEntity.EntityKey; + UDDI.Config.SetString( busEntityKeyName, key ); + + ConnectionManager.Commit(); + } + catch ( Exception e ) + { + ConnectionManager.Abort(); + LogException( "CreateBusinessEntity", e ); + Log( string.Format( "Unable to create a new Business Entity '{0}'. Reason: {1}", name, e.Message ) ); + throw e; + } + finally + { + ConnectionManager.Close(); + Leave(); + } + } + + + // + // Sets the Site.Language key to the ISO standard language code + // corresponding to the localeID + // If localeID = 0, then the system default language will be used + // + protected void UpdateSiteLanguage( int localeID ) + { + Enter(); + + try + { + // + // set up the connection and other environment settings + // + ConnectionManager.Open( true, true ); + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + UDDI.Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + + CultureInfo culture; + if ( localeID == 0 ) + culture = CultureInfo.CurrentCulture; + else + culture = new CultureInfo( localeID ); + + string languageCode = culture.TwoLetterISOLanguageName; + UDDI.Config.SetString( siteLangKeyName, languageCode ); + + ConnectionManager.Commit(); + } + catch ( Exception e ) + { + ConnectionManager.Abort(); + LogException( "UpdateSiteLanguage", e ); + } + finally + { + ConnectionManager.Close(); + Leave(); + } + } + + + protected void UpdateVersionFromRegistry() + { + Enter(); + + try + { + // + // set up the connection and other environment settings + // + ConnectionManager.Open( true, true ); + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + UDDI.Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + + string version = ( string ) Registry.LocalMachine.OpenSubKey( regDBServerKeyName ).GetValue( regVersionKeyName ); + UDDI.Config.SetString( siteVerKeyName, version ); + + ConnectionManager.Commit(); + } + catch ( Exception e ) + { + ConnectionManager.Abort(); + LogException( "UpdateVersionFromRegistry", e ); + } + finally + { + ConnectionManager.Close(); + Leave(); + } + } + + + protected string GetResource( string name ) + { + string fullname = ""; + try + { + // + // Prefix the resource name with the assembly name + // + Assembly assembly = Assembly.GetExecutingAssembly(); + //fullname = assembly.GetName().Name + "." + name; + fullname = name; + + // + // Read the resource. + // + Log( "Reading resource: " + fullname ); + Stream stream = assembly.GetManifestResourceStream( fullname ); + StreamReader reader = new StreamReader( stream ); + + return reader.ReadToEnd(); + } + catch ( Exception e ) + { + throw new InstallException( LogException( string.Format( "Unable to get resource for: {0}", fullname ), e ) ); + } + } + + public void Enter() + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "Entering " + method.ReflectedType.FullName + "." + method.Name + "..." ); + } + + public void Leave() + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "Leaving " + method.ReflectedType.FullName + "." + method.Name ); + } + + + private string LogError( string errmsg ) + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "----------------------------------------------------------" ); + Log( "An error occurred during installation. Details follow:" ); + Log( "Method: " + method.ReflectedType.FullName + "." + method.Name ); + Log( "Message: " + errmsg ); + Log( "----------------------------------------------------------" ); + + return errmsg; + } + + private string LogException( string context, Exception e ) + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "----------------------------------------------------------" ); + Log( "An exception occurred during installation. Details follow:" ); + Log( "Method: " + method.ReflectedType.FullName + "." + method.Name ); + Log( "Context: " + context ); + Log( "Stack Trace: " + e.StackTrace ); + Log( "Source: " + e.Source ); + Log( "Message: " + e.Message ); + Log( "----------------------------------------------------------" ); + + return context + ": " + e.Message; + } + + private void Log( string str ) + { + try + { + Debug.WriteLine( str ); + + FileStream f = new FileStream( System.Environment.ExpandEnvironmentVariables( "%systemroot%" ) + @"\uddisetup.log", FileMode.Append, FileAccess.Write ); + StreamWriter s = new StreamWriter( f, System.Text.Encoding.Unicode ); + s.WriteLine( "{0}: {1}", DateTime.Now.ToString(), str ); + s.Close(); + f.Close(); + } + catch( Exception e ) + { + Debug.WriteLine( "Error in Log():" + e.Message ); + } + } + + + private void InitializeDataFiles() + { + // + // Initialize default data directory + // + string installroot = ( string ) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstallRoot" ); + Log( "InstallRoot=" + installroot ); + + string defaultdatapath = CheckForSlash( installroot ) + dataFolderName; //dir local to db server for data files + Log( "DefaultDataPath=" + defaultdatapath ); + + // + // Get paths from properties passed from OCM dll, or set to default + // + + SystemFilePath = Context.Parameters[ propSysFilePath ]; + if ( null == SystemFilePath ) + SystemFilePath = defaultdatapath; + SystemFileSpec = CheckForSlash( SystemFilePath ) + dbName + ".sys.mdf"; + + Core1FilePath = Context.Parameters[ propCoreFilePath_1 ]; + if ( null == Core1FilePath ) + Core1FilePath = defaultdatapath; + Core1FileSpec = CheckForSlash( Core1FilePath ) + dbName + ".data.1.ndf"; + + Core2FilePath = Context.Parameters[ propCoreFilePath_1 ]; + if ( null == Core2FilePath ) + Core2FilePath = defaultdatapath; + Core2FileSpec = CheckForSlash( Core2FilePath ) + dbName + ".data.2.ndf"; + + JournalFilePath = Context.Parameters[ propJournalFilePath ]; + if ( null == JournalFilePath ) + JournalFilePath = defaultdatapath; + JournalFileSpec = CheckForSlash( JournalFilePath ) + dbName + ".journal.1.ndf"; + + StagingFilePath = Context.Parameters[ propStagingFilePath ]; + if ( null == StagingFilePath ) + StagingFilePath = defaultdatapath; + StagingFileSpec = CheckForSlash( StagingFilePath ) + dbName + ".staging.1.ndf"; + + LogFilePath = Context.Parameters[ propXactLogFilePath ]; + if ( null == LogFilePath ) + LogFilePath = defaultdatapath; + LogFileSpec = CheckForSlash( LogFilePath ) + dbName + ".log.ldf"; + + return; + } + + + private void CollectDatafilePaths() + { + Enter(); + + try + { + if ( database == null ) // we probably failed to locate the database + return; + + // + // first get the log + // + foreach ( SQLDMO._LogFile log in database.TransactionLog.LogFiles ) + { + uninstDataFiles.Add( log.PhysicalName ); + } + + // + // now take care of the data files + // + foreach ( SQLDMO._FileGroup fgrp in database.FileGroups ) + { + foreach ( SQLDMO.DBFile dbfile in fgrp.DBFiles ) + { + uninstDataFiles.Add( dbfile.PhysicalName ); + } + } + } + catch (Exception e) + { + LogException( "CollectDatafilePaths()", e ); + } + finally + { + Leave(); + } + } + + + // + // Drops the Active Directory site entry. The site comes from the + // Config table + // + protected void RemoveADSiteEntry() + { + Enter(); + + try + { + // + // set up the connection and other environment settings + // + ConnectionManager.Open( false, false ); + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + UDDI.Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + + // + // Try loading the site key + // + string defSiteKey = UDDI.Config.GetString( busEntityKeyName, "*" ); + if ( defSiteKey.Equals( "*" ) ) + Log( "Unable to get a site key" ); + else + { + UDDIServiceConnPoint.DeleteSiteEntry( defSiteKey ); + } + } + catch ( Exception e ) + { + LogException( "RemoveADSiteEntry", e ); + } + finally + { + ConnectionManager.Close(); + Leave(); + } + + } + + // + // Registering the extended stored procedure is a bit tricky because you need the absolute path to the DLL. + // + private void RegisterExtendedStoredProcedures() + { + // + // Build path to where the uddi.xp.dll file is going to be. + // + string targetDir = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstallRoot" ).ToString(); + string fullPath = CheckForSlash( targetDir ) + uddiXPFile; + + // + // Create the script that we need to register the extended stored proc. + // + string sqlScript = string.Format( RegisterXpSqlFormat, fullPath ); + + // + // Run this as a script using the master database DMO + // + masterdb.ExecuteImmediate( sqlScript, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default, sqlScript.Length ); + } + } + + // + // 751411 - Explicitly sort the files we receive in alphabetical order. + // + internal class BootStrapFileOrder : IComparer + { + private CultureInfo usCultureInfo; + + public BootStrapFileOrder() + { + // + // Try to create a US English culture info. This should always work no matter + // what the locale of the system, but do a catch just in case. + // + try + { + usCultureInfo = CultureInfo.CreateSpecificCulture( "en-US" ); + } + catch + { + usCultureInfo = null; + } + } + + public bool UsingExpectedOrder + { + get + { + return null != usCultureInfo; + } + } + + public int Compare( object x, object y ) + { + // + // Use the US English culture info if we have one, otherwise + // take our chances with the system one. Always ignore the case + // of the file. + // + if( null != usCultureInfo ) + { + return String.Compare( x as string , y as string, true, usCultureInfo ); + } + else + { + return String.Compare( x as string , y as string, true ); + } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/ca/dbca.csproj b/inetsrv/uddi/source/setup/db/ca/dbca.csproj new file mode 100644 index 0000000..d18f44c --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/dbca.csproj @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/setup/db/ca/dbca.resx b/inetsrv/uddi/source/setup/db/ca/dbca.resx new file mode 100644 index 0000000..1767da8 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/dbca.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader + + + System.Resources.ResXResourceWriter + + \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/ca/interop.sqldmo.dll b/inetsrv/uddi/source/setup/db/ca/interop.sqldmo.dll new file mode 100644 index 0000000..77357c0 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca/interop.sqldmo.dll differ diff --git a/inetsrv/uddi/source/setup/db/ca/makefile b/inetsrv/uddi/source/setup/db/ca/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/db/ca/makefile.inc b/inetsrv/uddi/source/setup/db/ca/makefile.inc new file mode 100644 index 0000000..6f6ce0e --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/setup/db/ca/obj/_objects.mac b/inetsrv/uddi/source/setup/db/ca/obj/_objects.mac new file mode 100644 index 0000000..25078f7 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\dbca.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\dbca.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\dbca.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\dbca.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/db/ca/obj/i386/dbca.dll b/inetsrv/uddi/source/setup/db/ca/obj/i386/dbca.dll new file mode 100644 index 0000000..5142e14 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca/obj/i386/dbca.dll differ diff --git a/inetsrv/uddi/source/setup/db/ca/obj/i386/dbca.pdb b/inetsrv/uddi/source/setup/db/ca/obj/i386/dbca.pdb new file mode 100644 index 0000000..c5ab3b7 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca/obj/i386/dbca.pdb differ diff --git a/inetsrv/uddi/source/setup/db/ca/placefil.txt b/inetsrv/uddi/source/setup/db/ca/placefil.txt new file mode 100644 index 0000000..1d3312a --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/placefil.txt @@ -0,0 +1,4 @@ +dbca.dll uddi\bin +Interop.SQLDMO.dll uddi\bin +uddi.database.backup.cmd uddi\data +uddi.database.restore.cmd uddi\data diff --git a/inetsrv/uddi/source/setup/db/ca/sources b/inetsrv/uddi/source/setup/db/ca/sources new file mode 100644 index 0000000..54a169d --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/sources @@ -0,0 +1,42 @@ +# +# sources file for a managed code DLL +# +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=dbca +TARGETPATH=obj +TARGETTYPE=DYNLINK + +SYNCHRONIZE_PASS2_BLOCK=1 + +# +# tell the system to build the resources file +# +NTTARGETFILE1=$(O)\dbca.resources foo.cs + +# +# this get passed to the csc.exe command line, so specify the resources +# and a response file here +# +USER_CS_FLAGS= @cscresponse.txt + +# +# add all the other assembly references here +# +REFERENCES=interop.sqldmo.dll, ..\..\..\api\obj\*\uddi.api.dll, ..\..\..\api\PassportLib.dll, ..\..\..\core\obj\*\uddi.core.dll + +# +# csharp source code +# +SOURCES=\ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + dbca.cs + +BINPLACE_PLACEFILE=placefil.txt + +MISCFILES=\ +uddi.database.backup.cmd \ +uddi.database.restore.cmd \ +Interop.SQLDMO.dll \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.database.backup.cmd b/inetsrv/uddi/source/setup/db/ca/uddi.database.backup.cmd new file mode 100644 index 0000000..327314a --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.database.backup.cmd @@ -0,0 +1,46 @@ +@ECHO OFF + +IF EXIST %0.txt (DEL %0.txt) + +ECHO Microsoft (R) UDDI Services Database Backup Utility +ECHO Copyright (C) Microsoft Corporation 2003. All rights reserved. + +IF '%1%' == '/?' GOTO PARMERROR + +SET SERVER=(local)\%1 + +IF '%SERVER%' == '(local)\' SET SERVER=(local) + +SET BACKUPFILE=%~Dp0%uddi.database.bak + +IF NOT EXIST %BACKUPFILE% GOTO STARTBACKUP +ECHO Preparing to delete old backup file %BACKUPFILE% +ECHO Press Ctrl-C to cancel... +PAUSE +DEL %BACKUPFILE% + +:STARTBACKUP +ECHO Backing up UDDI database on %SERVER% +SET CMDBATCH=BACKUP DATABASE UDDI TO DISK='%BACKUPFILE%' +OSQL -S%SERVER% -E -Q"%CMDBATCH%" -dmaster +GOTO END + +:PARMERROR +ECHO Backs up the UDDI database on a local SQL Server / MSDE instance +ECHO - +ECHO Usage: +ECHO uddi.database.backup [instance] +ECHO - +ECHO instance: Instance name of the local MSDE or SQL Server where UDDI is installed +ECHO - +ECHO Note: Brackets indicate optional parameters +ECHO - +ECHO Example 1 (Backs up UDDI Database on local UDDI instance of MSDE or SQL Server): +ECHO uddi.database.backup.cmd UDDI +ECHO - +ECHO Example 2 (Backs up UDDI Database on local default instance of MSDE or SQL Server): +ECHO uddi.database.backup.cmd +ECHO - + +:END +ECHO Run %0% /? for help diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.database.restore.cmd b/inetsrv/uddi/source/setup/db/ca/uddi.database.restore.cmd new file mode 100644 index 0000000..78e134b --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.database.restore.cmd @@ -0,0 +1,50 @@ +@ECHO OFF + +IF EXIST %0.txt (DEL %0.txt) + +ECHO Microsoft (R) UDDI Database Restore Utility +ECHO Copyright (C) Microsoft Corporation 2002. All rights reserved. + +IF '%1%' == '/?' GOTO PARMERROR + +SET SERVER=(local)\%1 + +IF '%SERVER%' == '(local)\' SET SERVER=(local) + +SET BACKUPFILE=%~Dp0%uddi.database.bak + +IF EXIST %BACKUPFILE% GOTO TAKEOFFLINE +ECHO Unable to locate %BACKUPFILE% +ECHO Restore failed +GOTO END + +:TAKEOFFLINE +ECHO Taking UDDI database on %SERVER% offline +SET CMDBATCH=ALTER DATABASE UDDI SET OFFLINE WITH ROLLBACK IMMEDIATE +OSQL -S%SERVER% -E -Q"%CMDBATCH%" -dmaster + +ECHO Restoring UDDI database on %SERVER% +ECHO Restoring from %BACKUPFILE% +SET CMDBATCH=RESTORE DATABASE uddi FROM DISK='%BACKUPFILE%' +OSQL -S%SERVER% -E -Q"%CMDBATCH%" -dmaster +GOTO END + +:PARMERROR +ECHO Restores the UDDI database on a local SQL Server / MSDE instance +ECHO - +ECHO Usage: +ECHO uddi.database.restore [instance] +ECHO - +ECHO instance: Instance name of the MSDE or SQL Server installation which hosts the UDDI database. +ECHO - +ECHO Note: Brackets indicate optional parameters +ECHO - +ECHO Example 1 (Restores UDDI Database on local UDDI instance of MSDE or SQL Server): +ECHO uddi.database.restore.cmd UDDI +ECHO - +ECHO Example 2 (Restores UDDI Database on local default instance of MSDE or SQL Server): +ECHO uddi.database.restore.cmd +ECHO - + +:END +ECHO Run %0% /? for help diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.admin.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.admin.sql new file mode 100644 index 0000000..4f0c0aa --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.admin.sql @@ -0,0 +1,613 @@ +-- Script: uddi.net.admin.sql +-- Author: LRDohert@Microsoft.com +-- Description: Administrative stored procedures +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Publisher administration +-- ============================================= + +-- ============================================= +-- Name: ADM_findPublisher +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'ADM_findPublisher' AND type = 'P') + DROP PROCEDURE ADM_findPublisher +GO + +CREATE PROCEDURE ADM_findPublisher + @email nvarchar(450) = NULL, + @name nvarchar(450) = NULL, + @companyName nvarchar(100) = NULL +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @contextID uniqueidentifier, + @rows int + + SET @contextID = NEWID() + + -- Check parameters + IF (@email IS NULL) AND (@name IS NULL) AND (@companyName IS NULL) + BEGIN + SET @error=50009 -- E_parmError + SET @context='At least one non-null parameter must be supplied.' + GOTO errorLabel + END + + IF @email IS NOT NULL + BEGIN + EXEC @RC=net_find_publisher_email @contextID, @email, @rows OUTPUT + + IF @RC<>0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + IF @rows = 0 + BEGIN + EXEC @RC=net_find_publisher_cleanup @contextID + + IF @RC<>0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + RETURN 0 + END + END + + IF @name IS NOT NULL + BEGIN + EXEC @RC=net_find_publisher_name @contextID, @name, @rows OUTPUT + + IF @RC<>0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + IF @rows = 0 + BEGIN + EXEC @RC=net_find_publisher_cleanup @contextID + + IF @RC<>0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + RETURN 0 + END + END + + IF @companyName IS NOT NULL + BEGIN + EXEC @RC=net_find_publisher_companyName @contextID, @companyName, @rows OUTPUT + + IF @RC<>0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + IF @rows = 0 + BEGIN + EXEC @RC=net_find_publisher_cleanup @contextID + + IF @RC<>0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + RETURN 0 + END + END + + EXEC @RC=net_find_publisher_commit @contextID = @contextID, @sortByNameAsc = 1, @sortByEmailAsc = 0, @sortByCompanyNameAsc = 0 + + IF @RC<>0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- ADM_findPublisher +GO + +-- ============================================= +-- Name: ADM_setPublisherTier +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'ADM_setPublisherTier' AND type = 'P') + DROP PROCEDURE ADM_setPublisherTier +GO + +CREATE PROCEDURE ADM_setPublisherTier + @PUID nvarchar(450), + @tier nvarchar(256) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherID bigint, + @tModelLimit int, + @businessLimit int, + @serviceLimit int, + @bindingLimit int, + @assertionLimit int, + @error int, + @context nvarchar(4000) + + SET @publisherID = dbo.publisherID(@PUID) + + -- Validate publisherID + IF (@publisherID IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUer + SET @context = 'Unknown publisher.' + GOTO errorLabel + END + + -- Validate tier parameter + IF @tier NOT IN ('1','2','unlimited') + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Invalid tier specified.' + GOTO errorLabel + END + + IF @tier = '1' + BEGIN + SET @tModelLimit=100 + SET @businessLimit=1 + SET @serviceLimit=4 + SET @bindingLimit=2 + SET @assertionLimit=10 + END + ELSE + BEGIN + IF (@tier = '2') OR (@tier = 'unlimited') + BEGIN + SET @tModelLimit=NULL + SET @businessLimit=NULL + SET @serviceLimit=NULL + SET @bindingLimit=NULL + SET @assertionLimit=NULL + END + END + + UPDATE + [UDO_publishers] + SET + [tModelLimit] = @tModelLimit, + [businessLimit] = @businessLimit, + [serviceLimit] = @serviceLimit, + [bindingLimit] = @bindingLimit, + [assertionLimit] = @assertionLimit + WHERE + ([publisherID] = @publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- ADM_setPublisherTier +GO + +-- ============================================= +-- Name: ADM_removePublisher +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'ADM_removePublisher' AND type = 'P') + DROP PROCEDURE ADM_removePublisher +GO + +CREATE PROCEDURE ADM_removePublisher + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherID bigint, + @error int, + @context nvarchar(4000) + + SET @publisherID = dbo.publisherID(@PUID) + + -- Validate publisherID + IF (@publisherID IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Invalid publisherID.' + GOTO errorLabel + END + + DELETE FROM + [UDO_publishers] + WHERE + ([publisherID] = @publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: ADM_setPublisherStatus +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'ADM_setPublisherStatus' AND type = 'P') + DROP PROCEDURE ADM_setPublisherStatus +GO + +CREATE PROCEDURE ADM_setPublisherStatus + @PUID nvarchar(450), + @publisherStatus nvarchar(256) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherID bigint, + @publisherStatusID tinyint, + @error int, + @context nvarchar(4000) + + SET @publisherID = dbo.publisherID(@PUID) + + -- Validate publisherID + IF (@publisherID IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Unknown publisherID.' + GOTO errorLabel + END + + -- Validate publisherStatus + SET @publisherStatusID = dbo.publisherStatusID(@publisherStatus) + + IF @publisherStatusID IS NULL + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Unknown publisher status ''' + @publisherStatus + '''' + GOTO errorLabel + END + + UPDATE + [UDO_publishers] + SET + [publisherStatusID] = @publisherStatusID + WHERE + ([publisherID] = @publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- ADM_setPublisherStatus +GO + +-- ============================================= +-- Section: Miscellaneous +-- ============================================= + +-- ============================================= +-- Name: ADM_execResetKeyImmediate +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'ADM_execResetKeyImmediate' AND type = 'P') + DROP PROCEDURE ADM_execResetKeyImmediate +GO + +CREATE PROCEDURE ADM_execResetKeyImmediate + @keyLastResetDate nvarchar(4000) = NULL OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @RC int, + @oldKeyLastResetDate varchar(8000) + + -- Get the original last reset date. We need this value to compare against our new one as an additional check + -- to make sure we successfully generated a new key. + SET @oldKeyLastResetDate = ISNULL(dbo.configValue('Security.KeyLastResetDate'),'Monday, January 01, 0001 12:00:00 AM') -- DateTime.MinValue + + -- Run extended stored proc to update security key. The new values will be put into the config table. + EXEC @RC=master.dbo.xp_reset_key + + -- Make sure we ran successfully. + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- The key generation implementation in the extended stored proc is synchronous, so we should have a new + -- key value at this point. + SET @keyLastResetDate = dbo.configValue('Security.KeyLastResetDate') + + -- Make sure the date is different. + IF @keyLastResetDate = @oldKeyLastResetDate + BEGIN + GOTO errorLabel + END + + -- Success. + RETURN 0 + +errorLabel: + RETURN 1 + +END -- ADM_execResetKeyImmediate +GO + +-- ============================================= +-- Name: ADM_addServiceAccount +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'ADM_addServiceAccount' AND type = 'P') + DROP PROCEDURE ADM_addServiceAccount +GO + +CREATE PROCEDURE ADM_addServiceAccount + @accountName nvarchar(128) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @RC int, + @SID varbinary(85), + @isDbo bit + + -- Grant database server access to security account + EXEC @RC=sp_grantlogin @accountName + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + SET @SID = SUSER_SID(@accountName) + + -- Determine if user is dbo + SET @isDbo = 0 + + IF EXISTS( SELECT * FROM [sysusers] WHERE [name] = 'dbo' AND [sid] = @SID ) + SET @isDbo = 1 + + -- Grant database access to security account + IF ( (@isDbo = 0) AND ( NOT EXISTS ( SELECT * FROM [sysusers] WHERE [sid] = @SID ) ) ) + BEGIN + EXEC @RC=sp_grantdbaccess @accountName + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + -- Add security account to UDDIService role + IF ( (@isDbo = 0) AND ( EXISTS ( SELECT * FROM [sysusers] WHERE [sid] = @SID ) ) ) + BEGIN + EXEC @RC=sp_addrolemember 'UDDIService', @accountName + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + -- Add security account to sysadmin server role + -- EXEC @RC=sp_addsrvrolemember @accountName, 'sysadmin' + --IF @RC <> 0 + --BEGIN + --SET @error = 50006 -- E_subProcFailure + --SET @context = '' + --GOTO errorLabel + --END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- ADM_addServiceAccount +GO + +-- ============================================= +-- Name: ADM_setAdminAccount +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'ADM_setAdminAccount' AND type = 'P') + DROP PROCEDURE ADM_setAdminAccount +GO + +CREATE PROCEDURE ADM_setAdminAccount + @accountName nvarchar(128) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @RC int, + @SID varbinary(85), + @isDbo bit, + @tmpString nvarchar(128), + @prevAccountName sysname, + @prevAccountSID varbinary(85) + + -- Grant database server access to security account + EXEC @RC=sp_grantlogin @accountName + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + SET @SID = SUSER_SID(@accountName) + + -- Determine if user is dbo + SET @isDbo = 0 + + IF EXISTS( SELECT * FROM [sysusers] WHERE [name] = 'dbo' AND [sid] = @SID ) + SET @isDbo = 1 + + -- Grant database access to security account + IF ( (@isDbo = 0) AND ( NOT EXISTS ( SELECT * FROM [sysusers] WHERE [sid] = @SID ) ) ) + BEGIN + EXEC @RC=sp_grantdbaccess @accountName + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + -- Add security account to UDDIService role + IF ( (@isDbo = 0) AND ( EXISTS ( SELECT * FROM [sysusers] WHERE [sid] = @SID ) ) ) + BEGIN + EXEC @RC=sp_addrolemember 'UDDIAdmin', @accountName + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + -- Get the previous account + CREATE TABLE #tempTable( + [dbRole] sysname, + [memberName] sysname, + [memberSID] varbinary(85)) + + INSERT #tempTable EXEC sp_helprolemember 'UDDIAdmin' + + SELECT + @prevAccountName = [memberName], + @prevAccountSID = [memberSID] + FROM + #tempTable + WHERE + [memberName] <> @accountName + + -- Revoke database access from old account + IF (@prevAccountName IS NOT NULL) OR (@prevAccountSID IS NOT NULL) + BEGIN + EXEC @RC=sp_revokedbaccess @prevAccountName + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + -- Add security account to sysadmin server role + --EXEC @RC=sp_addsrvrolemember @accountName, 'sysadmin' +-- + --IF @RC <> 0 + --BEGIN + --SET @error = 50006 -- E_subProcFailure + --SET @context = '' + --GOTO errorLabel + --END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- ADM_setAdminAccount +GO + +-- ============================================= +-- Section: AD publication +-- ============================================= + +-- ============================================= +-- Name: net_businessEntity_bindingTemplates_get +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_businessEntity_bindingTemplates_get' AND type = 'P') + DROP PROCEDURE net_businessEntity_bindingTemplates_get +GO + +CREATE PROCEDURE net_businessEntity_bindingTemplates_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @businessID bigint + + SET @businessID = dbo.businessID(@businessKey) + + IF @businessID IS NULL + BEGIN + SET @error = 60210 + SET @context = 'businessKey=' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + SELECT + BT.[bindingKey], + BS.[serviceKey], + UT.[URLType], + BT.[accessPoint], + BT.[hostingRedirector] + FROM + [UDC_bindingTemplates] BT + JOIN [UDC_URLTypes] UT ON BT.[URLTypeID] = UT.[URLTypeID] + JOIN [UDC_businessServices] BS ON BT.[serviceID] = BS.[serviceID] + WHERE + (BS.[businessID] = @businessID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_bindingTemplates_get +GO + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.bindingtemplate.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.bindingtemplate.sql new file mode 100644 index 0000000..7ff7a42 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.bindingtemplate.sql @@ -0,0 +1,1150 @@ +-- Script: uddi.v2.bindingTemplate.sql +-- Author: LRDohert@Microsoft.com +-- Description: Stored procedures associated with a bindingTemplate object. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Get stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_bindingTemplate_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_get' and type = 'P') + DROP PROCEDURE net_bindingTemplate_get +GO + +CREATE PROCEDURE net_bindingTemplate_get + @bindingKey uniqueidentifier, + @serviceKey uniqueidentifier OUTPUT, + @URLTypeID tinyint OUTPUT, + @accessPoint nvarchar(4000) OUTPUT, + @hostingRedirector uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @serviceKey = dbo.serviceKey([serviceID]), + @URLTypeID = [URLTypeID], + @accessPoint = [accessPoint], + @hostingRedirector = [hostingRedirector] + FROM + [UDC_bindingTemplates] + WHERE + ([bindingID] = dbo.bindingID(@bindingKey)) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_bindingTemplate_get +GO + +-- ============================================= +-- Name: net_bindingTemplate_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_get_batch' and type = 'P') + DROP PROCEDURE net_bindingTemplate_get_batch +GO + +CREATE PROCEDURE net_bindingTemplate_get_batch + @bindingKey uniqueidentifier, + @serviceKey uniqueidentifier OUTPUT, + @URLTypeID tinyint OUTPUT, + @accessPoint nvarchar(4000) OUTPUT, + @hostingRedirector uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @serviceKey = dbo.serviceKey([serviceID]), + @URLTypeID = [URLTypeID], + @accessPoint = [accessPoint], + @hostingRedirector = [hostingRedirector] + FROM + [UDC_bindingTemplates] + WHERE + ([bindingID] = dbo.bindingID(@bindingKey)) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_bindingTemplate_descriptions_get @bindingKey + EXEC net_bindingTemplate_tModelInstanceInfos_get @bindingKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_bindingTemplate_get_batch +GO + +-- ============================================= +-- Name: net_bindingTemplate_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_descriptions_get' and type = 'P') + DROP PROCEDURE net_bindingTemplate_descriptions_get +GO + +CREATE PROCEDURE net_bindingTemplate_descriptions_get + @bindingKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_bindingDesc] + WHERE + ([bindingID] = dbo.bindingID(@bindingKey)) + + RETURN 0 +END -- net_bindingTemplate_descriptions_get +GO + +-- ============================================= +-- Name: net_bindingTemplate_tModelInstanceInfos_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_tModelInstanceInfos_get' and type = 'P') + DROP PROCEDURE net_bindingTemplate_tModelInstanceInfos_get +GO + +CREATE PROCEDURE net_bindingTemplate_tModelInstanceInfos_get + @bindingKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [instanceID], + [tModelKey], + [overviewURL], + [instanceParms] + FROM + [UDC_tModelInstances] + WHERE + ([bindingID] = dbo.bindingID(@bindingKey)) + + RETURN 0 +END -- net_bindingTemplate_tModelInstanceInfos_get +GO + +-- ============================================= +-- Name: net_bindingTemplate_tModelInstanceInfo_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_tModelInstanceInfo_get_batch' and type = 'P') + DROP PROCEDURE net_bindingTemplate_tModelInstanceInfo_get_batch +GO + +CREATE PROCEDURE net_bindingTemplate_tModelInstanceInfo_get_batch + @instanceID bigint +WITH ENCRYPTION +AS +BEGIN + EXEC net_bindingTemplate_tModelInstanceInfo_descriptions_get @instanceID + EXEC net_bindingTemplate_instanceDetails_descriptions_get @instanceID + EXEC net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get @instanceID + + RETURN 0 +END -- net_bindingTemplate_tModelInstanceInfo_get_batch +GO + +-- ============================================= +-- Name: net_bindingTemplate_tModelInstanceInfo_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_tModelInstanceInfo_descriptions_get' and type = 'P') + DROP PROCEDURE net_bindingTemplate_tModelInstanceInfo_descriptions_get +GO + +CREATE PROCEDURE net_bindingTemplate_tModelInstanceInfo_descriptions_get + @instanceID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_instanceDesc] + WHERE + ([instanceID] = @instanceID) AND + ([elementID] = dbo.elementID('tModelInstanceInfo')) + + RETURN 0 +END -- net_bindingTemplate_tModelInstanceInfo_descriptions_get +GO + +-- ============================================= +-- Name: net_bindingTemplate_instanceDetails_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_instanceDetails_descriptions_get' and type = 'P') + DROP PROCEDURE net_bindingTemplate_instanceDetails_descriptions_get +GO + +CREATE PROCEDURE net_bindingTemplate_instanceDetails_descriptions_get + @instanceID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_instanceDesc] + WHERE + ([instanceID] = @instanceID) AND + ([elementID] = dbo.elementID('instanceDetails')) + + RETURN 0 +END -- net_bindingTemplate_instanceDetails_descriptions_get +GO + +-- ============================================= +-- Name: net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get' and type = 'P') + DROP PROCEDURE net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get +GO + +CREATE PROCEDURE net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get + @instanceID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_instanceDesc] + WHERE + ([instanceID] = @instanceID) AND + ([elementID] = dbo.elementID('overviewDoc')) + + RETURN 0 +END -- net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get +GO + +-- ============================================= +-- Section: Save stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_bindingTemplate_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_save' and type = 'P') + DROP PROCEDURE net_bindingTemplate_save +GO + +CREATE PROCEDURE net_bindingTemplate_save + @PUID nvarchar(450), + @bindingKey uniqueidentifier, + @serviceKey uniqueidentifier, + @generic varchar(20), + @URLTypeID tinyint, + @accessPoint nvarchar(4000), + @hostingRedirector uniqueidentifier, + @contextID uniqueidentifier, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @bindingLimit int, + @bindingCount int, + @publisherID bigint, + @serviceID bigint, + @isReplPublisher bit + + SET @RC = 0 + SET @serviceID = dbo.serviceID(@serviceKey) + + -- serviceKey validation must occur during save since its not always known at validate time + IF (@serviceID IS NULL) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + -- Look up publisherID + SET @isReplPublisher = dbo.isReplPublisher(@PUID) + SET @publisherID = dbo.publisherID(@PUID) + + IF (@publisherID IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + @PUID + GOTO errorLabel + END + + IF EXISTS(SELECT * FROM [UDC_bindingTemplates] WHERE [bindingKey] = @bindingKey) + BEGIN + DELETE [UDC_bindingTemplates] WHERE [bindingKey] = @bindingKey + END + ELSE + BEGIN + IF (@isReplPublisher = 1) + BEGIN + -- Perform this check only for replication publishers + IF (dbo.isUuidUnique(@bindingKey) = 0) + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'Key is not unique. bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + END + END + + -- Check limit + SELECT + @bindingLimit = [bindingLimit] + FROM + [UDO_publishers] + WHERE + ([publisherID] = @publisherID) + + SELECT + @bindingCount = COUNT(*) + FROM + [UDC_bindingTemplates] + WHERE + ([serviceID] = @serviceID) + + IF ((@bindingCount + 1) > @bindingLimit) + BEGIN + SET @error = 60160 -- E_accountLimitExceeded + SET @context = 'Publisher limit for ''bindingTemplate'' exceeded (limit=' + CAST(@bindingLimit AS nvarchar(4000)) + ', count=' + CAST(@bindingCount AS nvarchar(4000)) + ')' + GOTO errorLabel + END + + INSERT [UDC_bindingTemplates]( + [serviceID], + [generic], + [bindingKey], + [URLTypeID], + [accessPoint], + [hostingRedirector], + [lastChange]) + VALUES( + @serviceID, + @generic, + @bindingKey, + @URLTypeID, + @accessPoint, + @hostingRedirector, + @lastChange) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_bindingTemplate_save +GO + +-- ============================================= +-- Name: net_bindingTemplate_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_description_save' and type = 'P') + DROP PROCEDURE net_bindingTemplate_description_save +GO + +CREATE PROCEDURE net_bindingTemplate_description_save + @bindingKey uniqueidentifier, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_bindingDesc]( + [bindingID], + [isoLangCode], + [description]) + VALUES( + dbo.bindingID(@bindingKey), + @isoLangCode, + @description) + + RETURN 0 +END -- net_bindingTemplate_description_save +GO + +-- ============================================= +-- Name: net_bindingTemplate_tModelInstanceInfo_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_tModelInstanceInfo_save' and type = 'P') + DROP PROCEDURE net_bindingTemplate_tModelInstanceInfo_save +GO + +CREATE PROCEDURE net_bindingTemplate_tModelInstanceInfo_save + @bindingKey uniqueidentifier, + @tModelKey uniqueidentifier, + @overviewURL nvarchar(4000), + @instanceParms nvarchar(4000), + @instanceID bigint OUTPUT +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_tModelInstances]( + [bindingID], + [tModelKey], + [overviewURL], + [instanceParms]) + VALUES( + dbo.bindingID(@bindingKey), + @tModelKey, + @overviewURL, + @instanceParms) + + SET @instanceID = @@IDENTITY + + RETURN 0 +END -- net_bindingTemplate_tModelInstanceInfo_save +GO + +-- ============================================= +-- Name: net_bindingTemplate_tModelInstanceInfo_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_tModelInstanceInfo_description_save' and type = 'P') + DROP PROCEDURE net_bindingTemplate_tModelInstanceInfo_description_save +GO + +CREATE PROCEDURE net_bindingTemplate_tModelInstanceInfo_description_save + @instanceID bigint, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_instanceDesc]( + [instanceID], + [elementID], + [isoLangCode], + [description]) + VALUES( + @instanceID, + dbo.elementID('tModelInstanceInfo'), + @isoLangCode, + @description) + + RETURN 0 +END -- net_bindingTemplate_tModelInstanceInfo_description_save +GO + +-- ============================================= +-- Name: net_bindingTemplate_instanceDetails_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_instanceDetails_description_save' and type = 'P') + DROP PROCEDURE net_bindingTemplate_instanceDetails_description_save +GO + +CREATE PROCEDURE net_bindingTemplate_instanceDetails_description_save + @instanceID bigint, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_instanceDesc]( + [instanceID], + [elementID], + [isoLangCode], + [description]) + VALUES( + @instanceID, + dbo.elementID('instanceDetails'), + @isoLangCode, + @description) + + RETURN 0 +END -- net_bindingTemplate_instanceDetails_description_save +GO + +-- ============================================= +-- Name: net_bindingTemplate_instanceDetails_overviewDoc_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_instanceDetails_overviewDoc_description_save' and type = 'P') + DROP PROCEDURE net_bindingTemplate_instanceDetails_overviewDoc_description_save +GO + +CREATE PROCEDURE net_bindingTemplate_instanceDetails_overviewDoc_description_save + @instanceID bigint, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_instanceDesc]( + [instanceID], + [elementID], + [isoLangCode], + [description]) + VALUES( + @instanceID, + dbo.elementID('overviewDoc'), + @isoLangCode, + @description) + + RETURN 0 +END -- net_bindingTemplate_instanceDetails_overviewDoc_description_save +GO + +-- ============================================= +-- Section: Delete stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_bindingTemplate_delete +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_delete' and type = 'P') + DROP PROCEDURE net_bindingTemplate_delete +GO + +CREATE PROCEDURE net_bindingTemplate_delete + @PUID nvarchar(450), + @bindingKey uniqueidentifier, + @contextID uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @publisherID bigint, + @operatorID bigint + + SET @RC = 0 + + -- + -- Validate parameters + -- + + IF @bindingKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = '@bindingKey is required.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- + -- Validate bindingTemplate + -- + IF EXISTS(SELECT * FROM [UDC_bindingTemplates] WHERE ([bindingKey] = @bindingKey)) + BEGIN + IF dbo.getBindingOperatorID(@bindingKey) <> @operatorID + BEGIN + -- bindingKey doesn't belong to this operator + SET @error = 60130 -- E_operatorMismatch + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + ', operator = ' + dbo.operatorName(@operatorID) + GOTO errorLabel + END + + -- serviceKey exists. Make sure it belongs to current publisher + IF dbo.getBindingPublisherID(@bindingKey) <> @publisherID + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + END + ELSE + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + + DELETE [UDC_bindingTemplates] WHERE [bindingKey] = @bindingKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_bindingTemplate_delete +GO + +-- ============================================= +-- Section: Validation stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_bindingTemplate_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_bindingTemplate_validate' AND type = 'P') + DROP PROCEDURE net_bindingTemplate_validate +GO + +CREATE PROCEDURE net_bindingTemplate_validate + @PUID nvarchar(450), + @bindingKey uniqueidentifier, + @serviceKey uniqueidentifier, + @hostingRedirector uniqueidentifier = NULL, + @flag int = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint, + @replActive bit + + SET @RC = 0 + SET @replActive = 0 + + IF @flag IS NULL + SET @flag = 0 + + -- + -- Validate parameters + -- + + IF @bindingKey = @serviceKey + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'bindingKey ' + dbo.UUIDSTR(@bindingKey) + ' and serviceKey ' + dbo.UUIDSTR(@serviceKey) + ' are the same.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator / publisher association (replication only) + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT, @replActive OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- Validate parent businessService + IF (@serviceKey IS NOT NULL) AND (EXISTS(SELECT * FROM [UDC_businessServices] WHERE [serviceKey] = @serviceKey)) + BEGIN + IF (dbo.getServicePublisherID(@serviceKey) <> @publisherID) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + END + + -- + -- Validate bindingTemplate + -- + + -- Validate bindingKey + IF (@bindingKey IS NOT NULL) + BEGIN + IF EXISTS(SELECT * FROM [UDC_bindingTemplates] WHERE ([bindingKey] = @bindingKey)) + BEGIN + -- serviceKey exists. Make sure it belongs to current publisher + IF dbo.getBindingPublisherID(@bindingKey) <> @publisherID + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + END + ELSE + BEGIN + -- bindingKey doesn't exist + IF (@replActive = 0) AND (@flag & 0x1 <> 0x1) + BEGIN + -- save isn't coming from replication and preassigned keys flag is not set so throw an error + SET @error = 60210 -- E_invalidKey + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + END + END + + -- Validate hostingRedirector + IF @replActive = 0 + BEGIN + -- Validate bindingTemplate.hostingRedirector.bindingKey + IF @hostingRedirector IS NOT NULL + BEGIN + IF NOT EXISTS(SELECT * FROM [UDC_bindingTemplates] WHERE [bindingKey] = @hostingRedirector) + BEGIN + SET @error=60210 -- E_invalidKey + SET @context='hostingRedirector/@bindingKey = ' + dbo.UUIDSTR(@hostingRedirector) + GOTO errorLabel + END + ELSE + BEGIN + -- Referenced bindingKey exists. Make sure it isn't a hostingRedirector. + IF (SELECT [hostingRedirector] FROM [UDC_bindingTemplates] WHERE [bindingKey] = @hostingRedirector) IS NOT NULL + BEGIN + -- binding referenced by a hostingRedirector cannot itself reference a hostingRedirector + SET @error=60210 -- E_invalidKey + SET @context='Referenced bindingTemplate cannot be a hostingRedirector. hostingRedirector/@bindingKey = ' + dbo.UUIDSTR(@hostingRedirector) + GOTO errorLabel + END + END + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_bindingTemplate_validate +GO + +-- ============================================= +-- Name: net_bindingTemplate_tModelInstanceInfo_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_bindingTemplate_tModelInstanceInfo_validate' AND type = 'P') + DROP PROCEDURE net_bindingTemplate_tModelInstanceInfo_validate +GO + +CREATE PROCEDURE net_bindingTemplate_tModelInstanceInfo_validate + @PUID nvarchar(450), + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @publisherID bigint, + @operatorID bigint, + @replActive bit + + SET @RC = 0 + SET @replActive = 0 + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator / publisher association (replication only) + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT, @replActive OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- Validate tModelKey + IF NOT EXISTS(SELECT * FROM [UDC_tModels] WHERE [tModelKey] = @tModelKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_bindingTemplate_tModelInstanceInfo_validate +GO + +-- ============================================= +-- Section: Find stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_find_bindingTemplate_serviceKey +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_bindingTemplate_serviceKey' AND type = 'P') + DROP PROCEDURE net_find_bindingTemplate_serviceKey +GO + +CREATE PROCEDURE net_find_bindingTemplate_serviceKey + @contextID uniqueidentifier, + @serviceKey uniqueidentifier, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + IF @contextRows = 0 + BEGIN + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BT.[bindingKey] + FROM + [UDC_bindingTemplates] BT + JOIN [UDC_businessServices] BS ON BT.[serviceID] = BS.[serviceID] + WHERE + (BS.[serviceKey] = @serviceKey) + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BT.[bindingKey] + FROM + [UDC_bindingTemplates] BT + JOIN [UDC_businessServices] BS ON BT.[serviceID] = BS.[serviceID] + WHERE + (BT.[bindingKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE [contextID] = @contextID)) AND + (BS.[serviceKey] = @serviceKey) + END + + -- All keys for this search argument are combined using a logical AND + + IF @contextRows > 0 + BEGIN + DELETE + [UDS_findResults] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findResults] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findResults] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_bindingTemplate_serviceKey +GO + +-- ============================================= +-- Name: net_find_bindingTemplate_tModelBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_bindingTemplate_tModelBag' AND type = 'P') + DROP PROCEDURE net_find_bindingTemplate_tModelBag +GO + +CREATE PROCEDURE net_find_bindingTemplate_tModelBag + @contextID uniqueidentifier, + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + IF @contextRows = 0 + BEGIN + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BT.[bindingKey] + FROM + [UDC_bindingTemplates] BT + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BT.[bindingKey] + FROM + [UDC_bindingTemplates] BT + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + END + ELSE + BEGIN + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BT.[bindingKey] + FROM + [UDC_bindingTemplates] BT + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (BT.[bindingKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BT.[bindingKey] + FROM + [UDC_bindingTemplates] BT + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (BT.[bindingKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + END + +IF @orKeys = 1 + BEGIN + + -- OR operation between @tempKeys and the UDS_findScratch table + + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + + -- AND operation between @tempKeys and the UDS_findScratch table + + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = @@ROWCOUNT + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_bindingTemplate_tModelBag +GO + +-- ============================================= +-- Name: net_find_bindingTemplate_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_bindingTemplate_commit' AND type = 'P') + DROP PROCEDURE net_find_bindingTemplate_commit +GO + +CREATE PROCEDURE net_find_bindingTemplate_commit + @contextID uniqueidentifier, + @sortByDateAsc bit, + @sortByDateDesc bit, + @maxRows int, + @truncated int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Finalizes a find_business and returns a key list + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + SET @contextRows = dbo.contextRows(@contextID) + SET @truncated = 0 + + IF @contextRows = 0 + RETURN 0 + + DECLARE @tempKeys TABLE ( + [seqNo] bigint IDENTITY PRIMARY KEY , + [entityKey] uniqueidentifier, + [lastChange] bigint NULL, + [bindingID] bigint NULL) + + -- Set default sorting option + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + -- Set maxRows if default was passed + IF ISNULL(@maxRows,0) = 0 + SET @maxRows = dbo.configValue('Find.MaxRowsDefault') + + -- sortByDateAsc + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [lastChange], + [bindingID]) + SELECT DISTINCT + FR.[entityKey], + BT.[lastChange], + BT.[bindingID] + FROM + [UDS_findResults] FR + JOIN [UDC_bindingTemplates] BT ON FR.[entityKey] = BT.[bindingKey] AND @contextID = FR.[contextID] + ORDER BY + 2 ASC, + 3 ASC + GOTO endLabel + END + + -- sortByDateDesc + IF (@sortByDateDesc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [lastChange], + [bindingID]) + SELECT DISTINCT + FR.[entityKey], + BT.[lastChange], + BT.[bindingID] + FROM + [UDS_findResults] FR + JOIN [UDC_bindingTemplates] BT ON FR.[entityKey] = BT.[bindingKey] AND @contextID = FR.[contextID] + ORDER BY + 2 DESC, + 3 DESC + GOTO endLabel + END + +endLabel: + -- Set @truncated + IF (SELECT COUNT(*) FROM @tempKeys) > @maxRows + SET @truncated = 1 + + -- Return keys + SELECT + [entityKey] + FROM + @tempKeys + WHERE + ([seqNo] <= @maxRows) + + -- Run cleanup + EXEC net_find_cleanup @contextID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_bindingTemplate_commit +GO + + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.builddb.js b/inetsrv/uddi/source/setup/db/ca/uddi.v2.builddb.js new file mode 100644 index 0000000..ab7ec57 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.builddb.js @@ -0,0 +1,449 @@ +//////////////////////////////////////////////////////////////////////////// +// +// This script will install/deploy the UDDI 1.5 Database structure +// +// Author: lucasm +// +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// Consts +// + var c_logfile = "uddi.v2.builddb.log"; + var c_log = true;//true = log all the time + var c_verbose = false;//true = output all info to console + var c_dbserver = "(local)";//sql server where you want to deploy + var c_dbname = "uddi_v2";//name of the uddi database + var c_mode = 0;//0=DROPDB;1=CODEONLY;2=NODROP + var c_datadir = "C:\\sqldata";//dir local to db server for data files + var c_logdir = "C:\\sqldata";//dir local to db server for log files + var c_backupdir = "C:\\sqldata";//dir local to db server for backup files + var c_stagedir = "C:\\sqldata";//dir local to db server for staging files + var c_scriptdir = "C:\\dev\\nt\\inetsrv\\uddi\\source\\setup\\db\\ca";//dir local to this script where the t-sql files can be found + var c_backupscr = "createBackupSched.vbs";//script to run to configure backup on the db +// +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// Globals +// + var g_fso = new ActiveXObject( "Scripting.FileSystemObject" ); + var g_shell = new ActiveXObject( "WScript.Shell" ); + var g_sqlserver;// = new ActiveXObject( "SQLDMO.SQLServer" ); + var g_logfile ;//= c_dbname + "_log.ldf";//database log file name + var g_sysfile ;//= c_dbname + "_sys.mdf";//sys database file name + var g_datafile1 ;//= c_dbname + "_data_1.ndf";//database data file name + var g_datafile2 ;//= c_dbname + "_data_2.ndf";//database data file name + var g_journfile ;//= c_dbname + "_journal_1.ndf";//database journal file name + var g_stagefile ;//= c_dbname + "_stage_1.ndf";//database stageing file name + +// +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// Arrays +// + var g_dropdbcmd;//holds t-sql commands to drop the db + var g_cleanupcmd;//holds t-sql commands to run to clean and prep filesystem + var g_createdbcmd;//holds t-sql commands to create the db + var g_configdbcmd;//holds t-sql commands to config the db + var g_scriptarr;//holds sql file names to run to create and configure table schema + var g_codescrarr;//holds sql file names that pertain to code( sprocs,funcs, etc) + var g_taxonarr;//holds txt file names for taxonomy import +// +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// This is the help screen +// + var c_help = " deploydb.js help \r\n"+ + "\r\n"+ + " CScript deploydb.js [(-c)odeonly|(-d)ropdb|(-n)odrop] [options]\r\n"+ + "\r\n"+ + " -c Codeonly build of the database(1)\r\n"+ + " -d Drop Current Database and Restart Clean(0)\r\n"+ + " -n Do Not Drop the Current Database(2)\r\n"+ + " ( Default is " + c_mode + " )\r\n" + + "\r\n"+ + "Options:\r\n"+ + "\r\n"+ + " -s servername Name of database server( "+ c_dbserver +" )\r\n"+ + " -a datbase name Name of database( "+ c_dbname +" )\r\n"+ + " -l logname Enable logging and specify log( " + c_log + ", "+c_logfile+" )\r\n"+ + " -v Verbose Mode( " + c_verbose + ")\r\n"+ + " -D DataDir Database Data Directory( " + c_datadir + " )\r\n"+ + " NOTE: This path is local to the database server\r\n"+ + " -L LogDir Database Log Directory( " + c_logdir + " )\r\n"+ + " NOTE: This path is local to the database server\r\n"+ + " -B BackupDir Database Backup Directory( " + c_backupdir + " )\r\n"+ + " NOTE: This path is local to the database server\r\n"+ + " -S ScriptDir Database Script Location( " + c_scriptdir + " )\r\n"+ + " -N StagingDir Location to place Staging Files( " + c_stagedir + " )\r\n"+ + " -b BackupScript Script to run to install Backup Schedule\r\n" + + " ( " + c_backupscr + " )\r\n"+ + " \r\n"+ + "\r\n"; + +// +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// Handles command line arguments +// + function args( ) + { + var i =0; + try + { + if( WScript.Arguments.Length>0 ) + { + + if( WScript.Arguments( 0 ) =="-?"||WScript.Arguments( 0 ) =="/?" ) + log( c_help,6,"HELP" ); + + for( i=0;i 2 ) + WScript.Echo( entry ); + + + if( lvl > 5 ) + WScript.Quit(1); + + } +// +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// +// + g_fso = null; + g_sqlserver.Close(); + g_sqlserver= null; + g_shell=null; +// +//////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.businessentity.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.businessentity.sql new file mode 100644 index 0000000..23651f0 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.businessentity.sql @@ -0,0 +1,3433 @@ +-- Script: uddi.v2.businessEntity.sql +-- Description: Stored procedures associated with a businessEntity object. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Get stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_businessEntity_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_get' and type = 'P') + DROP PROCEDURE net_businessEntity_get +GO + +CREATE PROCEDURE net_businessEntity_get + @businessKey uniqueidentifier, + @operatorName nvarchar(450) OUTPUT, + @authorizedName nvarchar(4000) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @operatorName = dbo.publisherOperatorName([publisherID]), + @authorizedName = ISNULL([authorizedName],dbo.publisherName([publisherID])) + FROM + [UDC_businessEntities] + WHERE + [businessKey] = @businessKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_get +GO + +-- ============================================= +-- Name: net_businessEntity_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_get_batch' and type = 'P') + DROP PROCEDURE net_businessEntity_get_batch +GO + +CREATE PROCEDURE net_businessEntity_get_batch + @businessKey uniqueidentifier, + @operatorName nvarchar(450) OUTPUT, + @authorizedName nvarchar(4000) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @operatorName = dbo.publisherOperatorName([publisherID]), + @authorizedName = ISNULL([authorizedName],dbo.publisherName([publisherID])) + FROM + [UDC_businessEntities] + WHERE + [businessKey] = @businessKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_businessEntity_descriptions_get @businessKey + EXEC net_businessEntity_names_get @businessKey + EXEC net_businessEntity_discoveryURLs_get @businessKey + EXEC net_businessEntity_contacts_get @businessKey + EXEC net_businessEntity_IdentifierBag_get @businessKey + EXEC net_businessEntity_CategoryBag_get @businessKey + EXEC net_businessEntity_BusinessServices_get @businessKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_get_batch +GO + +-- ============================================= +-- Name: net_businessInfo_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessInfo_get_batch' and type = 'P') + DROP PROCEDURE net_businessInfo_get_batch +GO + +CREATE PROCEDURE net_businessInfo_get_batch + @businessKey uniqueidentifier, + @getServiceInfos bit + +WITH ENCRYPTION +AS +BEGIN + -- Retrieve the contained objects needed for a BusinessInfo + EXEC net_businessEntity_descriptions_get @businessKey + EXEC net_businessEntity_names_get @businessKey + + IF @getServiceInfos = 1 + BEGIN + EXEC net_businessEntity_BusinessServices_get @businessKey + END + + RETURN 0 + +END -- net_businessEntity_get_batch +GO + +-- ============================================= +-- Name: net_businessEntity_names_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_names_get' and type = 'P') + DROP PROCEDURE net_businessEntity_names_get +GO + +CREATE PROCEDURE net_businessEntity_names_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [name] + FROM + [UDC_names_BE] + WHERE + [businessID] = dbo.businessID(@businessKey) + + RETURN 0 +END -- net_businessEntity_names_get +GO + +-- ============================================= +-- Name: net_businessEntity_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_descriptions_get' and type = 'P') + DROP PROCEDURE net_businessEntity_descriptions_get +GO + +CREATE PROCEDURE net_businessEntity_descriptions_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_businessDesc] + WHERE + [businessID] = dbo.businessID(@businessKey) + + RETURN 0 +END -- net_businessEntity_descriptions_get +GO + +-- ============================================= +-- Name: net_businessEntity_discoveryURLs_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_discoveryURLs_get' and type = 'P') + DROP PROCEDURE net_businessEntity_discoveryURLs_get +GO + +CREATE PROCEDURE net_businessEntity_discoveryURLs_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [useType], + [discoveryURL] + FROM + [UDC_discoveryURLs] + WHERE + [businessID] = dbo.businessID(@businessKey) + + RETURN 0 +END -- net_businessEntity_discoveryURLs_get +GO + +-- ============================================= +-- Name: net_businessEntity_businessServices_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_businessServices_get' and type = 'P') + DROP PROCEDURE net_businessEntity_businessServices_get +GO + +CREATE PROCEDURE net_businessEntity_businessServices_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @maxBigInt bigint + + SET @maxBigInt = 9223372036854775807 + + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey) + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + SELECT + [serviceKey], + NULL AS [businessKey], + [lastChange], + [serviceID] + FROM + [UDC_businessServices] + WHERE + ([businessID] = dbo.businessID(@businessKey)) + + UNION + + SELECT + SP.[serviceKey], + SP.[businessKey2], -- businessKey of true parent business of a projected service + SP.[lastChange], + ISNULL(BS.[serviceID],@maxBigInt) + FROM + [UDC_serviceProjections] SP + LEFT JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + WHERE + (SP.[businessKey] = @businessKey) + + ORDER BY + 3 ASC, -- [lastChange] + 4 ASC -- [serviceID] + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_businessServices_get +GO + +-- ============================================= +-- Name: net_businessEntity_contacts_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_contacts_get' and type = 'P') + DROP PROCEDURE net_businessEntity_contacts_get +GO + +CREATE PROCEDURE net_businessEntity_contacts_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [contactID], + [useType], + [personName] + FROM + [UDC_contacts] + WHERE + [businessID] = dbo.businessID(@businessKey) + + RETURN 0 +END -- net_businessEntity_contacts_get +GO + +-- ============================================= +-- Name: net_businessEntity_contact_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_contact_get_batch' and type = 'P') + DROP PROCEDURE net_businessEntity_contact_get_batch +GO + +CREATE PROCEDURE net_businessEntity_contact_get_batch + @contactID bigint +WITH ENCRYPTION +AS +BEGIN + -- Get all contained objects in a contact + EXEC net_contact_descriptions_get @contactID + EXEC net_contact_phones_get @contactID + EXEC net_contact_emails_get @contactID + EXEC net_contact_addresses_get @contactID + +END -- net_businessEntity_contact_get_batch +GO + +-- ============================================= +-- Name: net_contact_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_descriptions_get' and type = 'P') + DROP PROCEDURE net_contact_descriptions_get +GO + +CREATE PROCEDURE net_contact_descriptions_get + @contactID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_contactDesc] + WHERE + [contactID] = @contactID + + RETURN 0 +END -- net_contact_descriptions_get +GO + +-- ============================================= +-- Name: net_businessEntity_categoryBag_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_categoryBag_get' and type = 'P') + DROP PROCEDURE net_businessEntity_categoryBag_get +GO + +CREATE PROCEDURE net_businessEntity_categoryBag_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [keyName], + [keyValue], + [tModelKey] + FROM + [UDC_categoryBag_BE] + WHERE + [businessID] = dbo.businessID(@businessKey) + + RETURN 0 +END -- net_businessEntity_categoryBag_get +GO + +-- ============================================= +-- Name: net_businessEntity_identifierBag_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_identifierBag_get' and type = 'P') + DROP PROCEDURE net_businessEntity_identifierBag_get +GO + +CREATE PROCEDURE net_businessEntity_identifierBag_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [keyName], + [keyValue], + [tModelKey] + FROM + [UDC_identifierBag_BE] + WHERE + [businessID] = dbo.businessID(@businessKey) + + RETURN 0 +END -- net_businessEntity_identifierBag_get +GO + +-- ============================================= +-- Name: net_contact_emails_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_emails_get' and type = 'P') + DROP PROCEDURE net_contact_emails_get +GO + +CREATE PROCEDURE net_contact_emails_get + @contactID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [useType], + [email] + FROM + [UDC_emails] + WHERE + [contactID] = @contactID + + RETURN 0 +END -- net_contact_emails_get +GO + +-- ============================================= +-- Name: net_contact_phones_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_phones_get' and type = 'P') + DROP PROCEDURE net_contact_phones_get +GO + +CREATE PROCEDURE net_contact_phones_get + @contactID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [useType], + [phone] + FROM + [UDC_phones] + WHERE + [contactID] = @contactID + + RETURN 0 +END -- net_contact_phones_get +GO + +-- ============================================= +-- Name: net_contact_addresses_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_addresses_get' and type = 'P') + DROP PROCEDURE net_contact_addresses_get +GO + +CREATE PROCEDURE net_contact_addresses_get + @contactID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [addressID], + [sortCode], + [useType], + [tModelKey] + FROM + [UDC_addresses] + WHERE + [contactID] = @contactID + + RETURN 0 +END -- net_contact_addresses_get +GO + +-- ============================================= +-- Name: net_address_addressLines_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_address_addressLines_get' and type = 'P') + DROP PROCEDURE net_address_addressLines_get +GO + +CREATE PROCEDURE net_address_addressLines_get + @addressID bigint +WITH ENCRYPTION +AS +BEGIN + SELECT + [addressLine], + [keyName], + [keyValue] + FROM + [UDC_addressLines] + WHERE + [addressID] = @addressID + + RETURN 0 +END -- net_address_addressLines_get +GO + +-- ============================================= +-- Section: Save stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_businessEntity_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_save' and type = 'P') + DROP PROCEDURE net_businessEntity_save +GO + +CREATE PROCEDURE net_businessEntity_save + @businessKey uniqueidentifier, + @PUID nvarchar(450), + @generic varchar(20), + @contextID uniqueidentifier, + @lastChange bigint, + @authorizedName nvarchar(4000) OUTPUT, + @operatorName nvarchar(450) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @publisherID bigint, + @isReplPublisher bit + + SET @RC = 0 + + SET @publisherID = dbo.publisherID(@PUID) + + IF (@publisherID IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Invalid publisherID.' + GOTO errorLabel + END + + SET @isReplPublisher = dbo.isReplPublisher(@PUID) + + IF @isReplPublisher = 0 + SET @authorizedName = NULL + + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey) + BEGIN + DELETE [UDC_businessEntities] WHERE [businessKey] = @businessKey + END + ELSE + BEGIN + IF (@isReplPublisher = 1) + BEGIN + -- perform this check only for replication publishers + IF (dbo.isUuidUnique(@businessKey) = 0) + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'Key is not unique. businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + END + END + + INSERT [UDC_businessEntities]( + [publisherID], + [generic], + [authorizedName], + [businessKey], + [lastChange]) + VALUES( + @publisherID, + ISNULL(@generic,dbo.configValue('CurrentAPIVersion')), + @authorizedName, + @businessKey, + @lastChange) + + SET @authorizedName = dbo.publisherName(@publisherID) + SET @operatorName = dbo.publisherOperatorName(@publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_save +GO + +-- ============================================= +-- Name: net_businessEntity_name_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_name_save' and type = 'P') + DROP PROCEDURE net_businessEntity_name_save +GO + +CREATE PROCEDURE net_businessEntity_name_save + @businessKey uniqueidentifier, + @isoLangCode varchar(17) = 'en', + @name nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000) + + -- Check for valid name + IF (@name IS NULL) OR (LEN(@name) = 0) + BEGIN + SET @error = 60500 -- E_fatalError + SET @context = 'name cannot be blank.' + GOTO errorLabel + END + + INSERT [UDC_names_BE]( + [businessID], + [isoLangCode], + [name]) + VALUES( + dbo.businessID(@businessKey), + @isoLangCode, + @name) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_name_save +GO + +-- ============================================= +-- Name: net_businessEntity_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_description_save' and type = 'P') + DROP PROCEDURE net_businessEntity_description_save +GO + +CREATE PROCEDURE net_businessEntity_description_save + @businessKey uniqueidentifier, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_businessDesc]( + [businessID], + [isoLangCode], + [description]) + VALUES( + dbo.businessID(@businessKey), + @isoLangCode, + @description) + + RETURN 0 +END -- net_businessEntity_description_save +GO + +-- ============================================= +-- Name: net_businessEntity_discoveryURL_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_discoveryURL_save' and type = 'P') + DROP PROCEDURE net_businessEntity_discoveryURL_save +GO + +CREATE PROCEDURE net_businessEntity_discoveryURL_save + @businessKey uniqueidentifier, + @useType nvarchar(4000), + @discoveryURL nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_discoveryURLs]( + [businessID], + [useType], + [discoveryURL]) + VALUES( + dbo.businessID(@businessKey), + @useType, + @discoveryURL) + + RETURN 0 +END -- net_businessEntity_discoveryURL_save +GO + +-- ============================================= +-- Name: net_businessEntity_categoryBag_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_categoryBag_save' and type = 'P') + DROP PROCEDURE net_businessEntity_categoryBag_save +GO + +CREATE PROCEDURE net_businessEntity_categoryBag_save + @businessKey uniqueidentifier, + @keyName nvarchar(255), + @keyValue nvarchar(255), + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_categoryBag_BE]( + [businessID], + [keyName], + [keyValue], + [tModelKey]) + VALUES( + dbo.businessID(@businessKey), + @keyName, + @keyValue, + @tModelKey) + + RETURN 0 +END -- net_businessEntity_categoryBag_save +GO + +-- ============================================= +-- Name: net_businessEntity_identifierBag_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_identifierBag_save' and type = 'P') + DROP PROCEDURE net_businessEntity_identifierBag_save +GO + +CREATE PROCEDURE net_businessEntity_identifierBag_save + @businessKey uniqueidentifier, + @keyName nvarchar(255), + @keyValue nvarchar(255), + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_identifierBag_BE]( + [businessID], + [keyName], + [keyValue], + [tModelKey]) + VALUES( + dbo.businessID(@businessKey), + @keyName, + @keyValue, + @tModelKey) + + RETURN 0 +END -- net_businessEntity_categoryBag_save +GO + +-- ============================================= +-- Name: net_businessEntity_contact_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_contact_save' and type = 'P') + DROP PROCEDURE net_businessEntity_contact_save +GO + +CREATE PROCEDURE net_businessEntity_contact_save + @businessKey uniqueidentifier, + @useType nvarchar(4000), + @personName nvarchar(4000), + @contactID bigint OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + INSERT [UDC_contacts]( + [businessID], + [useType], + [personName]) + VALUES( + dbo.businessID(@businessKey), + @useType, + @personName) + + SET @contactID = @@IDENTITY + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_contact_save +GO + +-- ============================================= +-- Name: net_contact_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_description_save' and type = 'P') + DROP PROCEDURE net_contact_description_save +GO + +CREATE PROCEDURE net_contact_description_save + @contactID bigint, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_contactDesc]( + [contactID], + [isoLangCode], + [description]) + VALUES( + @contactID, + @isoLangCode, + @description) + + RETURN 0 +END -- net_contact_description_save +GO + +-- ============================================= +-- Name: net_contact_email_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_email_save' and type = 'P') + DROP PROCEDURE net_contact_email_save +GO + +CREATE PROCEDURE net_contact_email_save + @contactID bigint, + @useType nvarchar(4000), + @email nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_emails]( + [contactID], + [useType], + [email]) + VALUES( + @contactID, + @useType, + @email) + + RETURN 0 +END -- net_contact_email_save +GO + +-- ============================================= +-- Name: net_contact_phone_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_phone_save' and type = 'P') + DROP PROCEDURE net_contact_phone_save +GO + +CREATE PROCEDURE net_contact_phone_save + @contactID bigint, + @useType nvarchar(4000), + @phone nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_phones]( + [contactID], + [useType], + [phone]) + VALUES( + @contactID, + @useType, + @phone) + + RETURN 0 +END -- net_contact_phone_save +GO + +-- ============================================= +-- Name: net_contact_address_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_contact_address_save' and type = 'P') + DROP PROCEDURE net_contact_address_save +GO + +CREATE PROCEDURE net_contact_address_save + @contactID bigint, + @sortCode nvarchar(4000), + @useType nvarchar(4000), + @tModelKey uniqueidentifier = NULL, + @addressID bigint OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @numRows int + + INSERT [UDC_addresses]( + [contactID], + [sortCode], + [useType], + [tModelKey]) + VALUES( + @contactID, + @sortCode, + @useType, + @tModelKey) + + SET @addressID = @@IDENTITY + + RETURN 0 +END -- net_contact_address_save +GO + +-- ============================================= +-- Name: net_address_addressLine_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_address_addressLine_save' and type = 'P') + DROP PROCEDURE net_address_addressLine_save +GO + +CREATE PROCEDURE net_address_addressLine_save + @addressID bigint, + @addressLine nvarchar(4000), + @keyName nvarchar(255) = NULL, + @keyValue nvarchar(255) = NULL +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_addressLines]( + [addressID], + [addressLine], + [keyName], + [keyValue]) + VALUES( + @addressID, + @addressLine, + @keyName, + @keyValue) + + RETURN 0 +END -- net_address_addressLine_save +GO + +-- ============================================= +-- Section: Delete stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_businessEntity_delete +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_delete' and type = 'P') + DROP PROCEDURE net_businessEntity_delete +GO + +CREATE PROCEDURE net_businessEntity_delete + @PUID nvarchar(450), + @businessKey uniqueidentifier, + @contextID uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint + + SET @RC = 0 + + -- + -- Validate parameters + -- + + IF @businessKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = '@businessKey is required.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- Check to see if businessKey exists + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE ([businessKey] = @businessKey)) + BEGIN + -- businessKey exists. Make sure it belongs to current publisher + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE ([businessKey] = @businessKey) AND (publisherID = @publisherID)) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + END + ELSE + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + -- Delete business + DELETE + [UDC_businessEntities] + WHERE + [businessKey] = @businessKey + + -- Delete assertions + DELETE + [UDC_assertions_BE] + WHERE + [fromKey] = @businessKey + + DELETE + [UDC_assertions_BE] + WHERE + [toKey] = @businessKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_delete +GO + +-- ============================================= +-- Section: Validation stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_businessEntity_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_businessEntity_validate' AND type = 'P') + DROP PROCEDURE net_businessEntity_validate +GO + +CREATE PROCEDURE net_businessEntity_validate + @PUID nvarchar(450), + @businessKey uniqueidentifier, + @flag int = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint, + @replActive bit + + SET @RC = 0 + SET @replActive = 0 + + IF @flag IS NULL + SET @flag = 0 + + -- + -- Validate parameters + -- + + IF @businessKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = '@businessKey is required.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator / publisher association (replication only) + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT, @replActive OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- + -- Validate businessEntity + -- + + -- Check to see if businessKey exists + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE ([businessKey] = @businessKey)) + BEGIN + -- businessKey exists. Make sure it belongs to current publisher + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE ([businessKey] = @businessKey) AND (publisherID = @publisherID)) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + IF @replActive = 0 + BEGIN + IF @operatorID <> dbo.currentOperatorID() + BEGIN + SET @error = 60130 -- E_operatorMismatch + SET @context = 'Operator ' + dbo.operatorName(@operatorID) + ' is not the local operator.' + GOTO errorLabel + END + END + END + ELSE + BEGIN + -- businessKey doesn't exist + IF (@replActive = 0) AND (@flag & 0x1 <> 0x1) + BEGIN + -- save isn't coming from replication and pre-assigned keys flag is not set so throw an error + SET @error = 60210 -- E_invalidKey + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_validate +GO + +-- ============================================= +-- Section: Publisher assertions +-- ============================================= + +-- ============================================= +-- Name: net_businessEntity_assertions_get +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_assertions_get' and type = 'P') + DROP PROCEDURE net_businessEntity_assertions_get +GO + +CREATE PROCEDURE net_businessEntity_assertions_get + @fromKey uniqueidentifier, + @toKey uniqueidentifier, + @completionStatus int +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + PA.[fromKey], + PA.[toKey], + PA.[keyName], + PA.[keyValue], + PA.[tModelKey] + FROM + [UDC_assertions_BE] PA + WHERE + (PA.[fromKey] = @fromKey) AND + (PA.[toKey] = @toKey) AND + (PA.[flag] = @completionStatus) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 + +END -- net_businessEntity_assertions_get +GO + +-- ============================================= +-- Section: Find stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_find_businessEntity_name +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_businessEntity_name' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_name +GO + +CREATE PROCEDURE net_find_businessEntity_name + @contextID uniqueidentifier, + @isoLangCode varchar(17) = '%', + @name nvarchar(450), + @exactNameMatch bit, + @caseSensitiveMatch bit, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Adds name search arguments for a find_business + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @wildCardSarg nvarchar(451) + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier, + [name] nvarchar(450)) + + SET @contextRows = dbo.contextRows(@contextID) + + IF dbo.containsWildcard(@isoLangCode) = 0 + SET @isoLangCode = @isoLangCode + N'%' + + -- + -- Do a wildcard search (default) + -- + + IF (@exactNameMatch = 0) + BEGIN + SET @wildCardSarg = @name + + IF dbo.containsWildcard(@name) = 0 + SET @wildCardSarg = @wildCardSarg + N'%' + + IF @contextRows = 0 + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BE.[businessKey], + BN.[name] + FROM + [UDC_businessEntities] BE JOIN + [UDC_names_BE] BN ON BE.[businessID] = BN.[businessID] + WHERE + (BN.[name] LIKE @wildCardSarg) AND + (BN.[isoLangCode] LIKE @isoLangCode) + END + ELSE + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BE.[businessKey], + BN.[name] + FROM + [UDC_businessEntities] BE JOIN + [UDC_names_BE] BN ON BE.[businessID] = BN.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (BN.[name] LIKE @wildCardSarg) AND + (BN.[isoLangCode] LIKE @isoLangCode) + END + END + + -- + -- Do an exactNameMatch search + -- + + IF (@exactNameMatch = 1) + BEGIN + IF @contextRows = 0 + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BE.[businessKey], + BN.[name] + FROM + [UDC_businessEntities] BE JOIN + [UDC_names_BE] BN ON BE.[businessID] = BN.[businessID] + WHERE + (BN.[name] = @name) AND + (BN.[isoLangCode] LIKE @isoLangCode) + END + ELSE + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BE.[businessKey], + BN.[name] + FROM + [UDC_businessEntities] BE JOIN + [UDC_names_BE] BN ON BE.[businessID] = BN.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (BN.[name] = @name) AND + (BN.[isoLangCode] LIKE @isoLangCode) + END + END + + IF (@caseSensitiveMatch = 1) + DELETE + @tempKeys + WHERE + (dbo.caseSensitiveMatch(@name, [name], @exactNameMatch) = 0) + + -- name search arguments are combined using a logical OR by default + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_name +GO + +-- ============================================= +-- Name: net_find_businessEntity_discoveryURL +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_businessEntity_discoveryURL' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_discoveryURL +GO + +CREATE PROCEDURE net_find_businessEntity_discoveryURL + @contextID uniqueidentifier, + @useType nvarchar(4000), + @discoveryURL nvarchar(4000), + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Adds discoveryURL search arguments for a find_business + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @defaultPattern nvarchar(4000), + @businessKeyStr char(36), + @businessKey uniqueidentifier + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + -- Perform special check for default discoveryURL + IF @useType = N'businessEntity' + BEGIN + SET @defaultPattern = UPPER(dbo.configValue('DefaultDiscoveryURL') + '[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]') + + -- Check to see if the discoveryURL looks like a default discoveryURL + IF @discoveryURL NOT LIKE @defaultPattern + GOTO continueSearch + + -- Extract the businessKey from the discoveryURL + SET @businessKeyStr = RIGHT(@discoveryURL, 36) + + IF dbo.ISGUID(@businessKeyStr) = 0 + GOTO continueSearch + + SET @businessKey = CAST(@businessKeyStr AS uniqueidentifier) + + -- Check to see if the businessKey exists + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey) + GOTO continueSearch + + -- businessKey exists. See if any existing discoveryURLs exist for useType = businessEntity + SELECT + @rows = COUNT(*) + FROM + [UDC_discoveryURLs] DU + JOIN [UDC_businessEntities] BE ON DU.[businessID] = BE.[businessID] + WHERE + (BE.[businessKey] = @businessKey) AND + (DU.[useType] = N'businessEntity') + + IF @rows > 0 + BEGIN + SET @rows = 0 + GOTO continueSearch + END + + -- No existing discoveryURLs exist for useType = businessEntity for this business. + -- Since search argument matches default discoveryURL, add businessKey to list of keys + + INSERT @tempKeys( + [entityKey]) + VALUES( + @businessKey) + + -- Continue search, since other businesses could possibly have the same discoveryURL + END -- default discoveryURL logic + +continueSearch: + SET @contextRows = dbo.contextRows(@contextID) + + IF LEN(@useType) = 0 OR @useType IS NULL + BEGIN + SET @useType = '%' + END + + IF @contextRows = 0 + BEGIN + INSERT INTO @tempKeys( + [entityKey]) + SELECT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_discoveryURLs] DU ON BE.[businessID] = DU.[businessID] + WHERE + (DU.[discoveryURL] = @discoveryURL) AND + ((ISNULL(DU.[useType],'[[NULL]]')) LIKE @useType) + END + ELSE + BEGIN + INSERT INTO @tempKeys( + [entityKey]) + SELECT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_discoveryURLs] DU ON BE.[businessID] = DU.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (DU.[discoveryURL] = @discoveryURL) AND + ((ISNULL(DU.[useType],'[[NULL]]')) LIKE @useType) + END + + -- All keys are combined using logical OR for discoveryURL search arguments + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_discoveryURL +GO + +-- ============================================= +-- Name: net_find_businessEntity_identifierBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessEntity_identifierBag' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_identifierBag +GO + +CREATE PROCEDURE net_find_businessEntity_identifierBag + @contextID uniqueidentifier, + @keyName nvarchar(4000), + @keyValue nvarchar(4000), + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + IF @contextRows = 0 + BEGIN + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_identifierBag_BE] IB ON BE.[businessID] = IB.[businessID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_identifierBag_BE] IB ON BE.[businessID] = IB.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + END + + IF @orKeys = 1 + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_identifierBag +GO + +-- ============================================= +-- Name: net_find_businessEntity_categoryBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessEntity_categoryBag' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_categoryBag +GO + +CREATE PROCEDURE net_find_businessEntity_categoryBag + @contextID uniqueidentifier, + @keyName nvarchar(4000), + @keyValue nvarchar(4000), + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @genKeywordsMatch bit + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + SET @genKeywordsMatch = 0 + + IF @tModelKey = dbo.genKeywordsKey() + SET @genKeywordsMatch = 1 + + IF @contextRows = 0 + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + ELSE + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + + IF @orKeys = 1 + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_categoryBag +GO + +-- ============================================= +-- Name: net_find_businessEntity_serviceSubset +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessEntity_serviceSubset' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_serviceSubset +GO + +CREATE PROCEDURE net_find_businessEntity_serviceSubset + @contextID uniqueidentifier, + @keyName nvarchar(4000), + @keyValue nvarchar(4000), + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @genKeywordsMatch bit + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier, + [subEntityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + SET @genKeywordsMatch = 0 + + IF @tModelKey = dbo.genKeywordsKey() + SET @genKeywordsMatch = 1 + + IF @contextRows = 0 + BEGIN + IF @genKeywordsMatch = 1 + BEGIN + -- Ignore keyName + + -- Standard services + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) + + -- Projected services + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + + -- Projected services + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + ELSE + BEGIN + IF @genKeywordsMatch = 1 + BEGIN + -- Ignore keyName + + -- Standard services + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) + + -- Projected services + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + + -- Standard services + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + + -- Projected services + INSERT @tempKeys( + [entityKey], + [subEntityKey]) + SELECT DISTINCT + BE.[businessKey], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + + IF @orKeys = 1 + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey], + [subEntityKey]) + SELECT DISTINCT + @contextID, + [entityKey], + [subEntityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey], + [subEntityKey]) + SELECT DISTINCT + @contextID, + [entityKey], + [subEntityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_serviceSubset +GO + +-- ============================================= +-- Name: net_find_businessEntity_combineCategoryBags +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessEntity_combineCategoryBags' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_combineCategoryBags +GO + +CREATE PROCEDURE net_find_businessEntity_combineCategoryBags + @contextID uniqueidentifier, + @keyName nvarchar(4000), + @keyValue nvarchar(4000), + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @genKeywordsMatch bit + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + SET @genKeywordsMatch = 0 + + IF @tModelKey = dbo.genKeywordsKey() + SET @genKeywordsMatch = 1 + + IF @contextRows = 0 + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + + -- businessEntity + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + + -- Standard services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + + -- Projected services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + + -- businessEntity + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + + -- Standard services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + + -- Projected services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + ELSE + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + + -- businessEntity + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + + -- Standard services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + + -- Projected services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + + -- businessEntity + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_categoryBag_BE] CB ON BE.[businessID] = CB.[businessID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + + -- Standard services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + + -- Projected services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + + IF @orKeys = 1 + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_combineCategoryBags +GO + +-- ============================================= +-- Name: net_find_businessEntity_tModelBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessEntity_tModelBag' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_tModelBag +GO + +CREATE PROCEDURE net_find_businessEntity_tModelBag + @contextID uniqueidentifier, + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + + -- See if we have any results from a search against another bag (ie. categoryBag or identifierBag) + SET @contextRows = dbo.contextRows(@contextID) + + IF @contextRows = 0 + + -- If there are no previous results we can just query and insert into @tempKeys + + BEGIN + -- + -- First check contained services + -- + + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + + -- + -- Next check projected services + -- + + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + END + ELSE + + -- If there are previous results from searches against other bags, then we must take that into account in the + -- queries for this bag. This is necessary because results between bags are always 'AND-ed'. + + BEGIN + -- + -- First check contained services + -- + + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + + -- + -- Next check projected services + -- + + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_serviceProjections] SP ON BE.[businessKey] = SP.[businessKey] + JOIN [UDC_businessServices] BS ON SP.[serviceKey] = BS.[serviceKey] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (BE.[businessKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + END + + IF @orKeys = 1 + BEGIN + + -- OR operation between @tempKeys and the UDS_findScratch table + + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + + -- AND operation between @tempKeys and the UDS_findScratch table + + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_tModelBag +GO + +-- ============================================= +-- Name: net_find_businessEntity_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_businessEntity_commit' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_commit +GO + +CREATE PROCEDURE net_find_businessEntity_commit + @contextID uniqueidentifier, + @sortByNameAsc bit, + @sortByNameDesc bit, + @sortByDateAsc bit, + @sortByDateDesc bit, + @maxRows int, + @truncated int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Finalizes a find_business and returns a key list + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + SET @contextRows = dbo.contextRows(@contextID) + SET @truncated = 0 + + IF @contextRows = 0 + RETURN 0 + + DECLARE @tempKeys TABLE ( + [seqNo] bigint IDENTITY PRIMARY KEY , + [entityKey] uniqueidentifier, + [name] nvarchar(450) NULL, + [lastChange] bigint NULL, + [businessID] bigint NULL) + + -- Set default sorting option + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) AND (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByNameAsc = 1 + + -- Set maxRows if default was passed + IF ISNULL(@maxRows,0) = 0 + SET @maxRows = dbo.configValue('Find.MaxRowsDefault') + + -- sortByNameAsc + IF (@sortByNameAsc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByNameDesc + IF (@sortByNameDesc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByDateAsc + IF (@sortByDateAsc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 DESC + END + + GOTO endLabel + END + + -- sortByDateDesc + IF (@sortByDateDesc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 DESC + END + + GOTO endLabel + END + +endLabel: + -- Set @truncated + IF (SELECT COUNT(*) FROM @tempKeys) > @maxRows + SET @truncated = 1 + + -- Return keys + SELECT + [entityKey] + FROM + @tempKeys + WHERE + ([seqNo] <= @maxRows) + + -- Run cleanup + EXEC net_find_cleanup @contextID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_commit +GO + +-- ============================================= +-- Name: net_find_businessEntity_serviceSubset_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_businessEntity_serviceSubset_commit' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_serviceSubset_commit +GO + +CREATE PROCEDURE net_find_businessEntity_serviceSubset_commit + @contextID uniqueidentifier, + @sortByNameAsc bit, + @sortByNameDesc bit, + @sortByDateAsc bit, + @sortByDateDesc bit, + @maxRows int, + @truncated int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Finalizes a find_business and returns a key list + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + SET @contextRows = dbo.contextRows(@contextID) + SET @truncated = 0 + + IF @contextRows = 0 + RETURN 0 + + DECLARE @tempKeys TABLE ( + [seqNo] bigint IDENTITY PRIMARY KEY , + [entityKey] uniqueidentifier, + [name] nvarchar(450) NULL, + [lastChange] bigint NULL, + [businessID] bigint NULL) + + -- Set default sorting option + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) AND (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByNameAsc = 1 + + -- Set maxRows if default was passed + IF ISNULL(@maxRows,0) = 0 + SET @maxRows = dbo.configValue('Find.MaxRowsDefault') + + -- sortByNameAsc + IF (@sortByNameAsc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByNameDesc + IF (@sortByNameDesc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByDateAsc + IF (@sortByDateAsc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 DESC + END + + GOTO endLabel + END + + -- sortByDateDesc + IF (@sortByDateDesc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 DESC + END + + GOTO endLabel + END + +endLabel: + -- Set @truncated + IF (SELECT COUNT(*) FROM @tempKeys) > @maxRows + SET @truncated = 1 + + -- Return keys + SELECT + TK.[entityKey], + FR.[subEntityKey] + FROM + @tempKeys TK + JOIN [UDS_findResults] FR ON @contextID = FR.[contextID] AND TK.[entityKey] = FR.[entityKey] + WHERE + ([seqNo] <= @maxRows) + ORDER BY + TK.[seqNo] ASC + + -- Run cleanup + EXEC net_find_cleanup @contextID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_serviceSubset_commit +GO + +-- ============================================= +-- Name: net_find_businessEntity_relatedBusinesses +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessEntity_relatedBusinesses' AND type = 'P') + DROP PROCEDURE net_find_businessEntity_relatedBusinesses +GO + +CREATE PROCEDURE net_find_businessEntity_relatedBusinesses + @contextID uniqueidentifier, + @businessKey uniqueidentifier, + @keyName nvarchar(4000) = NULL, + @keyValue nvarchar(4000) = NULL, + @tModelKey uniqueidentifier = NULL, + @sortByNameAsc bit, + @sortByNameDesc bit, + @sortByDateAsc bit, + @sortByDateDesc bit, + @maxRows int, + @truncated int OUTPUT, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + DECLARE @tempKeys TABLE( + [seqNo] bigint IDENTITY PRIMARY KEY, + [entityKey] uniqueidentifier, + [name] nvarchar(450) NULL, + [lastChange] bigint NULL, + [businessID] bigint NULL) + + IF @tModelKey IS NULL + BEGIN + -- Perform find without keyedReference + INSERT [UDS_findResults] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [toKey] + FROM + [UDC_assertions_BE] + WHERE + ([fromKey] = @businessKey) AND + ([flag] = 3) -- CompletionStatusType.Complete + + INSERT [UDS_findResults] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [fromKey] + FROM + [UDC_assertions_BE] + WHERE + ([toKey] = @businessKey) AND + ([flag] = 3) -- CompletionStatusType.Complete + END + ELSE + BEGIN + INSERT [UDS_findResults]( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [toKey] + FROM + [UDC_assertions_BE] + WHERE + ([fromKey] = @businessKey) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) AND + ([flag] = 3) -- CompletionStatusType.Complete + + INSERT [UDS_findResults]( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [fromKey] + FROM + [UDC_assertions_BE] + WHERE + ([toKey] = @businessKey) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) AND + ([flag] = 3) -- CompletionStatusType.Complete + END + + -- Set default sorting option + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) AND (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByNameAsc = 1 + + -- Set maxRows if default was passed + IF ISNULL(@maxRows,0) = 0 + SET @maxRows = dbo.configValue('Find.MaxRowsDefault') + + -- sortByNameAsc + IF (@sortByNameAsc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByNameDesc + IF (@sortByNameDesc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByDateAsc + IF (@sortByDateAsc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 DESC + END + + GOTO endLabel + END + + -- sortByDateDesc + IF (@sortByDateDesc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [businessID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BE] WHERE ([businessID] = dbo.businessID([entityKey]))), + BE.[lastChange], + BE.[businessID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessEntities] BE ON FR.[entityKey] = BE.[businessKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 DESC + END + + GOTO endLabel + END + +endLabel: + -- Set @truncated + SELECT + @rows = COUNT(*) + FROM + @tempKeys + + IF @rows > @maxRows + SET @truncated = 1 + + -- Return keys + SELECT + [entityKey] + FROM + @tempKeys + WHERE + ([seqNo] <= @maxRows) + + -- Run cleanup + EXEC net_find_cleanup @contextID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessEntity_relatedBusinesses +GO + +-- ============================================= +-- Section: Miscellaneous +-- ============================================= + +-- ============================================= +-- Name: net_businessEntity_owner_update +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_businessEntity_owner_update' AND type = 'P') + DROP PROCEDURE net_businessEntity_owner_update +GO + +CREATE PROCEDURE net_businessEntity_owner_update + @businessKey uniqueidentifier, + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @businessID bigint, + @publisherID bigint + + -- Validate parameters + SET @businessID = dbo.businessID(@businessKey) + + IF @businessID IS NULL + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + @PUID + GOTO errorLabel + END + + UPDATE + [UDC_businessEntities] + SET + [publisherID] = @publisherID + WHERE + ([businessID] = @businessID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_owner_update +GO + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.businessservice.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.businessservice.sql new file mode 100644 index 0000000..63250c9 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.businessservice.sql @@ -0,0 +1,1714 @@ +-- Script: uddi.v2.businessService.sql +-- Author: LRDohert@Microsoft.com +-- Description: Stored procedures associated with a businessService object. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Get stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_businessService_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_get' and type = 'P') + DROP PROCEDURE net_businessService_get +GO + +CREATE PROCEDURE net_businessService_get + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @businessKey = dbo.businessKey([businessID]) + FROM + [UDC_businessServices] + WHERE + [serviceKey] = @serviceKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_get +GO + +-- ============================================= +-- Name: net_businessService_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_get_batch' and type = 'P') + DROP PROCEDURE net_businessService_get_batch +GO + +CREATE PROCEDURE net_businessService_get_batch + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @businessKey = dbo.businessKey([businessID]) + FROM + [UDC_businessServices] + WHERE + [serviceKey] = @serviceKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_businessService_descriptions_get @serviceKey + EXEC net_businessService_names_get @serviceKey + EXEC net_businessService_bindingTemplates_get @serviceKey + EXEC net_businessService_categoryBag_get @serviceKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_get_batch +GO + +-- ============================================= +-- Name: net_serviceInfo_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_serviceInfo_get_batch' and type = 'P') + DROP PROCEDURE net_serviceInfo_get_batch +GO + +CREATE PROCEDURE net_serviceInfo_get_batch + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @businessKey = dbo.businessKey([businessID]) + FROM + [UDC_businessServices] + WHERE + [serviceKey] = @serviceKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_businessService_names_get @serviceKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_get_batch +GO + +-- ============================================= +-- Name: net_businessService_names_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_names_get' and type = 'P') + DROP PROCEDURE net_businessService_names_get +GO + +CREATE PROCEDURE net_businessService_names_get + @serviceKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [name] + FROM + [UDC_names_BS] + WHERE + ([serviceID] = dbo.serviceID(@serviceKey)) + + RETURN 0 +END -- net_businessService_names_get +GO + +-- ============================================= +-- Name: net_businessService_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_descriptions_get' and type = 'P') + DROP PROCEDURE net_businessService_descriptions_get +GO + +CREATE PROCEDURE net_businessService_descriptions_get + @serviceKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_serviceDesc] + WHERE + ([serviceID] = dbo.serviceID(@serviceKey)) + + RETURN 0 +END -- net_businessService_descriptions_get +GO + +-- ============================================= +-- Name: net_businessService_categoryBag_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_categoryBag_get' and type = 'P') + DROP PROCEDURE net_businessService_categoryBag_get +GO + +CREATE PROCEDURE net_businessService_categoryBag_get + @serviceKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [keyName], + [keyValue], + [tModelKey] + FROM + [UDC_categoryBag_BS] + WHERE + [serviceID] = dbo.serviceID(@serviceKey) + + RETURN 0 +END -- net_businessService_categoryBag_get +GO + +-- ============================================= +-- Name: net_businessService_bindingTemplates_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_bindingTemplates_get' and type = 'P') + DROP PROCEDURE net_businessService_bindingTemplates_get +GO + +CREATE PROCEDURE net_businessService_bindingTemplates_get + @serviceKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [bindingKey], + [lastChange], + [bindingID] + FROM + [UDC_bindingTemplates] + WHERE + ([serviceID] = dbo.serviceID(@serviceKey)) + ORDER BY + 2 ASC, -- lastChange + 3 ASC -- bindingID + + RETURN 0 +END -- net_businessService_bindingTemplates_get +GO + +-- ============================================= +-- Section: Save stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_businessService_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_save' and type = 'P') + DROP PROCEDURE net_businessService_save +GO + +CREATE PROCEDURE net_businessService_save + @PUID nvarchar(450), + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier, + @generic varchar(20), + @contextID uniqueidentifier, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @serviceLimit int, + @serviceCount int, + @publisherID bigint, + @businessID bigint, + @isReplPublisher bit, + @original_businessID bigint + + SET @RC = 0 + SET @businessID = dbo.businessID(@businessKey) + + -- businessKey validation must occur during save since its not always known at validate time + IF (@businessID IS NULL) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + -- Look up publisherID + SET @isReplPublisher = dbo.isReplPublisher(@PUID) + SET @publisherID = dbo.publisherID(@PUID) + + IF (@publisherID IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + @PUID + GOTO errorLabel + END + + -- Get the original businessID for this service. Use the existence of this key to determine + -- whether or not there was an existing service in the first place. If there was one, we'll delete + -- it. We'll need this ID later on to determine whether this save operation was actually a move + -- operation. + SELECT + @original_businessID = [businessID] + FROM + [UDC_businessServices] + WHERE + ([serviceKey] = @serviceKey) + + IF (@original_businessID IS NOT NULL) + BEGIN + DELETE [UDC_businessServices] WHERE [serviceKey] = @serviceKey + END + ELSE + BEGIN + IF (@isReplPublisher) = 1 + BEGIN + -- Perform this check only for replication publishers + IF (dbo.isUuidUnique(@serviceKey) = 0) + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'Key is not unique. serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + END + END + + -- Check limit + SELECT + @serviceLimit = [serviceLimit] + FROM + [UDO_publishers] + WHERE + ([publisherID] = @publisherID) + + SELECT + @serviceCount = COUNT(*) + FROM + [UDC_businessServices] + WHERE + ([businessID] = @businessID) + + IF ((@serviceCount + 1) > @serviceLimit) + BEGIN + SET @error = 60160 -- E_accountLimitExceeded + SET @context = 'Publisher limit for ''businessService'' exceeded (limit=' + CAST(@serviceLimit AS nvarchar(4000)) + ', count=' + CAST(@serviceCount AS nvarchar(4000)) + ')' + GOTO errorLabel + END + + -- Insert service + INSERT [UDC_businessServices]( + [businessID], + [generic], + [serviceKey], + [lastChange]) + VALUES( + @businessID, + @generic, + @serviceKey, + @lastChange) + + -- The original business ID will be non-NULL if there this service existed before. It will + -- not be the value of the given business ID if this save operation was a move operation. If + -- both of these conditions are true, then we want to make sure that this service is not a + -- service projection for the given business. We need to remove this service projection since + -- this service actually belongs to the business now. + IF ((@original_businessID IS NOT NULL) AND (@original_businessID <> @businessID)) + BEGIN + DELETE + [UDC_serviceProjections] + WHERE + ([businessKey] = @businessKey) AND + ([serviceKey] = @serviceKey) + + -- TODO remove this check after a few clean test runs + IF (@@ROWCOUNT > 1) + BEGIN + SET @error = 60500 -- E_fatalError + SET @context = 'Error, multiple service projections were deleted.' + GOTO errorLabel + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_save +GO + +-- ============================================= +-- Name: net_serviceProjection_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_serviceProjection_save' and type = 'P') + DROP PROCEDURE net_serviceProjection_save +GO + +CREATE PROCEDURE net_serviceProjection_save + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @businessKey2 uniqueidentifier + + SET @RC = 0 + + -- businessKey validation must occur during save since its not always known at validate time + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + -- serviceKey validation must occur during save since its not always known at validate time + IF NOT EXISTS(SELECT * FROM [UDC_businessServices] WHERE [serviceKey] = @serviceKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + -- Look up the true parent of the service, need this later in case true parent is deleted + SELECT + @businessKey2 = BE.[businessKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_businessEntities] BE ON BS.[businessID] = BE.[businessID] + WHERE + (BS.[serviceKey] = @serviceKey) + + -- Add service projection if it doesn't already exist + IF NOT EXISTS(SELECT * FROM [UDC_serviceProjections] WHERE ([businessKey] = @businessKey) AND ([serviceKey] = @serviceKey)) + BEGIN + INSERT [UDC_serviceProjections]( + [businessKey], + [serviceKey], + [businessKey2], + [lastChange]) + VALUES( + @businessKey, + @serviceKey, + @businessKey2, + @lastChange) + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_serviceProjection_save +GO + +-- ============================================= +-- Name: net_serviceProjection_repl_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_serviceProjection_repl_save' and type = 'P') + DROP PROCEDURE net_serviceProjection_repl_save +GO + +CREATE PROCEDURE net_serviceProjection_repl_save + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier, + @businessKey2 uniqueidentifier, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000) + + SET @RC = 0 + + -- IMPORTANT: This sproc should only ever be called for replication. As per IN 60, we have to process service projection + -- change records even if they refer to business services that no longer exist. Both businesses referenced + -- by the service projection must exist. + + -- businessKey validation must occur during save since its not always known at validate time + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + -- + -- Commenting out the following check to comply with IN60 as per UDDI bug 2454 + -- Which states that service projections that refer to a deleted service must be successfully saved + -- From this we can imply that service projections that refer to a deleted business must also be successfully saved + -- + + --IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey2) + --BEGIN + --SET @error = 60210 -- E_invalidKey + --SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey2) + --GOTO errorLabel + --END + + -- Add service projection if it doesn't already exist + IF NOT EXISTS(SELECT * FROM [UDC_serviceProjections] WHERE ([businessKey] = @businessKey) AND ([serviceKey] = @serviceKey)) + BEGIN + INSERT [UDC_serviceProjections]( + [businessKey], + [serviceKey], + [businessKey2], + [lastChange]) + VALUES( + @businessKey, + @serviceKey, + @businessKey2, + @lastChange) + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_serviceProjection_repl_save +GO + +-- ============================================= +-- Name: net_businessService_name_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_name_save' and type = 'P') + DROP PROCEDURE net_businessService_name_save +GO + +CREATE PROCEDURE net_businessService_name_save + @serviceKey uniqueidentifier, + @isoLangCode varchar(17) = 'en', + @name nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000) + + -- Check for valid name + IF (@name IS NULL) OR (LEN(@name) = 0) + BEGIN + SET @error = 60500 -- E_fatalError + SET @context = 'name cannot be blank.' + GOTO errorLabel + END + + INSERT [UDC_names_BS]( + [serviceID], + [isoLangCode], + [name]) + VALUES( + dbo.serviceID(@serviceKey), + @isoLangCode, + @name) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_name_save +GO + +-- ============================================= +-- Name: net_businessService_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_description_save' and type = 'P') + DROP PROCEDURE net_businessService_description_save +GO + +CREATE PROCEDURE net_businessService_description_save + @serviceKey uniqueidentifier, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_serviceDesc]( + [serviceID], + [isoLangCode], + [description]) + VALUES( + dbo.serviceID(@serviceKey), + @isoLangCode, + @description) + + RETURN 0 +END -- net_businessService_save +GO + +-- ============================================= +-- Name: net_businessService_categoryBag_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_categoryBag_save' and type = 'P') + DROP PROCEDURE net_businessService_categoryBag_save +GO + +CREATE PROCEDURE net_businessService_categoryBag_save + @serviceKey uniqueidentifier, + @keyName nvarchar(255), + @keyValue nvarchar(255), + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_categoryBag_BS]( + [serviceID], + [keyName], + [keyValue], + [tModelKey]) + VALUES( + dbo.serviceID(@serviceKey), + @keyName, + @keyValue, + @tModelKey) + + RETURN 0 +END -- net_businessService_categoryBag_save +GO + +-- ============================================= +-- Section: Delete stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_businessService_delete +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_delete' and type = 'P') + DROP PROCEDURE net_businessService_delete +GO + +CREATE PROCEDURE net_businessService_delete + @PUID nvarchar(450), + @serviceKey uniqueidentifier, + @contextID uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @publisherID bigint, + @operatorID bigint + + SET @RC = 0 + + -- + -- Validate parameters + -- + + IF @serviceKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = '@serviceKey is required.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- Validate businessService + IF EXISTS(SELECT * FROM [UDC_businessServices] WHERE ([serviceKey] = @serviceKey)) + BEGIN + -- serviceKey exists. Make sure it belongs to current publisher + IF dbo.getServicePublisherID(@serviceKey) <> @publisherID + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + END + ELSE + BEGIN + -- serviceKey doesn't exist + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + DELETE [UDC_businessServices] WHERE [serviceKey] = @serviceKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_delete +GO + +-- ============================================= +-- Section: Validation stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_serviceProjection_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_serviceProjection_validate' AND type = 'P') + DROP PROCEDURE net_serviceProjection_validate +GO + +CREATE PROCEDURE net_serviceProjection_validate + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @businessID bigint + + -- Try to get the parent business ID of this service + SET @businessID = (SELECT businessID from UDC_businessServices where serviceKey = @serviceKey) + IF (@businessID IS NOT NULL) + BEGIN + -- The service being projected exists, make sure it belongs to the specified business entity + IF (@businessID <> dbo.businessID(@businessKey)) + BEGIN + -- Business service being projected does not belong to the specified business entity so + -- throw an error + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + END + + -- It is not an error if the service being projected does not exist. + + RETURN 0 +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: net_businessService_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_businessService_validate' AND type = 'P') + DROP PROCEDURE net_businessService_validate +GO + +CREATE PROCEDURE net_businessService_validate + @PUID nvarchar(450), + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier, + @flag int = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint, + @replActive bit + + SET @RC = 0 + SET @replActive = 0 + + IF @flag IS NULL + SET @flag = 0 + + -- + -- Validate parameters + -- + + IF @serviceKey = @businessKey + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey ' + dbo.UUIDSTR(@serviceKey) + ' and businessKey ' + dbo.UUIDSTR(@businessKey) + ' are the same.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator / publisher association (replication only) + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT, @replActive OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + -- + -- Validate parent business + -- + + IF (@businessKey IS NOT NULL) AND (EXISTS(SELECT * FROM [UDC_businessEntities] WHERE ([businessKey] = @businessKey))) + BEGIN + IF (dbo.getBusinessPublisherID(@businessKey) <> @publisherID) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + END + + -- + -- Validate businessService + -- + + IF (@serviceKey IS NOT NULL) + BEGIN + IF EXISTS(SELECT * FROM [UDC_businessServices] WHERE ([serviceKey] = @serviceKey)) + BEGIN + -- serviceKey exists. Make sure it belongs to current publisher + IF (dbo.getServicePublisherID(@serviceKey) <> @publisherID) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + END + ELSE + BEGIN + -- serviceKey doesn't exist + IF (@replActive = 0) AND (@flag & 0x1 <> 0x1) + BEGIN + -- save isn't coming from replication and preassigned keys flag is not set so throw an error + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_validate +GO + +-- ============================================= +-- Section: Find stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_find_businessService_businessKey +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessService_businessKey' AND type = 'P') + DROP PROCEDURE net_find_businessService_businessKey +GO + +CREATE PROCEDURE net_find_businessService_businessKey + @contextID uniqueidentifier, + @businessKey uniqueidentifier, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + IF @contextRows = 0 + BEGIN + -- Standard services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_businessEntities] BE ON BS.[businessID] = BE.[businessID] + WHERE + (BE.[businessKey] = @businessKey) + + -- Projected services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_serviceProjections] SP ON BS.[serviceKey] = SP.[serviceKey] + WHERE + (SP.[businessKey] = @businessKey) + END + ELSE + BEGIN + -- Standard services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_businessEntities] BE ON BS.[businessID] = BE.[businessID] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE [contextID] = @contextID)) AND + (BE.[businessKey] = @businessKey) + + -- Projected services + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_serviceProjections] SP ON BS.[serviceKey] = SP.[serviceKey] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE [contextID] = @contextID)) AND + (SP.[businessKey] = @businessKey) + END + + -- All keys for this search argument are combined using a logical AND + + IF @contextRows > 0 + BEGIN + DELETE + [UDS_findResults] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findResults] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findResults] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessService_businessKey +GO + +-- ============================================= +-- Name: net_find_businessService_name +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_businessService_name' AND type = 'P') + DROP PROCEDURE net_find_businessService_name +GO + +CREATE PROCEDURE net_find_businessService_name + @contextID uniqueidentifier, + @isoLangCode varchar(17) = '%', + @name nvarchar(450), + @exactNameMatch bit, + @caseSensitiveMatch bit, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Adds name search arguments for a find_business + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @wildCardSarg nvarchar(451) + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier, + [name] nvarchar(450)) + + SET @contextRows = dbo.contextRows(@contextID) + + IF dbo.containsWildcard(@isoLangCode) = 0 + SET @isoLangCode = @isoLangCode + N'%' + + -- + -- Do a wildcard search (default) + -- + + IF (@exactNameMatch = 0) + BEGIN + SET @wildCardSarg = @name + + IF dbo.containsWildcard(@name) = 0 + SET @wildCardSarg = @wildCardSarg + N'%' + + IF @contextRows = 0 + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BS.[serviceKey], + SN.[name] + FROM + [UDC_businessServices] BS JOIN + [UDC_names_BS] SN ON BS.[serviceID] = SN.[serviceID] + WHERE + (SN.[name] LIKE @wildCardSarg) AND + (SN.[isoLangCode] LIKE @isoLangCode) + END + ELSE + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BS.[serviceKey], + SN.[name] + FROM + [UDC_businessServices] BS JOIN + [UDC_names_BS] SN ON BS.[serviceID] = SN.[serviceID] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (SN.[name] LIKE @wildCardSarg) AND + (SN.[isoLangCode] LIKE @isoLangCode) + END + END + + -- + -- Do an exactNameMatch search + -- + + IF (@exactNameMatch = 1) + BEGIN + IF @contextRows = 0 + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BS.[serviceKey], + SN.[name] + FROM + [UDC_businessServices] BS JOIN + [UDC_names_BS] SN ON BS.[serviceID] = SN.[serviceID] + WHERE + (SN.[name] = @name) AND + (SN.[isoLangCode] LIKE @isoLangCode) + END + ELSE + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + BS.[serviceKey], + SN.[name] + FROM + [UDC_businessServices] BS JOIN + [UDC_names_BS] SN ON BS.[serviceID] = SN.[serviceID] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (SN.[name] = @name) AND + (SN.[isoLangCode] LIKE @isoLangCode) + END + END + + IF (@caseSensitiveMatch = 1) + DELETE + @tempKeys + WHERE + (dbo.caseSensitiveMatch(@name, [name], @exactNameMatch) = 0) + + -- name search arguments are combined using a logical OR by default + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessService_name +GO + +-- ============================================= +-- Name: net_find_businessService_categoryBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessService_categoryBag' AND type = 'P') + DROP PROCEDURE net_find_businessService_categoryBag +GO + +CREATE PROCEDURE net_find_businessService_categoryBag + @contextID uniqueidentifier, + @keyName nvarchar(4000), + @keyValue nvarchar(4000), + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @genKeywordsMatch bit + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + SET @genKeywordsMatch = 0 + + IF @tModelKey = dbo.genKeywordsKey() + SET @genKeywordsMatch = 1 + + IF @contextRows = 0 + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + ELSE + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) + END + ELSE + BEGIN + -- Include keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + [serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_categoryBag_BS] CB ON BS.[serviceID] = CB.[serviceID] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + (ISNULL([keyName],'') = ISNULL(@keyName,'')) + END + END + + IF @orKeys = 1 + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessService_categoryBag +GO + +-- ============================================= +-- Name: net_find_businessService_tModelBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessService_tModelBag' AND type = 'P') + DROP PROCEDURE net_find_businessService_tModelBag +GO + +CREATE PROCEDURE net_find_businessService_tModelBag + @contextID uniqueidentifier, + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + IF @contextRows = 0 + BEGIN + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (TI.[tModelKey] = @tModelKey) + END + ELSE + BEGIN + -- check tModelInstances + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + + -- Check hostingRedirectors + + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + BS.[serviceKey] + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + JOIN [UDC_tModelInstances] TI ON BT2.[bindingID] = TI.[bindingID] + WHERE + (BS.[serviceKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (TI.[tModelKey] = @tModelKey) + END + + + IF @orKeys = 1 + BEGIN + + -- OR operation between @tempKeys and the UDS_findScratch table + + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + + -- AND operation between @tempKeys and the UDS_findScratch table + + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessService_tModelBag +GO + +-- ============================================= +-- Name: net_find_businessService_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_businessService_commit' AND type = 'P') + DROP PROCEDURE net_find_businessService_commit +GO + +CREATE PROCEDURE net_find_businessService_commit + @contextID uniqueidentifier, + @sortByNameAsc bit, + @sortByNameDesc bit, + @sortByDateAsc bit, + @sortByDateDesc bit, + @maxRows int, + @truncated int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Finalizes a find_business and returns a key list + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + SET @contextRows = dbo.contextRows(@contextID) + SET @truncated = 0 + + IF @contextRows = 0 + RETURN 0 + + DECLARE @tempKeys TABLE ( + [seqNo] bigint IDENTITY PRIMARY KEY , + [entityKey] uniqueidentifier, + [name] nvarchar(450) NULL, + [lastChange] bigint NULL, + [serviceID] bigint NULL) + + -- Set default sorting option + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) AND (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByNameAsc = 1 + + -- Set maxRows if default was passed + IF ISNULL(@maxRows,0) = 0 + SET @maxRows = dbo.configValue('Find.MaxRowsDefault') + + -- sortByNameAsc + IF (@sortByNameAsc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 ASC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByNameDesc + IF (@sortByNameDesc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 2 DESC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByDateAsc + IF (@sortByDateAsc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 ASC, + 4 ASC, + 2 DESC + END + + GOTO endLabel + END + + -- sortByDateDesc + IF (@sortByDateDesc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [serviceID]) + SELECT DISTINCT + FR.[entityKey], + (SELECT TOP 1 [name] FROM [UDC_names_BS] WHERE ([serviceID] = dbo.serviceID([entityKey]))), + BS.[lastChange], + BS.[serviceID] + FROM + [UDS_findResults] FR + JOIN [UDC_businessServices] BS ON FR.[entityKey] = BS.[serviceKey] + WHERE + (@contextID = FR.[contextID]) + ORDER BY + 3 DESC, + 4 DESC, + 2 DESC + END + + GOTO endLabel + END + +endLabel: + -- Set @truncated + IF (SELECT COUNT(*) FROM @tempKeys) > @maxRows + SET @truncated = 1 + + -- Return keys + SELECT + TK.[entityKey], + BE.[businessKey] AS [parentEntityKey] -- Must look up parent businessKey in case find_service with no businessKey is requested + FROM + @tempKeys TK + JOIN [UDC_businessServices] BS ON TK.[entityKey] = BS.[serviceKey] + JOIN [UDC_businessEntities] BE ON BS.[businessID] = BE.[businessID] + WHERE + ([seqNo] <= @maxRows) + + -- Run cleanup + EXEC net_find_cleanup @contextID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_businessService_commit +GO + + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.database.model.er1 b/inetsrv/uddi/source/setup/db/ca/uddi.v2.database.model.er1 new file mode 100644 index 0000000..58486aa Binary files /dev/null and b/inetsrv/uddi/source/setup/db/ca/uddi.v2.database.model.er1 differ diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.ddl.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.ddl.sql new file mode 100644 index 0000000..e41ecf7 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.ddl.sql @@ -0,0 +1,1181 @@ + +CREATE TABLE UDS_pubResults ( + contextID uniqueidentifier NOT NULL, + publisherID int NULL +) + ON "UDDI_STAGING" +go + +CREATE INDEX XIE1UDS_pubResults ON UDS_pubResults +( + contextID +) +go + + +CREATE TABLE UDO_queryTypes ( + queryTypeID tinyint NOT NULL, + queryType nvarchar(4000) NOT NULL, + CONSTRAINT XPKUDO_queryTypes + PRIMARY KEY NONCLUSTERED (queryTypeID) +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDO_contextTypes ( + contextTypeID tinyint NOT NULL, + contextType nvarchar(4000) NOT NULL, + CONSTRAINT XPKUDO_contextTypes + PRIMARY KEY (contextTypeID) +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDO_entityTypes ( + entityTypeID tinyint NOT NULL, + entityType nvarchar(4000) NOT NULL, + CONSTRAINT XPKUDO_entityTypes + PRIMARY KEY (entityTypeID) +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDO_queryLog ( + lastChange bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + entityKey uniqueidentifier NULL, + entityTypeID tinyint NULL, + queryTypeID tinyint NULL, + contextID uniqueidentifier NOT NULL, + contextTypeID tinyint NULL, + CONSTRAINT XPKUDO_queryLog + PRIMARY KEY (lastChange, seqNo), + CONSTRAINT R_1 + FOREIGN KEY (queryTypeID) + REFERENCES UDO_queryTypes, + CONSTRAINT R_135 + FOREIGN KEY (contextTypeID) + REFERENCES UDO_contextTypes +) + ON "UDDI_JOURNAL" +go + +CREATE INDEX XIF134UDO_queryLog ON UDO_queryLog +( + entityTypeID +) +go + +CREATE INDEX XIF135UDO_queryLog ON UDO_queryLog +( + contextTypeID +) +go + +CREATE INDEX XIF42UDO_queryLog ON UDO_queryLog +( + queryTypeID +) +go + + +CREATE TABLE UDO_changeTypes ( + changeTypeID tinyint NOT NULL, + changeType nvarchar(4000) NOT NULL, + CONSTRAINT XPKUDO_changeTypes + PRIMARY KEY (changeTypeID) +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDO_replStatus ( + replStatusID tinyint NOT NULL, + replStatus nvarchar(4000) NOT NULL, + CONSTRAINT XPKUDO_replStatus + PRIMARY KEY (replStatusID) +) +go + + +CREATE TABLE UDO_operatorStatus ( + operatorStatusID tinyint NOT NULL, + operatorStatus nvarchar(4000) NOT NULL, + CONSTRAINT XPKUDO_operatorStatus + PRIMARY KEY (operatorStatusID) +) +go + + +CREATE TABLE UDO_publisherStatus ( + publisherStatusID tinyint NOT NULL, + publisherStatus nvarchar(256) NOT NULL, + CONSTRAINT XPKUDO_publisherStatus + PRIMARY KEY (publisherStatusID) +) +go + +CREATE UNIQUE INDEX XAK1UDO_publisherStatus ON UDO_publisherStatus +( + publisherStatus +) +go + + +CREATE TABLE UDO_publishers ( + publisherID bigint IDENTITY NOT FOR REPLICATION, + publisherStatusID tinyint NULL, + PUID nvarchar(450) NOT NULL, + email nvarchar(450) NULL, + name nvarchar(100) NULL, + phone nvarchar(4000) NULL, + isoLangCode varchar(17) NULL + CONSTRAINT ENGLISH132 + DEFAULT 'en', + tModelLimit int NULL + CONSTRAINT tModelLimit132 + DEFAULT 100, + businessLimit int NULL + CONSTRAINT businessLimit132 + DEFAULT 1, + serviceLimit int NULL + CONSTRAINT serviceLimit132 + DEFAULT 4, + bindingLimit int NULL + CONSTRAINT bindingLimit132 + DEFAULT 4, + assertionLimit int NULL + CONSTRAINT assertionLimit52 + DEFAULT 10, + companyName nvarchar(100) NULL, + addressLine1 nvarchar(4000) NULL, + addressLine2 nvarchar(4000) NULL, + mailstop nvarchar(20) NULL, + city nvarchar(100) NULL, + stateProvince nvarchar(100) NULL, + extraProvince nvarchar(100) NULL, + country nvarchar(100) NULL, + postalCode varchar(100) NULL, + companyURL nvarchar(512) NULL, + companyPhone nvarchar(4000) NULL, + altPhone nvarchar(4000) NULL, + backupContact nvarchar(100) NULL, + backupEmail nvarchar(450) NULL, + description nvarchar(4000) NULL, + securityToken uniqueidentifier NULL, + flag int NULL + CONSTRAINT DEFAULT_0406 + DEFAULT 0, + CONSTRAINT XPKUDO_publishers + PRIMARY KEY (publisherID), + CONSTRAINT R_79 + FOREIGN KEY (publisherStatusID) + REFERENCES UDO_publisherStatus +) +go + +CREATE UNIQUE INDEX XAK1UDO_publishers ON UDO_publishers +( + PUID +) +go + +CREATE INDEX XIE1UDO_publishers ON UDO_publishers +( + email +) +go + +CREATE INDEX XIE2UDO_publishers ON UDO_publishers +( + name +) +go + + +CREATE TABLE UDO_operators ( + operatorID bigint IDENTITY NOT FOR REPLICATION, + operatorKey uniqueidentifier NOT NULL, + publisherID bigint NOT NULL, + operatorStatusID tinyint NOT NULL, + name nvarchar(450) NOT NULL, + soapReplicationURL nvarchar(4000) NULL, + businessKey uniqueidentifier NULL, + certSerialNo nvarchar(450) NOT NULL, + certIssuer nvarchar(225) NULL, + certSubject nvarchar(225) NULL, + certificate image NULL, + flag int NOT NULL + CONSTRAINT BIT_ZERO3147 + DEFAULT 0, + CONSTRAINT XPKUDO_operators + PRIMARY KEY (operatorID), + CONSTRAINT R_128 + FOREIGN KEY (operatorStatusID) + REFERENCES UDO_operatorStatus, + CONSTRAINT R_102 + FOREIGN KEY (publisherID) + REFERENCES UDO_publishers +) +go + +CREATE UNIQUE INDEX XAK3UDO_operators ON UDO_operators +( + operatorKey +) +go + +CREATE UNIQUE INDEX XAK4UDO_operators ON UDO_operators +( + certSerialNo +) +go + + +CREATE TABLE UDO_operatorLog ( + seqNo bigint IDENTITY NOT FOR REPLICATION, + operatorID bigint NOT NULL, + replStatusID tinyint NOT NULL, + description nvarchar(4000) NULL, + lastOperatorKey uniqueidentifier NULL, + lastUSN bigint NULL, + lastChange bigint NOT NULL, + CONSTRAINT XPKUDO_operatorLog + PRIMARY KEY (seqNo), + CONSTRAINT R_131 + FOREIGN KEY (replStatusID) + REFERENCES UDO_replStatus, + CONSTRAINT R_130 + FOREIGN KEY (operatorID) + REFERENCES UDO_operators +) +go + +CREATE INDEX XIF130UDO_operatorLog ON UDO_operatorLog +( + operatorID +) +go + +CREATE INDEX XIF131UDO_operatorLog ON UDO_operatorLog +( + replStatusID +) +go + + +CREATE TABLE UDC_assertions_BE ( + seqNo bigint IDENTITY NOT FOR REPLICATION, + fromKey uniqueidentifier NOT NULL, + toKey uniqueidentifier NOT NULL, + tModelKey uniqueidentifier NOT NULL, + keyName nvarchar(255) NULL, + keyValue nvarchar(255) NOT NULL, + flag int NULL + CONSTRAINT DEFAULT_0407 + DEFAULT 0, + CONSTRAINT XPKUDC_assertions_BE + PRIMARY KEY (seqNo) +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDC_assertions_BE ON UDC_assertions_BE +( + fromKey, + tModelKey, + keyValue +) +go + +CREATE INDEX XIE2UDC_assertions_BE ON UDC_assertions_BE +( + fromKey, + toKey +) +go + + +CREATE TABLE UDS_findScratch ( + contextID uniqueidentifier NOT NULL, + entityKey uniqueidentifier NULL, + subEntityKey uniqueidentifier NULL +) + ON "UDDI_STAGING" +go + +CREATE INDEX XIE1UDS_findScratch ON UDS_findScratch +( + contextID +) +go + + +CREATE TABLE UDC_serviceProjections ( + seqNo bigint IDENTITY NOT FOR REPLICATION, + businessKey uniqueidentifier NOT NULL, + serviceKey uniqueidentifier NOT NULL, + businessKey2 uniqueidentifier NOT NULL, + lastChange bigint NOT NULL, + CONSTRAINT XPKUDC_serviceProjections + PRIMARY KEY (seqNo) +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDC_serviceProjections ON UDC_serviceProjections +( + serviceKey +) +go + +CREATE INDEX XIE2UDC_serviceProjections ON UDC_serviceProjections +( + businessKey +) +go + + +CREATE TABLE UDC_businessEntities ( + businessID bigint IDENTITY NOT FOR REPLICATION, + publisherID bigint NULL, + generic varchar(20) NOT NULL + CONSTRAINT generic_v2525 + DEFAULT 2.0, + authorizedName nvarchar(4000) NULL, + businessKey uniqueidentifier NOT NULL + CONSTRAINT NEWID394 + DEFAULT NEWID(), + lastChange bigint NOT NULL, + flag int NULL + CONSTRAINT BIT_ZERO3148 + DEFAULT 0, + CONSTRAINT XPKUDC_businessEntities + PRIMARY KEY (businessID), + CONSTRAINT R_70 + FOREIGN KEY (publisherID) + REFERENCES UDO_publishers +) + ON "UDDI_CORE" +go + +CREATE UNIQUE INDEX XAK1UDC_businessEntities ON UDC_businessEntities +( + businessKey +) +go + +CREATE INDEX XIF70UDC_businessEntities ON UDC_businessEntities +( + publisherID +) +go + + +CREATE TABLE UDC_businessServices ( + serviceID bigint IDENTITY NOT FOR REPLICATION, + businessID bigint NOT NULL, + generic varchar(20) NOT NULL + CONSTRAINT generic_v2526 + DEFAULT 2.0, + serviceKey uniqueidentifier NOT NULL + CONSTRAINT NEWID395 + DEFAULT NEWID(), + lastChange bigint NOT NULL, + flag int NULL + CONSTRAINT BIT_ZERO3149 + DEFAULT 0, + CONSTRAINT XPKUDC_businessServices + PRIMARY KEY (serviceID), + CONSTRAINT R_75 + FOREIGN KEY (businessID) + REFERENCES UDC_businessEntities +) + ON "UDDI_CORE" +go + +CREATE UNIQUE INDEX XAK1UDC_businessServices ON UDC_businessServices +( + serviceKey +) +go + +CREATE INDEX XIF75UDC_businessServices ON UDC_businessServices +( + businessID +) +go + + +CREATE TABLE UDC_names_BS ( + serviceID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + isoLangCode varchar(17) NOT NULL, + name nvarchar(450) NOT NULL, + CONSTRAINT XPKUDC_names_BS + PRIMARY KEY (serviceID, seqNo), + CONSTRAINT R_117 + FOREIGN KEY (serviceID) + REFERENCES UDC_businessServices +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDC_names_BS ON UDC_names_BS +( + name +) +go + + +CREATE TABLE UDC_names_BE ( + businessID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + isoLangCode varchar(17) NOT NULL, + name nvarchar(450) NOT NULL, + CONSTRAINT XPKUDC_names_BE + PRIMARY KEY (businessID, seqNo), + CONSTRAINT R_116 + FOREIGN KEY (businessID) + REFERENCES UDC_businessEntities +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDC_names_BE ON UDC_names_BE +( + name +) +go + + +CREATE TABLE UDC_identifierBag_BE ( + businessID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + keyName nvarchar(255) NULL, + keyValue nvarchar(255) NULL, + tModelKey uniqueidentifier NULL, + flag int NULL + CONSTRAINT BIT_ZERO3150 + DEFAULT 0, + CONSTRAINT XPKUDC_identifierBag_BE + PRIMARY KEY (businessID, seqNo), + CONSTRAINT R_112 + FOREIGN KEY (businessID) + REFERENCES UDC_businessEntities +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE4UDC_identifierBag_BE ON UDC_identifierBag_BE +( + keyValue +) +go + + +CREATE TABLE UDC_categoryBag_BE ( + businessID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + keyName nvarchar(255) NULL, + keyValue nvarchar(255) NULL, + tModelKey uniqueidentifier NOT NULL, + flag int NULL + CONSTRAINT BIT_ZERO3151 + DEFAULT 0, + CONSTRAINT XPKUDC_categoryBag_BE + PRIMARY KEY (businessID, seqNo), + CONSTRAINT R_113 + FOREIGN KEY (businessID) + REFERENCES UDC_businessEntities +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDC_categoryBag_BE ON UDC_categoryBag_BE +( + keyValue +) +go + + +CREATE TABLE UDC_tModels ( + tModelID bigint IDENTITY NOT FOR REPLICATION, + publisherID bigint NULL, + generic varchar(20) NOT NULL + CONSTRAINT generic_v2527 + DEFAULT 2.0, + authorizedName nvarchar(4000) NULL, + tModelKey uniqueidentifier NOT NULL, + name nvarchar(450) NULL, + overviewURL nvarchar(4000) NULL, + lastChange bigint NOT NULL, + flag int NULL + CONSTRAINT BIT_ZERO3152 + DEFAULT 0, + CONSTRAINT XPKUDC_tModels + PRIMARY KEY (tModelID), + CONSTRAINT R_71 + FOREIGN KEY (publisherID) + REFERENCES UDO_publishers +) + ON "UDDI_CORE" +go + +CREATE UNIQUE INDEX XAK1UDC_tModels ON UDC_tModels +( + tModelKey +) +go + +CREATE INDEX XIF71UDC_tModels ON UDC_tModels +( + publisherID +) +go + +CREATE INDEX XIE1UDC_tModels ON UDC_tModels +( + name +) +go + + +CREATE TABLE UDC_identifierBag_TM ( + tModelID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + keyName nvarchar(255) NULL, + keyValue nvarchar(255) NULL, + tModelKey uniqueidentifier NULL, + flag int NULL + CONSTRAINT BIT_ZERO3153 + DEFAULT 0, + CONSTRAINT XPKUDC_identifierBag_TM + PRIMARY KEY (tModelID, seqNo), + CONSTRAINT R_111 + FOREIGN KEY (tModelID) + REFERENCES UDC_tModels +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE4UDC_identifierBag_TM ON UDC_identifierBag_TM +( + keyValue +) +go + + +CREATE TABLE UDC_categoryBag_TM ( + tModelID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + keyName nvarchar(255) NULL, + keyValue nvarchar(255) NULL, + tModelKey uniqueidentifier NOT NULL, + flag int NULL + CONSTRAINT BIT_ZERO3154 + DEFAULT 0, + CONSTRAINT XPKUDC_categoryBag_TM + PRIMARY KEY (tModelID, seqNo), + CONSTRAINT R_110 + FOREIGN KEY (tModelID) + REFERENCES UDC_tModels +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDC_categoryBag_TM ON UDC_categoryBag_TM +( + keyValue +) +go + + +CREATE TABLE UDO_config ( + configName nvarchar(450) NOT NULL, + configValue nvarchar(4000) NULL, + CONSTRAINT XPKUDO_config + PRIMARY KEY (configName) +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDT_taxonomies ( + taxonomyID bigint IDENTITY NOT FOR REPLICATION, + tModelKey uniqueidentifier NULL, + flag int NULL + CONSTRAINT BIT_ZERO3155 + DEFAULT 0, + CONSTRAINT PK_taxonomies + PRIMARY KEY (taxonomyID) +) + ON "UDDI_CORE" +go + +CREATE UNIQUE INDEX XAK1UDT_taxonomies ON UDT_taxonomies +( + tModelKey +) +go + + +CREATE TABLE UDC_discoveryURLs ( + businessID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + useType nvarchar(4000) NULL, + discoveryURL nvarchar(450) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3156 + DEFAULT 0, + CONSTRAINT XPKUDC_discoveryURLs + PRIMARY KEY (businessID, seqNo), + CONSTRAINT R_84 + FOREIGN KEY (businessID) + REFERENCES UDC_businessEntities +) +go + +CREATE INDEX XIE1UDC_discoveryURLs ON UDC_discoveryURLs +( + discoveryURL +) +go + + +CREATE TABLE UDO_changeLog ( + seqNo bigint IDENTITY NOT FOR REPLICATION, + USN bigint NULL, + newSeqNo bigint NULL, + publisherID bigint NOT NULL, + delegatePublisherID bigint NULL, + entityKey uniqueidentifier NULL, + entityTypeID tinyint NULL, + changeTypeID tinyint NOT NULL, + contextID uniqueidentifier NOT NULL, + contextTypeID tinyint NOT NULL, + lastChange bigint NOT NULL, + changeData ntext NULL, + flag int NOT NULL + CONSTRAINT DEFAULT_0408 + DEFAULT 0, + CONSTRAINT XPKUDO_changeLog + PRIMARY KEY (seqNo), + CONSTRAINT R_133 + FOREIGN KEY (changeTypeID) + REFERENCES UDO_changeTypes, + CONSTRAINT R_126 + FOREIGN KEY (contextTypeID) + REFERENCES UDO_contextTypes, + CONSTRAINT R_88 + FOREIGN KEY (publisherID) + REFERENCES UDO_publishers +) + ON "UDDI_JOURNAL" +go + +CREATE INDEX XIF88UDO_changeLog ON UDO_changeLog +( + publisherID +) +go + +CREATE INDEX XIE1UDO_changeLog ON UDO_changeLog +( + USN +) +go + + +CREATE TABLE UDO_elementNames ( + elementID tinyint NOT NULL, + elementName nvarchar(450) NOT NULL, + CONSTRAINT XPKUDO_elementNames + PRIMARY KEY (elementID) +) + ON "UDDI_CORE" +go + +CREATE UNIQUE INDEX XAK1UDO_elementNames ON UDO_elementNames +( + elementName +) +go + + +CREATE TABLE UDC_URLTypes ( + URLTypeID tinyint NOT NULL, + URLType nvarchar(450) NOT NULL, + sortOrder int NULL, + CONSTRAINT XPKUDC_URLTypes + PRIMARY KEY (URLTypeID) +) + ON "UDDI_CORE" +go + +CREATE UNIQUE INDEX URLType ON UDC_URLTypes +( + URLType +) +go + + +CREATE TABLE UDC_bindingTemplates ( + bindingID bigint IDENTITY NOT FOR REPLICATION, + serviceID bigint NOT NULL, + generic varchar(20) NOT NULL + CONSTRAINT generic_v2528 + DEFAULT 2.0, + bindingKey uniqueidentifier NOT NULL + CONSTRAINT NEWID396 + DEFAULT NEWID(), + URLTypeID tinyint NULL, + accessPoint nvarchar(4000) NULL, + hostingRedirector uniqueidentifier NULL, + lastChange bigint NOT NULL, + flag int NULL + CONSTRAINT BIT_ZERO3157 + DEFAULT 0, + CONSTRAINT XPKUDC_bindingTemplates + PRIMARY KEY (bindingID), + CONSTRAINT R_40 + FOREIGN KEY (URLTypeID) + REFERENCES UDC_URLTypes, + CONSTRAINT R_39 + FOREIGN KEY (serviceID) + REFERENCES UDC_businessServices +) + ON "UDDI_CORE" +go + +CREATE UNIQUE INDEX XAK1UDC_bindingTemplates ON UDC_bindingTemplates +( + bindingKey +) +go + +CREATE INDEX XIF39UDC_bindingTemplates ON UDC_bindingTemplates +( + serviceID +) +go + +CREATE INDEX XIE1UDC_bindingTemplates ON UDC_bindingTemplates +( + hostingRedirector +) +go + + +CREATE TABLE UDC_tModelInstances ( + instanceID bigint IDENTITY NOT FOR REPLICATION, + bindingID bigint NOT NULL, + tModelKey uniqueidentifier NOT NULL, + overviewURL nvarchar(4000) NULL, + instanceParms nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3158 + DEFAULT 0, + CONSTRAINT XPKUDC_tModelInstances + PRIMARY KEY (instanceID), + CONSTRAINT R_81 + FOREIGN KEY (bindingID) + REFERENCES UDC_bindingTemplates +) + ON "UDDI_CORE" +go + +CREATE INDEX XIF81UDC_tModelInstances ON UDC_tModelInstances +( + bindingID +) +go + +CREATE INDEX XIE1UDC_tModelInstances ON UDC_tModelInstances +( + tModelKey +) +go + + +CREATE TABLE UDC_instanceDesc ( + instanceID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + elementID tinyint NULL, + isoLangCode varchar(17) NOT NULL, + description nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3159 + DEFAULT 0, + CONSTRAINT XPKUDC_instanceDesc + PRIMARY KEY (instanceID, seqNo), + CONSTRAINT R_108 + FOREIGN KEY (elementID) + REFERENCES UDO_elementNames, + CONSTRAINT R_69 + FOREIGN KEY (instanceID) + REFERENCES UDC_tModelInstances +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_categoryBag_BS ( + serviceID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + keyName nvarchar(255) NULL, + keyValue nvarchar(255) NULL, + tModelKey uniqueidentifier NOT NULL, + flag int NULL + CONSTRAINT BIT_ZERO3160 + DEFAULT 0, + CONSTRAINT XPKUDC_categoryBag_BS + PRIMARY KEY (serviceID, seqNo), + CONSTRAINT R_114 + FOREIGN KEY (serviceID) + REFERENCES UDC_businessServices +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDC_categoryBag_BS ON UDC_categoryBag_BS +( + keyValue +) +go + + +CREATE TABLE UDC_tModelDesc ( + tModelID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + elementID tinyint NULL, + isoLangCode varchar(17) NOT NULL, + description nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3161 + DEFAULT 0, + CONSTRAINT XPKUDC_tModelDesc + PRIMARY KEY (tModelID, seqNo), + CONSTRAINT R_109 + FOREIGN KEY (elementID) + REFERENCES UDO_elementNames, + CONSTRAINT R_42 + FOREIGN KEY (tModelID) + REFERENCES UDC_tModels +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_bindingDesc ( + bindingID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + isoLangCode varchar(17) NOT NULL, + description nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3162 + DEFAULT 0, + CONSTRAINT XPKUDC_bindingDesc + PRIMARY KEY (bindingID, seqNo), + CONSTRAINT R_36 + FOREIGN KEY (bindingID) + REFERENCES UDC_bindingTemplates +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_serviceDesc ( + serviceID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + isoLangCode varchar(17) NOT NULL, + description nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3163 + DEFAULT 0, + CONSTRAINT XPKUDC_serviceDesc + PRIMARY KEY (serviceID, seqNo), + CONSTRAINT R_35 + FOREIGN KEY (serviceID) + REFERENCES UDC_businessServices +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_businessDesc ( + businessID bigint NOT NULL, + seqNo int IDENTITY NOT FOR REPLICATION, + isoLangCode varchar(17) NOT NULL, + description nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3164 + DEFAULT 0, + CONSTRAINT XPKUDC_businessDesc + PRIMARY KEY (businessID, seqNo), + CONSTRAINT R_33 + FOREIGN KEY (businessID) + REFERENCES UDC_businessEntities +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_contacts ( + contactID bigint IDENTITY NOT FOR REPLICATION, + businessID bigint NOT NULL, + useType nvarchar(4000) NULL, + personName nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3165 + DEFAULT 0, + CONSTRAINT XPKUDC_contacts + PRIMARY KEY (contactID), + CONSTRAINT R_34 + FOREIGN KEY (businessID) + REFERENCES UDC_businessEntities +) + ON "UDDI_CORE" +go + +CREATE INDEX XIF34UDC_contacts ON UDC_contacts +( + businessID +) +go + + +CREATE TABLE UDC_addresses ( + addressID bigint IDENTITY NOT FOR REPLICATION, + contactID bigint NOT NULL, + sortCode nvarchar(4000) NULL, + useType nvarchar(4000) NULL, + tModelKey uniqueidentifier NULL, + flag int NULL + CONSTRAINT BIT_ZERO3166 + DEFAULT 0, + CONSTRAINT XPKUDC_addresses + PRIMARY KEY (addressID), + CONSTRAINT R_132 + FOREIGN KEY (contactID) + REFERENCES UDC_contacts +) + ON "UDDI_CORE" +go + +CREATE INDEX XIF132UDC_addresses ON UDC_addresses +( + contactID +) +go + + +CREATE TABLE UDC_emails ( + contactID bigint NOT NULL, + seqNo int IDENTITY NOT FOR REPLICATION, + useType nvarchar(4000) NULL, + email nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3167 + DEFAULT 0, + CONSTRAINT XPKUDC_emails + PRIMARY KEY (contactID, seqNo), + CONSTRAINT R_25 + FOREIGN KEY (contactID) + REFERENCES UDC_contacts +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_phones ( + contactID bigint NOT NULL, + seqNo int IDENTITY NOT FOR REPLICATION, + useType nvarchar(4000) NULL, + phone nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3168 + DEFAULT 0, + CONSTRAINT XPKUDC_phones + PRIMARY KEY (contactID, seqNo), + CONSTRAINT R_21 + FOREIGN KEY (contactID) + REFERENCES UDC_contacts +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_contactDesc ( + contactID bigint NOT NULL, + seqNo int IDENTITY NOT FOR REPLICATION, + isoLangCode varchar(17) NOT NULL, + description nvarchar(4000) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3169 + DEFAULT 0, + CONSTRAINT XPKUDC_contactDesc + PRIMARY KEY (contactID, seqNo), + CONSTRAINT R_19 + FOREIGN KEY (contactID) + REFERENCES UDC_contacts +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDC_addressLines ( + addressID bigint NOT NULL, + seqNo bigint IDENTITY NOT FOR REPLICATION, + addressLine nvarchar(4000) NULL, + keyName nvarchar(255) NULL, + keyValue nvarchar(255) NULL, + flag int NULL + CONSTRAINT BIT_ZERO3170 + DEFAULT 0, + CONSTRAINT XPKUDC_addressLines + PRIMARY KEY (addressID, seqNo), + CONSTRAINT R_58 + FOREIGN KEY (addressID) + REFERENCES UDC_addresses +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDT_taxonomyValues ( + taxonomyID bigint NOT NULL, + keyValue nvarchar(255) NOT NULL, + parentKeyValue nvarchar(255) NOT NULL, + keyName nvarchar(255) NULL, + valid bit NOT NULL, + CONSTRAINT XPKUDT_taxonomyValues + PRIMARY KEY (taxonomyID, keyValue), + CONSTRAINT R_100 + FOREIGN KEY (taxonomyID) + REFERENCES UDT_taxonomies +) + ON "UDDI_CORE" +go + +CREATE INDEX XIE1UDT_taxonomyValues ON UDT_taxonomyValues +( + parentKeyValue +) +go + + +CREATE TABLE UDS_findResults ( + contextID uniqueidentifier NOT NULL, + entityKey uniqueidentifier NOT NULL, + subEntityKey uniqueidentifier NULL +) + ON "UDDI_STAGING" +go + +CREATE INDEX XIE1UDS_findResults ON UDS_findResults +( + contextID +) +go + + +CREATE TABLE UDS_replResults ( + contextID uniqueidentifier NOT NULL, + seqNo bigint NOT NULL +) + ON "UDDI_STAGING" +go + +CREATE INDEX XIE1UDS_replResults ON UDS_replResults +( + contextID +) +go + + +CREATE TABLE UDS_sessionCache ( + seqNo bigint IDENTITY NOT FOR REPLICATION, + PUID nvarchar(450) NULL, + context nvarchar(20) NULL, + cacheValue ntext NULL, + saveDate datetime NULL + CONSTRAINT GETUTCDATE383 + DEFAULT GETUTCDATE(), + CONSTRAINT XPKUDS_sessionCache + PRIMARY KEY NONCLUSTERED (seqNo) +) + ON "UDDI_STAGING" +go + +CREATE INDEX XIE1UDS_sessionCache ON UDS_sessionCache +( + PUID +) +go + +CREATE INDEX XIE2UDS_sessionCache ON UDS_sessionCache +( + PUID +) +go + + +CREATE TABLE UDO_reportStatus ( + reportStatusID tinyint NOT NULL, + reportStatus nvarchar(20) NOT NULL, + CONSTRAINT XPKUDO_reportStatus + PRIMARY KEY NONCLUSTERED (reportStatusID) +) + ON "UDDI_CORE" +go + + +CREATE TABLE UDO_reports ( + reportID sysname NOT NULL, + reportStatusID tinyint NULL, + lastChange datetime NOT NULL + CONSTRAINT CURRENT_TIMESTAMP34 + DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT XPKUDO_reports + PRIMARY KEY NONCLUSTERED (reportID), + CONSTRAINT R_5 + FOREIGN KEY (reportStatusID) + REFERENCES UDO_reportStatus +) + ON "UDDI_CORE" +go + +CREATE INDEX XIF43UDO_reports ON UDO_reports +( + reportStatusID +) +go + + +CREATE TABLE UDO_reportLines ( + seqNo bigint IDENTITY NOT FOR REPLICATION, + reportID sysname NULL, + section nvarchar(250) NULL, + label nvarchar(250) NULL, + value nvarchar(3000) NULL, + CONSTRAINT XPKUDO_reportLines + PRIMARY KEY (seqNo), + CONSTRAINT R_3 + FOREIGN KEY (reportID) + REFERENCES UDO_reports +) + ON "UDDI_CORE" +go + +CREATE INDEX XIF42UDO_reportLines ON UDO_reportLines +( + reportID +) +go + + + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.dml.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.dml.sql new file mode 100644 index 0000000..f16c4ea --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.dml.sql @@ -0,0 +1,275 @@ +-- Script: uddi.v2.ent.dml.sql +-- Author: LRDohert@Microsoft.com +-- Description: Loads required rows into tables. This script is designed to be run once only at initial build time. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- +-- UDO_config values +-- +INSERT INTO [UDO_config] VALUES('LastChange','Jan 01 0001 12:00AM') +INSERT INTO [UDO_config] VALUES('CurrentAPIVersion','2.0') +INSERT INTO [UDO_config] VALUES('DefaultDiscoveryURL','http://localhost/uddipublic/discovery.ashx?businessKey=') +INSERT INTO [UDO_config] VALUES('OperatorID','4') + +INSERT INTO [UDO_config] VALUES('Database.Version','2.0.0001.3') + +INSERT INTO [UDO_config] VALUES('Debug.DebuggerLevel','0') +INSERT INTO [UDO_config] VALUES('Debug.EventLogLevel','2') +INSERT INTO [UDO_config] VALUES('Debug.FileLogLevel','0') + +INSERT INTO [UDO_config] VALUES('Find.MaxRowsDefault','1000') + +INSERT INTO [UDO_config] VALUES('GroupName.Administrators','S-1-5-32-544') +-- TODO: Change to Security.AdministratorGroup +INSERT INTO [UDO_config] VALUES('GroupName.Coordinators','S-1-5-32-544') +-- TODO: Change to Security.CoordinatorGroup +INSERT INTO [UDO_config] VALUES('GroupName.Publishers','S-1-5-32-544') +-- TODO: Change to Security.PublisherGroup +INSERT INTO [UDO_config] VALUES('GroupName.Users','S-1-5-32-545') +-- TODO: Change to Security.UserGroup + +INSERT INTO [UDO_config] VALUES('Replication.ResponseLimitCountDefault','1000') + +INSERT INTO [UDO_config] VALUES('Security.AuthenticationMode','3') +INSERT INTO [UDO_config] VALUES('Security.AutoRegister', '1') +INSERT INTO [UDO_config] VALUES('Security.HTTPS', '0') +INSERT INTO [UDO_config] VALUES('Security.Timeout', '60') +INSERT INTO [UDO_config] VALUES('Security.KeyTimeout', '7') +INSERT INTO [UDO_config] VALUES('Security.KeyAutoReset', '1') + +INSERT INTO [UDO_config] VALUES('TModelKey.GeneralKeywords','uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4') +INSERT INTO [UDO_config] VALUES('TModelKey.Operators','uuid:327A56F0-3299-4461-BC23-5CD513E95C55') +GO + +-- +-- URLTypes standard values +-- + +INSERT INTO [UDC_URLTypes]([URLTypeID], [URLType],[SortOrder]) VALUES(0,'mailto',4) +INSERT INTO [UDC_URLTypes]([URLTypeID], [URLType],[SortOrder]) VALUES(1,'http',1) +INSERT INTO [UDC_URLTypes]([URLTypeID], [URLType],[SortOrder]) VALUES(2,'https',2) +INSERT INTO [UDC_URLTypes]([URLTypeID], [URLType],[SortOrder]) VALUES(3,'ftp',3) +INSERT INTO [UDC_URLTypes]([URLTypeID], [URLType],[SortOrder]) VALUES(4,'fax',5) +INSERT INTO [UDC_URLTypes]([URLTypeID], [URLType],[SortOrder]) VALUES(5,'phone',6) +INSERT INTO [UDC_URLTypes]([URLTypeID], [URLType],[SortOrder]) VALUES(6,'other',7) +GO + +-- +-- [UDO_publisherStatus] standard values +-- + +INSERT INTO [UDO_publisherStatus] VALUES(0, 'loggedOut') -- Default status for publishers +INSERT INTO [UDO_publisherStatus] VALUES(1, 'loggedIn') -- This status is used only when publishers are logged in +INSERT INTO [UDO_publisherStatus] VALUES(2, 'disabled') -- This status is used to disable a publisher to prevent logins +GO + +-- +-- [UDO_elementNames] standard values +-- + +INSERT [UDO_elementNames] VALUES(0,'tModel') +INSERT [UDO_elementNames] VALUES(1,'overviewDoc') +INSERT [UDO_elementNames] VALUES(2,'overviewURL') +INSERT [UDO_elementNames] VALUES(3,'tModelInstanceInfo') +INSERT [UDO_elementNames] VALUES(4,'instanceDetails') +GO + +-- +-- [UDO_entityTypes] standard values +-- + +INSERT INTO [UDO_entityTypes] VALUES (0,'tModel') +INSERT INTO [UDO_entityTypes] VALUES (1,'businessEntity') +INSERT INTO [UDO_entityTypes] VALUES (2,'businessService') +INSERT INTO [UDO_entityTypes] VALUES (3,'bindingTemplate') +GO + +-- +-- [UDO_changeTypes] standard values +-- +INSERT INTO [UDO_changeTypes] VALUES(0, 'changeRecordNull') +INSERT INTO [UDO_changeTypes] VALUES(1, 'changeRecordNewData') +INSERT INTO [UDO_changeTypes] VALUES(2, 'changeRecordDelete') +INSERT INTO [UDO_changeTypes] VALUES(3, 'changeRecordHide') +INSERT INTO [UDO_changeTypes] VALUES(4, 'changeRecordPublisherAssertion') +INSERT INTO [UDO_changeTypes] VALUES(5, 'changeRecordDeleteAssertion') +INSERT INTO [UDO_changeTypes] VALUES(6, 'changeRecordCustodyTransfer') +INSERT INTO [UDO_changeTypes] VALUES(7, 'changeRecordAcknowledgement') +INSERT INTO [UDO_changeTypes] VALUES(8, 'changeRecordCorrection') +INSERT INTO [UDO_changeTypes] VALUES(9, 'changeRecordSetAssertions') +GO + +-- +-- [UDO_changeTypes] standard values +-- +INSERT INTO [UDO_queryTypes] VALUES (0, 'get') +INSERT INTO [UDO_queryTypes] VALUES (1, 'find') +GO + +-- +-- [UDO_contextTypes] standard values +-- +INSERT INTO [UDO_contextTypes]([contextTypeID], [contextType]) VALUES(0, 'Other') +INSERT INTO [UDO_contextTypes]([contextTypeID], [contextType]) VALUES(1, 'API') +INSERT INTO [UDO_contextTypes]([contextTypeID], [contextType]) VALUES(2, 'UI') +INSERT INTO [UDO_contextTypes]([contextTypeID], [contextType]) VALUES(3, 'Replication') +GO + +-- +-- [UDO_operatorStatus] standard values +-- +INSERT INTO [UDO_operatorStatus]([operatorStatusID], [operatorStatus]) VALUES(0, 'disabled') +INSERT INTO [UDO_operatorStatus]([operatorStatusID], [operatorStatus]) VALUES(1, 'new') +INSERT INTO [UDO_operatorStatus]([operatorStatusID], [operatorStatus]) VALUES(2, 'normal') +INSERT INTO [UDO_operatorStatus]([operatorStatusID], [operatorStatus]) VALUES(3, 'resigned') +GO + +-- +-- [UDO_replStatus] standard values, outbound status +-- +INSERT INTO [UDO_replStatus]([replStatusID], [replStatus]) VALUES(0, 'success') +INSERT INTO [UDO_replStatus]([replStatusID], [replStatus]) VALUES(1, 'communicationError') +INSERT INTO [UDO_replStatus]([replStatusID], [replStatus]) VALUES(2, 'validationError') +GO + +-- +-- [UDO_replStatus] standard values, inbound status +-- +INSERT INTO [UDO_replStatus]([replStatusID], [replStatus]) VALUES(128, 'notify') +GO + +-- +-- [UDO_publishers] standard values +-- + +SET IDENTITY_INSERT [UDO_publishers] ON +GO + +INSERT INTO [UDO_publishers] ( + [publisherID], + [publisherStatusID], + [PUID], + [email], + [name], + [isoLangCode], + [tModelLimit], + [businessLimit], + [serviceLimit], + [bindingLimit], [assertionLimit]) +VALUES( + 4, + 2, + 'System', + '', + 'System', + 'en', + NULL, + NULL, + NULL, + NULL, + NULL) +GO + +SET IDENTITY_INSERT [UDO_publishers] OFF +GO + +-- +-- [UDO_operators] standard values +-- + +SET IDENTITY_INSERT [UDO_operators] ON +GO + +INSERT INTO [UDO_operators] ( + [operatorID], + [operatorKey], + [publisherID], + [operatorStatusID], + [name], + [soapReplicationURL], + [certSerialNo], + [certIssuer], + [certSubject], + [flag]) +VALUES( + 4, + NEWID(), + 4, + 2, + 'Microsoft UDDI Services', + 'not initialized', + NEWID(), + 'not initialized', + 'not initialized', + 0) +GO + +SET IDENTITY_INSERT [UDO_operators] OFF +GO + +-- +-- Insert [UDO_reportStatus] standard values +-- + +INSERT [UDO_reportStatus] VALUES(0, 'Available') +INSERT [UDO_reportStatus] VALUES(1, 'Processing') + +-- +-- Insert [UDO_reports] standard values +-- + +INSERT [UDO_reports] VALUES('UI_getEntityCounts', 0, GETDATE()) +INSERT [UDO_reports] VALUES('UI_getPublisherStats', 0, GETDATE()) +INSERT [UDO_reports] VALUES('UI_getTopPublishers', 0, GETDATE()) +INSERT [UDO_reports] VALUES('UI_getTaxonomyStats', 0, GETDATE()) +GO + +-- +-- Insert [UDO_reportLines] standard values +-- + +INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) +VALUES( + 'UI_getEntityCounts', + 'HEADING_STATISTICS_LABEL_REFRESH', + 'HEADING_STATISTICS_LABEL_REFRESH', + '') + +INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) +VALUES( + 'UI_getPublisherStats', + 'HEADING_STATISTICS_LABEL_REFRESH', + 'HEADING_STATISTICS_LABEL_REFRESH', + '') + +INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) +VALUES( + 'UI_getTopPublishers', + 'HEADING_STATISTICS_LABEL_REFRESH', + 'HEADING_STATISTICS_LABEL_REFRESH', + '') + +INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) +VALUES( + 'UI_getTaxonomyStats', + 'HEADING_STATISTICS_LABEL_REFRESH', + 'HEADING_STATISTICS_LABEL_REFRESH', + '') +GO + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.func.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.func.sql new file mode 100644 index 0000000..7944b51 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.func.sql @@ -0,0 +1,1822 @@ +-- Script: uddi.v2.func.sql +-- Author: LRDohert@Microsoft.com +-- Description: Creates scalar functions +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Configuration helper functions +-- ============================================= + +-- ============================================= +-- Name: configValue() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'configValue' AND type = 'FN') + DROP FUNCTION configValue +GO + +CREATE FUNCTION configValue ( + @configName nvarchar(450)) +RETURNS varchar(8000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @configValue nvarchar(4000) + + SELECT + @configValue = [configValue] + FROM + [UDO_config] + WHERE + ([configName] = @configName) + + RETURN @configValue +END +GO + +-- ============================================= +-- Name: currentOperatorID +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'currentOperatorID' AND type='FN') + DROP FUNCTION currentOperatorID +GO + +CREATE FUNCTION currentOperatorID () +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + -- Return the operatorID for the current operator site + DECLARE + @operatorID bigint + + SET @operatorID = CAST(dbo.configValue('OperatorID') AS bigint) + + RETURN @operatorID +END -- currentOperatorID +GO + +-- ============================================= +-- Section: Dereferencing functions +-- ============================================= + +-- ============================================= +-- Name: bindingKey +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'bindingKey' AND type = 'FN') + DROP FUNCTION bindingKey +GO + +CREATE FUNCTION bindingKey + (@bindingID bigint) +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE @bindingKey uniqueidentifier + + SELECT @bindingKey = bindingKey FROM [UDC_bindingTemplates] WHERE bindingID = @bindingID + + RETURN @bindingKey +END +GO + +-- ============================================= +-- Name: bindingID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'bindingID' AND type = 'FN') + DROP FUNCTION bindingID +GO + +CREATE FUNCTION bindingID( + @bindingKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @bindingID bigint + + SELECT @bindingID = bindingID FROM [UDC_bindingTemplates] WHERE bindingKey = @bindingKey + + RETURN @bindingID +END +GO + +-- ============================================= +-- Name: businessID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'businessID' AND type = 'FN') + DROP FUNCTION businessID +GO + +CREATE FUNCTION businessID( + @businessKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @businessID bigint + + SELECT @businessID = businessID FROM [UDC_businessEntities] WHERE businessKey = @businessKey + + RETURN @businessID +END +GO + +-- ============================================= +-- Name: businessKey() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'businessKey' AND type = 'FN') + DROP FUNCTION businessKey +GO + +CREATE FUNCTION businessKey( + @businessID bigint) +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @businessKey uniqueidentifier + + SELECT @businessKey = [businessKey] FROM [UDC_businessEntities] WHERE businessID = @businessID + + RETURN @businessKey +END -- businessKey +GO + +-- ============================================= +-- Name: changeType() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'changeType' AND type = 'FN') + DROP FUNCTION changeType +GO + +CREATE FUNCTION changeType( + @changeTypeID tinyint) +RETURNS nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @changeType nvarchar(4000) + + SELECT + @changeType = [changeType] + FROM + [UDO_changeTypes] + WHERE + [changeTypeID] = @changeTypeID + + RETURN @changeType +END -- changeType +GO + +-- ============================================= +-- Name: changeTypeID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'changeTypeID' AND type = 'FN') + DROP FUNCTION changeTypeID +GO + +CREATE FUNCTION changeTypeID( + @changeType nvarchar(4000)) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @changeTypeID tinyint + + SELECT + @changeTypeID = [changeTypeID] + FROM + [UDO_changeTypes] + WHERE + ([changeType] = @changeType) + + RETURN @changeTypeID +END +GO + +-- ============================================= +-- Name: elementName() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'elementName' AND type = 'FN') + DROP FUNCTION elementName +GO + +CREATE FUNCTION elementName( + @elementID tinyint) +RETURNS nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @elementName nvarchar(4000) + + SELECT + @elementName = [elementName] + FROM + [UDO_elementNames] + WHERE + [elementID] = @elementID + + RETURN @elementName +END -- elementName +GO + +-- ============================================= +-- Name: elementID() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'elementID' AND type = 'FN') + DROP FUNCTION elementID +GO + +CREATE FUNCTION elementID( + @elementName nvarchar(4000)) +RETURNS tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @elementID tinyint + + SELECT + @elementID = [elementID] + FROM + [UDO_elementNames] + WHERE + ([elementName] = @elementName) + + RETURN @elementID +END -- elementID +GO + +-- ============================================= +-- Name: entityType() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'entityType' AND type = 'FN') + DROP FUNCTION entityType +GO + +CREATE FUNCTION entityType + (@entityTypeID tinyint) +RETURNS nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @entityType nvarchar(4000) + + SELECT + @entityType = [entityType] + FROM + [UDO_entityTypes] + WHERE + ([entityTypeID] = @entityTypeID) + + RETURN @entityType +END -- entityType +GO + +-- ============================================= +-- Name: entityTypeID() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'entityTypeID' AND type = 'FN') + DROP FUNCTION entityTypeID +GO + +CREATE FUNCTION entityTypeID + (@entityType nvarchar(4000)) +RETURNS tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @entityTypeID tinyint + + SELECT + @entityTypeID = [entityTypeID] + FROM + [UDO_entityTypes] + WHERE + ([entityType] = @entityType) + + RETURN @entityTypeID +END -- entityTypeID +GO + +-- ============================================= +-- Name: operatorID +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'operatorID' AND type='FN') + DROP FUNCTION operatorID +GO + +CREATE FUNCTION operatorID + (@operatorKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @operatorID bigint + + SELECT + @operatorID = [operatorID] + FROM + [UDO_operators] + WHERE + ([operatorKey] = @operatorKey) + + RETURN @operatorID +END +GO + +-- ============================================= +-- Name: operatorStatus +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'operatorStatus' AND type='FN') + DROP FUNCTION operatorStatus +GO + +CREATE FUNCTION operatorStatus + (@operatorStatusID tinyint) +RETURNS nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @operatorStatus nvarchar(4000) + + SELECT + @operatorStatus = [operatorStatus] + FROM + [UDO_operatorStatus] + WHERE + ([operatorStatusID] = @operatorStatusID) + + RETURN @operatorStatus +END -- operatorStatus +GO + +-- ============================================= +-- Name: operatorStatusID +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'operatorStatusID' AND type='FN') + DROP FUNCTION operatorStatusID +GO + +CREATE FUNCTION operatorStatusID + (@operatorStatus nvarchar(4000)) +RETURNS tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @operatorStatusID tinyint + + SELECT + @operatorStatusID = [operatorStatusID] + FROM + [UDO_operatorStatus] + WHERE + ([operatorStatus] = @operatorStatus) + + RETURN @operatorStatusID +END -- operatorStatusID +GO + +-- ============================================= +-- Function: operatorKey +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = N'operatorKey' AND type = 'FN') + DROP FUNCTION operatorKey +GO + +CREATE FUNCTION operatorKey ( + @operatorID bigint) +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @operatorKey AS uniqueidentifier + + SELECT + @operatorKey = [operatorKey] + FROM + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + RETURN @operatorKey +END -- operatorKey +GO + +-- ============================================= +-- Name: operatorName +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'operatorName' AND type='FN') + DROP FUNCTION operatorName +GO + +CREATE FUNCTION operatorName + (@operatorID bigint) +RETURNS nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @name nvarchar(450) + + SELECT @name=[name] FROM [UDO_operators] WHERE [operatorID] = @operatorID + + RETURN @name +END +GO + +-- ============================================= +-- Name: publisherID +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'publisherID' AND type='FN') + DROP FUNCTION publisherID +GO + +CREATE FUNCTION publisherID + (@PUID nvarchar(450)) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherID bigint + + SELECT @publisherID=publisherID FROM [UDO_publishers] WHERE PUID=@PUID + + RETURN @publisherID +END +GO + +-- ============================================= +-- Name: PUID() +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'PUID' AND type='FN') + DROP FUNCTION PUID +GO + +CREATE FUNCTION PUID + (@publisherID bigint) +RETURNS nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @PUID nvarchar(450) + + SELECT @PUID = PUID FROM [UDO_publishers] WHERE publisherID = @publisherID + + RETURN @PUID +END +GO + +-- ============================================= +-- Name: publisherName +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'publisherName' AND type = 'FN') + DROP FUNCTION publisherName +GO + +CREATE FUNCTION publisherName( + @publisherID bigint) +RETURNS nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @name nvarchar(450) + + SELECT @name=[name] FROM [UDO_publishers] WHERE publisherID = @publisherID + + RETURN @name +END +GO + +-- ============================================= +-- publisherNameUnique +-- ============================================= +-- TODO: Temporarily removed for heartland +-- IF EXISTS (SELECT name FROM sysobjects WHERE name = 'publisherNameUnique' AND type = 'FN') +-- DROP FUNCTION publisherNameUnique +-- GO +-- +-- CREATE FUNCTION publisherNameUnique( +-- @publisherID bigint) +-- RETURNS nvarchar(450) +-- AS +-- BEGIN +-- DECLARE +-- @publisherName nvarchar(4000), +-- @publisherIDString nvarchar(4000), +-- @publisherNameUnique nvarchar(450) +-- +-- SELECT +-- @publisherName = [name] +-- FROM +-- [UDO_publishers] +-- WHERE +-- [publisherID] = @publisherID +-- +-- IF @@ROWCOUNT = 0 +-- RETURN NULL +-- +-- SET @publisherIDString = ' : ' + CAST(@publisherID AS nvarchar(4000)) +-- +-- SET @publisherNameUnique = LEFT(ISNULL(@publisherName,''),450 - LEN(@publisherIDString)) + @publisherIDString +-- +-- RETURN @publisherNameUnique +-- END -- publisherNameUnique +-- GO + +-- ============================================= +-- Name: publisherStatus +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'publisherStatus' AND type = 'FN') + DROP FUNCTION publisherStatus +GO + +CREATE FUNCTION publisherStatus( + @publisherStatusID tinyint) +RETURNS nvarchar(256) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherStatus nvarchar(256) + + SELECT @publisherStatus = publisherStatus FROM [UDO_publisherStatus] WHERE publisherStatusID = @publisherStatusID + + RETURN @publisherStatus +END +GO + +-- ============================================= +-- Name: publisherStatusID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'publisherStatusID' AND type = 'FN') + DROP FUNCTION publisherStatusID +GO + +CREATE FUNCTION publisherStatusID( + @publisherStatus nvarchar(256)) +RETURNS tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherStatusID tinyint + + SELECT @publisherStatusID = publisherStatusID FROM [UDO_publisherStatus] WHERE publisherStatus = @publisherStatus + + RETURN @publisherStatusID +END -- puublisherStatusID +GO + +-- ============================================= +-- Name: reportStatus +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'reportStatus' AND type = 'FN') + DROP FUNCTION reportStatus +GO + +CREATE FUNCTION reportStatus ( + @reportStatusID tinyint) +RETURNS nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @reportStatus nvarchar(4000) + + SELECT + @reportStatus = [reportStatus] + FROM + [UDO_reportStatus] + WHERE + ([reportStatusID] = @reportStatusID) + + RETURN @reportStatus +END -- reportStatus +GO + +-- ============================================= +-- Name: reportStatusID +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'reportStatusID' AND type = 'FN') + DROP FUNCTION reportStatusID +GO + +CREATE FUNCTION reportStatusID ( + @reportStatus nvarchar(4000)) +RETURNS tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @reportStatusID tinyint + + SELECT + @reportStatusID = [reportStatusID] + FROM + [UDO_reportStatus] + WHERE + ([reportStatus] = @reportStatus) + + RETURN @reportStatusID +END -- reportStatusID +GO + +-- ============================================= +-- Name: serviceKey +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'serviceKey' AND type = 'FN') + DROP FUNCTION serviceKey +GO + +CREATE FUNCTION serviceKey + (@serviceID bigint) +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE @serviceKey uniqueidentifier + + SELECT @serviceKey = serviceKey FROM [UDC_businessServices] WHERE serviceID = @serviceID + + RETURN @serviceKey +END +GO + +-- ============================================= +-- Name: serviceID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'serviceID' AND type = 'FN') + DROP FUNCTION serviceID +GO + +CREATE FUNCTION serviceID( + @serviceKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @serviceID bigint + + SELECT @serviceID = serviceID FROM [UDC_businessServices] WHERE serviceKey = @serviceKey + + RETURN @serviceID +END +GO + +-- ============================================= +-- Name: taxonomyID() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'taxonomyID' AND type = 'FN') + DROP FUNCTION taxonomyID +GO + +CREATE FUNCTION taxonomyID ( + @tModelKey uniqueidentifier) +RETURNS int +WITH ENCRYPTION +AS +BEGIN + DECLARE + @taxonomyID int + + SELECT @taxonomyID = [taxonomyID] FROM [UDT_taxonomies] WHERE [tModelKey] = @tModelKey + + RETURN @taxonomyID +END +GO + +-- ============================================= +-- Name: tModelKey +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'tModelKey' AND type = 'FN') + DROP FUNCTION tModelKey +GO + +CREATE FUNCTION tModelKey( + @tModelID bigint) +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @tModelKey uniqueidentifier + + SELECT @tModelKey = tModelKey FROM [UDC_tModels] WHERE tModelID = @tModelID + + RETURN @tModelKey +END + +GO + +-- ============================================= +-- Name: tModelID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'tModelID' AND type = 'FN') + DROP FUNCTION tModelID +GO + +CREATE FUNCTION tModelID( + @tModelKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @tModelID bigint + + SELECT @tModelID = tModelID FROM [UDC_tModels] WHERE tModelKey = @tModelKey + + RETURN @tModelID +END +GO + +-- ============================================= +-- Name: URLTypeID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'URLTypeID' AND type = 'FN') + DROP FUNCTION URLTypeID +GO + +CREATE FUNCTION URLTypeID( + @URLType nvarchar(450)) +RETURNS tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @URLTypeID tinyint + + SELECT @URLTypeID = URLTypeID FROM [UDC_URLTypes] WHERE URLType = @URLType + + RETURN @URLTypeID +END +GO + +-- ============================================= +-- Name: URLType +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'URLType' AND type = 'FN') + DROP FUNCTION URLType +GO + +CREATE FUNCTION URLType( + @URLTypeID tinyint) +RETURNS nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @URLType nvarchar(450) + + SELECT @URLType = URLType FROM [UDC_URLTypes] WHERE URLTypeID = @URLTypeID + + RETURN @URLType +END +GO + +-- ============================================= +-- Name: URLType +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'URLType' AND type = 'FN') + DROP FUNCTION URLType +GO + +CREATE FUNCTION URLType( + @URLTypeID tinyint) +RETURNS nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @URLType nvarchar(450) + + SELECT @URLType = URLType FROM [UDC_URLTypes] WHERE URLTypeID = @URLTypeID + + RETURN @URLType +END +GO + +-- ============================================= +-- Section: Find helper functions +-- ============================================= + +-- ============================================= +-- Name: caseSensitiveMatch +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'caseSensitiveMatch' AND type = 'FN') + DROP FUNCTION caseSensitiveMatch +GO + +CREATE FUNCTION caseSensitiveMatch( + @searchArgument nvarchar(4000), + @columnVal nvarchar(4000), + @exactNameMatch bit) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @caseSensitiveMatch bit + + SET @caseSensitiveMatch = 0 + + IF @exactNameMatch=1 + BEGIN + -- exactNameMatch and caseSensitiveMatch were specified + IF (CONVERT(binary(8000), @columnVal) = CONVERT(binary(8000), @searchArgument)) + SET @caseSensitiveMatch = 1 + END + ELSE + BEGIN + -- Only caseSensitiveMatch was specified, wildcards must be considered + IF (dbo.containsWildCard(@searchArgument) = 0) + SET @searchArgument = @searchArgument + N'%' + + IF (@columnVal COLLATE Latin1_General_BIN LIKE @searchArgument COLLATE Latin1_General_BIN) + SET @caseSensitiveMatch = 1 + END + + RETURN @caseSensitiveMatch +END -- caseSensitiveMatch +GO + +-- ============================================= +-- Name: contextRows +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'contextRows' AND type = 'FN') + DROP FUNCTION contextRows +GO + +CREATE FUNCTION contextRows( + @contextID uniqueidentifier) +RETURNS int +WITH ENCRYPTION +AS +BEGIN + DECLARE + @contextRows int + + SELECT + @contextRows = COUNT(*) + FROM + [UDS_findResults] + WHERE + ([contextID] = @contextID) + + RETURN @contextRows +END -- contextRows +GO + +-- ============================================= +-- Name: containsWildcard +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'containsWildcard' AND type = 'FN') + DROP FUNCTION containsWildcard +GO + +CREATE FUNCTION containsWildcard( + @string nvarchar(4000)) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @containsWildcard bit + + SET @containsWildcard = 0 + + IF CHARINDEX(N'%', @string) <> 0 + SET @containsWildcard = 1 + + RETURN @containsWildcard +END -- containsWildcard +GO + +-- ============================================= +-- Function: ownerFlag +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = N'ownerFlag' AND type = 'FN') + DROP FUNCTION ownerFlag +GO + +CREATE FUNCTION ownerFlag ( + @publisherID bigint, + @fromKey uniqueidentifier, + @toKey uniqueidentifier) +RETURNS int +WITH ENCRYPTION +AS +BEGIN + DECLARE + @ownerFlag int + + SET @ownerFlag = 0 + + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @fromKey AND [publisherID] = @publisherID) + SET @ownerFlag = @ownerFlag | 0x2 + + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @toKey AND [publisherID] = @publisherID) + SET @ownerFlag = @ownerFlag | 0x1 + + RETURN @ownerFlag +END -- ownerFlag +GO + +-- ============================================= +-- Function: genKeywordsKey +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = N'genKeywordsKey' AND type = 'FN') + DROP FUNCTION genKeywordsKey +GO + +CREATE FUNCTION genKeywordsKey () +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @genKeywordsKeyStr varchar(8000), + @genKeywordsKey uniqueidentifier + + SET @genKeywordsKeyStr = dbo.configValue('TModelKey.GeneralKeywords') + + SET @genKeywordsKey = RIGHT(@genKeywordsKeyStr, LEN(@genKeywordsKeyStr) - 5) + + RETURN @genKeywordsKey +END -- genKeywordsKey +GO + +-- ============================================= +-- Function: operatorsKey() +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = N'operatorsKey' AND type = 'FN') + DROP FUNCTION operatorsKey +GO + +CREATE FUNCTION operatorsKey () +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @operatorsKeyStr varchar(8000), + @operatorsKey uniqueidentifier + + SET @operatorsKeyStr = dbo.configValue('TModelKey.Operators') + + SET @operatorsKey = RIGHT(@operatorsKeyStr, LEN(@operatorsKeyStr) - 5) + + RETURN @operatorsKey +END -- operatorsKey +GO + +-- ============================================= +-- Section: Lookup helper functions +-- ============================================= + +-- ============================================= +-- Name: getBindingPublisherID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'getBindingPublisherID' AND type = 'FN') + DROP FUNCTION getBindingPublisherID +GO + +CREATE FUNCTION getBindingPublisherID( + @bindingKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @businessKey uniqueidentifier, + @publisherID bigint + + SELECT + @businessKey = dbo.businessKey(BS.businessID) + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT + ON BS.serviceID = BT.serviceID + WHERE + BT.bindingKey = @bindingKey + + SELECT @publisherID = dbo.getBusinessPublisherID(@businessKey) + + RETURN @publisherID +END +GO + +-- ============================================= +-- Name: getBindingOperatorID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'getBindingOperatorID' AND type = 'FN') + DROP FUNCTION getBindingOperatorID +GO + +CREATE FUNCTION getBindingOperatorID( + @bindingKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @businessKey uniqueidentifier, + @publisherID bigint, + @operatorID bigint + + SELECT + @businessKey = dbo.businessKey(BS.businessID) + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT + ON BS.serviceID = BT.serviceID + WHERE + BT.bindingKey = @bindingKey + + SELECT @publisherID = dbo.getBusinessPublisherID(@businessKey) + + + SELECT + @operatorID = [operatorID] + FROM + [UDO_operators] + WHERE + ([publisherID] = @publisherID) + + IF @operatorID IS NULL + SET @operatorID = dbo.currentOperatorID() + + RETURN @operatorID +END +GO + +-- ============================================= +-- Name: getBindingServiceKey +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'getBindingServiceKey' AND type = 'FN') + DROP FUNCTION getBindingServiceKey +GO + +CREATE FUNCTION getBindingServiceKey + (@bindingKey uniqueidentifier) +RETURNS uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @serviceID bigint + + SELECT @serviceID = serviceID FROM [UDC_bindingTemplates] WHERE bindingKey = @bindingKey + + RETURN dbo.serviceKey(@serviceID) +END +GO + +-- ============================================= +-- Name: getBusinessPublisherID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'getBusinessPublisherID' AND type = 'FN') + DROP FUNCTION getBusinessPublisherID +GO + +CREATE FUNCTION getBusinessPublisherID + (@businessKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE @publisherID bigint + + SELECT @publisherID = publisherID FROM [UDC_businessEntities] WHERE businessKey = @businessKey + + RETURN @publisherID +END +GO + +-- ============================================= +-- Function: getOperatorPublisherID +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = N'getOperatorPublisherID' AND type = 'FN') + DROP FUNCTION getOperatorPublisherID +GO + +CREATE FUNCTION getOperatorPublisherID ( + @operatorID bigint) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherID bigint + + SELECT + @publisherID = [publisherID] + FROM + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + RETURN @publisherID +END -- getOperatorPublisherID +GO + +-- ============================================= +-- Function: getPublisherOperatorID +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = N'getPublisherOperatorID' AND type = 'FN') + DROP FUNCTION getPublisherOperatorID +GO + +CREATE FUNCTION getPublisherOperatorID ( + @publisherID bigint) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @operatorID bigint + + SELECT + @operatorID = [operatorID] + FROM + [UDO_operators] + WHERE + ([publisherID] = @publisherID) + + IF @operatorID IS NULL + SET @operatorID = dbo.currentOperatorID() + + RETURN @operatorID +END -- getPublisherOperatorID +GO + +-- ============================================= +-- Name: getServicePublisherID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'getServicePublisherID' AND type = 'FN') + DROP FUNCTION getServicePublisherID +GO + +CREATE FUNCTION getServicePublisherID( + @serviceKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherID bigint, + @businessKey uniqueidentifier + + SELECT + @businessKey = dbo.businessKey(businessID) + FROM + [UDC_businessServices] + WHERE + serviceKey = @serviceKey + + SELECT @publisherID = dbo.getBusinessPublisherID(@businessKey) + + RETURN @publisherID +END +GO + +-- ============================================= +-- Name: getTModelPublisherID +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'getTModelPublisherID' AND type = 'FN') + DROP FUNCTION getTModelPublisherID +GO + +CREATE FUNCTION getTModelPublisherID( + @tModelKey uniqueidentifier) +RETURNS bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherID bigint + + SELECT @publisherID = publisherID FROM [UDC_tModels] WHERE tModelKey = @tModelKey + + RETURN @publisherID +END +GO + +-- ============================================= +-- Section: Publisher helper functions +-- ============================================= + +-- ============================================= +-- Name: defaultIsoLangCode +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'defaultIsoLangCode' AND type='FN') + DROP FUNCTION defaultIsoLangCode +GO + +CREATE FUNCTION defaultIsoLangCode ( + @PUID nvarchar(450) = NULL) +RETURNS varchar(17) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @isoLangCode varchar(17) + + IF @PUID IS NULL + RETURN 'en' + + -- Return the default isoLangCode for the current operator site + SELECT @isoLangCode = isoLangCode FROM [UDO_publishers] WHERE PUID = @PUID + + IF @isoLangCode IS NULL + SET @isoLangCode = 'en' + + RETURN @isoLangCode +END +GO + +-- ============================================= +-- Name: getPublisherStatus +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'getPublisherStatus' AND type = 'FN') + DROP FUNCTION getPublisherStatus +GO + +CREATE FUNCTION getPublisherStatus( + @PUID nvarchar(450)) +RETURNS nvarchar(256) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @publisherStatus nvarchar(256) + + SELECT @publisherStatus = dbo.publisherStatus(publisherStatusID) FROM [UDO_publishers] WHERE PUID = @PUID + + RETURN @publisherStatus +END +GO + +-- ============================================= +-- Name: publisherExists +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'publisherExists' AND type = 'FN') + DROP FUNCTION publisherExists +GO + +CREATE FUNCTION publisherExists( + @PUID nvarchar(450)) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC bit + + IF EXISTS(SELECT * FROM [UDO_publishers] WHERE PUID = @PUID) + SET @RC = 1 + ELSE + SET @RC = 0 + + RETURN @RC +END +GO + +-- ============================================= +-- Function: publisherOperatorName +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = N'publisherOperatorName' AND type = 'FN') + DROP FUNCTION publisherOperatorName +GO + +CREATE FUNCTION publisherOperatorName ( + @publisherID bigint) +RETURNS nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @name nvarchar(450) + + SELECT + @name = [name] + FROM + [UDO_operators] + WHERE + ([publisherID] = @publisherID) + + IF @name IS NULL + BEGIN + SELECT + @name = [name] + FROM + [UDO_operators] + WHERE + ([operatorID] = dbo.configValue('OperatorID')) + END + + RETURN @name +END -- publisherOperatorName +GO + +-- ============================================= +-- Section: Replication helper functions +-- ============================================= + +-- ============================================= +-- Name: entityExists() +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'entityExists' AND type = 'FN') + DROP FUNCTION entityExists +GO + +CREATE FUNCTION entityExists( + @entityKey uniqueidentifier, + @entityTypeID tinyint) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @entityExists bit, + @rowCount int + + IF dbo.entityType(@entityTypeID) NOT IN ('tModel', 'businessEntity', 'businessService', 'bindingTemplate') + RETURN 10500 + + SET @entityExists = 0 + + IF dbo.entityType(@entityTypeID) = 'tModel' + BEGIN + SELECT + @rowCount = COUNT(*) + FROM + [UDC_tModels] + WHERE + ([tModelKey] = @entityKey) AND + ([flag] = 0x0) + + IF @rowCount = 0 + RETURN 0 + ELSE + RETURN 1 + END + + IF dbo.entityType(@entityTypeID) = 'businessEntity' + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @entityKey) + RETURN 1 + ELSE + RETURN 0 + + IF dbo.entityType(@entityTypeID) = 'businessService' + IF EXISTS(SELECT * FROM [UDC_businessServices] WHERE [serviceKey] = @entityKey) + RETURN 1 + ELSE + RETURN 0 + + IF dbo.entityType(@entityTypeID) = 'bindingTemplate' + IF EXISTS(SELECT * FROM [UDC_bindingTemplates] WHERE [bindingKey] = @entityKey) + RETURN 1 + ELSE + RETURN 0 + + RETURN @entityExists +END -- entityExists +GO + +-- ============================================= +-- Name: entityKeyStr() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'entityKeyStr' AND type = 'FN') + DROP FUNCTION entityKeyStr +GO + +CREATE FUNCTION entityKeyStr( + @entityKey uniqueidentifier, + @entityTypeID tinyint) +RETURNS nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @entityKeyStr nvarchar(4000) + + IF dbo.entityType(@entityTypeID) = 'tModel' + SET @entityKeyStr = dbo.addURN(@entityKey) + ELSE + SET @entityKeyStr = dbo.UUIDSTR(@entityKey) + + RETURN @entityKeyStr +END -- entityKeyStr +GO + +-- ============================================= +-- Name: isReplPublisher() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'isReplPublisher' AND type = 'FN') + DROP FUNCTION isReplPublisher +GO + +CREATE FUNCTION isReplPublisher ( + @PUID nvarchar(4000)) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @isReplPublisher bit + + SET @isReplPublisher = 0 + + IF EXISTS(SELECT * FROM [UDO_operators] WHERE [publisherID] = dbo.publisherID(@PUID)) + BEGIN + SET @isReplPublisher = 1 + END + + RETURN @isReplPublisher +END +GO + +-- ============================================= +-- Name: keyType() +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'keyType' AND type = 'FN') + DROP FUNCTION keyType +GO + +CREATE FUNCTION keyType( + @key uniqueidentifier +) +RETURNS nvarchar(256) +WITH ENCRYPTION +AS +BEGIN + -- Returns the key type of an arbitrary key, returns NULL if the key doesn't exist + DECLARE + @keyType nvarchar(256) + + SET @keyType = NULL + + IF EXISTS(SELECT [tModelKey] FROM [UDC_tModels] WHERE [tModelKey] = @key) + BEGIN + SET @keyType = 'tModelKey' + RETURN @keyType + END + + IF EXISTS(SELECT [businessKey] FROM [UDC_businessEntities] WHERE [businessKey] = @key) + BEGIN + SET @keyType = 'businessKey' + RETURN @keyType + END + + IF EXISTS(SELECT [serviceKey] FROM [UDC_businessServices] WHERE [serviceKey] = @key) + BEGIN + SET @keyType = 'serviceKey' + RETURN @keyType + END + + IF EXISTS(SELECT [bindingKey] FROM [UDC_bindingTemplates] WHERE [bindingKey] = @key) + BEGIN + SET @keyType = 'bindingKey' + RETURN @keyType + END + + RETURN @keyType +END +GO + +-- ============================================= +-- Section: String and Conversion helper functions +-- ============================================= + +-- ============================================= +-- Name: addURN() +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'addURN' AND type='FN') + DROP FUNCTION addURN +GO + +CREATE FUNCTION addURN + (@guid uniqueidentifier) +RETURNS varchar(256) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @guidStr varchar(256) + + SET @guidStr='uuid:' + CAST(@guid AS varchar(256)) + + RETURN @guidStr +END -- addURN() +GO + +-- ============================================= +-- Name: UUIDSTR +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UUIDSTR' AND type = 'FN') + DROP FUNCTION UUIDSTR +GO + +CREATE FUNCTION UUIDSTR( + @uuid uniqueidentifier) +RETURNS varchar(256) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @uuidStr varchar(256) + + SET @uuidStr = CAST(@uuid AS varchar(256)) + + RETURN @uuidStr +END +GO + +-- ============================================= +-- Section: Validation helper functions +-- ============================================= + +-- ============================================= +-- Name: validTaxonomyValue() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'validTaxonomyValue' AND type = 'FN') + DROP FUNCTION validTaxonomyValue +GO + +CREATE FUNCTION validTaxonomyValue ( + @tModelKey uniqueidentifier, + @keyValue nvarchar(225)) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC bit + + IF (@tModelKey IS NOT NULL) AND (@keyValue IS NOT NULL) + IF EXISTS(SELECT * FROM [UDT_taxonomyValues] WHERE ([taxonomyID] = dbo.taxonomyID(@tModelKey)) AND ([keyValue] = @keyValue) AND ([valid]= 1)) + SET @RC=1 + ELSE + SET @RC=0 + ELSE + SET @RC=0 + + RETURN @RC +END -- validTaxonomyValue() +GO + +-- ============================================= +-- Name: checkedTaxonomy() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'checkedTaxonomy' AND type = 'FN') + DROP FUNCTION checkedTaxonomy +GO + +CREATE FUNCTION checkedTaxonomy ( + @tModelKey uniqueidentifier) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC bit, + @flag int + + SET @RC = 0 + + SELECT + @flag = [flag] + FROM + [UDT_taxonomies] + WHERE + [tModelKey] = @tModelKey + + IF @flag IS NOT NULL + IF dbo.checkFlag(@flag,0x1) = 1 + SET @RC = 1 + + RETURN @RC +END -- checkedTaxonomy() +GO + +-- ============================================= +-- Name: ISGUID() +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'ISGUID' AND type='FN') + DROP FUNCTION ISGUID +GO + +CREATE FUNCTION ISGUID + (@guidText varchar(256)) +RETURNS int +WITH ENCRYPTION +AS +BEGIN + DECLARE + @guidPattern1 varchar(256), + @guidPattern2 varchar(256), + @pos1 int, + @pos2 int, + @RC int + + SET @RC = 0 + + IF @guidText IS NULL + RETURN 1 + + SET @guidPattern1 ='%[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-%' + SET @guidPattern2 ='%-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]%' + + -- Check for standard GUID string with no curly braces + SELECT @pos1=PATINDEX(@guidPattern1, UPPER(@guidText)) + SELECT @pos2=PATINDEX(@guidPattern2, UPPER(@guidText)) + + IF (@pos1 = 1) AND (@pos2 = 24) + SET @RC=1 + ELSE + BEGIN + -- Check for standard GUID string with curly braces + SET @guidPattern1 ='%{[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]-%' + SET @guidPattern2 ='%-[0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]}%' + + SELECT @pos1=PATINDEX(@guidPattern1, UPPER(@guidText)) + SELECT @pos2=PATINDEX(@guidPattern2, UPPER(@guidText)) + + IF (@pos1 = 1) AND (@pos2 = 25) + SET @RC=1 + ELSE + SET @RC=0 + END + + RETURN @RC +END +GO + +-- ============================================= +-- Name: isUuidUnique +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'isUuidUnique' AND type = 'FN') + DROP FUNCTION isUuidUnique +GO + +CREATE FUNCTION isUuidUnique( + @uuid uniqueidentifier) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + IF EXISTS(SELECT [tModelKey] FROM [UDC_tModels] WHERE [tModelKey] = @uuid) + RETURN 0 + + IF EXISTS(SELECT [businessKey] FROM [UDC_businessEntities] WHERE [businessKey] = @uuid) + RETURN 0 + + IF EXISTS(SELECT [serviceKey] FROM [UDC_businessServices] WHERE [serviceKey] = @uuid) + RETURN 0 + + IF EXISTS(SELECT [bindingKey] FROM [UDC_bindingTemplates] WHERE [bindingKey] = @uuid) + RETURN 0 + + RETURN 1 +END -- isUuidUnique() +GO + +-- ============================================= +-- Section: Miscellaneous functions +-- ============================================= + +-- ============================================= +-- Name: checkFlag() +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'checkFlag' AND type = 'FN') + DROP FUNCTION checkFlag +GO + +CREATE FUNCTION checkFlag( + @flag int, + @bit int) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC bit + + IF @flag & @bit = @bit + SET @RC=1 + ELSE + SET @RC=0 + + RETURN @RC +END +GO + +-- ============================================= +-- Name: isReportRunning +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'isReportRunning' AND type = 'FN') + DROP FUNCTION isReportRunning +GO + +CREATE FUNCTION isReportRunning ( + @reportID sysname, + @now datetime) +RETURNS bit +WITH ENCRYPTION +AS +BEGIN + DECLARE + @isReportRunning bit, + @reportStatusID tinyint, + @lastChange datetime + + SET @isReportRunning = 0 + + SELECT + @reportStatusID = [reportStatusID], + @lastChange = [lastChange] + FROM + [UDO_reports] + WHERE + ([reportID] = @reportID) + + -- + -- Check to see if report is already running. + -- If report has been running for less than 5 minutes get out. + -- If report has been running for more than 5 assume failure and rerun. + -- + + IF (@reportStatusID = dbo.reportStatusID('Processing')) AND (DATEDIFF(mi, @lastChange, @now) < 5) + SET @isReportRunning = 1 + + RETURN @isReportRunning +END -- isReportRunning +GO + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.messages.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.messages.sql new file mode 100644 index 0000000..c6634d0 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.messages.sql @@ -0,0 +1,203 @@ +-- Script: uddi.v2.messages.sql +-- Author: LRDohert@Microsoft.com +-- Description: Custom UDDI error messages. +-- Note: This file is best viewed and edited with a tab width of 2. + +DECLARE + @baseError int, + @messageNum int, + @severity smallint, + @messageText nvarchar(255), + @lang sysname, + @withLog varchar(5), + @replace varchar(7) + +-- Initialize common variables for all messages +SET @baseError = 50000 +SET @severity = 16 -- user error +SET @lang = 'us_english' -- all errors are english +SET @withLog = 'FALSE' -- errors will not be written to application event log +SET @replace = 'REPLACE' -- replaces existing message with new one if it exists + +-- Add messages + +-- Internal Microsoft UDDI Errors +-- E_subProcFailure +SET @messageNum = @baseError + 6 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_parmError +SET @messageNum = @baseError + 9 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_maxStringLength +SET @messageNum = @baseError + 10 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_userDisabled +SET @messageNum = @baseError + 13 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_configError +SET @messageNum = @baseError + 14 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidSeqNo +SET @messageNum = @baseError + 15 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidCert +SET @messageNum = @baseError + 16 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- +-- UDDI Defined Errors +-- + +-- E_nameTooLong +SET @messageNum = @baseError + 10020 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_tooManyOptions +SET @messageNum = @baseError + 10030 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_unrecognizedVersion +SET @messageNum = @baseError + 10040 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_unsupported +SET @messageNum = @baseError + 10050 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_languageError +SET @messageNum = @baseError + 10060 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_authTokenExpired +SET @messageNum = @baseError + 10110 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_authTokenRequired +SET @messageNum = @baseError + 10120 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_operatorMismatch +SET @messageNum = @baseError + 10130 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_userMismatch +SET @messageNum = @baseError + 10140 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_unknownUser +SET @messageNum = @baseError + 10150 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_accountLimitExceeded +SET @messageNum = @baseError + 10160 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidKeyPassed +SET @messageNum = @baseError + 10210 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidURLPassed +SET @messageNum = @baseError + 10220 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_keyRetired +SET @messageNum = @baseError + 10310 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_busy +SET @messageNum = @baseError + 10400 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_fatalError +SET @messageNum = @baseError + 10500 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidCategory +SET @messageNum = @baseError + 20000 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_categorizationNotAllowed +SET @messageNum = @baseError + 20100 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidValue +SET @messageNum = @baseError + 20200 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_valueNotAllowed +SET @messageNum = @baseError + 20210 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidProjection +SET @messageNum = @baseError + 20230 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_assertionNotFound +SET @messageNum = @baseError + 30000 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_invalidCompletionStatus +SET @messageNum = @baseError + 30100 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- V2 spec error: duplicate error number +-- SET @messageNum = @baseError + 30100 +-- SET @messageText = N'E_messageTooLarge: %s' +-- EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_transferAborted +SET @messageNum = @baseError + 30200 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_requestDenied +SET @messageNum = @baseError + 30210 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_publisherCancelled +SET @messageNum = @baseError + 30220 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace + +-- E_secretUnknown +SET @messageNum = @baseError + 30230 +SET @messageText = N'%s' +EXEC master..sp_addmessage @messageNum, @severity, @messageText, @lang, @withLog, @replace +GO diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.publisher.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.publisher.sql new file mode 100644 index 0000000..ada48fb --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.publisher.sql @@ -0,0 +1,1368 @@ +-- Script: uddi.v2.publisher.sql +-- Author: LRDohert@Microsoft.com +-- Description: Stored procedures associated with a publisher +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Authentication routines +-- ============================================= + +-- ============================================= +-- Name: net_publisher_isRegistered +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_publisher_isRegistered' AND type = 'P') + DROP PROCEDURE net_publisher_isRegistered +GO + +CREATE PROCEDURE net_publisher_isRegistered + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @flag int + + IF dbo.publisherExists(@PUID) = 0 + RETURN 10150 + + RETURN 0 +END +GO + +-- ============================================= +-- Name: net_publisher_isVerified +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_publisher_isVerified' AND type = 'P') + DROP PROCEDURE net_publisher_isVerified +GO + +CREATE PROCEDURE net_publisher_isVerified + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @flag int + + IF dbo.publisherExists(@PUID) = 0 + RETURN 10150 + + SELECT + @flag = [flag] + FROM + UDO_publishers + WHERE + PUID = @PUID + + IF ((@flag & 0x01) <> 0x01) + RETURN 50013 + + RETURN 0 +END +GO + +-- ============================================= +-- Name: net_publisher_login +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_publisher_login' AND type = 'P') + DROP PROCEDURE net_publisher_login +GO + +CREATE PROCEDURE net_publisher_login + @PUID nvarchar(450), + @email nvarchar(100) OUTPUT, + @name nvarchar(100) OUTPUT, + @phone varchar(20) OUTPUT, + @companyName nvarchar(100) OUTPUT, + @altPhone varchar(20) OUTPUT, + @addressLine1 nvarchar(4000) OUTPUT, + @addressLine2 nvarchar(4000) OUTPUT, + @city nvarchar(100) OUTPUT, + @stateProvince nvarchar(100) OUTPUT, + @postalCode nvarchar(100) OUTPUT, + @country nvarchar(100) OUTPUT, + @isoLangCode varchar(17) OUTPUT, + @businessLimit int OUTPUT, + @businessCount int OUTPUT, + @tModelLimit int OUTPUT, + @tModelCount int OUTPUT, + @serviceLimit int OUTPUT, + @bindingLimit int OUTPUT, + @assertionLimit int OUTPUT, + @assertionCount int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @oldEmail nvarchar(100), + @publisherStatus nvarchar(256), + @error int, + @context nvarchar(4000), + @flag int, + @publisherID bigint + + -- Verify the publisher exists + + SET @publisherID = dbo.publisherID(@PUID) + + IF (@publisherID IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Unknown publisher, email ''' + @email + '''' + GOTO errorLabel + END + + -- Get the publisher data + + SELECT + @publisherStatus = dbo.publisherStatus([publisherStatusID]), + @oldEmail = [email], + @flag = [flag] + FROM + [UDO_publishers] + WHERE + ([publisherID] = @publisherID) + + -- Determine which email validation mode we are in. + -- 0 = track Passport + -- 1 = custom email validation + + IF ((@flag & 0x02) = 0x02) + BEGIN + -- We're using custom validation (i.e. not tracking the Passport + -- email address), so we'll ignore the @email input parameter and + -- make sure they have validated through our custom validation. + + IF ((@flag & 0x01) = 0x00) + BEGIN + -- User has not validated their email address. + SET @error = 60150 -- E_unknownUser + SET @context = 'Email address has not yet been validated.' + GOTO errorLabel + END + + SET @email = @oldEmail + END + ELSE + BEGIN + -- We are tracking Passport, so make sure a valid email address + -- was displayed. + + IF (@email IS NULL) + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Your Passport profile information is not shared. Please change your email options on the registration page or change your Passport profile to share your email address with this site.' + GOTO errorLabel + END + + SET @flag = (@flag | 0x01) + END + + IF (@publisherStatus = 'disabled') + BEGIN + SET @error = 50013 -- E_userDisabled + SET @context = 'Account disabled for publisher.' + GOTO errorLabel + END + + -- Only update the publisher record if the email has changed + + IF (ISNULL(@email,'') <> ISNULL(@oldEmail,'')) + BEGIN + UPDATE + [UDO_publishers] + SET + [email] = @email, + [flag] = @flag + WHERE + [publisherID] = @publisherID + END + + -- Return the publisher details + SELECT + @name = PU.[name], + @email = PU.[email], + @phone = PU.[phone], + @companyName = PU.[companyName], + @altPhone = PU.[altPhone], + @addressLine1 = PU.[addressLine1], + @addressLine2 = PU.[addressLine2], + @city = PU.[city], + @stateProvince = PU.[stateProvince], + @postalCode = PU.[postalCode], + @country = PU.[country], + @isoLangCode = PU.[isoLangCode], + @businessLimit = PU.[businessLimit], + @businessCount = (SELECT COUNT(*) FROM [UDC_businessEntities] BE WITH (READUNCOMMITTED) WHERE BE.[publisherID] = @publisherID), + @tModelLimit = PU.[tModelLimit], + @tModelCount = (SELECT COUNT(*) FROM [UDC_tModels] TM WITH (READUNCOMMITTED) WHERE TM.[publisherID] = @publisherID), + @serviceLimit = PU.[serviceLimit], + @bindingLimit = PU.[bindingLimit], + @assertionLimit = PU.[assertionLimit], + @assertionCount = (SELECT COUNT(*) FROM [UDC_assertions_BE] ASS WITH (READUNCOMMITTED) JOIN [UDC_businessEntities] BE WITH (READUNCOMMITTED) ON ASS.[fromKey] = BE.[businessKey] WHERE BE.[publisherID] = @publisherID) + FROM + [UDO_publishers] PU + WHERE + ([publisherID] = @publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_publisher_login +GO + +-- ============================================= +-- Section: Get routines +-- ============================================= + +-- ============================================= +-- Name: net_publisher_businessInfos_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_publisher_businessInfos_get' and type = 'P') + DROP PROCEDURE net_publisher_businessInfos_get +GO + +CREATE PROCEDURE net_publisher_businessInfos_get + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID bigint + + -- Validate PUID + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + @PUID + GOTO errorLabel + END + + SELECT + [businessKey] + FROM + [UDC_businessEntities] + WHERE + ([publisherID] = @publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_publisher_businessInfos_get +GO + +-- ============================================= +-- Name: net_publisher_tModelInfos_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_publisher_tModelInfos_get' and type = 'P') + DROP PROCEDURE net_publisher_tModelInfos_get +GO + +CREATE PROCEDURE net_publisher_tModelInfos_get + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID bigint + + -- Validate PUID + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + @PUID + GOTO errorLabel + END + + SELECT + [tModelKey], + [name], + [flag] + FROM + [UDC_tModels] + WHERE + ([publisherID] = @publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_publisher_tModelInfos_get +GO + +-- ============================================= +-- Name: net_pubOperator_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_pubOperator_get' AND type = 'P') + DROP PROCEDURE net_pubOperator_get +GO + +CREATE PROCEDURE net_pubOperator_get + @publisherID bigint, + @operatorID bigint OUTPUT, + @replActive bit = 0 OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SET @replActive = 0 + + -- Validate operator / publisher association (replication only) + IF @publisherID IN (SELECT [publisherID] FROM [UDO_operators]) + BEGIN + SET @replActive = 1 + + IF @operatorID IS NULL + BEGIN + SELECT + @operatorID = [operatorID] + FROM + [UDO_operators] + WHERE + ([publisherID] = @publisherID) + END + + IF NOT EXISTS(SELECT * FROM [UDO_operators] WHERE [operatorID] = @operatorID AND [publisherID] = @publisherID) + BEGIN + SET @error = 60130 -- E_operatorMismatch + SET @context = 'Operator ''' + dbo.operatorName(@operatorID) + 'and PUID ''' + dbo.PUID(@publisherID) + ''' are not associated.' + GOTO errorLabel + END + END + ELSE + BEGIN + IF @operatorID IS NULL + SET @operatorID = dbo.currentOperatorID() + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_pubOperator_get +GO + +-- ============================================= +-- Section: Find routines +-- ============================================= + +-- ============================================= +-- Name: net_find_publisher_name +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_find_publisher_name' and type = 'P') + DROP PROCEDURE net_find_publisher_name +GO + +CREATE PROCEDURE net_find_publisher_name + @contextID uniqueidentifier, + @name nvarchar(450), + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @wildCardSarg nvarchar(451) + + DECLARE @tempIDs TABLE( + [publisherID] bigint, + [name] nvarchar(450)) + + SET @contextRows = (SELECT COUNT(*) FROM [UDS_pubResults] WHERE [contextID] = @contextID) + + -- + -- Do a wildcard search (default) + -- + + SET @wildCardSarg = @name + + IF dbo.containsWildcard(@name) = 0 + SET @wildCardSarg = @wildCardSarg + N'%' + + IF @contextRows = 0 + BEGIN + INSERT INTO @tempIDs( + [publisherID], + [name]) + SELECT + [publisherID], + [name] + FROM + [UDO_publishers] + WHERE + ([name] LIKE @wildCardSarg) + END + ELSE + BEGIN + INSERT INTO @tempIDs( + [publisherID], + [name]) + SELECT + [publisherID], + [name] + FROM + [UDO_publishers] + WHERE + ([publisherID] IN (SELECT [publisherID] FROM [UDS_pubResults] WHERE ([contextID] = @contextID))) AND + ([name] LIKE @wildCardSarg) + END + + INSERT [UDS_pubResults] ( + [contextID], + [publisherID]) + SELECT DISTINCT + @contextID, + [publisherID] + FROM + @tempIDs + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_publisher_name +GO + +-- ============================================= +-- Name: net_find_publisher_email +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_find_publisher_email' and type = 'P') + DROP PROCEDURE net_find_publisher_email +GO + +CREATE PROCEDURE net_find_publisher_email + @contextID uniqueidentifier, + @email nvarchar(450), + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @wildCardSarg nvarchar(451) + + DECLARE @tempIDs TABLE( + [publisherID] bigint, + [email] nvarchar(450)) + + SET @contextRows = (SELECT COUNT(*) FROM [UDS_pubResults] WHERE [contextID] = @contextID) + + -- + -- Do a wildcard search (default) + -- + + SET @wildCardSarg = @email + + IF dbo.containsWildcard(@email) = 0 + SET @wildCardSarg = @wildCardSarg + N'%' + + IF @contextRows = 0 + BEGIN + INSERT INTO @tempIDs( + [publisherID], + [email]) + SELECT + [publisherID], + [email] + FROM + [UDO_publishers] + WHERE + ([email] LIKE @wildCardSarg) + END + ELSE + BEGIN + INSERT INTO @tempIDs( + [publisherID], + [email]) + SELECT + [publisherID], + [email] + FROM + [UDO_publishers] + WHERE + ([publisherID] IN (SELECT [publisherID] FROM [UDS_pubResults] WHERE ([contextID] = @contextID))) AND + ([email] LIKE @wildCardSarg) + END + + INSERT [UDS_pubResults] ( + [contextID], + [publisherID]) + SELECT DISTINCT + @contextID, + [publisherID] + FROM + @tempIDs + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_publisher_email +GO + +-- ============================================= +-- Name: net_find_publisher_companyName +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_find_publisher_companyName' and type = 'P') + DROP PROCEDURE net_find_publisher_companyName +GO + +CREATE PROCEDURE net_find_publisher_companyName + @contextID uniqueidentifier, + @companyName nvarchar(100), + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @wildCardSarg nvarchar(451) + + DECLARE @tempIDs TABLE( + [publisherID] bigint, + [companyName] nvarchar(100)) + + SET @contextRows = (SELECT COUNT(*) FROM [UDS_pubResults] WHERE [contextID] = @contextID) + + -- + -- Do a wildcard search (default) + -- + + SET @wildCardSarg = @companyName + + IF dbo.containsWildcard(@companyName) = 0 + SET @wildCardSarg = @wildCardSarg + N'%' + + IF @contextRows = 0 + BEGIN + INSERT INTO @tempIDs( + [publisherID], + [companyName]) + SELECT + [publisherID], + [companyName] + FROM + [UDO_publishers] + WHERE + ([companyName] LIKE @wildCardSarg) + END + ELSE + BEGIN + INSERT INTO @tempIDs( + [publisherID], + [companyName]) + SELECT + [publisherID], + [companyName] + FROM + [UDO_publishers] + WHERE + ([publisherID] IN (SELECT [publisherID] FROM [UDS_pubResults] WHERE ([contextID] = @contextID))) AND + ([companyName] LIKE @wildCardSarg) + END + + INSERT [UDS_pubResults] ( + [contextID], + [publisherID]) + SELECT DISTINCT + @contextID, + [publisherID] + FROM + @tempIDs + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_publisher_companyName +GO + +-- ============================================= +-- Name: net_find_publisher_cleanup +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_publisher_cleanup' AND type = 'P') + DROP PROCEDURE net_find_publisher_cleanup +GO + +CREATE PROCEDURE net_find_publisher_cleanup + @contextID uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + -- Cleans up leftover rows in scratch table + DELETE + [UDS_pubResults] + WHERE + ([contextID] = @contextID) + + RETURN 0 +END -- net_find_publisher_cleanup +GO + +-- ============================================= +-- Name: net_find_publisher_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_publisher_commit' AND type = 'P') + DROP PROCEDURE net_find_publisher_commit +GO + +CREATE PROCEDURE net_find_publisher_commit + @contextID uniqueidentifier, + @sortByNameAsc bit = 1, + @sortByEmailAsc bit = 0, + @sortByCompanyNameAsc bit = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + SET @contextRows = (SELECT COUNT(*) FROM [UDS_pubResults] WHERE [contextID] = @contextID) + + IF @contextRows = 0 + RETURN 0 + + DECLARE @tempIDs TABLE ( + [seqNo] bigint IDENTITY PRIMARY KEY , + [publisherID] bigint, + [PUID] nvarchar(450) NULL, + [name] nvarchar(450) NULL, + [email] nvarchar(450) NULL, + [companyName] nvarchar(100) NULL) + + -- Set default sorting option + IF (@sortByNameAsc = 0) AND (@sortByEmailAsc = 0) AND (@sortByCompanyNameAsc = 0) + SET @sortByNameAsc = 1 + + -- sortByNameAsc + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempIDs( + [publisherID], + [PUID], + [name], + [email], + [companyName]) + SELECT DISTINCT + PR.[publisherID], + PU.[PUID], + PU.[name], + PU.[email], + PU.[companyName] + FROM + [UDS_pubResults] PR + JOIN [UDO_publishers] PU ON PR.[publisherID] = PU.[publisherID] + WHERE + (PR.[contextID] = @contextID) + ORDER BY + 3 ASC + + GOTO endLabel + END + + -- sortByEmailAsc + IF (@sortByEmailAsc = 1) + BEGIN + INSERT @tempIDs( + [publisherID], + [PUID], + [name], + [email], + [companyName]) + SELECT DISTINCT + PR.[publisherID], + PU.[PUID], + PU.[name], + PU.[email], + PU.[companyName] + FROM + [UDS_pubResults] PR + JOIN [UDO_publishers] PU ON PR.[publisherID] = PU.[publisherID] + WHERE + (PR.[contextID] = @contextID) + ORDER BY + 4 ASC + + GOTO endLabel + END + + -- sortByCompanyNameAsc + IF (@sortByCompanyNameAsc = 1) + BEGIN + INSERT @tempIDs( + [publisherID], + [PUID], + [name], + [email], + [companyName]) + SELECT DISTINCT + PR.[publisherID], + PU.[PUID], + PU.[name], + PU.[email], + PU.[companyName] + FROM + [UDS_pubResults] PR + JOIN [UDO_publishers] PU ON PR.[publisherID] = PU.[publisherID] + WHERE + (PR.[contextID] = @contextID) + ORDER BY + 5 ASC + + GOTO endLabel + END + +endLabel: + -- Return results + SELECT + [PUID], + [email], + [name], + [companyName] + FROM + @tempIDs + + -- Run cleanup + EXEC net_find_publisher_cleanup @contextID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_publisher_commit +GO + +-- ============================================= +-- Section: Publisher assertions +-- ============================================= + +-- ============================================= +-- Name: net_publisher_assertion_save +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_publisher_assertion_save' and type = 'P') + DROP PROCEDURE net_publisher_assertion_save +GO + +CREATE PROCEDURE net_publisher_assertion_save + @PUID nvarchar(450), + @fromKey uniqueidentifier, + @toKey uniqueidentifier, + @tModelKey uniqueidentifier, + @keyName nvarchar(225), + @keyValue nvarchar(225), + @flag int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID bigint, + @completionStatus int, + @rows int, + @keyOwnership int + + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60140 + SET @context = 'Unknown publisher.' + GOTO errorLabel + END + + -- Check for required parameters + IF (@fromKey IS NULL) + BEGIN + SET @error=60050 -- E_unsupported + SET @context='fromKey is required' + GOTO errorLabel + END + + IF (@toKey IS NULL) + BEGIN + SET @error=60050 -- E_unsupported + SET @context='toKey is required' + GOTO errorLabel + END + + IF (@keyName IS NULL) + BEGIN + SET @error=60050 -- E_unsupported + SET @context='keyName is required' + GOTO errorLabel + END + + IF (@keyValue IS NULL) + BEGIN + SET @error=60050 -- E_unsupported + SET @context='keyValue is required' + GOTO errorLabel + END + + IF (@tModelKey IS NULL) + BEGIN + SET @error=60050 -- E_unsupported + SET @context='tModelKey is required' + GOTO errorLabel + END + + -- Check to see if tModelKey is a valid tModelKey + IF NOT EXISTS(SELECT * FROM [UDC_tModels] WHERE [tModelKey] = @tModelKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = ' Invalid tModelKey=' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + -- Check to see if fromKey is a valid business key + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @fromKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = ' Invalid fromKey=' + dbo.UUIDSTR(@fromKey) + GOTO errorLabel + END + + -- Check to see if toKey is a valid business key + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @toKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = ' Invalid toKey=' + dbo.UUIDSTR(@toKey) + GOTO errorLabel + END + + -- We want to determine what keys this publisher owns. @keyOwnership = 0 if the publisher does not own any + -- any keys, 0x2 if it owns the fromKey, 0x1 if it owns the toKey and 0x3 if it owns both keys. + + -- Check to see if the publisher owns the fromKey + SET @keyOwnership = 0 + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @fromKey AND [publisherID] = @publisherID) + SET @keyOwnership = @keyOwnership | 0x2 + + -- Check to see if the publisher owns the toKey + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @toKey AND [publisherID] = @publisherID) + SET @keyOwnership = @keyOwnership | 0x1 + + -- If the owner does not own either key, then it is an error + IF @keyOwnership = 0 + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'Publisher must own at least one of the businesses involved in a publisher assertion (fromKey=''' + dbo.UUIDSTR(@fromKey) + ''', toKey=''' + dbo.UUIDSTR(@toKey) + ''', tModelKey=''' + dbo.UUIDSTR(@tModelKey) + ''', keyName=''' + @keyName + ''', keyValue=''' + @keyValue + ''')' + GOTO errorLabel + END + + -- @flag is the status of the assertion as passed in by the caller. + + IF @flag IS NULL + BEGIN + -- If @flag is NULL, then we should determine the status based on key ownership. + -- If the caller owns the formKey, the status of this assertion is set to status:toKey_incomplete (2). If the caller owns the toKey, the status of the assertion is set to + -- status:fromKey_incomplete (1). If the caller owns both keys, then the status is set to status:complete (3). + SET @completionStatus = @keyOwnership + END + ELSE + BEGIN + -- The caller has specified a status value for this assertion. This will usually happen we this assertion is being saved during + -- a replication cycle. We have to make sure that the key ownership is compatible with the flag passed. Unless the publisher + -- owns both keys, @flag and @keyOwnership have to be of the same value. + IF @flag <> @keyOwnership AND @keyOwnership <> 0x3 + BEGIN + SET @error = 60140 -- E_userMismatch + + -- Note that varchar(15) is just a safe choice of size; @flag should only ever be a single digit integer. + SET @context = 'This publisher is not allowed to save this assertion in this state: ' + CAST(@flag AS varchar(15)) + '.' + GOTO errorLabel + END + + SET @completionStatus = @flag + END + -- At this point, @completionStatus now holds the status of this assertion that we are saving. + + -- Check to see if the assertion already exists. + SELECT + @rows = COUNT(*) + FROM + [UDC_assertions_BE] + WHERE + ([fromKey] = @fromKey) AND + ([tModelKey] = @tModelKey) AND + ([keyName] = @keyName) AND + ([keyValue] = @keyValue) AND + ([toKey] = @toKey) + + IF @rows = 0 + BEGIN + -- Add the new assertion + INSERT [UDC_assertions_BE]( + [fromKey], + [toKey], + [tModelKey], + [keyName], + [keyValue], + [flag]) + VALUES( + @fromKey, + @toKey, + @tModelKey, + @keyName, + @keyValue, + @completionStatus) + END + ELSE + BEGIN + -- Update the existing assertion + UPDATE + [UDC_assertions_BE] + SET + [flag] = [flag] | @completionStatus + WHERE + ([fromKey] = @fromKey) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + ([keyName] = @keyName) AND + ([toKey] = @toKey) + END + + SET @flag = @completionStatus + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_publisher_assertion_save +GO + +-- ============================================= +-- Name: net_publisher_assertion_delete +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_publisher_assertion_delete' and type = 'P') + DROP PROCEDURE net_publisher_assertion_delete +GO + +CREATE PROCEDURE net_publisher_assertion_delete + @PUID nvarchar(450), + @fromKey uniqueidentifier, + @toKey uniqueidentifier, + @tModelKey uniqueidentifier, + @keyName nvarchar(225), + @keyValue nvarchar(225), + @flag int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID bigint, + @completionStatus int, + @rows int, + @keyOwnership int + + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Unknown publisher.' + GOTO errorLabel + END + + -- Make sure the assertion exists + SELECT + @rows = COUNT(*) + FROM + [UDC_assertions_BE] + WHERE + ([fromKey] = @fromKey) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + ([toKey] = @toKey) + + IF @rows = 0 + BEGIN + SET @error = 80000 -- E_assertionNotFound + SET @context = 'Publisher assertion not found (fromKey=''' + dbo.UUIDSTR(@fromKey) + ''', toKey=''' + dbo.UUIDSTR(@toKey) + ''', tModelKey=''' + dbo.UUIDSTR(@tModelKey) + ''', keyName=''' + @keyName + ''', keyValue=''' + @keyValue + ''')' + GOTO errorLabel + END + + + -- We want to determine what keys this publisher owns. @keyOwnership = 0 if the publisher does not own any + -- any keys, 0x2 if it owns the fromKey, 0x1 if it owns the toKey and 0x3 if it owns both keys. + + -- Check to see if the publisher owns the fromKey + SET @keyOwnership = 0 + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @fromKey AND [publisherID] = @publisherID) + SET @keyOwnership = @keyOwnership | 0x2 + + -- Check to see if the publisher owns the toKey + IF EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @toKey AND [publisherID] = @publisherID) + SET @keyOwnership = @keyOwnership | 0x1 + + -- If the owner does not own either key, then it is an error + IF @keyOwnership = 0 + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'Publisher must own at least one of the businesses involved in a publisher assertion (fromKey=''' + dbo.UUIDSTR(@fromKey) + ''', toKey=''' + dbo.UUIDSTR(@toKey) + ''', tModelKey=''' + dbo.UUIDSTR(@tModelKey) + ''', keyName=''' + @keyName + ''', keyValue=''' + @keyValue + ''')' + GOTO errorLabel + END + + -- @flag represents the side that the caller wants to delete + IF @flag IS NULL + BEGIN + SET @completionStatus = @keyOwnership + END + ELSE + BEGIN + -- The caller has specified what side that they want to delete. This will usually happen when this assertion is being deleted + -- during a replication cycle. We have to make sure that the key ownership is compatible with the side the user wants to delete. + -- Unless the publisher owns both keys, @flag and @keyOwnership have to be of the same value. + IF @flag <> @keyOwnership AND @keyOwnership <> 0x3 + BEGIN + SET @error = 60140 -- E_userMismatch + + -- Note that varchar(15) is just a safe choice of size; @flag should only ever be a single digit integer. + SET @context = 'This publisher is not allowed to set this assertion to this state: ' + CAST(@flag AS varchar(15)) + '.' + GOTO errorLabel + END + + SET @completionStatus = @flag + END + + -- Get the assertion completion status flag + SELECT + @flag = [flag] + FROM + [UDC_assertions_BE] + WHERE + ([fromKey] = @fromKey) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + ([toKey] = @toKey) + + -- Check to see if we have to remove the assertion completely or just update it + IF (@flag = @completionStatus) OR (@completionStatus = 0x3 AND @keyOwnership = 0x3) + BEGIN + -- Remove the assertion from the database completely + DELETE + [UDC_assertions_BE] + WHERE + ([fromKey] = @fromKey) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + ([toKey] = @toKey) + END + ELSE + BEGIN + -- If the assertion is not complete, the wrong publisher must be trying to delete this assertion, so throw an error + IF @flag <> 0x3 AND @keyOwnership <> 0x3 + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'This publisher is not allowed to delete this assertion.' + GOTO errorLabel + END + + -- Remove the publisher's portion of the assertion + UPDATE + [UDC_assertions_BE] + SET + [flag] = @flag & (~@completionStatus) + WHERE + ([fromKey] = @fromKey) AND + ([tModelKey] = @tModelKey) AND + ([keyValue] = @keyValue) AND + ([toKey] = @toKey) + END + + SET @flag = @completionStatus + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 + +END -- net_publisher_assertion_delete +GO + +-- ============================================= +-- Name: net_publisher_assertions_get +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_publisher_assertions_get' and type = 'P') + DROP PROCEDURE net_publisher_assertions_get +GO + +CREATE PROCEDURE net_publisher_assertions_get + @PUID nvarchar(450), + @authorizedName nvarchar(4000) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID bigint + + DECLARE @report TABLE( + [seqNo] bigint, + [fromKey] uniqueidentifier, + [toKey] uniqueidentifier, + [keyName] nvarchar(225), + [keyValue] nvarchar(225), + [tModelKey] uniqueidentifier) + + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60140 + SET @context = 'Unknown publisher.' + GOTO errorLabel + END + + SET @authorizedName = dbo.publisherName(@publisherID) + + INSERT @report( + [seqNo], + [fromKey], + [toKey], + [keyName], + [keyValue], + [tModelKey]) + SELECT + PA.[seqNo], + PA.[fromKey], + PA.[toKey], + PA.[keyName], + PA.[keyValue], + PA.[tModelKey] + FROM + [UDC_assertions_BE] PA + JOIN [UDC_businessEntities] BE ON PA.[fromKey] = BE.[businessKey] + WHERE + (BE.[publisherID] = @publisherID) AND + (PA.[flag] & 0x2 = 0x2) + UNION ALL + SELECT + PA.[seqNo], + PA.[fromKey], + PA.[toKey], + PA.[keyName], + PA.[keyValue], + PA.[tModelKey] + FROM + [UDC_assertions_BE] PA + JOIN [UDC_businessEntities] BE ON PA.[toKey] = BE.[businessKey] + WHERE + (BE.[publisherID] = @publisherID) AND + (PA.[flag] & 0x1 = 0x1) + + SELECT DISTINCT + [fromKey], + [toKey], + [keyName], + [keyValue], + [tModelKey], + [seqNo] + FROM + @report + ORDER BY + [seqNo] ASC + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 + +END -- net_publisher_assertions_get +GO + +-- ============================================= +-- Name: net_publisher_assertionStatus_get +-- ============================================= + +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_publisher_assertionStatus_get' and type = 'P') + DROP PROCEDURE net_publisher_assertionStatus_get +GO + +CREATE PROCEDURE net_publisher_assertionStatus_get + @PUID nvarchar(450), + @completionStatus int = NULL +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID int + + DECLARE @report TABLE( + [fromKey] uniqueidentifier, + [toKey] uniqueidentifier, + [keyName] nvarchar(225), + [keyValue] nvarchar(225), + [tModelKey] uniqueidentifier, + [flag] int, + [seqNo] bigint) + + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60140 + SET @context = 'Unknown publisher.' + GOTO errorLabel + END + + IF @completionStatus IS NULL + BEGIN + -- Get all assertions for this publisher regardless of completionStatus + INSERT @report( + [fromKey], + [toKey], + [keyName], + [keyValue], + [tModelKey], + [flag], + [seqNo]) + SELECT + PA.[fromKey], + PA.[toKey], + PA.[keyName], + PA.[keyValue], + PA.[tModelKey], + PA.[flag], + PA.[seqNo] + FROM + [UDC_assertions_BE] PA + JOIN [UDC_businessEntities] BE ON PA.[fromKey] = BE.[businessKey] + WHERE + (BE.[publisherID] = @publisherID) + UNION ALL + SELECT + PA.[fromKey], + PA.[toKey], + PA.[keyName], + PA.[keyValue], + PA.[tModelKey], + PA.[flag], + PA.[seqNo] + FROM + [UDC_assertions_BE] PA + JOIN [UDC_businessEntities] BE ON PA.[toKey] = BE.[businessKey] + WHERE + (BE.[publisherID] = @publisherID) + END + ELSE + BEGIN + -- Get all assertions for this publisher for a specific completionStatus + INSERT @report( + [fromKey], + [toKey], + [keyName], + [keyValue], + [tModelKey], + [flag], + [seqNo]) + SELECT + PA.[fromKey], + PA.[toKey], + PA.[keyName], + PA.[keyValue], + PA.[tModelKey], + PA.[flag], + PA.[seqNo] + FROM + [UDC_assertions_BE] PA + JOIN [UDC_businessEntities] BE ON PA.[fromKey] = BE.[businessKey] + WHERE + (BE.[publisherID] = @publisherID) AND + (PA.[flag] = @completionStatus) + UNION ALL + SELECT + PA.[fromKey], + PA.[toKey], + PA.[keyName], + PA.[keyValue], + PA.[tModelKey], + PA.[flag], + PA.[seqNo] + FROM + [UDC_assertions_BE] PA + JOIN [UDC_businessEntities] BE ON PA.[toKey] = BE.[businessKey] + WHERE + (BE.[publisherID] = @publisherID) AND + (PA.[flag] = @completionStatus) + END + + SELECT DISTINCT + [fromKey], + [toKey], + [keyName], + [keyValue], + [tModelKey], + [flag], + dbo.ownerFlag(@publisherID,[fromKey],[toKey]) AS [ownerFlag], + [seqNo] + FROM + @report + ORDER BY + 8 ASC + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 + +END -- net_publisher_assertionStatus_get +GO + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.repl.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.repl.sql new file mode 100644 index 0000000..b20cd55 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.repl.sql @@ -0,0 +1,1003 @@ +-- Script: uddi.v2.repl.sql +-- Author: LRDohert@Microsoft.com +-- Description: Creates replication stored procedures. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Update routines +-- ============================================= + +-- ============================================= +-- Name: net_changeRecord_save +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_changeRecord_save' AND type = 'P') + DROP PROCEDURE net_changeRecord_save +GO + +CREATE PROCEDURE net_changeRecord_save + @USN bigint = NULL, -- NULL for local changeRecords + @PUID nvarchar(450) = NULL, -- NULL for remote changeRecords + @delegatePUID nvarchar(450) = NULL, -- NULL for remote changeRecords or local changeRecords with no delegate + @operatorKey uniqueidentifier = NULL, -- NULL for local changeRecords + @entityKey uniqueidentifier = NULL, -- entityKey for top-level entity in changeRecord + @entityTypeID tinyint = NULL, -- entityType for top-level entity in changeRecord + @changeTypeID tinyint, -- changeType for current save operation + @contextID uniqueidentifier, -- contextID for current save operation + @contextTypeID tinyint, -- contextType for current save operation + @lastChange bigint, -- timestamp for changeRecord + @changeData ntext, -- payload for current save operation + @flag int = 0, -- for future use + @seqNo bigint OUTPUT -- seqNo of newly created changeRecord +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID bigint, + @delegatePublisherID bigint, + @operatorID bigint, + @RC int + + -- Validate parameters + IF (@PUID IS NOT NULL) AND (@operatorKey IS NOT NULL) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Must pass either @PUID (local) or @operatorKey (remote).' + GOTO errorLabel + END + + IF (@operatorKey IS NOT NULL) + BEGIN + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = '@operatorKey = ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + SELECT + @PUID = PU.[PUID] + FROM + [UDO_publishers] PU + JOIN [UDO_operators] OP ON PU.[publisherID] = OP.[publisherID] + WHERE + (OP.[operatorID] = @operatorID) + + IF @delegatePUID IS NOT NULL + BEGIN + SET @error = 50009 -- E_parmError + SET @context = '@delegatePUID not valid for remote changeRecords.' + GOTO errorLabel + END + + SET @publisherID = dbo.publisherID(@PUID) + END -- @operatorKey + ELSE + BEGIN -- Local change records + IF @delegatePUID IS NOT NULL + BEGIN + SET @delegatePublisherID = dbo.publisherID(@delegatePUID) + + IF @delegatePublisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Invalid delegate PUID. Delegates must be registered as publishers prior to impersonating other users.' + GOTO errorLabel + END + END + + IF @PUID IS NULL + SET @publisherID = dbo.currentOperatorID() + ELSE + SET @publisherID = dbo.publisherID(@PUID) + END + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Invalid PUID.' + GOTO errorLabel + END + ELSE + + -- Insert changeRecord + INSERT [UDO_changeLog] ( + [USN], + [newSeqNo], + [publisherID], + [delegatePublisherID], + [entityKey], + [entityTypeID], + [changeTypeID], + [contextID], + [contextTypeID], + [lastChange], + [changeData], + [flag]) + VALUES ( + @USN, + NULL, + @publisherID, + @delegatePublisherID, + @entityKey, + @entityTypeID, + @changeTypeID, + @contextID, + @contextTypeID, + @lastChange, + @changeData, + @flag) + + SET @seqNo = @@IDENTITY + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_changeRecord_save +GO + +-- ============================================= +-- Name: net_changeRecord_update +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_changeRecord_update' AND type = 'P') + DROP PROCEDURE net_changeRecord_update +GO + +CREATE PROCEDURE net_changeRecord_update + @seqNo bigint = NULL, -- NULL for remote changeRecords + @USN bigint = NULL, -- NULL for local changeRecords + @operatorKey uniqueidentifier = NULL, -- NULL for local changeRecords + @newSeqNo bigint = NULL, -- seqNo of corrected changeRecord + @flag int = NULL -- updated flag value +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint + + -- Check parameters + IF @seqNo IS NOT NULL AND @USN IS NOT NULL + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Procedure accepts either @seqNo or @USN parameters, not both.' + GOTO errorLabel + END + + IF @newSeqNo IS NOT NULL + BEGIN + IF NOT EXISTS(SELECT [seqNo] FROM [UDO_changeLog] WHERE (([seqNo] = @newSeqNo) AND ([changeTypeID] = dbo.changeTypeID('changeRecordCorrection')))) + BEGIN + SET @error = 50015 -- E_invalidSeqNo + SET @context = '@newSeqNo = ' + CAST(@newSeqNo AS varchar(256)) + GOTO errorLabel + END + END + + IF @seqNo IS NOT NULL + BEGIN + UPDATE [UDO_changeLog] SET + [newSeqNo] = ISNULL(@newSeqNo, [newSeqNo]), + [flag] = ISNULL(@flag, [flag]) + WHERE + ([seqNo] = @seqNo) AND + ([changeTypeID] <> dbo.changeTypeID('changeRecordCorrection')) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 50015 -- E_invalidSeqNo + SET @context = 'changeRecord for seqNo = ' + CAST(@seqNo AS varchar(256)) + ' is invalid.' + GOTO errorLabel + END + END + + IF @USN IS NOT NULL + BEGIN + IF @operatorKey IS NULL + BEGIN + SET @error = 50009 -- E_parmError + SET @context = '@operatorKey required when annotating a USN.' + END + + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Unknown operatorKey: ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + SET @publisherID = dbo.getOperatorPublisherID(@operatorID) + + UPDATE [UDO_changeLog] SET + [newSeqNo] = ISNULL(@newSeqNo, [newSeqNo]), + [flag] = ISNULL(@flag, [flag]) + WHERE + ([USN] = @USN) AND + ([publisherID] = @publisherID) AND + ([changeTypeID] <> dbo.changeTypeID('changeRecordCorrection')) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 50015 -- E_invalidSeqNo + SET @context = 'changeRecord for USN = ' + CAST(@USN AS varchar(256)) + ' is invalid.' + GOTO errorLabel + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_changeRecord_update +GO + +-- ============================================= +-- Section: Find and get routines +-- ============================================= + +-- ============================================= +-- Name: net_find_changeRecords +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_changeRecords' AND type = 'P') + DROP PROCEDURE net_find_changeRecords +GO + +CREATE PROCEDURE net_find_changeRecords + @contextID uniqueidentifier, -- contextID of current find operation + @operatorKey uniqueidentifier, -- operatorKey for source operator node + @startUSN bigint, -- low end of USN range, NULL for 0 + @stopUSN bigint, -- high end of USN range, NULL for max + @rows bigint OUTPUT -- rows added to UDS_findResults +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint, + @i int + + SET @rows = 0 + + IF @startUSN > @stopUSN + BEGIN + SET @error = 50009 -- E_parmError + SET @context = '@startUSN must be less than or equal to @stopUSN.' + GOTO errorLabel + END + + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'operatorKey = ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + SET @publisherID = dbo.getOperatorPublisherID(@operatorID) + + IF (@operatorID = dbo.currentOperatorID()) + BEGIN + -- Find changeRecords for the local operator + INSERT [UDS_replResults] ( + [contextID], + [seqNo]) + SELECT + @contextID, + [seqNo] + FROM + [UDO_changeLog] + WHERE + ([seqNo] BETWEEN @startUSN and @stopUSN) AND + ([USN] IS NULL) + ORDER BY + [seqNo] ASC + END + ELSE + BEGIN + INSERT [UDS_replResults] ( + [contextID], + [seqNo]) + SELECT + @contextID, + [seqNo] + FROM + [UDO_changeLog] + WHERE + ([USN] BETWEEN @startUSN and @stopUSN) AND + ([publisherID] = @publisherID) + ORDER BY + [seqNo] ASC + END + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_changeRecords +GO + +-- ============================================= +-- Name: net_find_changeRecords_cleanup +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_changeRecords_cleanup' AND type = 'P') + DROP PROCEDURE net_find_changeRecords_cleanup +GO + +CREATE PROCEDURE net_find_changeRecords_cleanup + @contextID uniqueidentifier -- contextID of current find operation +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + DELETE + [UDS_replResults] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_changeRecords_cleanup +GO + + +-- ============================================= +-- Name: net_find_changeRecords_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_changeRecords_commit' AND type = 'P') + DROP PROCEDURE net_find_changeRecords_commit +GO + +CREATE PROCEDURE net_find_changeRecords_commit + @contextID uniqueidentifier, -- contextID of current find operation + @responseLimitCount bigint -- limits number of rows returned, 0 for all +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @RC int, + @changeRecord cursor, + @seqNo bigint, + @USN bigint, + @newSeqNo bigint, + @publisherID bigint, + @changeDataSeqNo bigint, + @flag int, + @rowNum bigint + + CREATE TABLE #tempResults ( + [seqNo] bigint, + [USN] bigint, + [newSeqNo] bigint, + [publisherID] bigint, + [changeDataSeqNo] bigint, + [flag] int) + + -- Set responseLimitCount + IF ISNULL(@responseLimitCount,0) = 0 + SET @responseLimitCount = ISNULL(dbo.configValue('Replication.ResponseLimitCountDefault'),1000) + + SET @changeRecord = CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR + SELECT DISTINCT + CL.[seqNo], + CL.[USN], + CL.[newSeqNo], + CL.[publisherID], + CL.[flag] + FROM + [UDO_changeLog] CL + JOIN [UDS_replResults] RR ON CL.[seqNo] = RR.[seqNo] + WHERE + (RR.[contextID] = @contextID) + ORDER BY + 1 ASC + + OPEN @changeRecord + FETCH NEXT FROM @changeRecord INTO + @seqNo, + @USN, + @newSeqNo, + @publisherID, + @flag + + SET @rowNum = 0 + + WHILE @@FETCH_STATUS = 0 + BEGIN + SET @rowNum = @rowNum + 1 + + IF @rowNum > @responseLimitCount + BREAK + + IF @newSeqNo IS NULL + SET @changeDataSeqNo = @seqNo + ELSE + SET @changeDataSeqNo = @newSeqNo + + INSERT #tempResults( + [seqNo], + [USN], + [newSeqNo], + [publisherID], + [changeDataSeqNo], + [flag]) + VALUES ( + @seqNo, + @USN, + @newSeqNo, + @publisherID, + @changeDataSeqNo, + @flag) + + FETCH NEXT FROM @changeRecord INTO + @seqNo, + @USN, + @newSeqNo, + @publisherID, + @flag + END + + CLOSE @changeRecord + + SELECT + TR.[seqNo] AS [seqNo], + ISNULL(TR.[USN], TR.[seqNo]) AS [USN], + dbo.operatorKey(dbo.getPublisherOperatorID(TR.[publisherID])) AS [operatorKey], + CL.[changeData] AS [changeData], + CL.[changeTypeID] AS [changeTypeID], + TR.[flag] AS [flag] + FROM + #tempResults TR + JOIN [UDO_changeLog] CL ON TR.[changeDataSeqNo] = CL.[seqNo] + ORDER BY + 1 ASC + + EXEC @RC=net_find_changeRecords_cleanup @contextID + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_changeRecords_commit +GO + +-- ============================================= +-- Section: Operator routines +-- ============================================= + +-- ============================================= +-- Name: net_operator_save +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_operator_save' AND type = 'P') + DROP PROCEDURE net_operator_save +GO + +CREATE PROCEDURE net_operator_save + @operatorKey uniqueidentifier, -- insert only + @PUID nvarchar(450) = NULL, -- insert only + @operatorStatusID tinyint = NULL, -- insert / update (NULL for no change) + @name nvarchar(450) = NULL, -- insert / update (NULL for no change) + @soapReplicationURL nvarchar(4000) = NULL, -- insert / update (NULL for no change) + @businessKey uniqueidentifier = NULL, -- insert / update (NULL for no change) + @certSerialNo nvarchar(450) = NULL, -- insert / update (NULL for no change) + @certIssuer nvarchar(225) = NULL, -- insert / update (NULL for no change) + @certSubject nvarchar(225) = NULL, -- insert / update (NULL for no change) + @certificate image -- insert / update (always required) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @publisherID bigint, + @oldOperatorStatusID tinyint, + @oldName nvarchar(4000), + @oldBusinessKey uniqueidentifier, + @oldSoapReplicationURL nvarchar(4000), + @oldCertSerialNo nvarchar(450), + @oldCertIssuer nvarchar(225), + @oldCertSubject nvarchar(225) + + IF EXISTS(SELECT * FROM [UDO_operators] WHERE [operatorKey] = @operatorKey) + BEGIN + -- Update Logic + SELECT + @oldOperatorStatusID = [operatorStatusID], + @oldName = [name], + @oldBusinessKey = [businessKey], + @oldSoapReplicationURL = [soapReplicationURL], + @oldCertSerialNo = [certSerialNo], + @oldCertIssuer = [certIssuer], + @oldCertSubject = [certSubject] + FROM + [UDO_operators] + WHERE + ([operatorKey] = @operatorKey) + + UPDATE + [UDO_operators] + SET + [operatorStatusID] = ISNULL(@operatorStatusID, @oldOperatorStatusID), + [name] = ISNULL(@name, @oldName), + [businessKey] = ISNULL(@businessKey, @oldBusinessKey), + [soapReplicationURL] = ISNULL(@soapReplicationURL, @oldSoapReplicationURL), + [certSerialNo] = ISNULL(@certSerialNo, @oldCertSerialNo), + [certIssuer] = ISNULL(@certIssuer, @oldCertIssuer), + [certSubject] = ISNULL(@certSubject, @oldCertSubject), + [certificate] = @certificate + WHERE + ([operatorKey] = @operatorKey) + END + ELSE + BEGIN + -- Insert Logic + + -- Validate @publisherID + IF @PUID IS NOT NULL + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = '' + GOTO errorLabel + END + + IF EXISTS(SELECT * FROM [UDO_operators] WHERE [publisherID] = @publisherID) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'Publisher is already being used by another operator.' + GOTO errorLabel + END + + INSERT [UDO_operators]( + [operatorKey], + [publisherID], + [operatorStatusID], + [name], + [businessKey], + [soapReplicationURL], + [certSerialNo], + [certIssuer], + [certSubject], + [certificate], + [flag]) + VALUES( + @operatorKey, + @publisherID, + ISNULL(@operatorStatusID,dbo.operatorStatusID('new')), + @name, + @businessKey, + @soapReplicationURL, + @certSerialNo, + @certIssuer, + @certSubject, + @certificate, + 0) + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_operator_save +GO + +-- ============================================= +-- Name: net_operator_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_operator_get' AND type = 'P') + DROP PROCEDURE net_operator_get +GO + +CREATE PROCEDURE net_operator_get + @operatorKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + -- Gets a single operator + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint + + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Invalid operatorKey: ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + SELECT + [operatorStatusID], + [name], + [soapReplicationURL], + [certSerialNo], + [certIssuer], + [certSubject], + [certificate] + FROM + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_operator_get +GO + +-- ============================================= +-- Name: net_operators_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_operators_get' AND type = 'P') + DROP PROCEDURE net_operators_get +GO + +CREATE PROCEDURE net_operators_get +WITH ENCRYPTION +AS +BEGIN + -- Gets all operators + + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + [operatorKey], + [operatorStatusID], + [name], + [soapReplicationURL] + FROM + [UDO_operators] + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_operators_get +GO + +-- ============================================= +-- Name: net_operator_delete +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_operator_delete' AND type = 'P') + DROP PROCEDURE net_operator_delete +GO + +CREATE PROCEDURE net_operator_delete + @operatorKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + -- Gets a single operator + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint + + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'Invalid operatorKey: ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + DELETE + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_operator_delete +GO + +-- ============================================= +-- Name: net_highWaterMarks_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_highWaterMarks_get' AND type = 'P') + DROP PROCEDURE net_highWaterMarks_get +GO + +CREATE PROCEDURE net_highWaterMarks_get +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @currentOperatorID bigint, + @operatorID bigint, + @rows bigint, + @operatorCursor cursor + + DECLARE @results TABLE( + [operatorKey] uniqueidentifier, + [USN] bigint) + + -- Calculate current highWaterMark for local operator + SET @currentOperatorID = dbo.currentOperatorID() + + SELECT + @rows = MAX([seqNo]) + FROM + [UDO_changeLog] + WHERE + ([publisherID] NOT IN (SELECT [publisherID] FROM [UDO_operators] WHERE [operatorID] <> @currentOperatorID)) + + INSERT @results VALUES( + dbo.operatorKey(@currentOperatorID), + ISNULL(@rows,0)) + + SET @operatorCursor = CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR + SELECT + [operatorID] + FROM + [UDO_operators] + WHERE + [operatorID] <> @currentOperatorID + + OPEN @operatorCursor + + FETCH NEXT FROM @operatorCursor INTO + @operatorID + + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT + @rows = MAX([USN]) + FROM + [UDO_changeLog] + WHERE + ([publisherID] = dbo.getOperatorPublisherID(@operatorID)) + + INSERT @results VALUES( + dbo.operatorKey(@operatorID), + ISNULL(@rows,0)) + + FETCH NEXT FROM @operatorCursor INTO + @operatorID + END + + CLOSE @operatorCursor + + SELECT * FROM @results + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_highWaterMarks_get +GO + +-- ============================================= +-- Name: net_operatorLog_save +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_operatorLog_save' AND type = 'P') + DROP PROCEDURE net_operatorLog_save +GO + +CREATE PROCEDURE net_operatorLog_save + @operatorKey uniqueidentifier, + @replStatusID tinyint, + @description nvarchar(4000) = NULL, + @lastOperatorKey uniqueidentifier = NULL, + @lastUSN bigint = NULL, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint + + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'operatorKey = ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + INSERT [UDO_operatorLog] ( + [operatorID], + [replStatusID], + [description], + [lastOperatorKey], + [lastUSN], + [lastChange]) + VALUES ( + @operatorID, + @replStatusID, + @description, + @lastOperatorKey, + @lastUSN, + @lastChange) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_operatorLog_save +GO + +-- ============================================= +-- Name: net_operatorLogLast_get +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_operatorLogLast_get' AND type = 'P') + DROP PROCEDURE net_operatorLogLast_get +GO + +CREATE PROCEDURE net_operatorLogLast_get + @operatorKey uniqueidentifier, + @inboundStatus bit, -- specifies whether we want last inbound or outbound status + @replStatusID tinyint OUTPUT, + @description nvarchar(4000) OUTPUT, + @lastOperatorKey uniqueidentifier OUTPUT, + @lastUSN bigint OUTPUT, + @lastChange bigint OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint, + @maxSeqNo bigint + + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'operatorKey = ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + IF (@inboundStatus = 0) + BEGIN + SELECT + @maxSeqNo = MAX([seqNo]) + FROM + [UDO_operatorLog] + WHERE + ([operatorID] = @operatorID) AND + ([replStatusID] < 128 ) + END + ELSE + BEGIN + SELECT + @maxSeqNo = MAX([seqNo]) + FROM + [UDO_operatorLog] + WHERE + ([operatorID] = @operatorID) AND + ([replStatusID] >= 128 ) + END + + IF @maxSeqNo IS NOT NULL + BEGIN + SELECT + @replStatusID = [replStatusID], + @description = [description], + @lastOperatorKey = [lastOperatorKey], + @lastUSN = [lastUSN], + @lastChange = [lastChange] + FROM + [UDO_operatorLog] + WHERE + ([operatorID] = @operatorID) AND + ([seqNo] = @maxSeqNo) + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_operatorLogLast_get +GO + +-- ============================================= +-- Name: net_operatorCert_get +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_operatorCert_get' AND type = 'P') + DROP PROCEDURE net_operatorCert_get +GO + +CREATE PROCEDURE net_operatorCert_get + @certSerialNo nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint + + SELECT + @operatorID = [operatorID] + FROM + [UDO_operators] + WHERE + ([certSerialNo] = @certSerialNo) + + IF (@operatorID IS NULL) + BEGIN + SET @error = 50016 -- E_invalidCert + SET @context = 'Certificate Serial Number not valid.' + GOTO errorLabel + END + + SELECT + [operatorKey], + [certificate] + FROM + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_operatorCert_get +GO diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.ri.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.ri.sql new file mode 100644 index 0000000..0307ac2 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.ri.sql @@ -0,0 +1,483 @@ +/* + Thursday, October 18, 2001 3:11:31 PM + User: + Server: LRDOHERT-LAP + Database: uddi_v2 + Application: MS SQLEM - Data Tools +*/ + +BEGIN TRANSACTION +SET QUOTED_IDENTIFIER ON +SET TRANSACTION ISOLATION LEVEL SERIALIZABLE +SET ARITHABORT ON +SET NUMERIC_ROUNDABORT OFF +SET CONCAT_NULL_YIELDS_NULL ON +SET ANSI_NULLS ON +SET ANSI_PADDING ON +SET ANSI_WARNINGS ON +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDT_taxonomyValues + DROP CONSTRAINT R_100 +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDT_taxonomyValues WITH NOCHECK ADD CONSTRAINT + R_100 FOREIGN KEY + ( + taxonomyID + ) REFERENCES dbo.UDT_taxonomies + ( + taxonomyID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDO_publishers + DROP CONSTRAINT R_79 +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDO_publishers WITH NOCHECK ADD CONSTRAINT + R_79 FOREIGN KEY + ( + publisherStatusID + ) REFERENCES dbo.UDO_publisherStatus + ( + publisherStatusID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_bindingTemplates + DROP CONSTRAINT R_40 +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_identifierBag_TM + DROP CONSTRAINT R_111 +GO +ALTER TABLE dbo.UDC_categoryBag_TM + DROP CONSTRAINT R_110 +GO +ALTER TABLE dbo.UDC_tModelDesc + DROP CONSTRAINT R_42 +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_tModelDesc WITH NOCHECK ADD CONSTRAINT + R_42 FOREIGN KEY + ( + tModelID + ) REFERENCES dbo.UDC_tModels + ( + tModelID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_identifierBag_TM WITH NOCHECK ADD CONSTRAINT + R_111 FOREIGN KEY + ( + tModelID + ) REFERENCES dbo.UDC_tModels + ( + tModelID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_categoryBag_TM WITH NOCHECK ADD CONSTRAINT + R_110 FOREIGN KEY + ( + tModelID + ) REFERENCES dbo.UDC_tModels + ( + tModelID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_businessDesc + DROP CONSTRAINT R_33 +GO +ALTER TABLE dbo.UDC_contacts + DROP CONSTRAINT R_34 +GO +ALTER TABLE dbo.UDC_businessServices + DROP CONSTRAINT R_75 +GO +ALTER TABLE dbo.UDC_names_BE + DROP CONSTRAINT R_116 +GO +ALTER TABLE dbo.UDC_identifierBag_BE + DROP CONSTRAINT R_112 +GO +ALTER TABLE dbo.UDC_categoryBag_BE + DROP CONSTRAINT R_113 +GO +ALTER TABLE dbo.UDC_discoveryURLs + DROP CONSTRAINT R_84 +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_discoveryURLs WITH NOCHECK ADD CONSTRAINT + R_84 FOREIGN KEY + ( + businessID + ) REFERENCES dbo.UDC_businessEntities + ( + businessID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_categoryBag_BE WITH NOCHECK ADD CONSTRAINT + R_113 FOREIGN KEY + ( + businessID + ) REFERENCES dbo.UDC_businessEntities + ( + businessID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_identifierBag_BE WITH NOCHECK ADD CONSTRAINT + R_112 FOREIGN KEY + ( + businessID + ) REFERENCES dbo.UDC_businessEntities + ( + businessID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_names_BE WITH NOCHECK ADD CONSTRAINT + R_116 FOREIGN KEY + ( + businessID + ) REFERENCES dbo.UDC_businessEntities + ( + businessID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_names_BS + DROP CONSTRAINT R_117 +GO +ALTER TABLE dbo.UDC_bindingTemplates + DROP CONSTRAINT R_39 +GO +ALTER TABLE dbo.UDC_categoryBag_BS + DROP CONSTRAINT R_114 +GO +ALTER TABLE dbo.UDC_serviceDesc + DROP CONSTRAINT R_35 +GO +ALTER TABLE dbo.UDC_businessServices WITH NOCHECK ADD CONSTRAINT + R_75 FOREIGN KEY + ( + businessID + ) REFERENCES dbo.UDC_businessEntities + ( + businessID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_serviceDesc WITH NOCHECK ADD CONSTRAINT + R_35 FOREIGN KEY + ( + serviceID + ) REFERENCES dbo.UDC_businessServices + ( + serviceID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_categoryBag_BS WITH NOCHECK ADD CONSTRAINT + R_114 FOREIGN KEY + ( + serviceID + ) REFERENCES dbo.UDC_businessServices + ( + serviceID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_names_BS WITH NOCHECK ADD CONSTRAINT + R_117 FOREIGN KEY + ( + serviceID + ) REFERENCES dbo.UDC_businessServices + ( + serviceID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_addresses + DROP CONSTRAINT R_132 +GO +ALTER TABLE dbo.UDC_emails + DROP CONSTRAINT R_25 +GO +ALTER TABLE dbo.UDC_phones + DROP CONSTRAINT R_21 +GO +ALTER TABLE dbo.UDC_contactDesc + DROP CONSTRAINT R_19 +GO +ALTER TABLE dbo.UDC_contacts WITH NOCHECK ADD CONSTRAINT + R_34 FOREIGN KEY + ( + businessID + ) REFERENCES dbo.UDC_businessEntities + ( + businessID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_contactDesc WITH NOCHECK ADD CONSTRAINT + R_19 FOREIGN KEY + ( + contactID + ) REFERENCES dbo.UDC_contacts + ( + contactID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_phones WITH NOCHECK ADD CONSTRAINT + R_21 FOREIGN KEY + ( + contactID + ) REFERENCES dbo.UDC_contacts + ( + contactID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_emails WITH NOCHECK ADD CONSTRAINT + R_25 FOREIGN KEY + ( + contactID + ) REFERENCES dbo.UDC_contacts + ( + contactID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_businessDesc WITH NOCHECK ADD CONSTRAINT + R_33 FOREIGN KEY + ( + businessID + ) REFERENCES dbo.UDC_businessEntities + ( + businessID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_tModelInstances + DROP CONSTRAINT R_81 +GO +ALTER TABLE dbo.UDC_bindingDesc + DROP CONSTRAINT R_36 +GO +ALTER TABLE dbo.UDC_bindingTemplates WITH NOCHECK ADD CONSTRAINT + R_40 FOREIGN KEY + ( + URLTypeID + ) REFERENCES dbo.UDC_URLTypes + ( + URLTypeID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +ALTER TABLE dbo.UDC_bindingTemplates WITH NOCHECK ADD CONSTRAINT + R_39 FOREIGN KEY + ( + serviceID + ) REFERENCES dbo.UDC_businessServices + ( + serviceID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_instanceDesc + DROP CONSTRAINT R_69 +GO +ALTER TABLE dbo.UDC_tModelInstances WITH NOCHECK ADD CONSTRAINT + R_81 FOREIGN KEY + ( + bindingID + ) REFERENCES dbo.UDC_bindingTemplates + ( + bindingID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_instanceDesc WITH NOCHECK ADD CONSTRAINT + R_69 FOREIGN KEY + ( + instanceID + ) REFERENCES dbo.UDC_tModelInstances + ( + instanceID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_bindingDesc WITH NOCHECK ADD CONSTRAINT + R_36 FOREIGN KEY + ( + bindingID + ) REFERENCES dbo.UDC_bindingTemplates + ( + bindingID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_addressLines + DROP CONSTRAINT R_58 +GO +ALTER TABLE dbo.UDC_addresses WITH NOCHECK ADD CONSTRAINT + R_132 FOREIGN KEY + ( + contactID + ) REFERENCES dbo.UDC_contacts + ( + contactID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDC_addressLines WITH NOCHECK ADD CONSTRAINT + R_58 FOREIGN KEY + ( + addressID + ) REFERENCES dbo.UDC_addresses + ( + addressID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +GO + +BEGIN TRANSACTION +SET QUOTED_IDENTIFIER ON +SET TRANSACTION ISOLATION LEVEL SERIALIZABLE +SET ARITHABORT ON +SET NUMERIC_ROUNDABORT OFF +SET CONCAT_NULL_YIELDS_NULL ON +SET ANSI_NULLS ON +SET ANSI_PADDING ON +SET ANSI_WARNINGS ON +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDO_operatorLog + DROP CONSTRAINT R_130 +GO +COMMIT +BEGIN TRANSACTION +ALTER TABLE dbo.UDO_operatorLog WITH NOCHECK ADD CONSTRAINT + R_130 FOREIGN KEY + ( + operatorID + ) REFERENCES dbo.UDO_operators + ( + operatorID + ) ON UPDATE CASCADE + ON DELETE CASCADE + NOT FOR REPLICATION + +GO +COMMIT +GO diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.sec.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.sec.sql new file mode 100644 index 0000000..6545af3 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.sec.sql @@ -0,0 +1,217 @@ +-- Script: uddi.v2.sec.sql +-- Author: LRDohert@Microsoft.com +-- Description: Grants exec permissions to SP's +-- Note: This file is best viewed and edited with a tab width of 2. + +-- +-- Create application roles +-- +IF NOT EXISTS(SELECT * FROM sysusers WHERE [name] = 'UDDIAdmin') + EXEC sp_addrole 'UDDIAdmin' +GO + +IF NOT EXISTS(SELECT * FROM sysusers WHERE [name] = 'UDDIService') + EXEC sp_addrole 'UDDIService' +GO + +-- +-- Grant SP permissions +-- + +-- Framework stored procedures +GRANT EXEC ON net_address_addressLine_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_address_addressLines_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_delete TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_instanceDetails_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_instanceDetails_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_instanceDetails_overviewDoc_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_tModelInstanceInfo_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_tModelInstanceInfo_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_tModelInstanceInfo_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_tModelInstanceInfo_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_tModelInstanceInfos_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_assertions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_bindingTemplates_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_businessServices_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_categoryBag_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_categoryBag_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_contact_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_contacts_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_delete TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_discoveryURL_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_discoveryURLs_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_identifierBag_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_identifierBag_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_name_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_names_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_owner_update TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_bindingTemplates_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_categoryBag_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_categoryBag_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_delete TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_name_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_names_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_serviceProjection_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_categoryBag_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_changeRecord_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_changeRecord_update TO UDDIAdmin, UDDIService +GRANT EXEC ON net_config_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_config_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_config_getLastChangeDate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_address_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_addresses_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_email_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_emails_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_phone_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_contact_phones_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_bindingTemplate_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_bindingTemplate_serviceKey TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_bindingTemplate_tModelBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_categoryBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_combineCategoryBags TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_discoveryURL TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_identifierBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_name TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_relatedBusinesses TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_serviceSubset TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_serviceSubset_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessEntity_tModelBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessService_businessKey TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessService_categoryBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessService_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessService_name TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_businessService_tModelBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_changeRecords TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_changeRecords_cleanup TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_changeRecords_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_cleanup TO UDDIAdmin, UDDIService +GRANT EXEC ON net_findScratch_cleanup TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_scratch_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_publisher_cleanup TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_publisher_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_publisher_companyName TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_publisher_email TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_publisher_name TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_tModel_categoryBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_tModel_commit TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_tModel_identifierBag TO UDDIAdmin, UDDIService +GRANT EXEC ON net_find_tModel_name TO UDDIAdmin, UDDIService +GRANT EXEC ON net_highWaterMarks_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_identifierBag_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_key_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_keyedReference_validate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_operator_delete TO UDDIADmin, UDDIService +GRANT EXEC ON net_operator_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_operator_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_operatorCert_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_operatorLog_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_operatorLogLast_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_operators_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_assertion_delete TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_assertion_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_assertions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_assertionStatus_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_businessInfos_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_isRegistered TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_isVerified TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_login TO UDDIAdmin, UDDIService +GRANT EXEC ON net_publisher_tModelInfos_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_pubOperator_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_queryLog_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_report_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_report_update TO UDDIAdmin, UDDIService +GRANT EXEC ON net_reportLines_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_serviceProjection_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_serviceProjection_repl_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_statistics_recalculate TO UDDIAdmin, UDDIService +GRANT EXEC ON net_taxonomy_delete TO UDDIAdmin, UDDIService +GRANT EXEC ON net_taxonomy_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_taxonomy_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_taxonomyValue_get to UDDIAdmin, UDDIService +GRANT EXEC ON net_taxonomyValue_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_taxonomyValues_get to UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_categoryBag_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_categoryBag_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_delete TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_identifierBag_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_identifierBag_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_overviewDoc_description_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_overviewDoc_descriptions_get TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_owner_update TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_validate TO UDDIAdmin, UDDIService + +-- Added as part of batch optimization +GRANT EXEC ON net_bindingTemplate_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_tModelInstanceInfo_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessInfo_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_contact_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_serviceInfo_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_get_batch TO UDDIAdmin, UDDIService + +GO + +-- UI stored procedures +GRANT EXEC ON UI_getEntityCounts TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getIdentifierTModels TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getPublisher TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getPublisherFromSecurityToken TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getPublisherStats TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getSessionCache TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getTaxonomies TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getBrowsableTaxonomies TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getTaxonomyChildrenNode TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getTaxonomyChildrenRoot TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getTaxonomyParent TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getTaxonomyName TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getTaxonomyStats TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getTopPublishers TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_getUnhostedTaxonomyTModels TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_isNodeValidForClassification TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_isTaxonomyBrowsable TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_removeSessionCache TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_savePublisher TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_setSessionCache TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_setTaxonomyBrowsable TO UDDIAdmin, UDDIService +GRANT EXEC ON UI_validatePublisher TO UDDIAdmin, UDDIService +GRANT EXEC ON VS_business_get TO UDDIAdmin, UDDIService +GRANT EXEC ON VS_service_get TO UDDIAdmin, UDDIService +GRANT EXEC ON VS_AWR_categorization_get TO UDDIAdmin, UDDIService +GRANT EXEC ON VS_AWR_services_get TO UDDIAdmin, UDDIService +GRANT EXEC ON VS_AWR_businesses_get TO UDDIAdmin, UDDIService + +GO + +-- Admin stored procedures +GRANT EXEC ON ADM_addServiceAccount TO UDDIAdmin, UDDIService +GRANT EXEC ON ADM_execResetKeyImmediate TO UDDIAdmin, UDDIService +GRANT EXEC ON ADM_findPublisher TO UDDIAdmin, UDDIService +GRANT EXEC ON ADM_removePublisher TO UDDIAdmin, UDDIService +GRANT EXEC ON ADM_setAdminAccount TO UDDIAdmin, UDDIService +GRANT EXEC ON ADM_setPublisherStatus TO UDDIAdmin, UDDIService +GRANT EXEC ON ADM_setPublisherTier TO UDDIAdmin, UDDIService +GO diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.sp.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.sp.sql new file mode 100644 index 0000000..b3a6f7d --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.sp.sql @@ -0,0 +1,1272 @@ +-- Script: uddi.v2.sp.sql +-- Author: LRDohert@Microsoft.com +-- Description: Creates common stored procedures. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Configuration routines +-- ============================================= + +-- ============================================= +-- Name: net_config_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_config_get' AND type = 'P') + DROP PROCEDURE net_config_get +GO + +CREATE PROCEDURE net_config_get +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint, + @businessKey uniqueidentifier, + @name nvarchar(450), + @description nvarchar(4000) + + DECLARE @tempConfig TABLE( + [configName] nvarchar(450), + [configValue] nvarchar(4000)) + + SET @operatorID = CAST(dbo.configValue('OperatorID') AS bigint) + + IF @operatorID IS NULL + BEGIN + SET @error = 50014 + SET @context = 'OperatorID configuration item not set.' + GOTO errorLabel + END + + INSERT @tempConfig ( + [configName], + [configValue]) + SELECT + [configName], + [configValue] + FROM + [UDO_config] + + INSERT @tempConfig ( + [configName], + [configValue]) + SELECT + 'Operator', + [name] + FROM + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + INSERT @tempConfig ( + [configName], + [configValue]) + SELECT + 'OperatorKey', + dbo.UUIDSTR([operatorKey]) + FROM + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + -- Look up the key for the operational business entity, a.k.a. "Site.Key" + SELECT + @businessKey = [businessKey] + FROM + [UDO_operators] + WHERE + ([operatorID] = @operatorID) + + IF (@businessKey IS NULL) + BEGIN + INSERT @tempConfig ( + [configName], + [configValue]) + VALUES ( + 'Site.Key', + 'unspecified') + + INSERT @tempConfig ( + [configName], + [configValue]) + VALUES ( + 'Site.Name', + 'unspecified') + + INSERT @tempConfig ( + [configName], + [configValue]) + VALUES ( + 'Site.Description', + 'unspecified') + END + ELSE + BEGIN + -- TODO: needs to be language aware as opposed to first item + SELECT TOP 1 + @name = [name] + FROM + [UDC_names_BE] + WHERE + ([businessID] = dbo.businessID(@businessKey)) + + -- TODO: needs to be language aware as opposed to first item + SELECT TOP 1 + @description = [description] + FROM + [UDC_businessDesc] + WHERE + ([businessID] = dbo.businessID(@businessKey)) + + INSERT @tempConfig ( + [configName], + [configValue]) + VALUES ( + 'Site.Key', + dbo.UUIDSTR(@businessKey)) + + INSERT @tempConfig ( + [configName], + [configValue]) + VALUES ( + 'Site.Name', + ISNULL(@name,'unspecified')) + + INSERT @tempConfig ( + [configName], + [configValue]) + VALUES ( + 'Site.Description', + ISNULL(@description,'unspecified')) + END + + -- Return results + SELECT + [configName], + [configValue] + FROM + @tempConfig + ORDER BY + 1 + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_config_get +GO + +-- ============================================= +-- Name: net_config_save +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_config_save' AND type = 'P') + DROP PROCEDURE net_config_save +GO + +CREATE PROCEDURE net_config_save + @configName nvarchar(450), + @configValue nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @RC int, + @dateTimeString varchar(8000) + + IF @configName NOT IN ('Operator', 'Site.Key') + BEGIN + -- Update configuration item in UDO_config + IF NOT EXISTS(SELECT * FROM [UDO_config] WHERE [configName] = @configName) + INSERT [UDO_config] VALUES(@configName, @configValue) + ELSE + UPDATE [UDO_config] SET [configValue] = @configValue WHERE [configName] = @configName + END + ELSE + BEGIN + -- Derived configuration item. Update elsewhere. + IF @configName = ('Operator') + BEGIN + UPDATE + [UDO_operators] + SET + [name] = LEFT(@configValue, 450) + WHERE + [operatorID] = dbo.currentOperatorID() + END + + IF @configName = ('Site.Key') + BEGIN + UPDATE + [UDO_operators] + SET + [businessKey] = CAST(@configValue AS uniqueidentifier) + WHERE + [operatorID] = dbo.currentOperatorID() + END + END + + -- + -- Update the last change date and time + -- + + SET @dateTimeString = CONVERT(varchar(8000), GETDATE(), 126) -- Use IS08601 format, e.g. yyyy-mm-dd Thh:mm:ss:mmm + + IF NOT EXISTS(SELECT * FROM [UDO_config] WHERE [configName]='LastChange') + INSERT [UDO_config] VALUES('LastChange', @dateTimeString) + ELSE + UPDATE [UDO_config] SET [configValue] = @dateTimeString WHERE [configName] = 'LastChange' + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_config_save +GO + +-- ============================================= +-- Name: net_config_getLastChangeDate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_config_getLastChangeDate' AND type = 'P') + DROP PROCEDURE net_config_getLastChangeDate +GO + +CREATE PROCEDURE net_config_getLastChangeDate +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + [configValue] + FROM + [UDO_config] + WHERE + [configName] = 'LastChange' + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_config_getLastChangeDate +GO + +-- ============================================= +-- Section: Validation shared routines +-- ============================================= + +-- ============================================= +-- Name: net_categoryBag_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_categoryBag_validate' AND type = 'P') + DROP PROCEDURE net_categoryBag_validate +GO + +CREATE PROCEDURE net_categoryBag_validate + @keyValue nvarchar(255), + @tModelKey uniqueidentifier, + @replActive bit = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + -- Validate keyValue + IF @tModelKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'tModelKey is required.' + GOTO errorLabel + END + + IF @keyValue IS NULL + BEGIN + SET @error = 70100 -- E_categorizationNotAllowed + SET @context = 'keyValue is required.' + GOTO errorLabel + END + + IF (dbo.checkedTaxonomy(@tModelKey) = 1) AND (dbo.validTaxonomyValue(@tModelKey, @keyValue) = 0) + BEGIN + SET @error = 70200 -- E_invalidValue + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + ', keyValue = ' + @keyValue + GOTO errorLabel + END + + IF @replActive = 0 + BEGIN + IF NOT EXISTS(SELECT [tModelKey] FROM [UDC_tModels] WHERE [tModelKey] = @tModelKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = dbo.addURN(@tModelKey) + GOTO errorLabel + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_categoryBag_validate +GO + +-- ============================================= +-- Name: net_identifierBag_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_identifierBag_validate' AND type = 'P') + DROP PROCEDURE net_identifierBag_validate +GO + +CREATE PROCEDURE net_identifierBag_validate + @keyValue nvarchar(225), + @tModelKey uniqueidentifier, + @replActive bit = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + -- Validate tModelKey + IF @tModelKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'tModelKey is required.' + GOTO errorLabel + END + + IF @replActive = 0 + BEGIN + IF @tModelKey IS NOT NULL + BEGIN + IF NOT EXISTS(SELECT [tModelKey] FROM [UDC_tModels] WHERE [tModelKey] = @tModelKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = dbo.addURN(@tModelKey) + GOTO errorLabel + END + + IF @tModelKey = dbo.operatorsKey() + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'Only operators may reference the uddi-org:operators tModelKey (' + dbo.configValue('TModelKey.Operators') + ').' + GOTO errorLabel + END + END + END + + -- Validate keyValue + IF @keyValue IS NULL + BEGIN + SET @error = 70100 -- E_categorizationNotAllowed + SET @context = 'keyValue is required.' + GOTO errorLabel + END + + IF (dbo.checkedTaxonomy(@tModelKey) = 1) AND (dbo.validTaxonomyValue(@tModelKey, @keyValue) = 0) + BEGIN + SET @error = 70200 -- E_invalidValue + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + ', keyValue = ' + @keyValue + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_identifierBag_validate +GO + +-- ============================================= +-- Name: net_keyedReference_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_keyedReference_validate' AND type = 'P') + DROP PROCEDURE net_keyedReference_validate +GO + +CREATE PROCEDURE net_keyedReference_validate + @PUID nvarchar(450), + @keyedRefType int, + @keyValue nvarchar(255), + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @publisherID bigint, + @operatorID bigint, + @replActive bit + + SET @RC=0 + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @operatorID = dbo.currentOperatorID() + SET @replActive = 0 + END + ELSE + BEGIN + -- Validate operator / publisher association (replication only) + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT, @replActive OUTPUT + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + IF (@keyedRefType NOT BETWEEN 1 AND 3) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = '@keyedRefType = ' + CAST(@keyedRefType AS varchar(8000)) + GOTO errorLabel + END + + IF @keyedRefType = 1 OR @keyedRefType = 3 -- categoryBag or assertion keyedReference + BEGIN + EXEC @RC=net_categoryBag_validate @keyValue, @tModelKey, @replActive + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + IF @keyedRefType = 2 -- identifierBag + BEGIN + EXEC @RC=net_identifierBag_validate @keyValue, @tModelKey, @replActive + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_keyedReference_validate +GO + +-- ============================================= +-- Name: net_key_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_key_validate' AND type = 'P') + DROP PROCEDURE net_key_validate +GO + +CREATE PROCEDURE net_key_validate + @entityTypeID tinyint, + @entityKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + IF (@entityTypeID NOT BETWEEN 0 AND 3) + BEGIN + SET @error = 50009 + SET @context = 'Invalid @entityTypeID parameter value: ' + CAST(@entityTypeid AS varchar(256)) + GOTO errorLabel + END + + IF dbo.entityExists(@entityKey, @entityTypeID) = 0 + BEGIN + SET @error = 60210 + SELECT @context = + CASE @entityTypeID + WHEN 0 THEN 'tModelKey = uuid:' + dbo.UUIDSTR(@entityKey) + WHEN 1 THEN 'businessKey = ' + dbo.UUIDSTR(@entityKey) + WHEN 2 THEN 'serviceKey = ' + dbo.UUIDSTR(@entityKey) + WHEN 3 THEN 'bindingKey = ' + dbo.UUIDSTR(@entityKey) + END + + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_key_validate +GO + +-- ============================================= +-- Section: General purpose routines +-- ============================================= + +-- ============================================= +-- Section: Shared find routines +-- ============================================= + +-- ============================================= +-- Name: net_find_scratch_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_scratch_commit' AND type = 'P') + DROP PROCEDURE net_find_scratch_commit +GO + +CREATE PROCEDURE net_find_scratch_commit + @contextID uniqueidentifier, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Commits keys in the scratch table to the find results table. + DECLARE + @error int, + @context nvarchar(4000), + @RC int + + IF EXISTS(SELECT * FROM [UDS_findResults] WHERE [contextID] = @contextID) + BEGIN + -- UDS_findResults has at least one entry so far + DELETE + [UDS_findResults] + WHERE + ([contextID] = @contextID) AND + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + + SET @rows = dbo.contextRows(@contextID) + + UPDATE + [UDS_findResults] + SET + [subEntityKey] = SC.[subEntityKey] + FROM + [UDS_findResults] + JOIN [UDS_findScratch] SC ON ([UDS_findResults].[entityKey] = SC.[entityKey]) + WHERE + ([UDS_findResults].[contextID] = @contextID) + END + ELSE + -- UDS_findResults does not have any entries so far + BEGIN + INSERT [UDS_findResults] ( + [contextID], + [entityKey], + [subEntityKey]) + SELECT DISTINCT + [contextID], + [entityKey], + [subEntityKey] + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + SET @rows = dbo.contextRows(@contextID) + END + + EXEC @RC=net_findScratch_cleanup @contextID + + IF @RC<>0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_scratch_commit +GO + +-- ============================================= +-- Name: net_find_cleanup +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_cleanup' AND type = 'P') + DROP PROCEDURE net_find_cleanup +GO + +CREATE PROCEDURE net_find_cleanup + @contextID uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + -- Cleans up leftover rows in scracth tables + DELETE + [UDS_findResults] + WHERE + ([contextID] = @contextID) + + DELETE + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 +END -- net_find_cleanup +GO + + +-- ============================================= +-- Name: net_findScratch_cleanup +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_findScratch_cleanup' AND type = 'P') + DROP PROCEDURE net_findScratch_cleanup +GO + +CREATE PROCEDURE net_findScratch_cleanup + @contextID uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + -- Cleans up leftover rows in scratch table + DELETE + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 +END -- net_findScratch_cleanup +GO + +-- ============================================= +-- Section: queryLog procedures +-- ============================================= + +-- ============================================= +-- Name: net_queryLog_save +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_queryLog_save' AND type = 'P') + DROP PROCEDURE net_queryLog_save +GO + +CREATE PROCEDURE net_queryLog_save + @contextID uniqueidentifier, + @lastChange bigint, + @entityKey uniqueidentifier = NULL, + @entityTypeID tinyint = NULL, + @contextTypeID tinyint, + @queryTypeID tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + INSERT [UDO_queryLog] ( + [lastChange], + [entityKey], + [entityTypeID], + [queryTypeID], + [contextID], + [contextTypeID]) + VALUES ( + @lastChange, + @entityKey, + @entityTypeID, + @queryTypeID, + @contextID, + @contextTypeID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_queryLog_save +GO + +-- ============================================= +-- Section: Taxonomy routines +-- ============================================= + +-- ============================================= +-- Name: net_taxonomy_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_taxonomy_get' AND type = 'P') + DROP PROCEDURE net_taxonomy_get +GO + +CREATE PROCEDURE net_taxonomy_get + @tModelKey uniqueidentifier, + @flag int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + IF NOT EXISTS(SELECT * FROM [UDT_taxonomies] WHERE [tModelKey] = @tModelKey) + BEGIN + SET @error = 60210 + SET @context = 'uuid:' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + SELECT + @flag = [flag] + FROM + [UDT_taxonomies] + WHERE + ([tModelKey] = @tModelKey) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_taxonomy_get +GO + +-- ============================================= +-- Name: net_taxonomy_save +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_taxonomy_save' AND type = 'P') + DROP PROCEDURE net_taxonomy_save +GO + +CREATE PROCEDURE net_taxonomy_save + @tModelKey uniqueidentifier, + @flag int, + @taxonomyID bigint = NULL OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @RC int + + -- Validate parameters + IF @flag NOT IN(0,1,2,3)--all valid values + BEGIN + -- flag 0x1 = checkedTaxonomy + -- flag 0x2 = browsable taxonomy + SET @error = 50009 -- E_parmError + SET @context = CAST(@flag AS varchar(256)) + ' is not a valid categorization scheme flag.' + GOTO errorLabel + END + + IF NOT EXISTS(SELECT * FROM [UDC_tModels] WHERE [tModelKey] = @tModelKey) + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = dbo.UUIDSTR(@tModelKey) + ' is not a valid tModelKey.' + GOTO errorLabel + END + + IF EXISTS(SELECT * FROM [UDT_taxonomies] WHERE [tModelKey] = @tModelKey) + BEGIN + -- + -- Fix for Windows Bug #733233 + -- Delete existing taxonomy instead of throwing an E_invalidKey + -- + + -- SET @error = 60210 -- E_invalidKeyPassed + -- SET @context = 'A categorization scheme already exists for tModelKey = ' + dbo.UUIDSTR(@tModelKey) + -- GOTO errorLabel + + EXEC @RC = net_taxonomy_delete @tModelKey + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + END + + -- Add new taxonomy + INSERT [UDT_taxonomies]( + [tModelKey], + [flag]) + VALUES( + @tModelKey, + @flag) + + SET @taxonomyID = @@IDENTITY + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: net_taxonomy_delete +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_taxonomy_delete' AND type = 'P') + DROP PROCEDURE net_taxonomy_delete +GO + +CREATE PROCEDURE net_taxonomy_delete + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @taxonomyID bigint + + SET @taxonomyID = dbo.taxonomyID(@tModelKey) + + IF @taxonomyID IS NULL + BEGIN + SET @error = 60210 + SET @context = 'uuid:' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + IF EXISTS(SELECT * FROM [UDT_taxonomies] WHERE [taxonomyID] = @taxonomyID) + DELETE [UDT_taxonomies] WHERE [taxonomyID] = @taxonomyID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: net_taxonomyValue_save +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_taxonomyValue_save' AND type = 'P') + DROP PROCEDURE net_taxonomyValue_save +GO + +CREATE PROCEDURE net_taxonomyValue_save + @tModelKey uniqueidentifier, + @keyValue nvarchar(255), + @parentKeyValue nvarchar(255), + @keyName nvarchar(255), + @valid bit +WITH ENCRYPTION +AS +BEGIN + -- This procedure saves new rows to UDT_taxonomyValues. + -- Note: if the row already exists it is deleted and resaved. + -- Note: parentKeyValue is not validated. + DECLARE + @error int, + @context nvarchar(4000), + @taxonomyID bigint + + SET @taxonomyID = dbo.taxonomyID(@tModelKey) + + IF @taxonomyID IS NULL + BEGIN + SET @error = 60210 + SET @context = 'No taxonomy for uuid:' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + -- Validate parameters + IF NOT EXISTS(SELECT * FROM [UDT_taxonomies] WHERE [taxonomyID] = @taxonomyID) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = CAST(@taxonomyID AS varchar(256)) + ' is not a valid taxonomyValue.' + GOTO errorLabel + END + + -- Delete taxonomyValue if it exists + IF EXISTS (SELECT * FROM [UDT_taxonomyValues] WHERE [taxonomyID] = @taxonomyID AND [keyValue] = @keyValue) + BEGIN + DELETE + [UDT_taxonomyValues] + WHERE + ([taxonomyID] = @taxonomyID) AND + ([keyValue] = @keyValue) + END + + INSERT [UDT_taxonomyValues]( + [taxonomyID], + [keyValue], + [parentKeyValue], + [keyName], + [valid]) + VALUES( + @taxonomyID, + @keyValue, + @parentKeyValue, + @keyName, + @valid) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: net_taxonomyValue_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_taxonomyValue_get' AND type = 'P') + DROP PROCEDURE net_taxonomyValue_get +GO + +CREATE PROCEDURE net_taxonomyValue_get + @tModelKey uniqueidentifier, + @keyValue nvarchar(255), + @relation int +WITH ENCRYPTION +AS +BEGIN + -- This procedure gets rows from UDT_taxonomyValues. + -- Note: @relation is as follows + -- 0 - Root information requested + -- 1 - Child information requested + -- 2 - Parent information requested + -- 3 - Current information requested + DECLARE + @error int, + @context nvarchar(4000), + @taxonomyID bigint + + SET @taxonomyID = dbo.taxonomyID(@tModelKey) + + IF @taxonomyID IS NULL + BEGIN + SET @error = 60210 + SET @context = 'uuid:' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + -- Validate parameters + IF NOT EXISTS(SELECT * FROM [UDT_taxonomies] WHERE [taxonomyID] = @taxonomyID) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = CAST(@taxonomyID AS varchar(256)) + ' is not a valid taxonomyValue.' + GOTO errorLabel + END + + IF @relation = 0 + BEGIN + -- Get root level values + -- The @keyValue is ignored in this case + SELECT + [keyValue], + [parentKeyValue], + [keyName], + [valid] + FROM + [UDT_taxonomyValues] + WHERE + [taxonomyID] = @taxonomyID AND [parentKeyValue] = '' + END + ELSE IF @relation = 1 + BEGIN + -- Get children values + SELECT + [keyValue], + [parentKeyValue], + [keyName], + [valid] + FROM + [UDT_taxonomyValues] + WHERE + [taxonomyID] = @taxonomyID AND [parentKeyValue] = @keyValue + END + ELSE IF @relation = 2 + BEGIN + -- Get parent values + SELECT + [keyValue], + [parentKeyValue], + [keyName], + [valid] + FROM + [UDT_taxonomyValues] + WHERE + [taxonomyID] = @taxonomyID AND [keyValue] + IN (SELECT [parentKeyValue] FROM [UDT_taxonomyValues] WHERE [keyValue] = @keyValue) + END + ELSE IF @relation = 3 + BEGIN + -- Get current values + SELECT + [keyValue], + [parentKeyValue], + [keyName], + [valid] + FROM + [UDT_taxonomyValues] + WHERE + [taxonomyID] = @taxonomyID AND [keyValue] = @keyValue + END + ELSE + BEGIN + SET @error = 50009 -- E_parmError + SET @context = CAST(@relation AS varchar(256)) + ' is not a valid relationship value.' + GOTO errorLabel + END + + RETURN 0 +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: net_taxonomyValues_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_taxonomyValues_get' AND type = 'P') + DROP PROCEDURE net_taxonomyValues_get +GO + +CREATE PROCEDURE net_taxonomyValues_get + @tModelKey uniqueidentifier +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @taxonomyID bigint + + SET @taxonomyID = dbo.taxonomyID(@tModelKey) + + IF @taxonomyID IS NULL + BEGIN + SET @error = 60210 + SET @context = 'uuid:' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + SELECT + [keyValue], + [parentKeyValue], + [keyName], + [valid] + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID] = @taxonomyID) + ORDER BY + [parentKeyValue], + [keyValue] + + RETURN 0 +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Section: Reporting routines +-- ============================================= + +-- ============================================= +-- Name: net_report_get +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_report_get' AND type = 'P') + DROP PROCEDURE net_report_get +GO + +CREATE PROCEDURE net_report_get + @reportID sysname, + @reportStatusID tinyint = NULL OUTPUT, + @lastChange datetime = NULL OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + IF NOT EXISTS(SELECT * FROM [UDO_reports] WHERE [reportID] = @reportID) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Invalid reportID.' + GOTO errorLabel + END + + SELECT + @reportStatusID = [reportStatusID], + @lastChange = [lastChange] + FROM + [UDO_reports] + WHERE + ([reportID] = @reportID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_report_get +GO + +-- ============================================= +-- Name: net_report_update +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_report_update' AND type = 'P') + DROP PROCEDURE net_report_update +GO + +CREATE PROCEDURE net_report_update + @reportID sysname, + @reportStatusID tinyint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @lastChange datetime + + IF NOT EXISTS(SELECT * FROM [UDO_reports] WHERE [reportID] = @reportID) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Invalid reportID.' + GOTO errorLabel + END + + IF NOT EXISTS(SELECT * FROM [UDO_reportStatus] WHERE [reportStatusID] = @reportStatusID) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Invalid reportStatusID.' + GOTO errorLabel + END + + SET @lastChange = GETDATE() + + UPDATE + [UDO_reports] + SET + [reportStatusID] = @reportStatusID, + [lastChange] = @lastChange + WHERE + ([reportID] = @reportID) + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_report_update +GO + +-- ============================================= +-- Name: net_reportLines_get +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_reportLines_get' AND type = 'P') + DROP PROCEDURE net_reportLines_get +GO + +CREATE PROCEDURE net_reportLines_get + @reportID sysname +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + IF NOT EXISTS(SELECT * FROM [UDO_reports] WHERE [reportID] = @reportID) + BEGIN + SET @error = 50009 -- E_parmError + SET @context = 'Invalid reportID.' + GOTO errorLabel + END + + SELECT + [section], + [label], + [value] + FROM + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + ORDER BY + [seqNo] ASC + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_reportLines_get +GO + +-- ============================================= +-- Name: net_statistics_recalculate +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_statistics_recalculate' AND type = 'P') + DROP PROCEDURE net_statistics_recalculate +GO + +CREATE PROCEDURE net_statistics_recalculate +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @RC int + + EXEC @RC=master.dbo.xp_recalculate_statistics + + IF @RC <> 0 + BEGIN + SET @error = 50006 -- E_subProcFailure + SET @context = '' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_statistics_recalculate +GO + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.tableopts.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.tableopts.sql new file mode 100644 index 0000000..92fa62a --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.tableopts.sql @@ -0,0 +1,13 @@ +-- Script: Applegate_tabopts.sql +-- Author: LRDohert@Microsoft.com +-- Description: Sets table options +-- Note: This file is best viewed and edited with a tab width of 2. + +-- +-- 'text in row' tables +-- + +-- Note: both of these tables see a lot of i/o, thus the need for setting this option + +EXEC sp_tableoption 'UDO_changeLog', 'text in row', 'on' +GO diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.tmodel.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.tmodel.sql new file mode 100644 index 0000000..2847feb --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.tmodel.sql @@ -0,0 +1,1325 @@ +-- Script: uddi.v2.tModel.sql +-- Author: LRDohert@Microsoft.com +-- Description: Stored procedures associated with a tModel object. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Get stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_tModel_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_get' and type = 'P') + DROP PROCEDURE net_tModel_get +GO + +CREATE PROCEDURE net_tModel_get + @tModelKey uniqueidentifier, + @operatorName nvarchar(450) OUTPUT, + @authorizedName nvarchar(4000) OUTPUT, + @name nvarchar(450) OUTPUT, + @overviewURL nvarchar(4000) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @operatorName = dbo.publisherOperatorName([publisherID]), + @authorizedName = ISNULL([authorizedName],dbo.publisherName([publisherID])), + @name = [name], + @overviewURL = [overviewURL] + FROM + [UDC_tModels] + WHERE + ([tModelKey] = @tModelKey) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_tModel_get +GO + +-- ============================================= +-- Name: net_tModel_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_get_batch' and type = 'P') + DROP PROCEDURE net_tModel_get_batch +GO + +CREATE PROCEDURE net_tModel_get_batch + @tModelKey uniqueidentifier, + @operatorName nvarchar(450) OUTPUT, + @authorizedName nvarchar(4000) OUTPUT, + @name nvarchar(450) OUTPUT, + @overviewURL nvarchar(4000) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @operatorName = dbo.publisherOperatorName([publisherID]), + @authorizedName = ISNULL([authorizedName],dbo.publisherName([publisherID])), + @name = [name], + @overviewURL = [overviewURL] + FROM + [UDC_tModels] + WHERE + ([tModelKey] = @tModelKey) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + + -- Get contained objects + EXEC net_tModel_descriptions_get @tModelKey + EXEC net_tModel_overviewDoc_descriptions_get @tModelKey + EXEC net_tModel_identifierBag_get @tModelKey + EXEC net_tModel_categoryBag_get @tModelKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_tModel_get_batch +GO + +-- ============================================= +-- Name: net_tModel_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_descriptions_get' and type = 'P') + DROP PROCEDURE net_tModel_descriptions_get +GO + +CREATE PROCEDURE net_tModel_descriptions_get + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_tModelDesc] + WHERE + ([tModelID] = dbo.tModelID(@tModelKey)) AND + ([elementID] = dbo.elementID('tModel')) + + RETURN 0 +END -- net_tModel_descriptions_get +GO + +-- ============================================= +-- Name: net_tModel_overviewDoc_descriptions_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_overviewDoc_descriptions_get' and type = 'P') + DROP PROCEDURE net_tModel_overviewDoc_descriptions_get +GO + +CREATE PROCEDURE net_tModel_overviewDoc_descriptions_get + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [isoLangCode], + [description] + FROM + [UDC_tModelDesc] + WHERE + ([tModelID] = dbo.tModelID(@tModelKey)) AND + ([elementID] = dbo.elementID('overviewDoc')) + + RETURN 0 +END -- net_tModel_overviewDoc_descriptions_get +GO + +-- ============================================= +-- Name: net_tModel_categoryBag_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_categoryBag_get' and type = 'P') + DROP PROCEDURE net_tModel_categoryBag_get +GO + +CREATE PROCEDURE net_tModel_categoryBag_get + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [keyName], + [keyValue], + [tModelKey] + FROM + [UDC_categoryBag_TM] + WHERE + [tModelID] = dbo.tModelID(@tModelKey) + + RETURN 0 +END -- net_tModel_categoryBag_get +GO + +-- ============================================= +-- Name: net_tModel_identifierBag_get +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_identifierBag_get' and type = 'P') + DROP PROCEDURE net_tModel_identifierBag_get +GO + +CREATE PROCEDURE net_tModel_identifierBag_get + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + SELECT + [keyName], + [keyValue], + [tModelKey] + FROM + [UDC_identifierBag_TM] + WHERE + [tModelID] = dbo.tModelID(@tModelKey) + + RETURN 0 +END -- net_tModel_identifierBag_get +GO + +-- ============================================= +-- Section: Save stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_tModel_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_save' and type = 'P') + DROP PROCEDURE net_tModel_save +GO + +CREATE PROCEDURE net_tModel_save + @tModelKey uniqueidentifier, + @PUID nvarchar(450), + @generic varchar(20), + @authorizedName nvarchar(4000) OUTPUT, + @name nvarchar(450), + @overviewURL nvarchar(4000), + @contextID uniqueidentifier, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @publisherID bigint, + @isReplPublisher bit + + SET @RC = 0 + SET @publisherID = dbo.publisherID(@PUID) + -- validate @publisherID is not NULL? + SET @isReplPublisher = dbo.isReplPublisher(@PUID) + + IF @isReplPublisher = 0 + SET @authorizedName = NULL + + IF EXISTS(SELECT * FROM [UDC_tModels] WHERE [tModelKey] = @tModelKey) + BEGIN + DELETE [UDC_tModels] WHERE [tModelKey] = @tModelKey + END + ELSE + BEGIN + IF (@isReplPublisher = 1) + BEGIN + -- Perform this check only for replication publishers + IF (dbo.isUuidUnique(@tModelKey) = 0) + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'Key is not unique. tModelKey = ' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + END + END + + INSERT [UDC_tModels]( + [publisherID], + [generic], + [authorizedName], + [tModelKey], + [name], + [overviewURL], + [lastChange], + [flag]) + VALUES( + @publisherID, + ISNULL(@generic,dbo.configValue('CurrentAPIVersion')), + @authorizedName, + @tModelKey, + @name, + @overviewURL, + @lastChange, + 0) + + SET @authorizedName = dbo.publisherName(@publisherID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_tModel_save +GO + +-- ============================================= +-- Name: net_tModel_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_description_save' and type = 'P') + DROP PROCEDURE net_tModel_description_save +GO + +CREATE PROCEDURE net_tModel_description_save + @tModelKey uniqueidentifier, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_tModelDesc]( + [tModelID], + [elementID], + [isoLangCode], + [description]) + VALUES( + dbo.tModelID(@tModelKey), + dbo.elementID('tModel'), + @isoLangCode, + @description) + + RETURN 0 +END -- net_tModel_description_save +GO + +-- ============================================= +-- Name: net_tModel_overviewDoc_description_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_overviewDoc_description_save' and type = 'P') + DROP PROCEDURE net_tModel_overviewDoc_description_save +GO + +CREATE PROCEDURE net_tModel_overviewDoc_description_save + @tModelKey uniqueidentifier, + @isoLangCode varchar(17) = 'en', + @description nvarchar(4000) +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_tModelDesc]( + [tModelID], + [elementID], + [isoLangCode], + [description]) + VALUES( + dbo.tModelID(@tModelKey), + dbo.elementID('overviewDoc'), + @isoLangCode, + @description) + + RETURN 0 +END -- net_tModel_overviewDoc_description_save +GO + +-- ============================================= +-- Name: net_tModel_categoryBag_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_categoryBag_save' and type = 'P') + DROP PROCEDURE net_tModel_categoryBag_save +GO + +CREATE PROCEDURE net_tModel_categoryBag_save + @tModelKeyParent uniqueidentifier, + @keyName nvarchar(255), + @keyValue nvarchar(255), + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_categoryBag_TM]( + [tModelID], + [keyName], + [keyValue], + [tModelKey]) + VALUES( + dbo.tModelID(@tModelKeyParent), + @keyName, + @keyValue, + @tModelKey) + + RETURN 0 +END -- net_tModel_categoryBag_save +GO + +-- ============================================= +-- Name: net_tModel_identifierBag_save +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_identifierBag_save' and type = 'P') + DROP PROCEDURE net_tModel_identifierBag_save +GO + +CREATE PROCEDURE net_tModel_identifierBag_save + @tModelKeyParent uniqueidentifier, + @keyName nvarchar(255), + @keyValue nvarchar(255), + @tModelKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + INSERT [UDC_identifierBag_TM]( + [tModelID], + [keyName], + [keyValue], + [tModelKey]) + VALUES( + dbo.tModelID(@tModelKeyParent), + @keyName, + @keyValue, + @tModelKey) + + RETURN 0 +END -- net_tModel_identifierBag_save +GO + +-- ============================================= +-- Section: Delete stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_tModel_delete +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_delete' and type = 'P') + DROP PROCEDURE net_tModel_delete +GO + +CREATE PROCEDURE net_tModel_delete + @PUID nvarchar(450), + @tModelKey uniqueidentifier, + @contextID uniqueidentifier, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint + + SET @RC = 0 + + -- + -- Validate parameters + -- + + IF @tModelKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = '@tModelKey is required.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Check to see if tModelKey exists + IF EXISTS(SELECT * FROM [UDC_tModels] WHERE (tModelKey = @tModelKey)) + BEGIN + -- tModelKey exists. Make sure it belongs to current publisher + IF NOT EXISTS(SELECT * FROM [UDC_tModels] WHERE (tModelKey = @tModelKey) AND (publisherID = @publisherID)) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + END + ELSE + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = '@tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + + -- Hide the tModel + UPDATE + [UDC_tModels] + SET + [lastChange] = @lastChange, + [flag] = 0x1 + WHERE + ([tModelKey] = @tModelKey) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_tModel_delete +GO + +-- ============================================= +-- Section: tModel validation stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_tModel_validate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_tModel_validate' AND type = 'P') + DROP PROCEDURE net_tModel_validate +GO + +CREATE PROCEDURE net_tModel_validate + @PUID nvarchar(450), + @tModelKey uniqueidentifier, + @flag int = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint, + @replActive bit + + SET @RC = 0 + SET @replActive = 0 + + IF @flag IS NULL + SET @flag = 0 + + -- + -- Validate parameters + -- + + IF @tModelKey IS NULL + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = '@tModelKey is required.' + GOTO errorLabel + END + + -- Validate publisher + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + ISNULL(@PUID, 'NULL') + GOTO errorLabel + END + + -- Validate operator / publisher association (replication only) + EXEC @RC=net_pubOperator_get @publisherID, @operatorID OUTPUT, @replActive OUTPUT + + -- + -- Validate tModel + -- + + -- Check to see if tModelKey exists + IF EXISTS(SELECT * FROM [UDC_tModels] WHERE (tModelKey = @tModelKey)) + BEGIN + -- tModelKey exists. Make sure it belongs to current publisher + IF NOT EXISTS(SELECT * FROM [UDC_tModels] WHERE (tModelKey = @tModelKey) AND (publisherID = @publisherID)) + BEGIN + SET @error = 60140 -- E_userMismatch + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + + IF @replActive = 0 + BEGIN + IF @operatorID <> dbo.currentOperatorID() + BEGIN + SET @error = 60130 -- E_operatorMismatch + SET @context = 'Operator ' + dbo.operatorName(@operatorID) + ' is not the local operator.' + GOTO errorLabel + END + END + END + ELSE + BEGIN + -- tModelKey doesn't exist + IF (@replActive = 0) AND (@flag & 0x1 <> 0x1) + BEGIN + -- save isn't coming from replication and preassigned keys flag is not set so throw an error + SET @error = 60210 -- E_invalidKey + SET @context = '@tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_tModel_validate +GO + +-- ============================================= +-- Section: Find stored procedures +-- ============================================= + +-- ============================================= +-- Name: net_find_tModel_name +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_tModel_name' AND type = 'P') + DROP PROCEDURE net_find_tModel_name +GO + +CREATE PROCEDURE net_find_tModel_name + @contextID uniqueidentifier, + @name nvarchar(450), + @exactNameMatch bit, + @caseSensitiveMatch bit, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Adds name search arguments for a find_business + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @wildCardSarg nvarchar(451) + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier, + [name] nvarchar(450)) + + SET @contextRows = dbo.contextRows(@contextID) + + -- + -- Do a wildcard search (default) + -- + + IF (@exactNameMatch = 0) + BEGIN + SET @wildCardSarg = @name + + IF dbo.containsWildcard(@name) = 0 + SET @wildCardSarg = @wildCardSarg + N'%' + + IF @contextRows = 0 + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + [tModelKey], + [name] + FROM + [UDC_tModels] + WHERE + ([name] LIKE @wildCardSarg) AND + ([flag] = 0) + END + ELSE + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + [tModelKey], + [name] + FROM + [UDC_tModels] + WHERE + ([tModelKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([name] LIKE @wildCardSarg) AND + ([flag] = 0) + + END + END + + -- + -- Do an exactNameMatch search + -- + + IF (@exactNameMatch = 1) + BEGIN + IF @contextRows = 0 + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + [tModelKey], + [name] + FROM + [UDC_tModels] + WHERE + ([name] = @name) AND + ([flag] = 0) + END + ELSE + BEGIN + INSERT INTO @tempKeys( + [entityKey], + [name]) + SELECT + [tModelKey], + [name] + FROM + [UDC_tModels] + WHERE + ([tModelKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + ([name] = @name) AND + ([flag] = 0) + END + END + + IF (@caseSensitiveMatch = 1) + DELETE + @tempKeys + WHERE + (dbo.caseSensitiveMatch(@name, [name], @exactNameMatch) = 0) + + -- name search arguments are combined using a logical OR by default + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_tModel_name +GO + +-- ============================================= +-- Name: net_find_tModel_identifierBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_tModel_identifierBag' AND type = 'P') + DROP PROCEDURE net_find_tModel_identifierBag +GO + +CREATE PROCEDURE net_find_tModel_identifierBag + @contextID uniqueidentifier, + @keyName nvarchar(4000), + @keyValue nvarchar(4000), + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + IF @contextRows = 0 + BEGIN + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_identifierBag_TM] IB ON TM.[tModelID] = IB.[tModelID] + WHERE + (IB.[tModelKey] = @tModelKey) AND + (IB.[keyValue] = @keyValue) AND + (TM.[flag] = 0) + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_identifierBag_TM] IB ON TM.[tModelID] = IB.[tModelID] + WHERE + (TM.[tModelKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (IB.[tModelKey] = @tModelKey) AND + (IB.[keyValue] = @keyValue) AND + (TM.[flag] = 0) + END + + IF @orKeys = 1 + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_tModel_identifierBag +GO + +-- ============================================= +-- Name: net_find_tModel_categoryBag +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_tModel_categoryBag' AND type = 'P') + DROP PROCEDURE net_find_tModel_categoryBag +GO + +CREATE PROCEDURE net_find_tModel_categoryBag + @contextID uniqueidentifier, + @keyName nvarchar(4000), + @keyValue nvarchar(4000), + @tModelKey uniqueidentifier, + @orKeys bit = 0, + @rows int OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int, + @genKeywordsMatch bit + + DECLARE @tempKeys TABLE( + [entityKey] uniqueidentifier) + + SET @contextRows = dbo.contextRows(@contextID) + + SET @genKeywordsMatch = 0 + + IF @tModelKey = dbo.genKeywordsKey() + SET @genKeywordsMatch = 1 + + IF @contextRows = 0 + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (TM.[flag] = 0) + END + ELSE + BEGIN + -- Include keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL(CB.[keyName],'') = ISNULL(@keyName,'')) AND + (TM.[flag] = 0) + END + END + ELSE + BEGIN + IF @genKeywordsMatch = 0 + BEGIN + -- Ignore keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (TM.[tModelKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (TM.[flag] = 0) + END + ELSE + BEGIN + -- Include keyName + INSERT @tempKeys( + [entityKey]) + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (TM.[tModelKey] IN (SELECT [entityKey] FROM [UDS_findResults] WHERE ([contextID] = @contextID))) AND + (CB.[tModelKey] = @tModelKey) AND + (CB.[keyValue] = @keyValue) AND + (ISNULL(CB.[keyName],'') = ISNULL(@keyName,'')) AND + (TM.[flag] = 0) + END + END + + IF @orKeys = 1 + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM [UDS_findScratch] WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + IF EXISTS(SELECT * FROM [UDS_findScratch] WHERE [contextID] = @contextID) + BEGIN + DELETE + [UDS_findScratch] + WHERE + ([entityKey] NOT IN (SELECT [entityKey] FROM @tempKeys WHERE [contextID] = @contextID)) + END + ELSE + BEGIN + INSERT [UDS_findScratch] ( + [contextID], + [entityKey]) + SELECT DISTINCT + @contextID, + [entityKey] + FROM + @tempKeys + END + END + + SELECT + @rows = COUNT(*) + FROM + [UDS_findScratch] + WHERE + ([contextID] = @contextID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_tModel_categoryBag +GO + +-- ============================================= +-- Name: net_find_tModel_commit +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'net_find_tModel_commit' AND type = 'P') + DROP PROCEDURE net_find_tModel_commit +GO + +CREATE PROCEDURE net_find_tModel_commit + @contextID uniqueidentifier, + @sortByNameAsc bit, + @sortByNameDesc bit, + @sortByDateAsc bit, + @sortByDateDesc bit, + @maxRows int, + @truncated int OUTPUT +WITH ENCRYPTION +AS +BEGIN + -- Finalizes a find_business and returns a key list + DECLARE + @error int, + @context nvarchar(4000), + @contextRows int + + SET @contextRows = dbo.contextRows(@contextID) + SET @truncated = 0 + + IF @contextRows = 0 + RETURN 0 + + DECLARE @tempKeys TABLE ( + [seqNo] bigint IDENTITY PRIMARY KEY , + [entityKey] uniqueidentifier, + [name] nvarchar(450) NULL, + [lastChange] bigint NULL, + [tModelID] bigint NULL) + + -- Set default sorting option + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) AND (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByNameAsc = 1 + + -- Set maxRows if default was passed + IF ISNULL(@maxRows,0) = 0 + SET @maxRows = dbo.configValue('Find.MaxRowsDefault') + + -- sortByNameAsc + IF (@sortByNameAsc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 2 ASC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 2 ASC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByNameDesc + IF (@sortByNameDesc = 1) + BEGIN + IF (@sortByDateAsc = 0) AND (@sortByDateDesc = 0) + SET @sortByDateAsc = 1 + + IF (@sortByDateAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 2 DESC, + 3 ASC, + 4 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 2 DESC, + 3 DESC, + 4 DESC + END + + GOTO endLabel + END + + -- sortByDateAsc + IF (@sortByDateAsc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 3 ASC, + 4 ASC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 3 ASC, + 4 ASC, + 2 DESC + END + + GOTO endLabel + END + + -- sortByDateDesc + IF (@sortByDateDesc = 1) + BEGIN + IF (@sortByNameAsc = 0) AND (@sortByNameDesc = 0) + SET @sortByNameAsc = 1 + + IF (@sortByNameAsc = 1) + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 3 DESC, + 4 DESC, + 2 ASC + END + ELSE + BEGIN + INSERT @tempKeys( + [entityKey], + [name], + [lastChange], + [tModelID]) + SELECT DISTINCT + FR.[entityKey], + TM.[name], + TM.[lastChange], + TM.[tModelID] + FROM + [UDS_findResults] FR + JOIN [UDC_tModels] TM ON FR.[entityKey] = TM.[tModelKey] AND @contextID = FR.[contextID] + ORDER BY + 3 DESC, + 4 DESC, + 2 DESC + END + + GOTO endLabel + END + +endLabel: + -- Set @truncated + IF (SELECT COUNT(*) FROM @tempKeys) > @maxRows + SET @truncated = 1 + + -- Return keys + SELECT + [entityKey] + FROM + @tempKeys + WHERE + ([seqNo] <= @maxRows) + + -- Run cleanup + EXEC net_find_cleanup @contextID + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_tModel_commit +GO + +-- ============================================= +-- Section: Miscellaneous +-- ============================================= + +-- ============================================= +-- Name: net_tModel_owner_update +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_tModel_owner_update' AND type = 'P') + DROP PROCEDURE net_tModel_owner_update +GO + +CREATE PROCEDURE net_tModel_owner_update + @tModelKey uniqueidentifier, + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @tModelID bigint, + @publisherID bigint + + -- Validate parameters + SET @tModelID = dbo.tModelID(@tModelKey) + + IF @tModelID IS NULL + BEGIN + SET @error = 60210 -- E_invalidKeyPassed + SET @context = 'tModelKey = ' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + SET @publisherID = dbo.publisherID(@PUID) + + IF @publisherID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID = ' + @PUID + GOTO errorLabel + END + + UPDATE + [UDC_tModels] + SET + [publisherID] = @publisherID + WHERE + ([tModelID] = @tModelID) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_tModel_owner_update +GO diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.trig.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.trig.sql new file mode 100644 index 0000000..8a3d5d1 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.trig.sql @@ -0,0 +1,31 @@ +-- Script: uddi.v2.trig.sql +-- Author: LRDohert@Microsoft.com +-- Description: Creates triggers +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: UDC_businessEntities +-- ============================================= + +-- ============================================= +-- Name: UDC_businessEntities_delete +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UDC_businessEntities_delete' AND type = 'TR') + DROP TRIGGER UDC_businessEntities_delete +GO + +CREATE TRIGGER UDC_businessEntities_delete + ON UDC_businessEntities + FOR DELETE +AS +BEGIN + IF (SELECT COUNT(*) FROM [deleted]) > 0 + BEGIN + DELETE + [UDC_serviceProjections] + WHERE + ([businessKey] IN (SELECT [businessKey] FROM [deleted])) + END +END -- UDC_businessEntities_delete +GO \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.uisp.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.uisp.sql new file mode 100644 index 0000000..d34b8d7 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.uisp.sql @@ -0,0 +1,1906 @@ +-- Script: uddi.net.win.uisp.sql +-- Author: ericguth@Microsoft.com +-- Description: Creates UI stored procedures. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Cache routines +-- ============================================= + +-- ============================================= +-- name: UI_getSessionCache +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getSessionCache' AND type = 'P') + DROP PROCEDURE UI_getSessionCache +GO + +CREATE PROCEDURE UI_getSessionCache + @PUID nvarchar(450), + @context nvarchar(20) = NULL +WITH ENCRYPTION +AS +BEGIN + IF NOT EXISTS (SELECT * FROM [UDS_sessionCache] WHERE [PUID] = @PUID AND [context] = @context) + RETURN 1 + + SELECT + [cacheValue] + FROM + [UDS_sessionCache] + WHERE + ([PUID] = @PUID) AND + ([context] = @context) + + RETURN 0 +END +GO + +-- ============================================= +-- name: UI_setSessionCache +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_setSessionCache' AND type = 'P') + DROP PROCEDURE UI_setSessionCache +GO + +CREATE PROCEDURE UI_setSessionCache + @PUID nvarchar(450), + @context nvarchar(20) = NULL, + @cacheValue ntext +WITH ENCRYPTION +AS +BEGIN + IF NOT EXISTS(SELECT * FROM [UDS_sessionCache] WHERE [PUID] = @PUID AND [context] = @context) + BEGIN + INSERT INTO [UDS_sessionCache] ( + [PUID], + [context], + [cacheValue]) + VALUES ( + @PUID, + @context, + @cacheValue) + END + ELSE + BEGIN + UPDATE + [UDS_sessionCache] + SET + [cacheValue] = @cacheValue + WHERE + ([PUID] = @PUID) AND + ([context] = @context) + END + + RETURN 0 +END +GO + +-- ============================================= +-- name: UI_removeSessionCache +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_removeSessionCache' AND type = 'P') + DROP PROCEDURE UI_removeSessionCache +GO + +CREATE PROCEDURE UI_removeSessionCache + @PUID nvarchar(450), + @context nvarchar(20) = NULL +WITH ENCRYPTION +AS +BEGIN + IF NOT EXISTS (SELECT * FROM [UDS_sessionCache] WHERE [PUID] = @PUID AND [context] = @context) + RETURN 1 + + DELETE FROM + [UDS_sessionCache] + WHERE + ([PUID] = @PUID) AND + ([context] = @context) + + RETURN 0 +END +GO + +-- ============================================= +-- Section: Publisher routines +-- ============================================= + +-- ============================================= +-- name: UI_savePublisher +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_savePublisher' AND type = 'P') + DROP PROCEDURE UI_savePublisher +GO + +CREATE PROCEDURE UI_savePublisher + @PUID nvarchar(450), + @isoLangCode varchar(17) = 'en', + @name nvarchar(100), + @email nvarchar(450), + @phone nvarchar(50), + @companyName nvarchar(100) = NULL, + @altPhone nvarchar(50) = NULL, + @addressLine1 nvarchar(4000) = NULL, + @addressLine2 nvarchar(4000) = NULL, + @city nvarchar(100) = NULL, + @stateProvince nvarchar(100) = NULL, + @postalCode nvarchar(100) = NULL, + @country nvarchar(100) = NULL, + @flag int = 0, + @securityToken uniqueidentifier = NULL, + @tier nvarchar(256) = '2' +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + IF 0 = LEN( RTRIM( LTRIM( @PUID ) ) )--blank PUID + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'PUID can not be blank or null. Please re-login.' + GOTO errorLabel + END + + IF EXISTS(SELECT [PUID] FROM [UDO_publishers] WHERE [PUID]=@PUID) + BEGIN + UPDATE + [UDO_publishers] + SET + [publisherStatusID] = dbo.publisherStatusID('loggedIn'), + [email] = LTRIM(@email), + [name] = @name, + [phone] = @phone, + [isoLangCode] = @isoLangCode, + [companyName] = @companyName, + [addressLine1] = @addressLine1, + [addressLine2] = @addressLine2, + [city] = @city, + [stateProvince] = @stateProvince, + [postalCode] = @postalCode, + [country] = @country, + [flag] = @flag, + [securityToken] = @securityToken, + [altPhone] = @altPhone + WHERE + [PUID] = @PUID + END + ELSE + BEGIN + INSERT [UDO_publishers] ( + [publisherStatusID], + [PUID], + [isoLangCode], + [name], + [email], + [phone], + [altPhone], + [addressLine1], + [addressLine2], + [city], + [stateProvince], + [country], + [flag], + [securityToken], + [postalCode], + [companyName]) + VALUES ( + dbo.publisherStatusID('loggedIn'), + @PUID, + @isoLangCode, + @name, + LTRIM(@email), + @phone, + @altPhone, + @addressLine1, + @addressLine2, + @city, + @stateProvince, + @country, + @flag, + @securityToken, + @postalCode, + @companyName) + + EXEC ADM_setPublisherTier @PUID, @tier + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: UI_getPublisher +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getPublisher' AND type = 'P') + DROP PROCEDURE UI_getPublisher +GO + +CREATE PROCEDURE UI_getPublisher + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + SELECT + [PUID], + [isoLangCode], + [name], + [email], + [phone], + [companyName], + [altphone], + [addressLine1], + [addressLine2], + [city], + [stateProvince], + [postalCode], + [country], + [flag], + [securityToken] + FROM + UDO_publishers + WHERE + PUID = @PUID +END +GO + +-- ============================================= +-- Name: UI_getPublisherFromSecurityToken +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getPublisherFromSecurityToken' AND type = 'P') + DROP PROCEDURE UI_getPublisherFromSecurityToken +GO + +CREATE PROCEDURE UI_getPublisherFromSecurityToken + @securityToken uniqueidentifier, + @PUID nvarchar(450) OUTPUT +WITH ENCRYPTION +AS +BEGIN + SELECT + @PUID = [PUID] + FROM + [UDO_publishers] + WHERE + [securityToken] = @securityToken +END +GO + +-- ============================================= +-- Name: UI_validatePublisher +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_validatePublisher' AND type = 'P') + DROP PROCEDURE UI_validatePublisher +GO + +CREATE PROCEDURE UI_validatePublisher + @PUID nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @flag int + + IF dbo.publisherExists(@PUID) = 0 + RETURN 10150 + + IF dbo.getPublisherStatus(@PUID) <> 'loggedIn' + RETURN 10110 + + SELECT + @flag = [flag] + FROM + UDO_publishers + WHERE + PUID = @PUID + + IF ((@flag & 0x01) <> 0x01) + RETURN 50013 + + RETURN 0 +END +GO + +-- ============================================= +-- Section: taxonomy routines +-- ============================================= + +-- ============================================= +-- Name: UI_getUnhostedTaxonomyTModels +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getUnhostedTaxonomyTModels' AND type = 'P') + DROP PROCEDURE UI_getUnhostedTaxonomyTModels +GO + +CREATE PROCEDURE UI_getUnhostedTaxonomyTModels +WITH ENCRYPTION +AS +BEGIN + SELECT DISTINCT + TM.[tModelKey], + TM.[name] + FROM + [UDC_tModels] TM + INNER JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + LEFT OUTER JOIN [UDT_taxonomies] TX ON TM.[tModelKey] = TX.[tModelKey] + WHERE + CB.[tModelKey] = '{C1ACF26D-9672-4404-9D70-39B756E62AB4}' AND + CB.[keyValue] = 'categorization' AND + TX.[taxonomyID] IS NULL +END +GO + +-- ============================================= +-- name: UI_getTaxonomies +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getTaxonomies' AND type = 'P') + DROP PROCEDURE UI_getTaxonomies +GO + +CREATE PROCEDURE UI_getTaxonomies + @tModelKey uniqueidentifier = NULL +WITH ENCRYPTION +AS +BEGIN + IF @tModelKey IS NULL + SELECT + TX.[taxonomyID], + TX.[tModelKey], + TM.[name] AS [description], + TX.[flag] + FROM + [UDT_taxonomies] TX + JOIN [UDC_tModels] TM ON TX.[tModelKey] = TM.[tModelKey] + ELSE + SELECT + TX.[taxonomyID], + TX.[tModelKey], + TM.[name] AS [description], + TX.[flag] + FROM + [UDT_taxonomies] TX + JOIN [UDC_tModels] TM ON TX.[tModelKey] = TM.[tModelKey] + WHERE + TX.[tModelKey] = @tModelKey + + RETURN @@ROWCOUNT +END +GO + +-- ============================================= +-- name: UI_getBrowsableTaxonomies +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getBrowsableTaxonomies' AND type = 'P') + DROP PROCEDURE UI_getBrowsableTaxonomies +GO + +CREATE PROCEDURE UI_getBrowsableTaxonomies + @tModelKey uniqueidentifier = NULL +WITH ENCRYPTION +AS +BEGIN + IF @tModelKey IS NULL + BEGIN + SELECT + TX.[taxonomyID], + TX.[tModelKey], + TM.[name] AS [description], + TX.[flag] + FROM + [UDT_taxonomies] TX + JOIN [UDC_tModels] TM ON TX.[tModelKey] = TM.[tModelKey] + WHERE + (TX.[flag] & 0x2) <> 0 + END + ELSE + BEGIN + SELECT + TX.[taxonomyID], + TX.[tModelKey], + TM.[name] AS [description], + TX.[flag] + FROM + [UDT_taxonomies] TX + JOIN [UDC_tModels] TM ON TX.[tModelKey] = TM.[tModelKey] + WHERE + (TX.[tModelKey] = @tModelKey) AND + (TX.[flag] & 0x2) <> 0 + END + + RETURN @@ROWCOUNT +END +GO + +-- ============================================= +-- name: UI_getTaxonomyChildrenNode +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getTaxonomyChildrenNode' AND type = 'P') + DROP PROCEDURE UI_getTaxonomyChildrenNode +GO + +CREATE PROCEDURE UI_getTaxonomyChildrenNode + @taxonomyID int, + @node nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + SELECT + * + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID] = @taxonomyID) AND + ([parentKeyValue] = @node) + ORDER BY + [keyName] + + RETURN @@ROWCOUNT +END +GO + +-- ============================================= +-- name: UI_isNodeValidForClassification +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_isNodeValidForClassification' AND type = 'P') + DROP PROCEDURE UI_isNodeValidForClassification +GO + +CREATE PROCEDURE UI_isNodeValidForClassification + @taxonomyID int, + @node nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + SELECT + [valid] + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID] = @taxonomyID) AND + ([keyValue] = @node) + + RETURN 0 +END +GO + +-- ============================================= +-- name: UI_isTaxonomyBrowsable +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_isTaxonomyBrowsable' AND type = 'P') + DROP PROCEDURE UI_isTaxonomyBrowsable +GO + +CREATE PROCEDURE UI_isTaxonomyBrowsable + @TModelKey uniqueidentifier, + @isBrowsable bit = 0 OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context char(255), + @flag int + + SET @isBrowsable = 0 + + SELECT + @flag = [flag] + FROM + [UDT_taxonomies] + WHERE + ([tModelKey] = @tModelKey) + + IF (@flag IS NULL) + BEGIN + SET @error = 60210 --E_InvalidKeyPassed + SET @context = 'tModelKey uuid:' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + IF ( @flag & 0x2 ) = 0x2 + SET @isBrowsable = 1 + ELSE + SET @isBrowsable = 0 + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- name: UI_setTaxonomyBrowsable +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_setTaxonomyBrowsable' AND type = 'P') + DROP PROCEDURE UI_setTaxonomyBrowsable +GO + +CREATE PROCEDURE UI_setTaxonomyBrowsable + @tModelKey uniqueidentifier, + @enabled bit = 0 +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context char(255), + @flag int + + SELECT + @flag = [flag] + FROM + [UDT_taxonomies] + WHERE + ([tModelKey] = @tModelKey) + + IF @flag IS NULL + BEGIN + SET @error = 60210 --E_InvalidKeyPassed + SET @context = 'tModelKey uuid:' + dbo.UUIDSTR(@tmodelKey) + GOTO errorLabel + END + + IF (1 = @enabled) + SET @flag = @flag | 0x2 + ELSE + BEGIN + -- Remove bit 0x4 + IF ( @flag & 0x2 ) = 0x2 + BEGIN + SET @flag = @flag ^ 0x2 + END + END + + -- run update + UPDATE + [UDT_taxonomies] + SET + [flag] = @flag + WHERE + ([tModelKey] = @tModelKey) + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- name: UI_getTaxonomyChildrenRoot +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getTaxonomyChildrenRoot' AND type = 'P') + DROP PROCEDURE UI_getTaxonomyChildrenRoot +GO + +CREATE PROCEDURE UI_getTaxonomyChildrenRoot + @taxonomyID int +WITH ENCRYPTION +AS +BEGIN + SELECT + * + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID]=@taxonomyID) AND + ([parentKeyValue]='') + ORDER BY + [keyName] + + RETURN @@ROWCOUNT +END +GO + +-- ============================================= +-- name: UI_getTaxonomyName +-- ============================================= +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getTaxonomyName' AND type = 'P') + DROP PROCEDURE UI_getTaxonomyName +GO +CREATE PROCEDURE UI_getTaxonomyName + @TaxonomyID int, + @ID varchar(450) +WITH ENCRYPTION +AS +BEGIN + SELECT + [KeyName] + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID]=@TaxonomyID) AND + ([keyValue]=@ID) +END +GO + +-- ============================================= +-- name: UI_getTaxonomyParent +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getTaxonomyParent' AND type = 'P') + DROP PROCEDURE UI_getTaxonomyParent +GO + +CREATE PROCEDURE UI_getTaxonomyParent + @TaxonomyID int, + @ID varchar(450) +WITH ENCRYPTION +AS +BEGIN + SELECT + [parentKeyValue] + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID]=@TaxonomyID) AND + ([keyValue]=@ID) +END +GO + +-- ============================================= +-- Section: identifier routines +-- ============================================= + +-- ============================================= +-- name: UI_getIdentifierTModels +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'UI_getIdentifierTModels' AND type = 'P') + DROP PROCEDURE UI_getIdentifierTModels +GO + +CREATE PROCEDURE UI_getIdentifierTModels +WITH ENCRYPTION +AS +BEGIN + SELECT DISTINCT + TM.[tModelKey], + TM.[name] + FROM + [UDC_categoryBag_TM] CB + INNER JOIN + [UDC_tModels] TM + ON + TM.tModelID = CB.tModelID + WHERE + CB.[tModelKey] = '{C1ACF26D-9672-4404-9D70-39B756E62AB4}' AND + CB.[keyValue] = 'identifier' AND + TM.[flag] = 0 + + RETURN @@ROWCOUNT +END +GO + +-- ============================================= +-- Section: Statistics routines +-- ============================================= + +-- ============================================= +-- Name: UI_getEntityCounts +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'UI_getEntityCounts' AND type = 'P') + DROP PROCEDURE UI_getEntityCounts +GO + +CREATE PROCEDURE UI_getEntityCounts +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @count bigint, + @reportID sysname, + @reportStatusID tinyint, + @RC int + + DECLARE @results TABLE( + [sortOrder] int, + [section] nvarchar(250), + [label] nvarchar(250), + [value] nvarchar(3500)) + + SET @reportID = 'UI_getEntityCounts' + + IF dbo.isReportRunning( @reportID, GETDATE() ) = 1 + RETURN 0 + + SET @reportStatusID = dbo.reportStatusID('Processing') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) + VALUES( + @reportID, + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + '') + + -- Calculate tModel count + SELECT @count = COUNT(*) FROM [UDC_tModels] WHERE [flag] = 0 + + INSERT @results VALUES( + 1, + N'HEADING_STATISTICS_SECTION_ENTITYCOUNTS', + N'HEADING_STATISTICS_LABEL_TMODELCOUNT', + @count) + + -- Calculate businessEntity count + SELECT @count = COUNT(*) FROM [UDC_businessEntities] + + INSERT @results VALUES( + 2, + N'HEADING_STATISTICS_SECTION_ENTITYCOUNTS', + N'HEADING_STATISTICS_LABEL_BUSINESSCOUNT', + @count) + + -- Calculate businessService count + SELECT @count = COUNT(*) FROM [UDC_businessServices] + + INSERT @results VALUES( + 3, + N'HEADING_STATISTICS_SECTION_ENTITYCOUNTS', + N'HEADING_STATISTICS_LABEL_SERVICECOUNT', + @count) + + -- Calculate bindingTemplate count + SELECT @count = COUNT(*) FROM [UDC_bindingTemplates] + + INSERT @results VALUES( + 4, + N'HEADING_STATISTICS_SECTION_ENTITYCOUNTS', + N'HEADING_STATISTICS_LABEL_BINDINGCOUNT', + @count) + + BEGIN TRANSACTION + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines]( + [reportID], + [section], + [label], + [value]) + SELECT + @reportID, + [section], + [label], + [value] + FROM + @results + ORDER BY + [section], + [sortOrder] + + COMMIT TRANSACTION + + SET @reportStatusID = dbo.reportStatusID('Available') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 + SET @context='' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- UI_getEntityCounts +GO + +-- ============================================= +-- Name: UI_getPublisherStats +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'UI_getPublisherStats' AND type = 'P') + DROP PROCEDURE UI_getPublisherStats +GO + +CREATE PROCEDURE UI_getPublisherStats +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @count bigint, + @reportID sysname, + @reportStatusID tinyint, + @RC int + + DECLARE @results TABLE( + [sortOrder] int, + [section] nvarchar(250), + [label] nvarchar(250), + [value] nvarchar(3500)) + + SET @reportID = 'UI_getPublisherStats' + + IF dbo.isReportRunning( @reportID, GETDATE() ) = 1 + RETURN 0 + + SET @reportStatusID = dbo.reportStatusID('Processing') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) + VALUES( + @reportID, + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + '') + + -- Calculate publisher count + SELECT @count = COUNT(*) FROM [UDO_publishers] + + INSERT @results VALUES( + 1, + N'HEADING_STATISTICS_SECTION_PUBSTATS', + N'HEADING_STATISTICS_LABEL_PUBCOUNT', + CAST(@count AS nvarchar(3500))) + + -- Calculate publishers with active publications + DECLARE @publishers TABLE( + [publisherID] int) + + INSERT @publishers ( + [publisherID]) + SELECT DISTINCT + [publisherID] + FROM + [UDC_tModels] + WHERE + ([flag] = 0) + + INSERT @publishers ( + [publisherID]) + SELECT DISTINCT + [publisherID] + FROM + [UDC_businessEntities] + + SELECT @count = COUNT(DISTINCT [publisherID]) FROM @publishers + + INSERT @results VALUES( + 2, + N'HEADING_STATISTICS_SECTION_PUBSTATS', + N'HEADING_STATISTICS_LABEL_PUBWITHPUB', + CAST(@count AS nvarchar(3500))) + + BEGIN TRANSACTION + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines]( + [reportID], + [section], + [label], + [value]) + SELECT + @reportID, + [section], + [label], + [value] + FROM + @results + ORDER BY + [section], + [sortOrder] + + COMMIT TRANSACTION + + SET @reportStatusID = dbo.reportStatusID('Available') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 + SET @context='' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- UI_getPublisherStats +GO + +-- ============================================= +-- Name: UI_getTopPublishers +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'UI_getTopPublishers' AND type = 'P') + DROP PROCEDURE UI_getTopPublishers +GO + +CREATE PROCEDURE UI_getTopPublishers +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @count int, + @reportID sysname, + @reportStatusID tinyint, + @RC int + + DECLARE @results TABLE( + [sortOrder] int, + [section] nvarchar(250), + [label] nvarchar(250), + [value] bigint) + + SET @reportID = 'UI_getTopPublishers' + + IF dbo.isReportRunning( @reportID, GETDATE() ) = 1 + RETURN 0 + + SET @reportStatusID = dbo.reportStatusID('Processing') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) + VALUES( + @reportID, + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + '') + + -- Calculate top 10 tModel publishers + INSERT @results ( + [sortOrder], + [section], + [label], + [value]) + SELECT TOP 10 + 1, + N'HEADING_STATISTICS_LABEL_TMODELCOUNT', + PU.[name], + COUNT(PU.[name]) + FROM + [UDO_publishers] PU + JOIN [UDC_tModels] TM ON PU.[publisherID] = TM.[publisherID] + WHERE + (TM.[flag] = 0) + GROUP BY + PU.[name] + ORDER BY + 4 DESC + + -- Calculate top 10 businessEntity publishers + INSERT @results ( + [sortOrder], + [section], + [label], + [value]) + SELECT TOP 10 + 2, + N'HEADING_STATISTICS_LABEL_BUSINESSCOUNT', + PU.[name], + COUNT(PU.[name]) + FROM + [UDO_publishers] PU + JOIN [UDC_businessEntities] BE ON PU.[publisherID] = BE.[publisherID] + GROUP BY + PU.[name] + ORDER BY + 4 DESC + + -- Calculate top 10 businessService publishers + INSERT @results ( + [sortOrder], + [section], + [label], + [value]) + SELECT TOP 10 + 3, + N'HEADING_STATISTICS_LABEL_SERVICECOUNT', + PU.[name], + COUNT(PU.[name]) + FROM + [UDO_publishers] PU + JOIN [UDC_businessEntities] BE ON PU.[publisherID] = BE.[publisherID] + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + GROUP BY + PU.[name] + ORDER BY + 4 DESC + + -- Calculate top 10 bindingTemplate publishers + INSERT @results ( + [sortOrder], + [section], + [label], + [value]) + SELECT TOP 10 + 4, + N'HEADING_STATISTICS_LABEL_BINDINGCOUNT', + PU.[name], + COUNT(PU.[name]) + FROM + [UDO_publishers] PU + JOIN [UDC_businessEntities] BE ON PU.[publisherID] = BE.[publisherID] + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + GROUP BY + PU.[name] + ORDER BY + 4 DESC + + BEGIN TRANSACTION + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines]( + [reportID], + [section], + [label], + [value]) + SELECT + @reportID, + [section], + [label], + CAST([value] AS nvarchar(3500)) + FROM + @results + ORDER BY + [sortOrder] + + COMMIT TRANSACTION + + SET @reportStatusID = dbo.reportStatusID('Available') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 + SET @context='' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- UI_getTopPublishers +GO + +-- ============================================= +-- Name: UI_getTaxonomyStats +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'UI_getTaxonomyStats' AND type = 'P') + DROP PROCEDURE UI_getTaxonomyStats +GO + +CREATE PROCEDURE UI_getTaxonomyStats +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @count int, + @taxCursor cursor, + @taxCursorStatus int, + @taxonomyID int, + @tModelKey uniqueidentifier, + @sortOrder int, + @section nvarchar(250), + @label nvarchar(250), + @value nvarchar(3500), + @valCursor cursor, + @valCursorStatus int, + @keyValue nvarchar(128), + @keyName nvarchar(128), + @reportID sysname, + @reportStatusID tinyint, + @RC int + + DECLARE @results TABLE( + [sortOrder] int, + [section] nvarchar(250), + [label] nvarchar(250), + [value] nvarchar(3500)) + + DECLARE @taxCounts TABLE( + [taxonomyID] bigint, + [tModelKey] uniqueidentifier, + [count] bigint) + + DECLARE @valCounts TABLE( + [keyName] nvarchar(128), + [keyValue] nvarchar(128), + [count] bigint) + + SET @reportID = 'UI_getTaxonomyStats' + + IF dbo.isReportRunning( @reportID, GETDATE() ) = 1 + RETURN 0 + + SET @reportStatusID = dbo.reportStatusID('Processing') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 -- E_subProcFailure + SET @context='' + GOTO errorLabel + END + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines] ( + [reportID], + [section], + [label], + [value]) + VALUES( + @reportID, + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + 'HEADING_STATISTICS_LABEL_RECALCINPROGRESS', + '') + + -- Loop through each taxonomy and calculate the total number of references + SET @taxCursor = CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR + SELECT + [taxonomyID], + [tModelKey] + FROM + [UDT_taxonomies] + + OPEN @taxCursor + + FETCH NEXT FROM @taxCursor INTO + @taxonomyID, + @tModelKey + + SET @taxCursorStatus = @@FETCH_STATUS + + WHILE @taxCursorStatus = 0 + BEGIN + SET @count = 0 + + -- Calculate the number of categorizations for tModels + SELECT + @count = @count + COUNT(*) + FROM + [UDC_categoryBag_TM] + WHERE + ([tModelKey] = @tModelKey) + + SELECT + @count = @count + COUNT(*) + FROM + [UDC_identifierBag_TM] + WHERE + ([tModelKey] = @tModelKey) + + -- Calculate the number of categorizations for businessEntities + SELECT + @count = @count + COUNT(*) + FROM + [UDC_categoryBag_BE] + WHERE + ([tModelKey] = @tModelKey) + + SELECT + @count = @count + COUNT(*) + FROM + [UDC_identifierBag_BE] + WHERE + ([tModelKey] = @tModelKey) + + -- Calculate the number of categorizations for businessServices + SELECT + @count = @count + COUNT(*) + FROM + [UDC_categoryBag_BS] + WHERE + ([tModelKey] = @tModelKey) + + INSERT @taxCounts( + [taxonomyID], + [tModelKey], + [count]) + VALUES( + @taxonomyID, + @tModelKey, + @count) + + FETCH NEXT FROM @taxCursor INTO + @taxonomyID, + @tModelKey + + SET @taxCursorStatus = @@FETCH_STATUS + END -- taxCursor + + CLOSE @taxCursor + DEALLOCATE @taxCursor + + -- Loop through each taxonomy sorted by total references in descending order + + SET @taxCursor = CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR + SELECT + [taxonomyID], + [tModelKey], + [count] + FROM + @taxCounts + ORDER BY + [count] DESC + + OPEN @taxCursor + + FETCH NEXT FROM @taxCursor INTO + @taxonomyID, + @tModelKey, + @count + + SET @taxCursorStatus = @@FETCH_STATUS + + SET @sortOrder = 0 + + WHILE @taxCursorStatus = 0 + BEGIN + SET @sortOrder = @sortOrder + 1 + + SELECT + @section = [name] + ' (' + dbo.addURN(@tModelKey) +')' + FROM + [UDC_tModels] + WHERE + [tModelKey] = @tModelKey + + SET @label = 'HEADING_STATISTICS_LABEL_TAXREFS' + SET @value = CAST(@count AS nvarchar(3500)) + + -- Add taxonomy row to results + INSERT @results VALUES( + @sortOrder, + @section, + @label, + @value) + + DELETE @valCounts + + -- Calculate the top ten categorizations for the current taxonomy + SET @valCursor = CURSOR LOCAL READ_ONLY FORWARD_ONLY FOR + SELECT + [keyName], + [keyValue] + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID] = @taxonomyID) + + OPEN @valCursor + + FETCH NEXT FROM @valCursor INTO + @keyName, + @keyValue + + SET @valCursorStatus = @@FETCH_STATUS + + WHILE @valCursorStatus = 0 + BEGIN + SET @count = 0 + + -- Calculate the number of categorizations for tModels + SELECT + @count = @count + COUNT(*) + FROM + [UDC_categoryBag_TM] + WHERE + ([tModelKey] = @tModelKey) AND ([keyValue] = @keyValue) + + SELECT + @count = @count + COUNT(*) + FROM + [UDC_identifierBag_TM] + WHERE + ([tModelKey] = @tModelKey) AND ([keyValue] = @keyValue) + + -- Calculate the number of categorizations for businessEntities + SELECT + @count = @count + COUNT(*) + FROM + [UDC_categoryBag_BE] + WHERE + ([tModelKey] = @tModelKey) AND ([keyValue] = @keyValue) + + SELECT + @count = @count + COUNT(*) + FROM + [UDC_identifierBag_BE] + WHERE + ([tModelKey] = @tModelKey) AND ([keyValue] = @keyValue) + + -- Calculate the number of categorizations for businessServices + SELECT + @count = @count + COUNT(*) + FROM + [UDC_categoryBag_BS] + WHERE + ([tModelKey] = @tModelKey) AND ([keyValue] = @keyValue) + + IF (@count > 0) + BEGIN + INSERT @valCounts VALUES( + @keyName, + @keyValue, + @count) + END + + FETCH NEXT FROM @valCursor INTO + @keyName, + @keyValue + + SET @valCursorStatus = @@FETCH_STATUS + END -- valCursor + + CLOSE @valCursor + + IF (SELECT COUNT(*) FROM @valCounts) > 0 + BEGIN + SET @label = 'HEADING_STATISTICS_LABEL_TAXVALREFS' + + INSERT @results ( + [sortOrder], + [section], + [label], + [value]) + SELECT TOP 10 + @sortOrder, + '-- ' + ISNULL([keyName], N'') + ' (' + [keyValue] + ')', + @label, + CAST([count] AS nvarchar(3500)) + FROM + @valCounts + ORDER BY + [count] DESC + END + + FETCH NEXT FROM @taxCursor INTO + @taxonomyID, + @tModelKey, + @count + + SET @taxCursorStatus = @@FETCH_STATUS + END + + CLOSE @taxCursor + + BEGIN TRANSACTION + + DELETE + [UDO_reportLines] + WHERE + ([reportID] = @reportID) + + INSERT [UDO_reportLines]( + [reportID], + [section], + [label], + [value]) + SELECT + @reportID, + [section], + [label], + [value] + FROM + @results + ORDER BY + [sortOrder] + + COMMIT TRANSACTION + + SET @reportStatusID = dbo.reportStatusID('Available') + + EXEC @RC=net_report_update @reportID, @reportStatusID + + IF @RC<> 0 + BEGIN + SET @error=50006 + SET @context='' + GOTO errorLabel + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- UI_getTaxonomyStats +GO + +-- ============================================= +-- Section: Visual Studio Procedures +-- ============================================= + +-- ============================================= +-- Name: VS_business_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'VS_business_get' AND type = 'P') + DROP PROCEDURE VS_business_get +GO + +CREATE PROCEDURE VS_business_get + @businessName nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @typesTModelKey uniqueidentifier, + @wsdlKeyValue nvarchar(255) + + SET @typesTModelKey = 'C1ACF26D-9672-4404-9D70-39B756E62AB4' + SET @wsdlKeyValue = 'wsdlSpec' + + DECLARE @wsdlTModelKeys TABLE ( + [tModelKey] uniqueidentifier) + + DECLARE @tempBusiness TABLE ( + [businessID] bigint) + + INSERT @wsdlTModelKeys + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @typesTModelKey) AND + (CB.[keyValue] = @wsdlKeyValue) + + INSERT @tempBusiness( + [businessID]) + SELECT DISTINCT + BN.[businessID] + FROM + [UDC_names_BE] BN + WHERE + (BN.[name] LIKE @businessName + '%') + + SELECT DISTINCT + (SELECT TOP 1 BN.[name] FROM [UDC_names_BE] BN WHERE BN.[businessID] = BE.[businessID]) AS [name], + BE.[businessKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TMI ON BT.[bindingID] = TMI.[bindingID] + WHERE + (BE.[businessID] IN (SELECT TB.[businessID] FROM @tempBusiness TB)) AND + (TMI.[tModelKey] IN (SELECT [tModelKey] FROM @wsdlTModelKeys)) + ORDER BY + 1 ASC + + RETURN @@ROWCOUNT + +END -- VS_business_get +GO + +-- ============================================= +-- Name: VS_service_get +-- ============================================= + +IF EXISTS (SELECT name FROM dbo.sysobjects WHERE name = 'VS_service_get' AND type = 'P') + DROP PROCEDURE [dbo].[VS_service_get] +GO + +CREATE PROCEDURE VS_service_get + @businessKey uniqueidentifier +WITH ENCRYPTION +AS +BEGIN + DECLARE + @typesTModelKey uniqueidentifier, + @wsdlKeyValue nvarchar(255) + + SET @typesTModelKey = 'C1ACF26D-9672-4404-9D70-39B756E62AB4' + SET @wsdlKeyValue = 'wsdlSpec' + + DECLARE @wsdlTModelKeys TABLE ( + [tModelKey] uniqueidentifier) + + INSERT @wsdlTModelKeys + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @typesTModelKey) AND + (CB.[keyValue] = @wsdlKeyValue) + + IF @@ROWCOUNT = 0 + -- There were no tModels with the wsdl categorization, so return a non-zero return code to indicate an error + RETURN -1 + + SELECT + (SELECT TOP 1 BN.[name] FROM [UDC_names_BE] BN WHERE BN.[businessID] = BE.[businessID]) AS [businessName], + BS.[serviceKey], + (SELECT TOP 1 SN.[name] FROM [UDC_names_BS] SN WHERE SN.[serviceID] = BS.[serviceID]) AS [serviceName], + SD.[description], + BT.[accessPoint], + TM.[name] AS [tModelName], + TMD.[description] AS [tModelDescription], + TM.[overviewURL] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TMI ON BT.[bindingID] = TMI.[bindingID] + JOIN [UDC_tModels] TM ON TM.[tModelKey] = TMI.[tModelKey] + LEFT OUTER JOIN [UDC_serviceDesc] SD ON BS.[serviceID] = SD.[serviceID] + LEFT OUTER JOIN [UDC_tModelDesc] TMD ON (TM.[tModelID] = TMD.[tModelID] AND TMD.[isoLangCode] = 'en' AND TMD.[elementID] = 1 ) + WHERE + (BE.[businessKey] = @businessKey) AND + (TMI.[tModelKey] IN (SELECT [tModelKey] FROM @wsdlTModelKeys)) + ORDER BY + 3 DESC, + BS.[serviceKey] + + RETURN 0 +END -- VS_service_get +GO + + +-- ============================================= +-- Name: VS_AWR_businesses_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'VS_AWR_businesses_get' AND type = 'P') + DROP PROCEDURE VS_AWR_businesses_get +GO + +CREATE PROCEDURE VS_AWR_businesses_get + @businessName nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @typesTModelKey uniqueidentifier, + @wsdlKeyValue nvarchar(255), + @services cursor, + @serviceID bigint, + @serviceKey uniqueidentifier, + @businessID bigint, + @businessName2 nvarchar(450), + @businessKey uniqueidentifier, + @serviceName nvarchar(450) + + -- + -- Get a list of tModel keys for tModels categorized as a wsdlSpec + -- + + SET @typesTModelKey = 'C1ACF26D-9672-4404-9D70-39B756E62AB4' + SET @wsdlKeyValue = 'wsdlSpec' + + DECLARE @wsdlTModelKeys TABLE ( + [tModelKey] uniqueidentifier) + + INSERT @wsdlTModelKeys + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @typesTModelKey) AND + (CB.[keyValue] = @wsdlKeyValue) + + -- + -- Setup temporary table for staging results + -- + + DECLARE @results TABLE( + [businessName] nvarchar(450), + [businessKey] uniqueidentifier, + [serviceName] nvarchar(450), + [serviceKey] uniqueidentifier) + + -- + -- Cursor through every service that: + -- 1. Has a tModelInstance that references a wsdlTModelKey + -- 2. Is owned by a business that meets the name search criteria + -- Build results from this list of services + -- + + SET @services = CURSOR LOCAL READ_ONLY FORWARD_ONLY FOR + SELECT + BS.[serviceID], + BS.[serviceKey], + BS.[businessID] + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TMI ON BT.[bindingID] = TMI.[bindingID] + WHERE + (TMI.[tModelKey] IN (SELECT [tModelKey] FROM @wsdlTModelKeys)) AND + (BS.[businessID] IN (SELECT DISTINCT BN.[businessID] FROM [UDC_names_BE] BN WHERE (BN.[name] LIKE @businessName + '%'))) + + OPEN @services + + FETCH NEXT FROM @services INTO + @serviceID, + @serviceKey, + @businessID + + WHILE @@FETCH_STATUS = 0 + BEGIN + -- + -- Retrieve the name of the business that owns the service + -- + + SET @businessName2 = (SELECT TOP 1 BN.[name] FROM [UDC_names_BE] BN WHERE (BN.[businessID] = @businessID)) + + -- + -- Retrieve the key of the business that owns the service + -- + + SET @businessKey = dbo.businessKey(@businessID) + + -- + -- Retrieve the name of the service + -- + + SET @serviceName = (SELECT TOP 1 SN.[name] FROM [UDC_names_BS] SN WHERE (SN.[serviceID] = @serviceID)) + + -- + -- Add results to results table + -- + + INSERT @results VALUES( + @businessName2, + @businessKey, + @serviceName, + @serviceKey) + + FETCH NEXT FROM @services INTO + @serviceID, + @serviceKey, + @businessID + END + + CLOSE @services + + -- + -- Return results + -- + + SELECT * FROM @results + +END +GO + + +-- ============================================= +-- Name: VS_AWR_services_get +-- ============================================= + +IF EXISTS (SELECT name FROM dbo.sysobjects WHERE name = 'VS_AWR_services_get' AND type = 'P') + DROP PROCEDURE [dbo].[VS_AWR_services_get] +GO + +CREATE PROCEDURE VS_AWR_services_get + @serviceName nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @typesTModelKey uniqueidentifier, + @wsdlKeyValue nvarchar(255) + + SET @typesTModelKey = 'C1ACF26D-9672-4404-9D70-39B756E62AB4' + SET @wsdlKeyValue = 'wsdlSpec' + + DECLARE @wsdlTModelKeys TABLE ( + [tModelKey] uniqueidentifier) + + INSERT @wsdlTModelKeys + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @typesTModelKey) AND + (CB.[keyValue] = @wsdlKeyValue) + + IF @@ROWCOUNT = 0 + -- There were no tModels with the wsdl categorization, so return a non-zero return code to indicate an error + RETURN -1 + + SELECT DISTINCT + (SELECT TOP 1 BN.[name] FROM [UDC_names_BE] BN WHERE BN.[businessID] = BE.[businessID]) AS [businessName], + BE.[businessKey], + SN.[name] AS [serviceName], + BS.[serviceKey] + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TMI ON BT.[bindingID] = TMI.[bindingID] + JOIN [UDC_tModels] TM ON TM.[tModelKey] = TMI.[tModelKey] + JOIN [UDC_names_BS] SN ON SN.[serviceID] = BT.[serviceID] + LEFT OUTER JOIN [UDC_serviceDesc] SD ON BS.[serviceID] = SD.[serviceID] + LEFT OUTER JOIN [UDC_tModelDesc] TMD ON (TM.[tModelID] = TMD.[tModelID] AND TMD.[isoLangCode] = 'en' AND TMD.[elementID] = 1 ) + WHERE + (TMI.[tModelKey] IN (SELECT [tModelKey] FROM @wsdlTModelKeys)) AND + SN.[name] like @serviceName + '%' + ORDER BY + 1 ASC + + RETURN 0 +END +GO + +-- ============================================= +-- Name: VS_AWR_categorization_get +-- ============================================= + +-- This sproc will return all business services that are categorized by the given tModelKey, regardless of +-- whether the business entity that they belong to is categorized by that same tModelKey +IF EXISTS (SELECT name FROM dbo.sysobjects WHERE name = 'VS_AWR_categorization_get' AND type = 'P') + DROP PROCEDURE [dbo].[VS_AWR_categorization_get] +GO + +CREATE PROCEDURE VS_AWR_categorization_get + @tModelKey uniqueidentifier, + @keyValue nvarchar(255) + +WITH ENCRYPTION +AS +BEGIN + DECLARE + @typesTModelKey uniqueidentifier, + @wsdlKeyValue nvarchar(255) + + SET @typesTModelKey = 'C1ACF26D-9672-4404-9D70-39B756E62AB4' + SET @wsdlKeyValue = 'wsdlSpec' + + DECLARE @wsdlTModelKeys TABLE ( + [tModelKey] uniqueidentifier) + + INSERT @wsdlTModelKeys + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @typesTModelKey) AND + (CB.[keyValue] = @wsdlKeyValue) + + IF @@ROWCOUNT = 0 + -- There were no tModels that match, so return a non-zero return code to indicate an error + RETURN -1 + + SELECT DISTINCT + (SELECT TOP 1 BN.[name] FROM [UDC_names_BE] BN WHERE BN.[businessID] = BE.[businessID]) AS [businessName], + BE.[businessKey], + SN.[name] AS [serviceName], + BS.[serviceKey] + + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TMI ON BT.[bindingID] = TMI.[bindingID] + JOIN [UDC_tModels] TM ON TM.[tModelKey] = TMI.[tModelKey] + JOIN [UDC_names_BS] SN ON SN.[serviceID] = BT.[serviceID] + LEFT OUTER JOIN [UDC_categoryBag_BE] CBE ON CBE.[businessID] = BS.[businessID] + lEFT OUTER JOIN [UDC_categoryBag_BS] CBS ON CBS.[serviceID] = BT.[serviceID] + LEFT OUTER JOIN [UDC_serviceDesc] SD ON BS.[serviceID] = SD.[serviceID] + LEFT OUTER JOIN [UDC_tModelDesc] TMD ON (TM.[tModelID] = TMD.[tModelID] AND TMD.[isoLangCode] = 'en' AND TMD.[elementID] = 1 ) + WHERE + (TMI.[tModelKey] IN (SELECT [tModelKey] FROM @wsdlTModelKeys)) AND + (CBS.[tModelKey] = @tModelKey AND CBS.[keyValue] LIKE @keyValue) OR + (CBE.[tModelKey] = @tModelKey AND CBE.[keyValue] LIKE @keyValue) + + ORDER BY + 1 ASC + + RETURN 0 +END +GO + diff --git a/inetsrv/uddi/source/setup/db/ca/uddi.v2.xp.uninstall.sql b/inetsrv/uddi/source/setup/db/ca/uddi.v2.xp.uninstall.sql new file mode 100644 index 0000000..4313a86 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/ca/uddi.v2.xp.uninstall.sql @@ -0,0 +1,21 @@ +-- Script: uddi.v2.xp.uninstall.sql +-- Author: ericlee@Microsoft.com +-- Description: Un-registers extended stored procedures needed by UDDI Services. This script must be run against the master +-- database. +-- Note: This file is best viewed and edited with a tab width of 2. + +-- Tell SQL Server to let go of the DLLs so we can delete them later +DBCC xp_reset_key(FREE) +GO + +DBCC xp_recalculate_statistics(FREE) +GO + +-- Remove the extended stored procedures +IF EXISTS (SELECT * FROM sysobjects where name = 'xp_reset_key' and type = 'X') + EXEC sp_dropextendedproc 'xp_reset_key' +GO + +IF EXISTS (SELECT * FROM sysobjects where name= 'xp_recalculate_statistics' and type = 'X') + EXEC sp_dropextendedproc 'xp_recalculate_statistics' +GO \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/dirs b/inetsrv/uddi/source/setup/db/dirs new file mode 100644 index 0000000..f492419 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/dirs @@ -0,0 +1 @@ +dirs = ca ca.unmanaged wsi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/wsi/makefile b/inetsrv/uddi/source/setup/db/wsi/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/wsi/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/db/wsi/obj/_objects.mac b/inetsrv/uddi/source/setup/db/wsi/obj/_objects.mac new file mode 100644 index 0000000..8c49520 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/wsi/obj/_objects.mac @@ -0,0 +1,16 @@ +386_OBJECTS= + +PASS0_386_OBJECTS= + +IA64_OBJECTS= + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/db/wsi/placefil.txt b/inetsrv/uddi/source/setup/db/wsi/placefil.txt new file mode 100644 index 0000000..3648ee9 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/wsi/placefil.txt @@ -0,0 +1 @@ +uddidb.msi uddi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/wsi/sources b/inetsrv/uddi/source/setup/db/wsi/sources new file mode 100644 index 0000000..df493d5 --- /dev/null +++ b/inetsrv/uddi/source/setup/db/wsi/sources @@ -0,0 +1,8 @@ +TARGETNAME= +TARGETTYPE=NOTARGET +TARGETPATH=. +SOURCES= + +MISCFILES = uddidb.msi + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/db/wsi/uddidb.msi b/inetsrv/uddi/source/setup/db/wsi/uddidb.msi new file mode 100644 index 0000000..245e112 Binary files /dev/null and b/inetsrv/uddi/source/setup/db/wsi/uddidb.msi differ diff --git a/inetsrv/uddi/source/setup/db/wsi/uddidb.wsi b/inetsrv/uddi/source/setup/db/wsi/uddidb.wsi new file mode 100644 index 0000000..7e60eaf Binary files /dev/null and b/inetsrv/uddi/source/setup/db/wsi/uddidb.wsi differ diff --git a/inetsrv/uddi/source/setup/dirs b/inetsrv/uddi/source/setup/dirs new file mode 100644 index 0000000..ca8911e --- /dev/null +++ b/inetsrv/uddi/source/setup/dirs @@ -0,0 +1 @@ +dirs = admin web db ocm msitoddf uddimsifiler \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/msitoddf/makefile b/inetsrv/uddi/source/setup/msitoddf/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/msitoddf/msitoddf.h b/inetsrv/uddi/source/setup/msitoddf/msitoddf.h new file mode 100644 index 0000000..05dd5f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/msitoddf.h @@ -0,0 +1,2 @@ +#pragma once +#include "resource.h" diff --git a/inetsrv/uddi/source/setup/msitoddf/msitoddf.rc b/inetsrv/uddi/source/setup/msitoddf/msitoddf.rc new file mode 100644 index 0000000..17b2fed --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/msitoddf.rc @@ -0,0 +1,70 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELLO "Hello from MFC!" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/inetsrv/uddi/source/setup/msitoddf/msitoddf.vcproj b/inetsrv/uddi/source/setup/msitoddf/msitoddf.vcproj new file mode 100644 index 0000000..0d0f43f --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/msitoddf.vcproj @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/setup/msitoddf/obj/_objects.mac b/inetsrv/uddi/source/setup/msitoddf/obj/_objects.mac new file mode 100644 index 0000000..2f482b2 --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/obj/_objects.mac @@ -0,0 +1,24 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\msitoddf.res \ + $(_OBJ_DIR)\i386\msitoddf.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\msitoddf.res \ + $(_OBJ_DIR)\ia64\msitoddf.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\msitoddf.res \ + $(_OBJ_DIR)\amd64\msitoddf.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\msitoddf.res \ + $(_OBJ_DIR)\arm\msitoddf.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.exe b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.exe new file mode 100644 index 0000000..c431f73 Binary files /dev/null and b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.exe differ diff --git a/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.obj b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.obj new file mode 100644 index 0000000..98a9e4b Binary files /dev/null and b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.obj differ diff --git a/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.pdb b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.pdb new file mode 100644 index 0000000..73139d1 Binary files /dev/null and b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.pdb differ diff --git a/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.res b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.res new file mode 100644 index 0000000..ad927ce Binary files /dev/null and b/inetsrv/uddi/source/setup/msitoddf/obj/i386/msitoddf.res differ diff --git a/inetsrv/uddi/source/setup/msitoddf/obj/i386/stdafx.obj b/inetsrv/uddi/source/setup/msitoddf/obj/i386/stdafx.obj new file mode 100644 index 0000000..1c1cab5 Binary files /dev/null and b/inetsrv/uddi/source/setup/msitoddf/obj/i386/stdafx.obj differ diff --git a/inetsrv/uddi/source/setup/msitoddf/obj/i386/stdafx.pch b/inetsrv/uddi/source/setup/msitoddf/obj/i386/stdafx.pch new file mode 100644 index 0000000..31fa8cb Binary files /dev/null and b/inetsrv/uddi/source/setup/msitoddf/obj/i386/stdafx.pch differ diff --git a/inetsrv/uddi/source/setup/msitoddf/placefil.txt b/inetsrv/uddi/source/setup/msitoddf/placefil.txt new file mode 100644 index 0000000..055c45d --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/placefil.txt @@ -0,0 +1 @@ +msitoddf.exe uddi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/msitoddf/resource.h b/inetsrv/uddi/source/setup/msitoddf/resource.h new file mode 100644 index 0000000..350e3ea --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by CreateMSICABMakefile.rc +// +#define IDS_HELLO 1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/inetsrv/uddi/source/setup/msitoddf/sources b/inetsrv/uddi/source/setup/msitoddf/sources new file mode 100644 index 0000000..a9ecc69 --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/sources @@ -0,0 +1,52 @@ +TARGETNAME=msitoddf +TARGETPATH=obj +TARGETTYPE=PROGRAM + +UMENTRY=wmain +UMTYPE=console +UMAPPL=msitoddf + + +# +# Added include path of $(FROOT)\src\common for using ocmres.h +# +INCLUDES=$(INCLUDES);$(_NTROOT)\public\sdk\inc\atl30;C:\nt\public\sdk\inc\mfc42 + + +PRECOMPILED_CXX=1 +PRECOMPILED_OBJ=stdafx.obj +PRECOMPILED_INCLUDE=stdafx.h +USE_MFCUNICODE=1 +USE_STL=1 +USE_ATL=1 +USE_MSVCRT=1 +ATL_VER=30 + + +TARGETLIBS=\ + $(SDK_LIB_PATH)\atl.lib \ + $(SDK_LIB_PATH)\adsiid.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\oleaut32.lib \ + $(SDK_LIB_PATH)\ole32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\rpcrt4.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\gdi32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\netapi32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\Secur32.lib \ + $(SDK_LIB_PATH)\msi.lib + +SOURCES=\ + msitoddf.cpp \ + msitoddf.rc + +C_DEFINES=$(C_DEFINES) /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/setup/msitoddf/stdafx.cpp b/inetsrv/uddi/source/setup/msitoddf/stdafx.cpp new file mode 100644 index 0000000..fd4f341 --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/stdafx.cpp @@ -0,0 +1 @@ +#include "stdafx.h" diff --git a/inetsrv/uddi/source/setup/msitoddf/stdafx.h b/inetsrv/uddi/source/setup/msitoddf/stdafx.h new file mode 100644 index 0000000..2222ea4 --- /dev/null +++ b/inetsrv/uddi/source/setup/msitoddf/stdafx.h @@ -0,0 +1,8 @@ +#pragma once + +#include +#include +#include +#include +#include +#include diff --git a/inetsrv/uddi/source/setup/ocm/adm_addserviceaccount.h b/inetsrv/uddi/source/setup/ocm/adm_addserviceaccount.h new file mode 100644 index 0000000..144abbf --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/adm_addserviceaccount.h @@ -0,0 +1,68 @@ +// ADM_addServiceAccount.h : Declaration of the CADM_addServiceAccount + +#pragma once + +// ADM_addServiceAccount.h : Declaration of the ADM_addServiceAccount class + +#ifndef __ADM_addServiceAccount_H_ +#define __ADM_addServiceAccount_H_ + +class ADM_addServiceAccountAccessor +{ +public: + LONG m_RETURNVALUE; + TCHAR m_accountName[129]; + CComBSTR m_connectionString; + +BEGIN_PARAM_MAP(ADM_addServiceAccountAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURNVALUE) + SET_PARAM_TYPE(DBPARAMIO_INPUT) + COLUMN_ENTRY(2, m_accountName) +END_PARAM_MAP() + +DEFINE_COMMAND(ADM_addServiceAccountAccessor, _T("{ ? = CALL dbo.ADM_addServiceAccount;1 (?) }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class ADM_addServiceAccount : public CCommand > +{ +public: + HRESULT Open() + { + HRESULT hr; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + + hr = db.OpenFromInitializationString( m_connectionString ); + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + + HRESULT OpenRowset() + { + return CCommand >::Open(m_session); + } + + CSession m_session; +}; + +#endif // __ADM_addServiceAccount_H_ diff --git a/inetsrv/uddi/source/setup/ocm/appcompat.cpp b/inetsrv/uddi/source/setup/ocm/appcompat.cpp new file mode 100644 index 0000000..7cba56b --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/appcompat.cpp @@ -0,0 +1,92 @@ +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#ifndef INITGUID +#define INITGUID // must be before iadmw.h +#endif + +#include +#include +#include // Interface header +#include // MD_ & IIS_MD_ defines + +#include "appcompat.h" + +#define REASONABLE_TIMEOUT 1000 + +HRESULT IsIIS5CompatMode( bool *pbIsIIS5CompatMode ) +{ + IMSAdminBase* pIMSAdminBase = NULL; + METADATA_HANDLE hMetabase = NULL; + HRESULT hr = 0; + + *pbIsIIS5CompatMode = false; + + hr = CoInitializeEx( NULL, COINIT_MULTITHREADED ); + if( FAILED( hr ) ) + { + return hr; + } + + __try + { + hr = CoCreateInstance( + CLSID_MSAdminBase, + NULL, + CLSCTX_ALL, + IID_IMSAdminBase, + (void**)&pIMSAdminBase ); + + if( FAILED( hr ) ) + { + // this occurs with a 1058 ERROR_SERVICE_DISABLED if the service is disabled + __leave; + } + + METADATA_RECORD mr = {0}; + + // + // open the key and get a handle + // + hr = pIMSAdminBase->OpenKey( METADATA_MASTER_ROOT_HANDLE, + TEXT( "/LM/W3SVC" ), + METADATA_PERMISSION_READ, + REASONABLE_TIMEOUT, + &hMetabase ); + if( FAILED( hr ) ) + { + __leave; + } + + DWORD dwIISIsolationModeEnabled = 0; + mr.dwMDIdentifier = 9203; // iis5isolationmode=9203 + mr.dwMDAttributes = 0; + mr.dwMDUserType = IIS_MD_UT_SERVER; + mr.dwMDDataType = DWORD_METADATA; + mr.dwMDDataLen = sizeof( DWORD ); + mr.pbMDData = reinterpret_cast ( &dwIISIsolationModeEnabled ); + + // + // See if MD_APPPOOL_FRIENDLY_NAME exists + // + DWORD dwMDRequiredDataLen = 0; + hr = pIMSAdminBase->GetData( hMetabase, /* subkey= */ TEXT(""), &mr, &dwMDRequiredDataLen ); + if( FAILED( hr ) ) + { + __leave; + } + + *pbIsIIS5CompatMode = ( dwIISIsolationModeEnabled > 0 ); + } + + __finally + { + if( pIMSAdminBase && hMetabase ) + pIMSAdminBase->CloseKey( hMetabase ); + + CoUninitialize(); + } + + return hr; +} diff --git a/inetsrv/uddi/source/setup/ocm/appcompat.h b/inetsrv/uddi/source/setup/ocm/appcompat.h new file mode 100644 index 0000000..4ccb8af --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/appcompat.h @@ -0,0 +1,6 @@ +#ifndef _APPCOMPAT_H_ +#define _APPCOMPAT_H_ + +HRESULT IsIIS5CompatMode( bool *pbIsIIS5CompatMode ); + +#endif \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/ocm/common.cpp b/inetsrv/uddi/source/setup/ocm/common.cpp new file mode 100644 index 0000000..88b5efb --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/common.cpp @@ -0,0 +1 @@ +#include "..\shared\common.cpp" diff --git a/inetsrv/uddi/source/setup/ocm/logo.bmp b/inetsrv/uddi/source/setup/ocm/logo.bmp new file mode 100644 index 0000000..591f3d9 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/logo.bmp differ diff --git a/inetsrv/uddi/source/setup/ocm/makefile b/inetsrv/uddi/source/setup/ocm/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/ocm/misc/copytobuildserver.cmd b/inetsrv/uddi/source/setup/ocm/misc/copytobuildserver.cmd new file mode 100644 index 0000000..62863db --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/copytobuildserver.cmd @@ -0,0 +1,4 @@ +rem !!!xcopy /s /I /F /K /Y \\uddi\Drops\main\2.0.2223.1\Release\server \\uddidotnetbld\UDDI$ +xcopy /s /I /F /K /Y \\uddi\Drops\main\2.0.2223.1\Release\server \\a-markpa10\c$\nt\inetsrv\uddi + +pause \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/ocm/misc/getocmbits.cmd b/inetsrv/uddi/source/setup/ocm/misc/getocmbits.cmd new file mode 100644 index 0000000..b196f2f --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/getocmbits.cmd @@ -0,0 +1,7 @@ +copy \\a-markpa10\c$\dev\uddi\main\source\ocm\Debug\uddiocm.dll c:\windows\system32\setup\uddiocm1.dll +rem !!! copy \\a-markpa10\c$\dev\uddi\main\source\ocm\uddi.inf c:\windows\inf + +rem copy \\a-markpa10\c$\cdimage\install\uddi.msi c:\windows\system32 +rem !!! copy \\a-markpa10\c$\cdimage\redist\sql* c:\windows\system32 + +pause diff --git a/inetsrv/uddi/source/setup/ocm/misc/howtosetupocm.txt b/inetsrv/uddi/source/setup/ocm/misc/howtosetupocm.txt new file mode 100644 index 0000000..6f1f370 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/howtosetupocm.txt @@ -0,0 +1,85 @@ +These are the steps to get UDDI Services into the OCM: + +Check the UDDI code into \nt\inetsrv\UDDI. +Verify that it builds cleanly and that the "sources" file binplaces the binary. + +Make sure that the following files are binplaced: + + From the \source\ocm folder: + + uddiocm.dll + + From the \bin folder: + + uddidb.msi + uddiweb.msi + uddiadm.msi + sqlrun.dat (this is a renamed version of sqlrun08.msi) + sqlrun.cab + +Add the following lines to \nt\Published\sdk\lib\placefil.txt: + + uddi.inf retail + uddiocm.dll retail + uddidb.msi retail + uddiweb.msi retail + uddiadm.msi retail + sqlrun.dat retail + sqlrun.cab retail + +Add the following lines to the [SourceDiskFiles] section of \nt\MergedComponents\SetupInfs\layout.inx: + + @s!b:@i!m:uddiocm.dll = 1,,,,,,,32,0,0 ; UDDI Services OCM DLL into \windows\system32\setup + @s!b:@i!m:uddi.inf = 1,,,,,,,20,0,0 ; UDDI Services OCM into \windows\inf + @s!b:@i!m:uddidb.msi = 1,,,,,,,,3,3 ; UDDI Services database installer (not copied at install time) + @s!b:@i!m:uddiweb.msi = 1,,,,,,,,3,3 ; UDDI Services web installer (not copied at install time) + @s!b:@i!m:uddiadm.msi = 1,,,,,,,,3,3 ; UDDI Services admin installer (not copied at install time) + @s!b:@i!m:sqlrun.dat = 1,,,,,,_x,,3,3 ; UDDI Services installer (not copied at install time) _x will keep file uncompressed + @s!b:@i!m:sqlrun.cab = 1,,,,,,_x,,3,3 ; UDDI Services installer (not copied at install time) _x will keep file uncompressed + + Prefix Definition: + @s!b = Server only, but not Blade + @i!m = Intel only, but not 64-bit + +Check the following into \nt\MergedComponents\SetupInfs: + + uddi.inx + +Check the following into \nt\MergedComponents\SetupInfs\usa: + + uddi.txt + +Edit \nt\MergedComponents\SetupInfs\makefile.inc: + + Add to the make_infs section: + + $(O)\uddi.inf \ + + Add later in the same file the command to merge the + localized strings into the uddi.inx file: + + $(O)\uddi.inf: $(_INX)\uddi.inx $(_LNG)\uddi.txt + $(CC) $(PREFLAGS) $(_LNG)\$(@B).txt > $(O)\$(@B).txt1 + copy $(_INX)\$(@B).inx+$(O)\$(@B).txt1 $@ + @del $(O)\$(@B).txt1 + $(STAMP) + $(TSBINPLACE_CMD) + +Add the following line to \nt\MergedComponents\SetupInfs\sysoc.inx: + + @s!b:@i!m:UDDIServices=uddiocm.dll,OcEntry,uddi.inf,,6 + + Prefix Definition: + @s!b = Server only, but not Blade + @i!m = Intel only, but not 64-bit + + The last number is a bit field: + 0x1 = No wizard pages (off) + 0x2 = Not interested in skipping nonexistent pages (whatever that means!) (on) + 0x4 = no extra flags (on) + +Edit the 'dirs' files: + + Add 'uddi{x86}' to the 'dirs' file in the 'inetsrv' folder. When we are able to run under 64-bit, remove the x86 tag. + Add 'source' and 'bin' to the 'dirs' file in the 'uddi' folder + Add 'ocm' to the 'dirs' file in the 'source' folder diff --git a/inetsrv/uddi/source/setup/ocm/misc/runuddiocm.cmd b/inetsrv/uddi/source/setup/ocm/misc/runuddiocm.cmd new file mode 100644 index 0000000..b78ccdc --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/runuddiocm.cmd @@ -0,0 +1 @@ +sysocmgr /i:mysysoc.inf \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/ocm/misc/sysoc.inf b/inetsrv/uddi/source/setup/ocm/misc/sysoc.inf new file mode 100644 index 0000000..f914658 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/sysoc.inf @@ -0,0 +1,13 @@ +; +; Do not use this file directly! +; +; Add the following line to your c:\windows\inf\sysoc.inf file +; + +[Version] +Signature = "$Windows NT$" +DriverVer=07/01/2001,5.1.3593.0 + + +[Components] +UDDIServices=uddiocm1.dll,OcEntry,udditest.inf,,6 diff --git a/inetsrv/uddi/source/setup/ocm/misc/sysoc.inx b/inetsrv/uddi/source/setup/ocm/misc/sysoc.inx new file mode 100644 index 0000000..9d264db --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/sysoc.inx @@ -0,0 +1,61 @@ +[Version] +Signature = "$Windows NT$" + +[Components] +NtComponents=ntoc.dll,NtOcSetupProc,,4 +WBEM=ocgen.dll,OcEntry,wbemoc.inf,hide,7 +Display=desk.cpl,DisplayOcSetupProc,,7 +@@:@i:Fax=fxsocm.dll,FaxOcmSetupProc,fxsocm.inf,,7 +@@:NetOC=netoc.dll,NetOcSetupProc,netoc.inf,,7 +@s!b:RSTORAGE=RsOptCom.dll,OcEntry,RsOptCom.inf,7 +@@!p:iis=iis.dll,OcEntry,iis.inf,,7 +@p:iis=iis.dll,OcEntry,iis.inf,hide,7 +@@:@3:com=comsetup.dll,OcEntry,comnt5.inf,hide,7 +@@:@3:dtc=msdtcstp.dll,OcEntry,dtcnt5.inf,hide,7 +@@:@6:dtc=msdtcstp.dll,OcEntry,dtcsetup.inf,hide,7 +@@:@6:com=comsetup.dll,OcEntry,comsetup.inf,hide,7 +IndexSrv_System = setupqry.dll,IndexSrv,setupqry.inf,,7 +@s!b:@@!n:TerminalServer=TsOc.dll, HydraOc, TsOc.inf,,2 +@b:@@!n:TerminalServer=TsOc.dll, HydraOc, TsOc.inf,hide,2 +@w:@@!n:TerminalServer=TsOc.dll, HydraOc, TsOc.inf,hide,2 +@@!p:msmq=msmqocm.dll,MsmqOcm,msmqocm.inf,,6 +@s!b:RemInst=ocgen.dll,OcEntry,ocmri.inf,,3 +@s!b:Cluster=clusocm.dll,ClusOcmSetupProc,clusocm.inf,hide,7 +@s:@i!n:netfx=netfxocm.dll,UrtOcmProc,netfxocm.inf,hide,7 +@s:ins=imsinsnt.dll,OcEntry,ins.inf,,7 +ims=imsinsnt.dll,OcEntry,ims.inf,,7 +@@!s:@@:fp_extensions=fp40ext.dll,FrontPage4Extensions,fp40ext.inf,,7 ; non-server +@s:@@:fp_extensions=fp50ext.dll,FrontPage5Extensions,fp50ext.inf,,7 ; FPSE 5 is server only +@s!b:certsrv=certocm.dll,CertSrvOCProc,certocm.inf,,2 +@s!b:@@!n:LicenseServer=LicenOc.dll,EntryProc,LicenOc.inf,,6 +@s!b:@3:wms=wmsocm.dll,OcEntry,wmsocm.inf,,3 +@d:proccon=ocgen.dll,OcEntry,proccon.inf,hide,7 +@@!d:AutoUpdate=ocgen.dll,OcEntry,au.inf,hide,7 +@w:@i:msmsgs=msgrocm.dll,OcEntry,msmsgs.inf,hide,7 +@@:RootAutoUpdate=ocgen.dll,OcEntry,rootau.inf,,7 +@@:IEAccess=ocgen.dll,OcEntry,ieaccess.inf,,7 +@s!b:@i:RTCSrv=ocgen.dll,OcEntry,rtcsrv.inf,,7 +@s:BITSServerExtensions=ocgen.dll,OcEntry,bitssrv.inf,,7 + +@s!b:@i!n:UDDIServices=uddiocm.dll,OcEntry,uddi.inf,,6 + +; old base components +@w:Games=ocgen.dll,OcEntry,games.inf,,7 +@w:AccessUtil=ocgen.dll,OcEntry,accessor.inf,,7 +@w:CommApps=ocgen.dll,OcEntry,communic.inf,HIDE,7 +@w:MultiM=ocgen.dll,OcEntry,multimed.inf,HIDE,7 +@w:AccessOpt=ocgen.dll,OcEntry,optional.inf,HIDE,7 +@w:@3:Pinball=ocgen.dll,OcEntry,pinball.inf,HIDE,7 +@w:MSWordPad=ocgen.dll,OcEntry,wordpad.inf,HIDE,7 +@w:@i:ZoneGames=zoneoc.dll,ZoneSetupProc,igames.inf,,7 +@s:AccessUtil=ocgen.dll,OcEntry,accessor.inf,,7 +@s:CommApps=ocgen.dll,OcEntry,communic.inf,,7 +@s!b:MultiM=ocgen.dll,OcEntry,multimed.inf,,7 +@s:AccessOpt=ocgen.dll,OcEntry,optional.inf,,7 +@s:MSWordPad=ocgen.dll,OcEntry,wordpad.inf,,7 + + +[Global] +WindowTitle=%WindowTitle% +WindowTitle.StandAlone="*" + diff --git a/inetsrv/uddi/source/setup/ocm/misc/sysocmgr.exe b/inetsrv/uddi/source/setup/ocm/misc/sysocmgr.exe new file mode 100644 index 0000000..5cecf87 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/misc/sysocmgr.exe differ diff --git a/inetsrv/uddi/source/setup/ocm/misc/uddi.inf b/inetsrv/uddi/source/setup/ocm/misc/uddi.inf new file mode 100644 index 0000000..d59d57f --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/uddi.inf @@ -0,0 +1,114 @@ +;----------------------------------------------------- +; UDDI Services .inf file +;----------------------------------------------------- + +[version] +signature = "$Windows NT$" +layoutfile = layout.inf +DriverVer=07/01/2001,5.1.3593.0 + +;----------------------------------------------------- + +[Optional Components] +UDDIServices +UDDIWeb +UDDIDatabase +UDDIAdmin + +;----------------------------------------------------- + +[UDDIServices] +OptionDesc = %UDDI_Desc% +Tip = %UDDI_Tip% +IconIndex = *,uddiocm1.dll,108 + +;----------------------------------------------------- + +[UDDIWeb] +Parent=UDDIServices +OptionDesc = %UDDI_Web_Desc% +Tip = %UDDI_Web_Tip% +Needs = iis_www, iis_inetmgr, netfx +IconIndex = *,uddiocm1.dll,108 +SizeApproximation = 2000000 + +;----------------------------------------------------- + +[UDDIDatabase] +Parent=UDDIServices +OptionDesc = %UDDI_Database_Desc% +Tip = %UDDI_Database_Tip% +Needs = netfx +IconIndex = *,uddiocm1.dll,108 +SizeApproximation = 4000000 + +;----------------------------------------------------- + +[UDDIAdmin] +Parent=UDDIServices +OptionDesc = %UDDI_Admin_Desc% +Tip = %UDDI_Admin_Tip% +IconIndex = *,uddiocm1.dll,108 +SizeApproximation = 1000000 + +;----------------------------------------------------- +; file group sections +; +[Install.MSDE] +CopyFiles = MSDEFiles + +[Install.UDDIServices] +CopyFiles = UDDIWebFiles, UDDIDatabaseFiles, UDDIAdminFiles + +[Install.UDDIWeb] +CopyFiles = UDDIWebFiles + +[Install.UDDIDatabase] +CopyFiles = UDDIDatabaseFiles + +[Install.UDDIAdmin] +CopyFiles = UDDIAdminFiles + +[UDDIWebFiles] +uddiweb.msi + +[UDDIDatabaseFiles] +uddidb.msi + +[UDDIAdminFiles] +uddiadm.msi + +[MSDEFiles] +sqlrun.dat +sqlrun.cab + +;----------------------------------------------------- +; Put all the files into the Windows directory +; +[DestinationDirs] +DefaultDestDir=10 + +[SourceDisksFiles] +uddidb.msi = 1 +uddiweb.msi = 1 +uddiadm.msi = 1 +sqlrun.cab = 1 +sqlrun.dat = 1 + +[SourceDisksNames] +1 = %CDNAME%,,,\i386 + +[Strings] +CDNAME = "Windows Server 2003 CD-ROM" + +UDDI_Tip = "Installs UDDI Services" +UDDI_Desc = "UDDI Services" + +UDDI_Web_Tip = "Install the UDDI Services Web server components" +UDDI_Web_Desc = "UDDI Services Web Server Components" + +UDDI_Database_Tip = "Install the UDDI Services database components" +UDDI_Database_Desc = "UDDI Services Database Components" + +UDDI_Admin_Tip = "Install the UDDI Services administration console" +UDDI_Admin_Desc = "UDDI Services Administration Console" diff --git a/inetsrv/uddi/source/setup/ocm/misc/udditestocm.msi b/inetsrv/uddi/source/setup/ocm/misc/udditestocm.msi new file mode 100644 index 0000000..33b4995 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/misc/udditestocm.msi differ diff --git a/inetsrv/uddi/source/setup/ocm/misc/unattend.txt b/inetsrv/uddi/source/setup/ocm/misc/unattend.txt new file mode 100644 index 0000000..ec9ef03 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/unattend.txt @@ -0,0 +1,3 @@ +[Components] +UDDI=on +msmq=off diff --git a/inetsrv/uddi/source/setup/ocm/misc/xcopyexclude.txt b/inetsrv/uddi/source/setup/ocm/misc/xcopyexclude.txt new file mode 100644 index 0000000..1bafd95 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/misc/xcopyexclude.txt @@ -0,0 +1,7 @@ +.ncb +.pch +.sou +.obj +.ilk +.pdb +.bak \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/ocm/net_config_get.h b/inetsrv/uddi/source/setup/ocm/net_config_get.h new file mode 100644 index 0000000..c2a3dd4 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/net_config_get.h @@ -0,0 +1,72 @@ +// net_config_get.h : Declaration of the net_config_get class + +#ifndef __NET_CONFIG_GET_H_ +#define __NET_CONFIG_GET_H_ + +class net_config_getAccessor +{ +public: + TCHAR m_configName[257]; + TCHAR m_configValue[8001]; + DBSTATUS m_dwconfigNameStatus; + DBSTATUS m_dwconfigValueStatus; + DBLENGTH m_dwconfigNameLength; + DBLENGTH m_dwconfigValueLength; + CComBSTR m_connectionString; + LONG m_RETURN_VALUE; + +BEGIN_COLUMN_MAP(net_config_getAccessor) + COLUMN_ENTRY_LENGTH_STATUS(1, m_configName, m_dwconfigNameLength, m_dwconfigNameStatus) + COLUMN_ENTRY_LENGTH_STATUS(2, m_configValue, m_dwconfigValueLength, m_dwconfigValueStatus) +END_COLUMN_MAP() + +BEGIN_PARAM_MAP(net_config_getAccessor) + SET_PARAM_TYPE(DBPARAMIO_OUTPUT) + COLUMN_ENTRY(1, m_RETURN_VALUE) +END_PARAM_MAP() + + +DEFINE_COMMAND(net_config_getAccessor, _T("{ ? = CALL dbo.net_config_get }")) + + // You may wish to call this function if you are inserting a record and wish to + // initialize all the fields, if you are not going to explicitly set all of them. + void ClearRecord() + { + memset(this, 0, sizeof(*this)); + } +}; + +class net_config_get : public CCommand, CRowset, CMultipleResults > +{ +public: + HRESULT Open() + { + HRESULT hr; + m_configName[ 0 ] = 0x00; + m_configValue[ 0 ] = 0x00; + + hr = OpenDataSource(); + if( FAILED(hr) ) + return hr; + + return OpenRowset(); + } + HRESULT OpenDataSource() + { + HRESULT hr; + CDataSource db; + hr = db.OpenFromInitializationString( m_connectionString ); + + if( FAILED(hr) ) + return hr; + + return m_session.Open(db); + } + HRESULT OpenRowset() + { + return __super::Open(m_session, NULL, NULL, 0, DBGUID_DBSQL, false); + } + CSession m_session; +}; + +#endif // __NET_CONFIG_GET_H_ diff --git a/inetsrv/uddi/source/setup/ocm/obj/_objects.mac b/inetsrv/uddi/source/setup/ocm/obj/_objects.mac new file mode 100644 index 0000000..42b859d --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/obj/_objects.mac @@ -0,0 +1,52 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\uddiocm.res \ + $(_OBJ_DIR)\i386\appcompat.obj \ + $(_OBJ_DIR)\i386\strlist.obj \ + $(_OBJ_DIR)\i386\uddiinst.obj \ + $(_OBJ_DIR)\i386\uddiocm.obj \ + $(_OBJ_DIR)\i386\wizpage.obj \ + $(_OBJ_DIR)\i386\objectpicker.obj \ + $(_OBJ_DIR)\i386\ocmcallback.obj \ + $(_OBJ_DIR)\i386\common.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\uddiocm.res \ + $(_OBJ_DIR)\ia64\appcompat.obj \ + $(_OBJ_DIR)\ia64\strlist.obj \ + $(_OBJ_DIR)\ia64\uddiinst.obj \ + $(_OBJ_DIR)\ia64\uddiocm.obj \ + $(_OBJ_DIR)\ia64\wizpage.obj \ + $(_OBJ_DIR)\ia64\objectpicker.obj \ + $(_OBJ_DIR)\ia64\ocmcallback.obj \ + $(_OBJ_DIR)\ia64\common.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\uddiocm.res \ + $(_OBJ_DIR)\amd64\appcompat.obj \ + $(_OBJ_DIR)\amd64\strlist.obj \ + $(_OBJ_DIR)\amd64\uddiinst.obj \ + $(_OBJ_DIR)\amd64\uddiocm.obj \ + $(_OBJ_DIR)\amd64\wizpage.obj \ + $(_OBJ_DIR)\amd64\objectpicker.obj \ + $(_OBJ_DIR)\amd64\ocmcallback.obj \ + $(_OBJ_DIR)\amd64\common.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\uddiocm.res \ + $(_OBJ_DIR)\arm\appcompat.obj \ + $(_OBJ_DIR)\arm\strlist.obj \ + $(_OBJ_DIR)\arm\uddiinst.obj \ + $(_OBJ_DIR)\arm\uddiocm.obj \ + $(_OBJ_DIR)\arm\wizpage.obj \ + $(_OBJ_DIR)\arm\objectpicker.obj \ + $(_OBJ_DIR)\arm\ocmcallback.obj \ + $(_OBJ_DIR)\arm\common.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/appcompat.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/appcompat.obj new file mode 100644 index 0000000..c380c47 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/appcompat.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/common.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/common.obj new file mode 100644 index 0000000..45a8d8d Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/common.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/objectpicker.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/objectpicker.obj new file mode 100644 index 0000000..c7d6dde Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/objectpicker.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/ocmcallback.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/ocmcallback.obj new file mode 100644 index 0000000..6bf989c Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/ocmcallback.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/strlist.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/strlist.obj new file mode 100644 index 0000000..db11f12 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/strlist.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/uddiinst.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiinst.obj new file mode 100644 index 0000000..967236a Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiinst.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.dll b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.dll new file mode 100644 index 0000000..02512bb Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.dll differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.exp b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.exp new file mode 100644 index 0000000..0441d64 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.exp differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.lib b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.lib new file mode 100644 index 0000000..a211eb5 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.lib differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.obj new file mode 100644 index 0000000..41f48d9 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.pdb b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.pdb new file mode 100644 index 0000000..63d7be9 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.pdb differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.res b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.res new file mode 100644 index 0000000..07c6660 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/uddiocm.res differ diff --git a/inetsrv/uddi/source/setup/ocm/obj/i386/wizpage.obj b/inetsrv/uddi/source/setup/ocm/obj/i386/wizpage.obj new file mode 100644 index 0000000..f9ad492 Binary files /dev/null and b/inetsrv/uddi/source/setup/ocm/obj/i386/wizpage.obj differ diff --git a/inetsrv/uddi/source/setup/ocm/objectpicker.cpp b/inetsrv/uddi/source/setup/ocm/objectpicker.cpp new file mode 100644 index 0000000..149e1f1 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/objectpicker.cpp @@ -0,0 +1,649 @@ +//-------------------------------------------------------------------------- + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0510 +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#endif + +#define SECURITY_WIN32 +#include +#include +#include +#include +#include +#include +#include + +#include "objectpicker.h" + +#define OP_GENERIC_EXCEPTION ( ( DWORD ) 1 ) + +//-------------------------------------------------------------------------- + +extern HINSTANCE g_hInstance; + +UINT g_cfDsObjectPicker = RegisterClipboardFormat( CFSTR_DSOP_DS_SELECTION_LIST ); + +static HRESULT InitObjectPicker( UINT uObjectType, IDsObjectPicker *pDsObjectPicker ); + +static HRESULT InitObjectPickerForComputers( IDsObjectPicker *pDsObjectPicker ); + +static HRESULT InitObjectPickerForGroups( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect, + BOOL fWantSidPath ); + +static HRESULT InitObjectPickerForUsers( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect ); + +static bool ProcessSelectedObjects( IDataObject *pdo, PTCHAR szObjectName, ULONG uBufSize ); + +//-------------------------------------------------------------------------- +// returns true if no errors, false otherwise +// use GetLastError() to get error code +// +bool ObjectPicker( HWND hwndParent, UINT uObjectType, PTCHAR szObjectName, ULONG uBufSize ) +{ + IDsObjectPicker *pDsObjectPicker = NULL; + IDataObject *pdo = NULL; + bool bRet = true; // assume no errors + + try + { + HRESULT hr = CoInitializeEx( NULL, COINIT_APARTMENTTHREADED ); + if( FAILED( hr ) ) + throw HRESULT_CODE( hr ); + + // + // Create an instance of the object picker. + // + hr = CoCreateInstance( + CLSID_DsObjectPicker, + NULL, + CLSCTX_INPROC_SERVER, + IID_IDsObjectPicker, + ( void ** ) &pDsObjectPicker ); + + if( FAILED( hr ) ) + throw HRESULT_CODE( hr ); + + // + // Initialize the object picker instance. + // + hr = InitObjectPicker( uObjectType, pDsObjectPicker ); + if( FAILED( hr ) ) + throw HRESULT_CODE( hr ); + + // + // Invoke the modal dialog. + // + hr = pDsObjectPicker->InvokeDialog( hwndParent, &pdo ); + if( S_OK == hr ) + { + if( !ProcessSelectedObjects( pdo, szObjectName, uBufSize )) + throw GetLastError(); + } + else if( S_FALSE == hr ) // user pressed cancel + { + throw OP_GENERIC_EXCEPTION; + } + else + { + throw HRESULT_CODE( hr ); + } + } + catch( HRESULT hrErr ) + { + SetLastError( hrErr ); + bRet = false; + } + catch( DWORD dwErr ) + { + SetLastError( dwErr ); + bRet = false; + } + + if( pdo ) + pdo->Release(); + + if( pDsObjectPicker ) + pDsObjectPicker->Release(); + + CoUninitialize(); + + return bRet; +} + +//-------------------------------------------------------------------------- + +static HRESULT InitObjectPicker( UINT uObjectType, IDsObjectPicker *pDsObjectPicker ) +{ + if( NULL == pDsObjectPicker ) + { + return E_INVALIDARG; + } + + HRESULT hr = E_FAIL; + + if( OP_COMPUTER == uObjectType ) + { + hr = InitObjectPickerForComputers( pDsObjectPicker ); + } + else if( OP_USER == uObjectType ) + { + hr = InitObjectPickerForUsers( pDsObjectPicker, FALSE ); + } + else if( OP_GROUP == uObjectType ) + { + hr = InitObjectPickerForGroups( pDsObjectPicker, FALSE, TRUE ); + } + + return hr; +} + +//-------------------------------------------------------------------------- + +static bool ProcessSelectedObjects( IDataObject *pdo, PTCHAR szObjectName, ULONG uBufSize ) +{ + PDS_SELECTION_LIST pDsSelList = NULL; + bool dwRet = true; // assume ok + + STGMEDIUM stgmedium = + { + TYMED_HGLOBAL, + NULL, + NULL + }; + + FORMATETC formatetc = + { + ( CLIPFORMAT ) g_cfDsObjectPicker, + NULL, + DVASPECT_CONTENT, + -1, + TYMED_HGLOBAL + }; + + try + { + // + // Get the global memory block containing a user's selections. + // + HRESULT hr = pdo->GetData( &formatetc, &stgmedium ); + if( FAILED( hr ) ) + throw HRESULT_CODE( hr ); + + // + // Retrieve pointer to DS_SELECTION_LIST structure. + // + pDsSelList = ( PDS_SELECTION_LIST ) GlobalLock( stgmedium.hGlobal ); + if( !pDsSelList ) + { + throw GetLastError(); + } + + // + // assume there is only 1 item returned because + // we have multi-select turned off + // + if( pDsSelList->cItems != 1 ) + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + + UINT i = 0; + + //_tprintf( TEXT( "Object '%u'\n" ), i ); + //_tprintf( TEXT( " Name '%ws'\n" ), pDsSelList->aDsSelection[i].pwzName ); + //_tprintf( TEXT( " Class '%ws'\n" ), pDsSelList->aDsSelection[i].pwzClass ); + //_tprintf( TEXT( " Path '%ws'\n" ), pDsSelList->aDsSelection[i].pwzADsPath ); + //_tprintf( TEXT( " UPN '%ws'\n" ), pDsSelList->aDsSelection[i].pwzUPN ); + + // + // did we request a computer name? If so, we get it directly in the pwzName field + // + if( 0 == _tcsicmp( pDsSelList->aDsSelection[i].pwzClass, TEXT( "computer" )) ) + { + assert( uBufSize > _tcslen( pDsSelList->aDsSelection[i].pwzName ) ); + _tcsncpy( szObjectName, pDsSelList->aDsSelection[i].pwzName, uBufSize - 1 ); + szObjectName[ uBufSize - 1 ] = NULL; + } + // + // user name or group takes some post-processsing... + // + else if( 0 == _tcsicmp( pDsSelList->aDsSelection[i].pwzClass, TEXT( "user" ) ) || + 0 == _tcsicmp( pDsSelList->aDsSelection[i].pwzClass, TEXT( "group" ) ) ) + { + // + // user names from the domain begin with "LDAP:" + // strip off the prefix info, up to the first "cn=" + // then use the TranslateName API to get the form "domain\user" or "domain\group" + // + if( 0 == _tcsnicmp( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "LDAP:" ), 5 ) ) + { + PTCHAR p = _tcsstr( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "CN=" ) ); + if( NULL == p ) + p = _tcsstr( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "cn=" ) ); + + if( NULL == p ) + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + + if( !TranslateName( p, NameFullyQualifiedDN, NameSamCompatible, szObjectName, &uBufSize ) ) + throw GetLastError(); + } + // + // otherwise, names on the local box begin with "winnt:" + // and we are only interested in the last two sections of the string, + // delimited by "/" + // + else if( 0 == _tcsnicmp( pDsSelList->aDsSelection[i].pwzADsPath, TEXT( "WINNT:" ), 6 ) ) + { + PTCHAR p = pDsSelList->aDsSelection[i].pwzADsPath; + PTCHAR pend = p + _tcslen( p ); + UINT uCount = 0; + while( pend > p ) + { + if( '/' == *pend ) + { + *pend = '\\'; + uCount++; + + if( uCount == 2 ) + { + p = pend + 1; + break; + } + } + pend--; + } + + // + // if this fails, assert during debug but do not stop + // + if( p == pend ) + assert( false ); + + assert( uBufSize > _tcslen( p ) ); + _tcsncpy( szObjectName, p, uBufSize - 1 ); + szObjectName[ uBufSize - 1 ] = NULL; + } + else + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + } + else + { + assert( false ); + throw OP_GENERIC_EXCEPTION; + } + } + + catch( DWORD dwErr ) + { + SetLastError( dwErr ); + dwRet = false; + } + + if( pDsSelList ) + GlobalUnlock( stgmedium.hGlobal ); + + ReleaseStgMedium( &stgmedium ); + + return dwRet; +} + +//+-------------------------------------------------------------------------- +// +// Function: InitObjectPickerForGroups +// +// Synopsis: Call IDsObjectPicker::Initialize with arguments that will +// set it to allow the user to pick one or more groups. +// +// Arguments: [pDsObjectPicker] - object picker interface instance +// +// Returns: Result of calling IDsObjectPicker::Initialize. +// +// History: 10-14-1998 DavidMun Created +// 1-8-2000 SergeiA Adapted for IIS +// 9-6-2002 a-dsebes Adapted for UDDI +// +//--------------------------------------------------------------------------- +HRESULT +InitObjectPickerForGroups( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect, + BOOL fWantSidPath ) +{ + // + // Prepare to initialize the object picker. + // Set up the array of scope initializer structures. + // + + static const int SCOPE_INIT_COUNT = 5; + DSOP_SCOPE_INIT_INFO aScopeInit[ SCOPE_INIT_COUNT ]; + + ZeroMemory( aScopeInit, sizeof( DSOP_SCOPE_INIT_INFO ) * SCOPE_INIT_COUNT ); + + // + // Target computer scope. This adds a "Look In" entry for the + // target computer. Computer scopes are always treated as + // downlevel (i.e., they use the WinNT provider). + // + aScopeInit[ 0 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 0 ].flType = DSOP_SCOPE_TYPE_TARGET_COMPUTER; + aScopeInit[ 0 ].flScope = DSOP_SCOPE_FLAG_STARTING_SCOPE; + + aScopeInit[ 0 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_BUILTIN_GROUPS; + aScopeInit[ 0 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS; + + if( fWantSidPath ) + { + aScopeInit[ 0 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // The domain to which the target computer is joined. Note we're + // combining two scope types into flType here for convenience. + // + aScopeInit[ 1 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 1 ].flScope = 0; + aScopeInit[ 1 ].flType = DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN | + DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN; + + aScopeInit[ 1 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE | + DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE; + aScopeInit[ 1 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS; + + if( fWantSidPath ) + { + aScopeInit[ 1 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // The domains in the same forest (enterprise) as the domain to which + // the target machine is joined. Note these can only be DS-aware + // + + aScopeInit[ 2 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 2 ].flType = DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN; + aScopeInit[ 2 ].flScope = 0; + + aScopeInit[ 2 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE; + + if( fWantSidPath ) + { + aScopeInit[ 2 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // Domains external to the enterprise but trusted directly by the + // domain to which the target machine is joined. + // + // If the target machine is joined to an NT4 domain, only the + // external downlevel domain scope applies, and it will cause + // all domains trusted by the joined domain to appear. + // + + aScopeInit[ 3 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 3 ].flScope = 0; + aScopeInit[ 3 ].flType = DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN | + DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN; + + aScopeInit[ 3 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE; + aScopeInit[ 3 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS; + + if( fWantSidPath ) + { + aScopeInit[ 3 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // The Global Catalog + // + + aScopeInit[ 4 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 4 ].flScope = 0; + aScopeInit[ 4 ].flType = DSOP_SCOPE_TYPE_GLOBAL_CATALOG; + + // + // Only native mode applies to gc scope. + // + aScopeInit[ 4 ].FilterFlags.Uplevel.flNativeModeOnly = DSOP_FILTER_GLOBAL_GROUPS_SE | + DSOP_FILTER_UNIVERSAL_GROUPS_SE; + + if( fWantSidPath ) + { + aScopeInit[ 4 ].flScope |= DSOP_SCOPE_FLAG_WANT_SID_PATH; + } + + // + // Put the scope init array into the object picker init array + // + + DSOP_INIT_INFO InitInfo; + ZeroMemory( &InitInfo, sizeof( InitInfo ) ); + InitInfo.cbSize = sizeof( InitInfo ); + + // + // The pwzTargetComputer member allows the object picker to be + // retargetted to a different computer. It will behave as if it + // were being run ON THAT COMPUTER. + // + InitInfo.cDsScopeInfos = SCOPE_INIT_COUNT; + InitInfo.aDsScopeInfos = aScopeInit; + InitInfo.flOptions = fMultiselect ? DSOP_FLAG_MULTISELECT : 0; + + // + // Note object picker makes its own copy of InitInfo. Also note + // that Initialize may be called multiple times, last call wins. + // + + HRESULT hr = pDsObjectPicker->Initialize( &InitInfo ); + + return hr; +} + + +//+-------------------------------------------------------------------------- +// +// Function: InitObjectPickerForUsers +// +// Synopsis: Call IDsObjectPicker::Initialize with arguments that will +// set it to allow the user to pick one or more groups. +// +// Arguments: [pDsObjectPicker] - object picker interface instance +// +// Returns: Result of calling IDsObjectPicker::Initialize. +// +// History: 9-6-2002 a-dsebes Created. +// +// +//--------------------------------------------------------------------------- +HRESULT +InitObjectPickerForUsers( IDsObjectPicker *pDsObjectPicker, + BOOL fMultiselect ) +{ + // + // Prepare to initialize the object picker. + // Set up the array of scope initializer structures. + // + + static const int SCOPE_INIT_COUNT = 5; + DSOP_SCOPE_INIT_INFO aScopeInit[ SCOPE_INIT_COUNT ]; + + ZeroMemory( aScopeInit, sizeof( DSOP_SCOPE_INIT_INFO ) * SCOPE_INIT_COUNT ); + + // + // Target computer scope. This adds a "Look In" entry for the + // target computer. Computer scopes are always treated as + // downlevel (i.e., they use the WinNT provider). + // + aScopeInit[ 0 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 0 ].flType = DSOP_SCOPE_TYPE_TARGET_COMPUTER; + aScopeInit[ 0 ].flScope = DSOP_SCOPE_FLAG_STARTING_SCOPE; + + aScopeInit[ 0 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + aScopeInit[ 0 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_USERS; + + // + // The domain to which the target computer is joined. Note we're + // combining two scope types into flType here for convenience. + // + aScopeInit[ 1 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 1 ].flScope = 0; + aScopeInit[ 1 ].flType = DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN | + DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN; + + aScopeInit[ 1 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + aScopeInit[ 1 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_USERS; + + // + // The domains in the same forest (enterprise) as the domain to which + // the target machine is joined. Note these can only be DS-aware + // + aScopeInit[ 2 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 2 ].flType = DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN; + aScopeInit[ 2 ].flScope = 0; + + aScopeInit[ 2 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + + // + // Domains external to the enterprise but trusted directly by the + // domain to which the target machine is joined. + // + // If the target machine is joined to an NT4 domain, only the + // external downlevel domain scope applies, and it will cause + // all domains trusted by the joined domain to appear. + // + aScopeInit[ 3 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 3 ].flScope = 0; + aScopeInit[ 3 ].flType = DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN | + DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN; + + aScopeInit[ 3 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_USERS; + aScopeInit[ 3 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_USERS; + + // + // The Global Catalog + // + aScopeInit[ 4 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 4 ].flScope = 0; + aScopeInit[ 4 ].flType = DSOP_SCOPE_TYPE_GLOBAL_CATALOG; + + // + // Only native mode applies to gc scope. + // + aScopeInit[ 4 ].FilterFlags.Uplevel.flNativeModeOnly = DSOP_FILTER_USERS; + + // + // Put the scope init array into the object picker init array + // + DSOP_INIT_INFO InitInfo; + ZeroMemory( &InitInfo, sizeof( InitInfo ) ); + InitInfo.cbSize = sizeof( InitInfo ); + + // + // The pwzTargetComputer member allows the object picker to be + // retargetted to a different computer. It will behave as if it + // were being run ON THAT COMPUTER. + // + InitInfo.cDsScopeInfos = SCOPE_INIT_COUNT; + InitInfo.aDsScopeInfos = aScopeInit; + InitInfo.flOptions = fMultiselect ? DSOP_FLAG_MULTISELECT : 0; + + // + // Note object picker makes its own copy of InitInfo. Also note + // that Initialize may be called multiple times, last call wins. + // + HRESULT hr = pDsObjectPicker->Initialize( &InitInfo ); + + return hr; +} + + +//+-------------------------------------------------------------------------- +// +// Function: InitObjectPickerForComputers +// +// Synopsis: Call IDsObjectPicker::Initialize with arguments that will +// set it to allow the user to pick a single computer object. +// +// Arguments: [pDsObjectPicker] - object picker interface instance +// +// Returns: Result of calling IDsObjectPicker::Initialize. +// +// History: 10-14-1998 DavidMun Created +// 08-06-2002 a-dsebes Adapted for UDDI. +// +//--------------------------------------------------------------------------- + +HRESULT +InitObjectPickerForComputers( IDsObjectPicker *pDsObjectPicker ) +{ + // + // Prepare to initialize the object picker. + // Set up the array of scope initializer structures. + // + + static const int SCOPE_INIT_COUNT = 2; + DSOP_SCOPE_INIT_INFO aScopeInit[ SCOPE_INIT_COUNT ]; + + ZeroMemory( aScopeInit, sizeof( DSOP_SCOPE_INIT_INFO ) * SCOPE_INIT_COUNT ); + + // + // Build a scope init struct for everything except the joined domain. + // + + aScopeInit[ 0 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 0 ].flType = DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN + | DSOP_SCOPE_TYPE_GLOBAL_CATALOG + | DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN + | DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN + | DSOP_SCOPE_TYPE_WORKGROUP + | DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE + | DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE; + + aScopeInit[ 0 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_COMPUTERS; + aScopeInit[ 0 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_COMPUTERS; + + + // + // scope for the joined domain, make it the default + // + aScopeInit[ 1 ].cbSize = sizeof( DSOP_SCOPE_INIT_INFO ); + aScopeInit[ 1 ].flType = DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN + | DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN; + + aScopeInit[ 1 ].FilterFlags.Uplevel.flBothModes = DSOP_FILTER_COMPUTERS; + aScopeInit[ 1 ].FilterFlags.flDownlevel = DSOP_DOWNLEVEL_FILTER_COMPUTERS; + aScopeInit[ 1 ].flScope = DSOP_SCOPE_FLAG_STARTING_SCOPE; + + // + // Put the scope init array into the object picker init array + // + + DSOP_INIT_INFO InitInfo; + ZeroMemory( &InitInfo, sizeof( InitInfo ) ); + + InitInfo.cbSize = sizeof( InitInfo ); + InitInfo.pwzTargetComputer = NULL; // NULL == local machine + InitInfo.cDsScopeInfos = SCOPE_INIT_COUNT; + InitInfo.aDsScopeInfos = aScopeInit; + + // + // Note object picker makes its own copy of InitInfo. Also note + // that Initialize may be called multiple times, last call wins. + // + + return pDsObjectPicker->Initialize(&InitInfo); +} diff --git a/inetsrv/uddi/source/setup/ocm/objectpicker.h b/inetsrv/uddi/source/setup/ocm/objectpicker.h new file mode 100644 index 0000000..05f3100 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/objectpicker.h @@ -0,0 +1,12 @@ +//-------------------------------------------------------------------------- + +#pragma once + +// +// These are the supported types +// +#define OP_USER 0 +#define OP_COMPUTER 1 +#define OP_GROUP 2 + +bool ObjectPicker( HWND hwndParent, UINT uObjectType, PTCHAR szObjectName, ULONG uBufSize ); diff --git a/inetsrv/uddi/source/setup/ocm/ocm.vcproj b/inetsrv/uddi/source/setup/ocm/ocm.vcproj new file mode 100644 index 0000000..081fb1f --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/ocm.vcproj @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/setup/ocm/ocmcallback.cpp b/inetsrv/uddi/source/setup/ocm/ocmcallback.cpp new file mode 100644 index 0000000..4f7b57e --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/ocmcallback.cpp @@ -0,0 +1,71 @@ +//----------------------------------------------------------------------------------------- + +#include "assert.h" +#include "ocmcallback.h" + +OCMANAGER_ROUTINES COCMCallback::m_OCMRoutines; +bool COCMCallback::m_bInitialized = false; + +//----------------------------------------------------------------------------------------- +// capture the struct of OCM callback funtion pointers + +void COCMCallback::SetOCMRoutines( POCMANAGER_ROUTINES pOCMRoutines ) +{ + m_OCMRoutines = *pOCMRoutines; + m_bInitialized = true; +} + +//----------------------------------------------------------------------------------------- +// set the text on the OCM progress dialog + +void COCMCallback::SetProgressText( LPCTSTR szText ) +{ + if( m_bInitialized ) + m_OCMRoutines.SetProgressText( m_OCMRoutines.OcManagerContext, szText ); +} + +//----------------------------------------------------------------------------------------- +// advances the OCM progress bar by 1 tick count + +void COCMCallback::AdvanceTickGauge() +{ + if( m_bInitialized ) + m_OCMRoutines.TickGauge( m_OCMRoutines.OcManagerContext ); +} + +//----------------------------------------------------------------------------------------- +// tells the OCM that a reboot is needed + +void COCMCallback::SetReboot() +{ + if( m_bInitialized ) + m_OCMRoutines.SetReboot( m_OCMRoutines.OcManagerContext, NULL ); +} + +//----------------------------------------------------------------------------------------- +// ask the OCM for the current selection state of the component + +DWORD COCMCallback::QuerySelectionState( LPCTSTR szSubcomponentName, bool &bSelected ) +{ + if( !m_bInitialized ) + { + assert( false ); + return false; + } + + BOOL bRet = m_OCMRoutines.QuerySelectionState( + m_OCMRoutines.OcManagerContext, + szSubcomponentName, + OCSELSTATETYPE_CURRENT ); + + if( bRet ) + { + bSelected = true; + return ERROR_SUCCESS; + } + else + { + bSelected = false; + return GetLastError(); + } +} diff --git a/inetsrv/uddi/source/setup/ocm/ocmcallback.h b/inetsrv/uddi/source/setup/ocm/ocmcallback.h new file mode 100644 index 0000000..f1c5072 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/ocmcallback.h @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------------------------- +// +// Singleton class that encapsulates the OCM callbacks +// + +#pragma once + +#include +#include +#include +#include +#include "ocmanage.h" + +class COCMCallback +{ +public: + static void SetOCMRoutines( POCMANAGER_ROUTINES pOCMRoutines ); + static void SetProgressText( LPCTSTR szText ); + static void AdvanceTickGauge(); + static void SetReboot(); + static DWORD QuerySelectionState( LPCTSTR szSubcomponentName, bool &bSelected ); + +private: + static OCMANAGER_ROUTINES m_OCMRoutines; + static bool m_bInitialized; +}; diff --git a/inetsrv/uddi/source/setup/ocm/resource.h b/inetsrv/uddi/source/setup/ocm/resource.h new file mode 100644 index 0000000..2cbde45 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/resource.h @@ -0,0 +1,135 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by uddiocm.rc +// +#define ID_MAINICON 1 +#define IDD_PROPPAGE_LARGE 101 +#define IDD_WIZARD_SUMMARY 101 +#define IDD_SITE_NAME 101 +#define IDD_DB_INSTANCE 102 +#define IDD_SSL 103 +#define IDD_CONFIRM_PW 104 +#define IDD_PROPPAGE_LARGE1 107 +#define IDD_ADD_SERVICES 107 +#define IDS_SUBTITLE 111 +#define IDS_TITLE 111 +#define IDS_DB_SUBTITLE 112 +#define IDS_NO_INSTANCE_MSG 113 +#define IDD_REMOTE_DB 114 +#define IDS_LOGIN_ERROR 114 +#define IDS_MSDE_ALREADY_USED 115 +#define IDD_LOGIN 116 +#define IDS_NO_LOCAL_ACCT_ALLOWED 116 +#define IDS_WRONG_FRAMEWORK_VER 117 +#define IDS_IIS_ISOLATION_MODE_ERROR 117 +#define IDS_PLEASE_TYPE_INSTANCE_NAME 118 +#define IDS_UDDI_DB_NOT_EXIST 118 +#define IDS_SELECT_REMOTE_COMPUTER 119 +#define IDS_SSL_SUBTITLE 120 +#define IDS_REMOTE_DB_SUBTITLE 121 +#define IDS_LOGIN_SUBTITLE 122 +#define IDS_PW_MISMATCH 123 +#define IDS_ZERO_LEN_USER_NAME 124 +#define IDS_INSTALL 125 +#define IDS_UNINSTALL 126 +#define IDS_REMOTE_DB_NOT_FOUND 127 +#define IDD_DATAPATHS 127 +#define IDS_WIZARD_SUMMARY_SUBTITLE 128 +#define IDS_WIZARD_SUMMARY_GENERAL 129 +#define IDS_WIZARD_SUMMARY_DB 130 +#define IDS_WIZARD_SUMMARY_WEB 131 +#define IDS_WIZARD_SUMMARY_ADMIN 132 +#define IDS_INSTALL_ERROR 133 +#define IDS_MSDE_NAME 134 +#define IDS_DB_NAME 135 +#define IDS_WEB_NAME 136 +#define IDS_ADMIN_NAME 137 +#define IDS_IIS_SERVICE_DISABLED 138 +#define IDS_IIS_UNKNOWN_ERROR 139 +#define IDS_ZERO_LEN_PROVIDER_NAME 140 +#define IDS_UDDIPROV_SUBTITLE 141 +#define IDS_UDDIADDSVC_SUBTITLE 142 +#define IDS_FILEPATHS_SUBTITLE 143 +#define IDS_PROMPT_SELSYSDATAPATH 144 +#define IDS_PROMPT_SELCOREPATH_1 145 +#define IDS_PROMPT_SELCOREPATH_2 146 +#define IDS_PROMPT_SELJRNLPATH 147 +#define IDS_PROMPT_SELSTGPATH 148 +#define IDS_PROMPT_SELXLOGPATH 149 +#define IDS_LABEL_SYSPATHSIMPLE 150 +#define IDS_LABEL_SYSPATH_ADV 151 +#define IDD_EXISTING_DBINSTANCE 152 +#define IDS_GETSID_ERROR 152 +#define IDS_GETREMOTEACCT_ERROR 153 +#define IDS_SQLSPVERSION_TOO_LOW 154 +#define IDS_CANTOPENCLUSTER 155 +#define IDD_CLUSTDATA 156 +#define IDS_NOCLUSTERRESAVAIL 156 +#define IDS_GENERALCLUSTERR 157 +#define IDS_PASSIVENODE_DB 158 +#define IDS_DB_ANALYSING_MSG 159 +#define IDS_WRONGLOGONTYPE 160 +#define IDS_CANTCONNTOSTD 161 +#define IDS_DB_EXISTS 162 +#define IDS_ACTIVENODE_DB 163 +#define IDC_RADIO_INSTALL_MSDE 1002 +#define IDC_RADIO_USE_EXISTING_INSTANCE 1003 +#define IDC_LIST_DB_INSTANCES 1004 +#define IDC_CHECK_USE_SSL 1005 +#define IDC_SSL_YES 1006 +#define IDC_RADIO2 1007 +#define IDC_SSL_NO 1008 +#define IDC_RADIO_NETWORK_SERVICE 1009 +#define IDC_RADIO_DOMAIN_ACCT 1010 +#define IDC_REMOTE_MACHINE 1011 +#define IDC_USER_NAME 1012 +#define IDC_PASSWORD 1013 +#define IDC_BROWSE_MACHINES 1014 +#define IDC_REMOTE_INSTANCES 1015 +#define IDC_BROWSE_USERS 1016 +#define IDC_REMOTE_MACHINE_PROMPT 1017 +#define IDC_REMOTE_INSTANCES_PROMPT 1018 +#define IDC_CONFIRM_PW 1019 +#define IDC_REMOTE_DB 1020 +#define IDC_REMOTE_INSTANCE 1020 +#define IDC_SUMMARY 1021 +#define IDC_USER_NAME_PROMPT 1022 +#define IDC_PASSWORD_PROMPT 1023 +#define IDC_SITE_NAME 1024 +#define IDC_CHECK_ADDSVC 1025 +#define IDC_CHECK_UAD 1026 +#define IDC_SYSPATH 1028 +#define IDC_BROWSESYSPATH 1029 +#define IDC_LESS_BTN 1031 +#define IDC_MORE_BTN 1032 +#define IDC_STATIC_SYS 1033 +#define IDC_COREPATH_1 1034 +#define IDC_BROWSECOREPATH1 1035 +#define IDC_COREPATH_2 1036 +#define IDC_BROWSECOREPATH2 1037 +#define IDC_JRNLPATH 1038 +#define IDC_BROWSEJRNLPATH 1039 +#define IDC_STAGINGPATH 1040 +#define IDC_BROWSESTAGINGPATH 1041 +#define IDC_XLOGPATH 1042 +#define IDC_BROWSEXLOGPATH 1043 +#define IDC_STATIC_C1 1044 +#define IDC_STATIC_C2 1045 +#define IDC_STATIC_JRNL 1046 +#define IDC_STATIC_STG 1047 +#define IDC_STATIC_XLOG 1048 +#define IDC_INSTANCENAME 1049 +#define IDS_EXISTINGDB_TITLE 1050 +#define IDS_EXISTINGDB_SUBTITLE 1051 +#define IDS_UDDI_ILLEGALCHARACTERS 1052 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 156 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1053 +#define _APS_NEXT_SYMED_VALUE 105 +#endif +#endif diff --git a/inetsrv/uddi/source/setup/ocm/sources b/inetsrv/uddi/source/setup/ocm/sources new file mode 100644 index 0000000..7a4850e --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/sources @@ -0,0 +1,60 @@ +TARGETNAME=uddiocm +TARGETPATH=obj +TARGETTYPE=DYNLINK +DLLDEF=uddiocm.def +DLLENTRY=_DllMainCRTStartup + +# +# Added include path of $(FROOT)\src\common for using ocmres.h +# +INCLUDES=$(INCLUDES);..\shared;$(_NTROOT)\public\sdk\inc\atl30;$(_NTROOT)\public\sdk\inc\mfc42; + + +#PRECOMPILED_CXX=1 +#PRECOMPILED_OBJ=pch.obj +#PRECOMPILED_INCLUDE=stdafx.h +USE_MFCUNICODE=1 +USE_STL=1 +USE_ATL=1 +USE_MSVCRT=1 +ATL_VER=30 + + +TARGETLIBS=\ + $(SDK_LIB_PATH)\atl.lib \ + $(SDK_LIB_PATH)\adsiid.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\oleaut32.lib \ + $(SDK_LIB_PATH)\ole32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\rpcrt4.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\gdi32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\netapi32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\Secur32.lib \ + $(SDK_LIB_PATH)\msi.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\clusapi.lib \ + $(SDK_LIB_PATH)\resutils.lib \ + $(SDK_LIB_PATH)\wbemuuid.lib \ + $(SDK_LIB_PATH)\uuid.lib + + +SOURCES=\ + appcompat.cpp \ + strlist.cpp \ + uddiinst.cpp \ + uddiocm.cpp \ + uddiocm.rc \ + wizpage.cpp \ + objectpicker.cpp \ + ocmcallback.cpp \ + common.cpp + +C_DEFINES= $(C_DEFINES) -DUDDIOCM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP diff --git a/inetsrv/uddi/source/setup/ocm/strlist.cpp b/inetsrv/uddi/source/setup/ocm/strlist.cpp new file mode 100644 index 0000000..a424011 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/strlist.cpp @@ -0,0 +1 @@ +#include "..\..\shared\strlist.cpp" \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/ocm/uddiinst.cpp b/inetsrv/uddi/source/setup/ocm/uddiinst.cpp new file mode 100644 index 0000000..cf6f235 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/uddiinst.cpp @@ -0,0 +1,2605 @@ +//----------------------------------------------------------------------------------------- + + +#define _WIN32_MSI 200 + +#ifndef OLEDBVER +#define OLEDBVER 0x0200 +#endif + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. +#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#endif + +#ifndef SECURITY_WIN32 +#define SECURITY_WIN32 +#endif + +// Windows Header Files: +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "uddiinst.h" +#include "..\shared\common.h" +#include "ocmcallback.h" +#include "net_config_get.h" +#include "ADM_addServiceAccount.h" +#include "resource.h" + +using namespace ATL; + +// +// The following block defines types and identifiers used by the clustering "discovery" unit +// +#define RESTYPE_DISK TEXT( "Physical Disk" ) +#define RESTYPE_SQL TEXT( "SQL Server" ) + +#define PROPNAME_VIRTUALSERVER L"VirtualServerName" +#define PROPNAME_INSTANCENAME L"InstanceName" + +#define PROPNAME_DBSCHEMAVER TEXT("Database.Version") + +// +// Callback data blocks +// +typedef struct +{ + HCLUSTER hCluster; + cStrList *pSqlDependencies; + cDrvMap *pPhysSrvMap; +} +DISK_CALLBACK_DATA, *LPDISK_CALLBACK_DATA; + +typedef struct +{ + HCLUSTER hCluster; + tstring sSqlInstanceName; + cStrList *pSqlDependencies; +} +SQL_CALLBACK_DATA, *LPSQL_CALLBACK_DATA; + + +typedef struct +{ + tstring sSqlInstanceName; + tstring sNodeName; + + CLUSTER_RESOURCE_STATE resState; +} +SQL_NODE_CALLBACK_DATA, *LPSQL_NODE_CALLBACK_DATA; + + +// +// Callback functions +// +static DWORD PhysDiskCallback( HRESOURCE hOriginal, HRESOURCE hResource, PVOID lpParams ); +static DWORD SqlDepCallback( HRESOURCE hOriginal, HRESOURCE hResource, PVOID lpParams ); +static DWORD SqlCallback( HRESOURCE hOriginal, HRESOURCE hResource, PVOID lpParams ); + +// +// Helper functions +// +static LPBYTE ParseDiskInfo( LPBYTE DiskInfo, DWORD DiskInfoSize, DWORD SyntaxValue ); +static BOOL IsInList( LPCTSTR szStrToFind, cStrList *pList, BOOL bIgnoreCase = TRUE ); +static DWORD GetClusterResourceControl( HRESOURCE hResource, DWORD dwControlCode, LPBYTE *pOutBuffer, DWORD *dwBytesReturned ); + +void HandleOLEDBError( HRESULT hrErr ); + +//----------------------------------------------------------------------------------------- +// General installation definitions +// +PTCHAR szInstallStateText[] = { TEXT( "Uninstall" ), TEXT( "No Action" ), TEXT( "Install" ) }; +LPCTSTR szWamPwdKey = TEXT( "C9E18" ); + +//----------------------------------------------------------------------------------------- +// Global objects and data items +// +extern CDBInstance g_dbLocalInstances; + +//----------------------------------------------------------------------------------------- + +CUDDIInstall::CUDDIInstall() +{ + ZeroMemory( m_package, sizeof( SINGLE_UDDI_PACKAGE_DEF ) * UDDI_PACKAGE_COUNT ); + + m_package[ UDDI_MSDE ].cMSIName = TEXT( "sqlrun.dat" ); // this is the "cloaked" name of sqlrun08.msi + m_package[ UDDI_WEB ].cMSIName = TEXT( "uddiweb.msi" ); + m_package[ UDDI_DB ].cMSIName = TEXT( "uddidb.msi" ); + m_package[ UDDI_ADMIN ].cMSIName = TEXT( "uddiadm.msi" ); + + m_package[ UDDI_MSDE ].bOCMComponent = false; + m_package[ UDDI_WEB ].bOCMComponent = true; + m_package[ UDDI_DB ].bOCMComponent = true; + m_package[ UDDI_ADMIN ].bOCMComponent = true; + m_package[ UDDI_COMBO ].bOCMComponent = false; + + // + // sql is the only package that has a cab file + // + + m_package[ UDDI_MSDE ].cCABName = TEXT( "sqlrun.cab" ); + + // + // the following names must match the names given in UDDI.INF + // + m_package[ UDDI_MSDE ].cOCMName = TEXT( "(n/a)" ); + m_package[ UDDI_WEB ].cOCMName = TEXT( "uddiweb" ); + m_package[ UDDI_DB ].cOCMName = TEXT( "uddidatabase" ); + m_package[ UDDI_ADMIN ].cOCMName = TEXT( "uddiadmin" ); + m_package[ UDDI_COMBO ].cOCMName = TEXT( "uddicombo" ); + + // + // 775306 + // A-DSEBES: Swapped the product code for MSDE instance #8 with WMSDE instance #8. + // + _tcscpy( m_package[ UDDI_MSDE ].szProductCode, TEXT( "{B42339CD-9F22-4A6A-A023-D12990E0B918}" ) ); + _tcscpy( m_package[ UDDI_WEB ].szProductCode, TEXT( "{D9F718B1-61D5-41B3-81E6-C6B6B4FC712C}" ) ); + _tcscpy( m_package[ UDDI_DB ].szProductCode, TEXT( "{22FD5ACF-9151-483E-8E8F-41B1DC28E671}" ) ); + _tcscpy( m_package[ UDDI_ADMIN ].szProductCode, TEXT( "{98F055D3-99CF-4BBB-BC35-3672F9A297C1}" ) ); + + // + // 775306 + // A-DSEBES: Upgrade code has not changed. + // + _tcscpy( m_package[ UDDI_MSDE ].szUpgradeCode, TEXT( "{421A321C-2214-4713-B3EB-253F2FBCCE49}" ) ); + _tcscpy( m_package[ UDDI_WEB ].szUpgradeCode, TEXT( "{E2B9B8F4-D0F2-4810-92AB-81F8E60732A4}" ) ); + _tcscpy( m_package[ UDDI_DB ].szUpgradeCode, TEXT( "{B7EB7DEC-9CCA-4EBD-96CB-801EABE06A17}" ) ); + _tcscpy( m_package[ UDDI_ADMIN ].szUpgradeCode, TEXT( "{50CA09F3-3FAE-4FE1-BEF2-C29980E95B9A}" ) ); + + // + // this property will turn off networking + // + AddProperty( UDDI_MSDE, TEXT( "DISABLENETWORKPROTOCOLS" ), TEXT( "1" ) ); + + // + // this property will prevent the agent from starting + // + AddProperty( UDDI_MSDE, TEXT( "DISABLEAGENTSTARTUP" ), TEXT( "1" ) ); + + // + // this property will allow MSDE to use a blank sa password. + // + AddProperty( UDDI_MSDE, TEXT( "BLANKSAPWD" ), TEXT( "1" ) ); + + // + // this property will keep these components off ARP + // + AddProperty( UDDI_WEB, TEXT( "ARPSYSTEMCOMPONENT" ), TEXT( "1" ) ); + AddProperty( UDDI_DB, TEXT( "ARPSYSTEMCOMPONENT" ), TEXT( "1" ) ); + AddProperty( UDDI_ADMIN, TEXT( "ARPSYSTEMCOMPONENT" ), TEXT( "1" ) ); + + // + // this property will install for all users and not current user + // + AddProperty( UDDI_MSDE, TEXT( "ALLUSERS" ), TEXT( "2" ) ); + AddProperty( UDDI_WEB, TEXT( "ALLUSERS" ), TEXT( "2" ) ); + AddProperty( UDDI_DB, TEXT( "ALLUSERS" ), TEXT( "2" ) ); + AddProperty( UDDI_ADMIN, TEXT( "ALLUSERS" ), TEXT( "2" ) ); + + // + // this property will prevent MSI from rebooting, but will return the reboot code back to us + // + AddProperty( UDDI_MSDE, TEXT( "REBOOT" ), TEXT( "ReallySuppress" ) ); + AddProperty( UDDI_WEB, TEXT( "REBOOT" ), TEXT( "ReallySuppress" ) ); + AddProperty( UDDI_DB, TEXT( "REBOOT" ), TEXT( "ReallySuppress" ) ); + AddProperty( UDDI_ADMIN, TEXT( "REBOOT" ), TEXT( "ReallySuppress" ) ); + + // + // this property will prevent user from running the installation outside OCM + // + AddProperty( UDDI_WEB, TEXT( "RUNFROMOCM" ), TEXT( "1" ) ); + AddProperty( UDDI_DB, TEXT( "RUNFROMOCM" ), TEXT( "1" ) ); + AddProperty( UDDI_ADMIN, TEXT( "RUNFROMOCM" ), TEXT( "1" ) ); + + // + // now figure out the Windows volume and the target path + // + TCHAR szTargetPath[ MAX_PATH + 1 ]; + DWORD dwRet = ExpandEnvironmentStrings( TEXT( "%SystemDrive%\\Inetpub" ), szTargetPath, MAX_PATH ); + if ( !dwRet ) // fallback on C:\Inetpub + _tcscpy( szTargetPath, TEXT( "C:\\Inetpub" ) ); + + m_cDefaultDataDir = szTargetPath; + m_cDefaultDataDir += TEXT( "\\uddi\\data" ); + + AddProperty( UDDI_WEB, TEXT( "TARGETDIR" ), szTargetPath ); + AddProperty( UDDI_DB, TEXT( "TARGETDIR" ), szTargetPath ); + AddProperty( UDDI_ADMIN, TEXT( "TARGETDIR" ), szTargetPath ); + + // + // Now set up the install date property so that it goes to the registry in + // a locale-independent fashion + // + TCHAR szMDYDate[ 256 ]; + time_t now = time( NULL ); + struct tm *today = localtime( &now ); + + _tcsftime( szMDYDate, sizeof szMDYDate / sizeof szMDYDate[0], TEXT( "%m/%d/%Y" ), today ); + + AddProperty( UDDI_WEB, TEXT( "MDY" ), szMDYDate ); + AddProperty( UDDI_DB, TEXT( "MDY" ), szMDYDate ); + AddProperty( UDDI_ADMIN, TEXT( "MDY" ), szMDYDate ); + + m_hInstance = NULL; + m_uSuiteMask = 0; +} + +//----------------------------------------------------------------------------------------- +// +// set the install level of a component given the component index +// +void CUDDIInstall::SetInstallLevel( UDDI_PACKAGE_ID id, INSTALL_LEVEL iInstallLevel, BOOL bForceInstall ) +{ + if( UDDI_INSTALL == iInstallLevel ) + { + if ( bForceInstall ) + { + m_package[ id ].iInstallLevel = UDDI_INSTALL; + if ( UDDI_COMBO == id ) + { + m_package[ UDDI_WEB ].iInstallLevel = UDDI_INSTALL; + m_package[ UDDI_DB ].iInstallLevel = UDDI_INSTALL; + } + } + else + { + m_package[ id ].iInstallLevel = IsInstalled( id ) ? UDDI_NOACTION : UDDI_INSTALL; + if ( UDDI_COMBO == id ) + { + m_package[ UDDI_WEB ].iInstallLevel = m_package[ id ].iInstallLevel; + m_package[ UDDI_DB ].iInstallLevel = m_package[ id ].iInstallLevel; + } + } + } + else if( UDDI_UNINSTALL == iInstallLevel ) + { + m_package[ id ].iInstallLevel = IsInstalled( id ) ? UDDI_UNINSTALL : UDDI_NOACTION; + if ( UDDI_COMBO == id ) + { + m_package[ UDDI_WEB ].iInstallLevel = m_package[ id ].iInstallLevel; + m_package[ UDDI_DB ].iInstallLevel = m_package[ id ].iInstallLevel; + } + } + else if( UDDI_NOACTION == iInstallLevel ) + { + m_package[ id ].iInstallLevel = UDDI_NOACTION; + if ( UDDI_COMBO == id ) + { + m_package[ UDDI_WEB ].iInstallLevel = m_package[ id ].iInstallLevel; + m_package[ UDDI_DB ].iInstallLevel = m_package[ id ].iInstallLevel; + } + } + else + { + assert( false ); + } +} + +//----------------------------------------------------------------------------------------- +// +// set the install level of a component give the component name +// +void CUDDIInstall::SetInstallLevel( LPCTSTR szOCMName, INSTALL_LEVEL iInstallLevel, BOOL bForceInstall ) +{ + SetInstallLevel( GetPackageID( szOCMName ), iInstallLevel, bForceInstall ); +} + +//----------------------------------------------------------------------------------------- +// +// Get the install level of a component give the component name +// +LPCTSTR CUDDIInstall::GetInstallStateText( LPCTSTR szOCMName ) +{ + return GetInstallStateText( GetPackageID( szOCMName ) ); +} + +//----------------------------------------------------------------------------------------- +// +// Get the install level of a component give the component index +// +LPCTSTR CUDDIInstall::GetInstallStateText( UDDI_PACKAGE_ID id ) +{ + return szInstallStateText[ m_package[ id ].iInstallLevel ]; +} + +//----------------------------------------------------------------------------------------- +// +// look up the id ( index ) of the component based on the name. +// The name set in the constructor must match the name given in uddi.inf. +// +UDDI_PACKAGE_ID CUDDIInstall::GetPackageID( LPCTSTR szOCMName ) +{ + for( UINT uid=UDDI_MSDE; uid <= UDDI_COMBO; uid++ ) + { + UDDI_PACKAGE_ID id = ( UDDI_PACKAGE_ID ) uid; + + if( 0 == m_package[ id ].cOCMName.compare( szOCMName ) ) + { + return id; + } + } + + assert( false ); + return ( UDDI_PACKAGE_ID ) 0; +} + +//-------------------------------------------------------------------------------------- +// Returns the default Data Files location (typically %SystemDrive%\Inetpub\uddi\data) +// +LPCTSTR CUDDIInstall::GetDefaultDataPath () +{ + return m_cDefaultDataDir.c_str(); +} + + +//----------------------------------------------------------------------------------------- + +void CUDDIInstall::AddProperty( UDDI_PACKAGE_ID id, LPCTSTR szProperty, LPCTSTR szValue ) +{ + m_package[ id ].installProperties.Add( szProperty, szValue ); +} + +//----------------------------------------------------------------------------------------- + +void CUDDIInstall::AddProperty( UDDI_PACKAGE_ID id, LPCTSTR szProperty, DWORD dwValue ) +{ + m_package[ id ].installProperties.Add( szProperty, dwValue ); +} + +//----------------------------------------------------------------------------------------- + +LPCTSTR CUDDIInstall::GetProperty ( UDDI_PACKAGE_ID id, LPCTSTR szProperty, LPTSTR szOutBuf ) +{ + return m_package[ id ].installProperties.GetString( szProperty, szOutBuf ); +} + +//----------------------------------------------------------------------------------------- + +void CUDDIInstall::DeleteProperty( UDDI_PACKAGE_ID id, LPCTSTR szProperty ) +{ + m_package[ id ].installProperties.Delete( szProperty ); +} + +//----------------------------------------------------------------------------------------- +// +// clear out all the properties for a component +// +void CUDDIInstall::DeleteProperties( UDDI_PACKAGE_ID id ) +{ + m_package[ id ].installProperties.Clear(); +} + +//----------------------------------------------------------------------------------------- + +bool CUDDIInstall::SetDBInstanceName( LPCTSTR szComputerName, LPCTSTR szNewInstanceName, + bool bIsInstallingMSDE, bool bIsCluster ) +{ + const cBUFFSIZE = 50; + bool bFullyQualifiedInstance = false; + bool bIsLocalComputer = false; + TCHAR szTempInstanceName[ cBUFFSIZE ] = {0}; + TCHAR szCompNameBuf[ 256 ] = {0}; + TCHAR szInstNameBuf[ 256 ] = {0}; + + assert( NULL != szNewInstanceName ); + + // + // First, should we parse the instance name out and separate the server name from the + // instance name ? + // + TCHAR *pChar = _tcschr( szNewInstanceName, TEXT( '\\') ); + if ( pChar ) + { + // + // We were given a fully-qualified instance name + // Use the computer name from the instance, as it may differ from the physical + // computer name when run on a cluster node + // + bFullyQualifiedInstance = true; + bIsLocalComputer = false; + _tcsncpy( szCompNameBuf, szNewInstanceName, (pChar - szNewInstanceName) ); + _tcsncpy( szInstNameBuf, pChar+1, cBUFFSIZE - 1 ); + } + else + { + bFullyQualifiedInstance = false; + _tcscpy( szInstNameBuf, szNewInstanceName ); + + if( szComputerName ) + { + bIsLocalComputer = false; + _tcscpy( szCompNameBuf, szComputerName ); + } + else + { + bIsLocalComputer = true; + + TCHAR szLocalComputerName[ MAX_COMPUTERNAME_LENGTH + 1 ] = {0}; + DWORD dwLen = MAX_COMPUTERNAME_LENGTH + 1; + GetComputerName( szLocalComputerName, &dwLen ); + + _tcscpy( szCompNameBuf, szLocalComputerName ); + } + } + + // + // now set up the dbInstance structure + // + m_dbinstance.bIsCluster = bIsCluster; + m_dbinstance.cComputerName = szCompNameBuf; + m_dbinstance.bIsLocalComputer = bIsLocalComputer; + + _tcsncpy( szTempInstanceName, szInstNameBuf, cBUFFSIZE - 1 ); + + // + // if we are creating a new db, make sure the name select is not already in use + // + if( bIsInstallingMSDE ) + { + // + // container class of all the local db instance names + // + CDBInstance localDBInstance; + + bool bUnusedNameFound = false; + for( int i=1; i<100 && !bUnusedNameFound; i++ ) + { + if( localDBInstance.IsInstanceInstalled( szTempInstanceName ) == -1 ) + { + bUnusedNameFound = true; + } + else + { + Log( TEXT( "MSDE instance name %s is already in use." ), szTempInstanceName ); + _stprintf( szTempInstanceName, TEXT( "%s%d" ), szNewInstanceName, i ); + } + } + + if( !bUnusedNameFound ) + { + Log( TEXT( "FAIL: Unable to find an unused instance name" ) ); + return false; + } + } + + m_dbinstance.cSQLInstanceName = szTempInstanceName; + m_dbinstance.cFullName = m_dbinstance.cComputerName; + if( m_dbinstance.cSQLInstanceName.compare( DEFAULT_SQL_INSTANCE_NAME ) ) + { + m_dbinstance.cFullName += TEXT( "\\" ); + m_dbinstance.cFullName += m_dbinstance.cSQLInstanceName; + } + + // + // add a property to the db and web install command line to note the instance name + // + AddProperty( UDDI_DB, TEXT( "INSTANCENAMEONLY" ), m_dbinstance.cSQLInstanceName.c_str() ); + AddProperty( UDDI_DB, TEXT( "INSTANCENAME" ), m_dbinstance.cFullName.c_str() ); + AddProperty( UDDI_WEB, TEXT( "INSTANCENAME" ), m_dbinstance.cFullName.c_str() ); + + // + // MSDE needs only the instance name, not the machine name + // + AddProperty( UDDI_MSDE, TEXT( "INSTANCENAME" ), m_dbinstance.cSQLInstanceName.c_str() ); + + return true; +} + + +//----------------------------------------------------------------------------------------- +// Counterpart routines for the Set above +// +LPCTSTR CUDDIInstall::GetDBInstanceName() +{ + return m_dbinstance.cSQLInstanceName.c_str(); +} + + +LPCTSTR CUDDIInstall::GetFullDBInstanceName() +{ + return m_dbinstance.cFullName.c_str(); +} + + +LPCTSTR CUDDIInstall::GetDBComputerName() +{ + return m_dbinstance.cComputerName.c_str(); +} + +//----------------------------------------------------------------------------------------- +// +// determine if a component is installed given the component name +// +bool CUDDIInstall::IsInstalled( LPCTSTR szOCMName ) +{ + return IsInstalled( GetPackageID( szOCMName ) ); +} + +//----------------------------------------------------------------------------------------- +// +// determine if a component is installed given the component id +// +bool CUDDIInstall::IsInstalled( UDDI_PACKAGE_ID id ) +{ + TCHAR szProductGuid[ MSI_GUID_LEN ]; + + // + // Here we handle the "virtual" component UDDI_COMBO that actually is a mix of DB and Web + // + if ( UDDI_COMBO == id ) + { + bool bRes = IsInstalled( UDDI_WEB ) && IsInstalled( UDDI_DB ); + return bRes; + } + + assert( MSI_GUID_LEN - 1 == _tcslen( m_package[ id ].szUpgradeCode ) ); + + UINT iRet = MsiEnumRelatedProducts( m_package[ id ].szUpgradeCode, 0, 0, szProductGuid ); + + if( ERROR_NO_MORE_ITEMS == iRet ) + { + Log( TEXT( "%s is not already installed." ), m_package[ id ].cMSIName.c_str() ); + return false ; + } + else if( ERROR_SUCCESS == iRet ) + { + Log( TEXT( "A version of %s is already installed." ), m_package[ id ].cMSIName.c_str() ); + return true; + } + else if( ERROR_INVALID_PARAMETER == iRet ) + { + Log( TEXT( "FAIL: Invalid upgrade code %s passed to MsiEnumRelatedProducts() for %s." ), + m_package[ id ].szUpgradeCode, + m_package[ id ].cMSIName.c_str() ); + assert( false ); + return false; + } + else + { + Log( TEXT( "FAIL: Error calling MsiEnumRelatedProducts()." ) ); + assert( false ); + return false; + } +} + +//----------------------------------------------------------------------------------------- +// +// determine if any of the components are set to install +// +bool CUDDIInstall::IsAnyInstalling() +{ + for( UINT uid=UDDI_MSDE; uid <= UDDI_ADMIN; uid++ ) + { + UDDI_PACKAGE_ID id = ( UDDI_PACKAGE_ID ) uid; + + if( IsInstalling( id ) ) + { + return true; + } + } + + return false; +} + +//----------------------------------------------------------------------------------------- +// +// determine if any of the components are set to install +// +bool CUDDIInstall::IsUninstalling( UDDI_PACKAGE_ID id ) +{ + return ( UDDI_UNINSTALL == m_package[ id ].iInstallLevel ); +} + +//----------------------------------------------------------------------------------------- +// +// determine if any of the components are set to install +// +bool CUDDIInstall::IsInstalling( UDDI_PACKAGE_ID id ) +{ + return ( UDDI_INSTALL == m_package[ id ].iInstallLevel ); +} + +//----------------------------------------------------------------------------------------- +// +// determine if any of the components are set to install +// +bool CUDDIInstall::IsInstalling( LPCTSTR szOCMName ) +{ + return IsInstalling( GetPackageID( szOCMName ) ); +} + +//----------------------------------------------------------------------------------------- +// +// get the selection state from the OCM and updat the install level +// +void CUDDIInstall::UpdateAllInstallLevel() +{ + for( UINT uid=UDDI_MSDE; uid <= UDDI_ADMIN; uid++ ) + { + UDDI_PACKAGE_ID id = ( UDDI_PACKAGE_ID ) uid; + + if( m_package[ id ].bOCMComponent ) + { + // + // if this is an OCM component (i.e. NOT MSDE), check its selection state + // + bool bIsInstalling = false; + if( ERROR_SUCCESS == COCMCallback::QuerySelectionState( m_package[ id ].cOCMName.c_str(), bIsInstalling ) ) + { + SetInstallLevel( id, bIsInstalling ? UDDI_INSTALL : UDDI_UNINSTALL ); + } + } + } + + // + // now as we updated the DB and Web components, we can take care of the "combo" one + // + bool bIsInstallingCombo = false; + if( ERROR_SUCCESS == COCMCallback::QuerySelectionState( m_package[ UDDI_COMBO ].cOCMName.c_str(), bIsInstallingCombo ) ) + { + SetInstallLevel( UDDI_COMBO, bIsInstallingCombo ? UDDI_INSTALL : UDDI_UNINSTALL ); + } +} + +//----------------------------------------------------------------------------------------- +// +// install and uninstall any or all of the components +// +UINT CUDDIInstall::Install() +{ + ENTER(); + + BOOL InstallingPackage[ UDDI_PACKAGE_COUNT ] = {0}; + + // + // if any errors, don't bail + // keep going and report errors at the very end + // + UINT uFinalRetCode = ERROR_SUCCESS; + + // + // uninstall ALL the packages that are set to uninstall + // + for( int id = UDDI_ADMIN; id >= UDDI_MSDE; id-- ) + { + UDDI_PACKAGE_ID pkgid = (UDDI_PACKAGE_ID) id; + + if( IsUninstalling( pkgid ) ) + { + COCMCallback::AdvanceTickGauge(); + + UINT uRetCode = UninstallPackage( pkgid ); + + if( ERROR_SUCCESS != uRetCode ) + uFinalRetCode = uRetCode; + } + } + + // + // install ALL the packages that are set to install + // + for( UINT uid=UDDI_MSDE; uid <= UDDI_ADMIN; uid++ ) + { + UDDI_PACKAGE_ID id = ( UDDI_PACKAGE_ID ) uid; + InstallingPackage[ uid ] = IsInstalling( id ); + + if( IsInstalling( id ) ) + { + COCMCallback::AdvanceTickGauge(); + + UINT uRetCode = InstallPackage( id ); + + if( ERROR_SUCCESS != uRetCode ) + { + uFinalRetCode = uRetCode; + + // + // on the Standard Server, the first failed component fails the whole thing + // + if ( IsStdServer() && ERROR_SUCCESS_REBOOT_REQUIRED != uRetCode ) + { + for( int tmpid = id; tmpid > UDDI_MSDE; tmpid-- ) + { + if( InstallingPackage[ tmpid ] ) + { + COCMCallback::AdvanceTickGauge(); + UninstallPackage( (UDDI_PACKAGE_ID)tmpid ); + } + } + + if ( InstallingPackage[ UDDI_MSDE ] ) + UninstallPackage( UDDI_MSDE ); + + break; + } + } + else + { + uRetCode = PostInstallPackage( id ); + if( ERROR_SUCCESS != uRetCode && ERROR_SUCCESS_REBOOT_REQUIRED != uRetCode ) + { + uFinalRetCode = uRetCode; + + // + // Remove the package that failed on post-installation phase + // + UninstallPackage( id ); + } + } + } + } + + return uFinalRetCode; +} + +//----------------------------------------------------------------------------------------- + +UINT CUDDIInstall::InstallPackage( UDDI_PACKAGE_ID id ) +{ + ENTER(); + DWORD dwRetCode = 0; + + // + // Before we do anything else, try to enable the Remote Registry + // + if ( id == UDDI_DB || id == UDDI_WEB ) + { + EnableRemoteRegistry(); + } + + // + // 739722 - Change installing message to better suite localization. + // + + // + // create and display the text on the OCM progress dialog + // + TCHAR szBuffer[ 1024 ]; + TCHAR szComponent[ 256 ]; + TCHAR szMsgFormat[ 256 ]; + + // + // Get the Installing %S ... message. + // + if( !LoadString( m_hInstance, IDS_INSTALL, szMsgFormat, sizeof( szMsgFormat ) / sizeof( TCHAR ) ) ) + return GetLastError(); + + // + // Get the component that we are installing. + // + if( !LoadString( m_hInstance, IDS_MSDE_NAME + id, szComponent, sizeof( szComponent ) / sizeof( TCHAR ) ) ) + return GetLastError(); + + // + // Write out a formatted string that combines these 2. + // + _sntprintf( szBuffer, 1023, szMsgFormat, szComponent ); + COCMCallback::SetProgressText( szBuffer ); + Log( szBuffer ); + + // + // create the path to the msi file + // + TCHAR szWindowsDir[ MAX_PATH + 1 ]; + if( 0 == GetWindowsDirectory( szWindowsDir, MAX_PATH ) ) + { + return GetLastError(); + } + tstring cMSIPath = szWindowsDir; + cMSIPath.append( TEXT( "\\" ) ); + cMSIPath.append( m_package[ id ].cMSIName.c_str() ); + + // + // start the msiexec command line + // + tstring cMSIArgs = TEXT( "/i " ); + cMSIArgs.append( TEXT ("\"") ); + cMSIArgs.append( cMSIPath ); + cMSIArgs.append( TEXT ("\"") ); + + // + // add the "quiet" switch + // + cMSIArgs.append( TEXT( " /q" ) ); + + // + // turn logging on, put log into a file in the windows folder, + // same name as the MSI file, with a .log extension + // + cMSIArgs.append( TEXT( " /l* " ) ); + cMSIArgs.append( TEXT ("\"") ); + cMSIArgs.append( cMSIPath ); + cMSIArgs.append( TEXT( ".log" ) ); + cMSIArgs.append( TEXT ("\"") ); + + // + // append all the MSI properties to the command line + // + Log ( TEXT ("Composing the command-line") ); + + // + // 777143 + // + if( UDDI_MSDE == id ) + { + const WORD hongKongLangID = MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_HONGKONG ); + + LCID systemLocale = ::GetSystemDefaultLCID(); + WORD systemLangID = LANGIDFROMLCID( systemLocale ); + if( hongKongLangID == systemLangID ) + { + Log( TEXT( "**********Hong Kong system locale detected**********" ) ); + cMSIArgs.append( TEXT( " COLLATION=" ) ); + cMSIArgs.append( TEXT( "\"Chinese_PRC_CI_AS\" " ) ); + } + else + { + Log( TEXT( "**********System locale is not Hong Kong************" ) ); + } + } + + ATOM at = 0; + TCHAR szWamPwd[ 1024 ]; + + ZeroMemory( szWamPwd, sizeof szWamPwd ); + + if ( m_package[ id ].installProperties.GetString( TEXT("WAM_PWD"), szWamPwd ) ) + { + // + // we found the property, now let's change it so it does not get passed across + // in a clear text format + // + at = GlobalAddAtom( szWamPwd ); + m_package[ id ].installProperties.Delete( TEXT("WAM_PWD") ); + m_package[ id ].installProperties.Add ( szWamPwdKey, at ); + } + + TCHAR tmpBuf [4096]; + m_package[ id ].installProperties.ConcatValuePairs (_T(" "), tmpBuf); + + cMSIArgs.append ( _T(" ") ); + cMSIArgs.append ( tmpBuf ); + + dwRetCode = RunMSIEXECCommandLine( cMSIArgs ); + + if( ERROR_SUCCESS != dwRetCode ) + { + LogError( TEXT( "Error Installing UDDI" ), dwRetCode ); + } + + // + // delete the msi file and the cab file + // + DeleteFile( cMSIPath.c_str() ); + GlobalDeleteAtom( at ); + + if( m_package[ id ].cCABName.length() ) + { + tstring cCABPath = szWindowsDir; + cCABPath.append( TEXT( "\\" ) ); + cCABPath.append( m_package[ id ].cCABName.c_str() ); + DeleteFile( cCABPath.c_str() ); + } + + return dwRetCode; +} + +//----------------------------------------------------------------------------------------- +// Executes the post-installation tasks +// BEWARE: if the function returns an error code, then the whole package will be uninstalled +// +UINT CUDDIInstall::PostInstallPackage( UDDI_PACKAGE_ID id ) +{ + Log( TEXT( "Executing the post-installation tasks for the package '%s'" ), m_package[ id ].cOCMName.c_str() ); + + return ERROR_SUCCESS; +} + + +//----------------------------------------------------------------------------------------- + +UINT CUDDIInstall::UninstallPackage( UDDI_PACKAGE_ID id ) +{ + tstring cMSIArgs, cOptionalParams; + DWORD dwRetCode = 0; + + // + // create and display the text on the OCM progress dialog + // + TCHAR szMask[ 256 ] = {0}, + szComponent[ 256 ] = {0}, + szStage[ 256 ] = {0}, + szBuf[ 512 ] = {0}; + + if( !LoadString( m_hInstance, IDS_UNINSTALL, szMask, DIM( szMask ) ) ) + return GetLastError(); + + // + // concat the name of this component + // + if( !LoadString( m_hInstance, IDS_MSDE_NAME + id, szComponent, DIM( szComponent ) ) ) + return GetLastError(); + + // + // First, format the message (in case we are on a cluster node, we need to say something) + // + if ( id == UDDI_DB ) + { + if( !LoadString( m_hInstance, IDS_DB_ANALYSING_MSG, szStage, DIM( szStage ) ) ) + return GetLastError(); + } + + _stprintf( szBuf, szMask, szComponent, szStage ); + COCMCallback::SetProgressText( szBuf ); + Log( szBuf ); + + // + // Now, proceed with the cluster environment analysis + // + if ( id == UDDI_DB || id == UDDI_WEB ) + { + TCHAR szInstance[ 1024 ] = {0}; + DWORD cbBuf = DIM( szInstance ); + bool bCluster = false; + + // + // We create a temp instance as we don't want to interfere with the other components + // + CDBInstance dbInstances; + + bool bRes = dbInstances.GetUDDIDBInstanceName( NULL, szInstance, &cbBuf, &bCluster ); + if ( !bRes ) + { + // + // apparently there is no instance to uninstall. Assume we are in the "normal" mode + // + bCluster = false; + } + + // + // Now we need to detect the cluster node (if any) and its state + // + if ( bCluster ) + { + TCHAR szComputer[ 256 ]; + WCHAR szNode[ 256 ]; + DWORD cbNode = DIM( szNode ); + DWORD cbComputer = DIM( szComputer ); + bool bIsActiveNode = true; + + DWORD dwErr = GetSqlNode( szInstance, szNode, cbNode - 1 ); + if ( dwErr == ERROR_SUCCESS && wcslen( szNode ) ) + { + // + // this is a node. Now let's see whether it's an owning one + // + GetComputerName( szComputer, &cbComputer ); + if ( _tcsicmp( szNode, szComputer ) ) + bIsActiveNode = false; + } + + // + // Now we will set the additional command-line parameters for the custome action, + // indicating the type of the node + // + cOptionalParams += TEXT( " " ); + cOptionalParams += PROPKEY_CLUSTERNODETYPE; + cOptionalParams += TEXT( "=\"" ); + cOptionalParams += bIsActiveNode ? PROPKEY_ACTIVENODE : PROPKEY_PASSIVENODE; + cOptionalParams += TEXT( "\" " ); + } + } + + // + // create the path to the msi file + // + TCHAR szWindowsDir[ MAX_PATH + 1 ]; + if( 0 == GetWindowsDirectory( szWindowsDir, MAX_PATH ) ) + { + return GetLastError(); + } + tstring cMSIPath = szWindowsDir; + cMSIPath.append( TEXT( "\\" ) ); + cMSIPath.append( m_package[ id ].cMSIName.c_str() ); + + // + // create the command line for the msiexec uninstall + // + cMSIArgs = TEXT( "/q /x " ); + + cMSIArgs.append( m_package[ id ].szProductCode ); + + // + // turn logging on + // + cMSIArgs.append( TEXT( " /l* " ) ); + cMSIArgs.append( TEXT ("\"") ); + cMSIArgs.append( cMSIPath ); + cMSIArgs.append( TEXT( ".uninst.log" ) ); + cMSIArgs.append( TEXT ("\"") ); + + // + // 777143 + // + if( UDDI_MSDE == id ) + { + const WORD hongKongLangID = MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_HONGKONG ); + + LCID systemLocale = ::GetSystemDefaultLCID(); + WORD systemLangID = LANGIDFROMLCID( systemLocale ); + if( hongKongLangID == systemLangID ) + { + Log( TEXT( "**********Hong Kong system locale detected**********" ) ); + cMSIArgs.append( TEXT( " COLLATION=" ) ); + cMSIArgs.append( TEXT( "\"Chinese_PRC_CI_AS\" " ) ); + } + else + { + Log( TEXT( "**********System locale is not Hong Kong************" ) ); + } + } + + // + // suppress MSI reboots! + // The return code from msiexec will tell us if MSI needs a reboot, + // we will then instruct the OCM to request a reboot + // + cMSIArgs.append( TEXT( " REBOOT=ReallySuppress RUNFROMOCM=1 " ) ); + cMSIArgs.append( cOptionalParams ); + + dwRetCode = RunMSIEXECCommandLine( cMSIArgs ); + + if( ERROR_SUCCESS != dwRetCode ) + { + LogError( TEXT( "FAIL: Error Installing package" ), dwRetCode ); + } + + return dwRetCode; +} + + +//----------------------------------------------------------------------------------------- + +HRESULT CUDDIInstall::DetectOSFlavor() +{ + return GetOSProductSuiteMask( NULL, &m_uSuiteMask ); +} + + + +//----------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------------- + +CDBInstance::CDBInstance( LPCTSTR szRemoteMachine ) +{ + m_instanceCount = 0; + GetInstalledDBInstanceNames( szRemoteMachine ); +} + +//----------------------------------------------------------------------------------------- + +LONG CDBInstance::GetInstalledDBInstanceNames( LPCTSTR szRemoteMachine ) +{ + HKEY hParentKey = NULL; + TCHAR szInstanceVersion[ 256 ]; + TCHAR szCSDVersion[ 256 ]; + TCHAR szVirtualMachineName[ MAX_COMPUTERNAME_LENGTH + 1 ]; + TCHAR szComputerName[ MAX_COMPUTERNAME_LENGTH + 1 ]; + DWORD dwLen = MAX_COMPUTERNAME_LENGTH + 1; + DWORD dwCSDVersion = 0; + bool bIsLocalComputer; + LONG iRet1 = 0; + + Log( TEXT( "Looking for installed instances on machine: %s" ), szRemoteMachine ); + + // + // connect to the remote machine (NULL indicates local machine) + // + if( NULL != szRemoteMachine ) + { + bIsLocalComputer = false; + _tcsncpy( szComputerName, szRemoteMachine, MAX_COMPUTERNAME_LENGTH ); + iRet1 = RegConnectRegistry( szRemoteMachine, HKEY_LOCAL_MACHINE, &hParentKey ); + if( ERROR_SUCCESS != iRet1 ) + { + LogError( TEXT( "Unable to connect to remote machine" ), iRet1 ); + return iRet1; + } + } + // + // or else connect to the local machine registry + // + else + { + bIsLocalComputer = true; + if( !GetComputerName( szComputerName, &dwLen ) ) + { + Log( TEXT( "GetComputerName() failed, error = %d" ), GetLastError() ); + } + Log( TEXT( "Local computer name is: %s" ), szComputerName ); + iRet1 = RegOpenKeyEx( HKEY_LOCAL_MACHINE, NULL, NULL, KEY_READ, &hParentKey ); + if( ERROR_SUCCESS != iRet1 ) + { + LogError( TEXT( "Unable to open local registry" ), iRet1 ); + return iRet1; + } + } + + CRegKey key; + assert( hParentKey ); + iRet1 = key.Open( hParentKey, TEXT( "SOFTWARE\\Microsoft\\Microsoft SQL Server" ), KEY_READ ); + if( ERROR_SUCCESS != iRet1 ) + { + Log( TEXT( "Unable to open the SQL Server regkey - SQLServer must not be installed" ) ); + RegCloseKey( hParentKey ); + return iRet1; + } + + TCHAR szInstanceNames[ 500 ]; + ULONG uLen = sizeof( szInstanceNames ) / sizeof( TCHAR ); + + // + // get the list of installed instances of SQL on this machine + // + Log( TEXT( "Looking for installed instances on machine: %s" ), szComputerName ); + DWORD dwType = REG_MULTI_SZ; + iRet1 = RegQueryValueEx( key.m_hKey, TEXT( "InstalledInstances" ), NULL, &dwType, (LPBYTE) szInstanceNames, &uLen ); + if( ERROR_SUCCESS != iRet1 ) + { + Log( TEXT( "There is no InstalledInstances value on this machine - SQLServer must not be installed" ) ); + RegCloseKey( hParentKey ); + return iRet1; + } + + m_instanceCount = 0; + + // + // process all the instance names that were found + // + for( PTCHAR pInstance = szInstanceNames; + _tcslen( pInstance ) && m_instanceCount < MAX_INSTANCE_COUNT; + pInstance += _tcslen( pInstance ) + 1 ) + { + // + // get the version number of this instance + // + if( !GetSqlInstanceVersion( hParentKey, pInstance, szInstanceVersion, sizeof( szInstanceVersion ) / sizeof( TCHAR ), szCSDVersion, sizeof( szCSDVersion ) / sizeof( TCHAR ) ) ) + { + Log( TEXT( "Error getting version for SQL instance %s" ), pInstance ); + continue; + } + + // + // if this is not sql 2000 (8.0.0) or later, do not add this one to the list + // + if( CompareVersions( szInstanceVersion , TEXT( "8.0.0" ) ) < 0 ) + { + Log( TEXT( "SQL instance %s, version %s is not supported" ), pInstance, szInstanceVersion ); + continue; + } + + // + // if this is not sql sp3 or later, do not add this one to the list + // + if( CompareVersions( szCSDVersion , MIN_SQLSP_VERSION ) < 0 ) + { + Log( TEXT( "Warning: SQL instance %s, SP Level [%s] is not supported" ), pInstance, szCSDVersion ); + } + + // + // see if this is a cluster (virtual) instance + // + bool bIsClusterDB = IsClusteredDB( hParentKey, pInstance, szVirtualMachineName, sizeof( szVirtualMachineName ) ); + + m_dbinstance[ m_instanceCount ].cComputerName = bIsClusterDB ? szVirtualMachineName : szComputerName; + m_dbinstance[ m_instanceCount ].bIsLocalComputer = bIsLocalComputer; + m_dbinstance[ m_instanceCount ].bIsCluster = bIsClusterDB; + m_dbinstance[ m_instanceCount ].cSQLVersion = szInstanceVersion; + m_dbinstance[ m_instanceCount ].cSPVersion = szCSDVersion; + + // + // look for the default instance + // + if( _tcsicmp( pInstance, DEFAULT_SQL_INSTANCE_NATIVE ) == 0 ) + { + // + // if this is the default instance, use only the machine name + // + m_dbinstance[ m_instanceCount ].cSQLInstanceName = DEFAULT_SQL_INSTANCE_NAME; + m_dbinstance[ m_instanceCount ].cFullName = m_dbinstance[ m_instanceCount ].cComputerName; + } + else + { + // + // if this this a named instance, use "machine\instance" + // + m_dbinstance[ m_instanceCount ].cSQLInstanceName = pInstance; + m_dbinstance[ m_instanceCount ].cFullName = m_dbinstance[ m_instanceCount ].cComputerName; + m_dbinstance[ m_instanceCount ].cFullName.append( TEXT( "\\" ) ); + m_dbinstance[ m_instanceCount ].cFullName.append( m_dbinstance[ m_instanceCount ].cSQLInstanceName ); + } + + Log( TEXT( "SQL instance %s added to list" ), m_dbinstance[ m_instanceCount ].cFullName.c_str() ); + + m_instanceCount++; + } + + if( 0 == m_instanceCount ) + { + Log( TEXT( "No acceptable SQL instances found" ) ); + return ERROR_SUCCESS; + } + + return ERROR_SUCCESS; +} + +//----------------------------------------------------------------------------------------- + +bool CDBInstance::IsClusteredDB( HKEY hParentKey, LPCTSTR szInstanceName, LPTSTR szVirtualMachineName, DWORD dwLen ) +{ + tstring cVersionKey; + if( _tcsicmp( szInstanceName, DEFAULT_SQL_INSTANCE_NAME ) == 0 || _tcsicmp( szInstanceName, TEXT( "MSSQLSERVER" ) ) == 0 ) + { + cVersionKey = TEXT( "SOFTWARE\\Microsoft\\MSSQLServer\\Cluster" ); + } + else + { + cVersionKey = TEXT( "SOFTWARE\\Microsoft\\Microsoft SQL Server\\" ); + cVersionKey.append( szInstanceName ); + cVersionKey.append( TEXT( "\\Cluster" ) ); + } + + CRegKey key; + assert( hParentKey ); + LONG iRet1 = key.Open( hParentKey, cVersionKey.c_str(), KEY_READ ); + if( ERROR_SUCCESS == iRet1 ) + { + DWORD dwType = REG_SZ; + iRet1 = RegQueryValueEx( key.m_hKey, TEXT( "ClusterName" ), NULL, &dwType, (LPBYTE) szVirtualMachineName, &dwLen ); + if( ERROR_SUCCESS == iRet1 ) + { + Log( TEXT( "DB Instance %s is a cluster, VM name = %s" ), szInstanceName, szVirtualMachineName ); + return true; + } + else + { + Log( TEXT( "Unable to read ClusterName value in regkey %s, error=%d" ), cVersionKey.c_str(), iRet1 ); + } + } + else + { + Log( TEXT( "Unable to open regkey %s, error=%d" ), cVersionKey.c_str(), iRet1 ); + } + + Log( TEXT( "DB Instance %s is NOT a cluster" ), szInstanceName ); + + return false; +} + +//----------------------------------------------------------------------------------------- + +bool CDBInstance::GetSqlInstanceVersion( HKEY hParentKey, LPCTSTR szInstanceName, + LPTSTR szInstanceVersion, DWORD dwVersionLen, + LPTSTR szCSDVersion, DWORD dwCSDVersionLen ) +{ + tstring cVersionKey; + + if( _tcsicmp( szInstanceName, DEFAULT_SQL_INSTANCE_NAME ) == 0 || _tcsicmp( szInstanceName, TEXT( "MSSQLSERVER" ) ) == 0 ) + { + cVersionKey = TEXT( "SOFTWARE\\Microsoft\\MSSQLServer\\MSSQLServer\\CurrentVersion" ); + } + else + { + cVersionKey = TEXT( "SOFTWARE\\Microsoft\\Microsoft SQL Server\\" ); + cVersionKey.append( szInstanceName ); + cVersionKey.append( TEXT( "\\MSSQLServer\\CurrentVersion" ) ); + } + + CRegKey key; + assert( hParentKey ); + LONG iRet = key.Open( hParentKey, cVersionKey.c_str() ); + if( ERROR_SUCCESS != iRet ) + { + return false; + } + + DWORD dwType = REG_SZ; + iRet = RegQueryValueEx( key.m_hKey, TEXT( "CurrentVersion" ), NULL, &dwType, (LPBYTE) szInstanceVersion, &dwVersionLen ); + if( ERROR_SUCCESS != iRet ) + { + return false; + } + + // + // Now see if there a SP installed, and if yes - what version + // + dwType = REG_SZ; + iRet = RegQueryValueEx( key.m_hKey, TEXT( "CSDVersion" ), NULL, &dwType, (LPBYTE) szCSDVersion, &dwCSDVersionLen ); + if ( ERROR_SUCCESS != iRet ) + { + _tcscpy( szCSDVersion, TEXT( "" ) ); + } + + return true; +} + +//----------------------------------------------------------------------------------------- +// retrieves the UDDI instance name on a local or remote computer +// looks for a string registry values that is created by the UDDI DB installer +bool CDBInstance::GetUDDIDBInstanceName( LPCTSTR szRemoteMachine, LPTSTR szInstanceName, PULONG puLen, bool *pbIsClustered ) +{ + LONG iRet; + HKEY hParentKey; + ULONG uBufSize = puLen ? *puLen : 0; + TCHAR szVirtualMachineName[ 2 * MAX_COMPUTERNAME_LENGTH + 1 ] = {0}; + + Log( TEXT( "Looking for UDDI databases on machine %s" ), szRemoteMachine ? szRemoteMachine : TEXT( "( local )" ) ); + + if( NULL != szRemoteMachine ) + { + iRet = RegConnectRegistry( szRemoteMachine, HKEY_LOCAL_MACHINE, &hParentKey ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "Unable to connect to remote machine" ), iRet ); + return false; + } + } + else + { + iRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, NULL, NULL, KEY_READ, &hParentKey ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "Unable to open local registry" ), iRet ); + return false; + } + } + + CRegKey key; + assert( hParentKey ); + iRet = key.Open( hParentKey, TEXT( "SOFTWARE\\Microsoft\\UDDI\\Setup\\DBServer" ) ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "Unable to open the UDDI\\Setup\\DBServer regkey" ), iRet ); + RegCloseKey( hParentKey ); + return false; + } + + DWORD dwType = REG_SZ; + iRet = RegQueryValueEx( key.m_hKey, TEXT( "InstanceNameOnly" ), NULL, &dwType, (LPBYTE) szInstanceName, &uBufSize ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "There are no UDDI databases on this machine" ), iRet ); + RegCloseKey( hParentKey ); + return false; + } + + // + // Now check whether the instance belongs to a cluster + // + if ( pbIsClustered ) + *pbIsClustered = false; + + if ( IsClusteredDB( hParentKey, szInstanceName, szVirtualMachineName, DIM( szVirtualMachineName ) - 1 ) ) + { + _tcscat( szVirtualMachineName, TEXT( "\\" ) ); + _tcscat( szVirtualMachineName, szInstanceName ); + + if ( puLen ) + *puLen = (ULONG)_tcslen( szVirtualMachineName ); + + _tcsncpy( szInstanceName, szVirtualMachineName, uBufSize ); + + if ( pbIsClustered ) + *pbIsClustered = true; + } + + RegCloseKey( hParentKey ); + return true; +} + +//----------------------------------------------------------------------------------------- + +bool CDBInstance::GetInstanceName( int i, PTCHAR szBuffer, UINT uBufLen ) +{ + if( NULL == szBuffer ) + return false; + + if( i >= 0 && i < m_instanceCount ) + { + _tcsncpy( szBuffer, m_dbinstance[ i ].cSQLInstanceName.c_str(), uBufLen ); + return true; + } + else + { + *szBuffer = '\0'; + return false; + } +} + + +//----------------------------------------------------------------------------------------- + +int CDBInstance::IsInstanceInstalled( LPCTSTR szInstanceName ) +{ + for( int i=0; i= to our minimum version? + if( CompareVersions( szVersion, szMinDotNetVersion ) >= 0 ) + { + bVersionOK = true; + } + } + + FreeLibrary(hinstLib); + + return bVersionOK; +} + +//----------------------------------------------------------------------------------------- +// if version1 > version2 returns 1 +// if version1 = version2 returns 0 +// if version1 < version2 returns -1 +int CompareVersions( LPCTSTR szVersion1, LPCTSTR szVersion2 ) +{ + if( NULL == szVersion1 || NULL == szVersion2 ) + { + return 0; + } + const cBUFFSIZE = 100; + TCHAR szV1[ cBUFFSIZE ]; + TCHAR szV2[ cBUFFSIZE ]; + + _tcsncpy( szV1, szVersion1, cBUFFSIZE - 1 ); + _tcsncpy( szV2, szVersion2, cBUFFSIZE - 1 ); + szV1[ cBUFFSIZE - 1 ] = NULL; + szV2[ cBUFFSIZE - 1 ] = NULL; + + StrTrim( szV1, TEXT( " vV" ) ); + StrTrim( szV2, TEXT( " vV" ) ); + + PTCHAR p1 = szV1; + PTCHAR p2 = szV2; + + // look at up to four sections of the version string ( e.g. 1.0.3233.14 ) + for( int i=0; i<4; i++ ) + { + UINT v1 = StrToInt( p1 ); + UINT v2 = StrToInt( p2 ); + + if( v1 > v2 ) + return 1; + + if( v1 < v2 ) + return -1; + + // otherwise keep on going + p1 = StrChr( p1, '.' ); + if( NULL == p1 ) + return 0; + p1++; + + p2 = StrChr( p2, '.' ); + if( NULL == p2 ) + return 0; + p2++; + } + + return 0; // assume we are equal +} +//----------------------------------------------------------------------------------------- + +void RaiseErrorDialog( LPCTSTR szAction, DWORD dwErrorCode ) +{ + LPVOID lpMsgBuf = NULL; + + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dwErrorCode, + MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // Default language + ( LPTSTR ) &lpMsgBuf, + 0, + NULL + ); + + TCHAR szMsg[ 1000 ]; + + _sntprintf( szMsg, 1000, TEXT( "%s\n%s" ), szAction, ( LPCTSTR ) lpMsgBuf ); + szMsg[ 999 ] = NULL; + + // Display the string. + if( 0 == MessageBox( NULL, szMsg, TEXT( "UDDI Services Setup Error" ), MB_OK | MB_ICONWARNING ) ) + { + UINT uErr = GetLastError(); + } + + // Free the buffer. + LocalFree( lpMsgBuf ); +} + +//----------------------------------------------------------------------------------------- + +bool IsOsWinXP() +{ + OSVERSIONINFOEX osvi = { 0 }; + DWORDLONG dwlConditionMask = 0; + + // Initialize the OSVERSIONINFOEX structure. + osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFOEX ); + osvi.dwMajorVersion = 5; + osvi.dwMinorVersion = 1; + osvi.wProductType = VER_NT_SERVER; + + // Initialize the condition mask. + VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL ); + VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL ); + VER_SET_CONDITION( dwlConditionMask, VER_PRODUCT_TYPE, VER_GREATER_EQUAL ); + + // Perform the test. + BOOL bIsServer = VerifyVersionInfo( + &osvi, + VER_MAJORVERSION | VER_MINORVERSION | VER_PRODUCT_TYPE, + dwlConditionMask ); + + return( TRUE == bIsServer ); +} + +//----------------------------------------------------------------------------------------- + +bool IsTSAppCompat() +{ + OSVERSIONINFOEX osvi = { 0 }; + DWORDLONG dwlConditionMask = 0; + + // Initialize the OSVERSIONINFOEX structure. + osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFOEX ); + osvi.wSuiteMask = VER_SUITE_TERMINAL; + + // Initialize the condition mask. + VER_SET_CONDITION( dwlConditionMask, VER_SUITENAME, VER_AND ); + + // Perform the test. + BOOL bIsServer = VerifyVersionInfo( + &osvi, + VER_SUITENAME, + dwlConditionMask ); + + if( FALSE == bIsServer ) + return false; + + // + // check to see if we are in application server mode + // + CRegKey key; + DWORD dwValue = 0; + LONG iRet = key.Open( HKEY_LOCAL_MACHINE, TEXT( "System\\CurrentControlSet\\Control\\Terminal Server" ), KEY_READ ); + if( ERROR_SUCCESS != iRet ) + return false; + + iRet = key.QueryValue( dwValue, TEXT( "TSAppCompat" )); + if( ERROR_SUCCESS != iRet ) + return false; + + return ( 1 == dwValue ); +} + +//----------------------------------------------------------------------------------------- + +bool CheckForAdminPrivs() +{ + BYTE psidLocalAdmins[ SECURITY_MAX_SID_SIZE + 2 ]; + BOOL isLocalAdmin = FALSE; + DWORD cbSid = DIM( psidLocalAdmins ); + DWORD dwErr = 0; + BOOL bRet; + + cbSid = SECURITY_MAX_SID_SIZE; + bRet = CreateWellKnownSid( WinBuiltinAdministratorsSid, NULL, psidLocalAdmins, &cbSid ); + dwErr = GetLastError(); + if ( !bRet ) + { + Log( TEXT( "CheckForAdminPrivs: Error creating LocalAdmins SID. Error %d [%x]" ), dwErr, dwErr ); + return false; + } + + CheckTokenMembership( NULL, psidLocalAdmins, &isLocalAdmin ); + return isLocalAdmin ? true : false; +} + + +//-------------------------------------------------------------------------------- +// Enables the RemoteRegistry service and puts it into "AutoStart" mode +// +DWORD EnableRemoteRegistry() +{ + DWORD dwRet = 0; + SC_HANDLE hSCM = NULL; + SC_HANDLE hService = NULL; + SC_LOCK hLock = NULL; + + try + { + hSCM = OpenSCManager( NULL, NULL, GENERIC_ALL ); + if ( !hSCM ) + throw ( dwRet = GetLastError() ); + + hLock = LockServiceDatabase( hSCM ); + if ( !hLock ) + throw ( dwRet = GetLastError() ); + + hService = OpenService( hSCM, _T( "RemoteRegistry" ), GENERIC_ALL ); + if ( !hService ) + { + throw ( dwRet = GetLastError() ); + } + + BOOL bRes = ChangeServiceConfig( hService, SERVICE_NO_CHANGE, + SERVICE_AUTO_START, + SERVICE_NO_CHANGE, + NULL, NULL, NULL, NULL, NULL, NULL, NULL ); + if ( !bRes ) + throw ( dwRet = GetLastError() ); + } + catch ( DWORD err ) + { + LogError( TEXT( "EnableRemoteRegistry()" ), err ); + dwRet = err; + } + catch (...) + { + LogError( TEXT( "EnableRemoteRegistry()" ), E_UNEXPECTED ); + dwRet = E_UNEXPECTED; + } + + if ( hService ) + CloseServiceHandle( hService ); + + if ( hLock ) + UnlockServiceDatabase( hLock ); + + if ( hSCM ) + CloseServiceHandle( hSCM ); + + return dwRet; +} + +//************************************************************************************** +// Clustering functions +// +// Enumerates the physical drives and filters out online ones, then collects the +// drive data etc. +// +DWORD EnumPhysicalDrives( HCLUSTER hCls, cStrList *pSqlDependencies, cDrvMap *pMap ) +{ + if ( IsBadReadPtr( pMap, sizeof cDrvMap ) || + IsBadReadPtr( pSqlDependencies, sizeof cStrList ) ) + return E_INVALIDARG; + + DISK_CALLBACK_DATA callbackData; + callbackData.hCluster = hCls; + callbackData.pPhysSrvMap = pMap; + callbackData.pSqlDependencies = pSqlDependencies; + + pMap->clear(); + DWORD dwErr = ResUtilEnumResources( NULL, RESTYPE_DISK, PhysDiskCallback, &callbackData ); + + return dwErr; +} + +//--------------------------------------------------------------------------------------- +// Enumerates all SQL Server resources and their "Physical Drive" dependencies +// +DWORD EnumSQLDependencies( HCLUSTER hCls, cStrList *pList, LPCTSTR szInstanceName ) +{ + if ( IsBadReadPtr( pList, sizeof cStrList ) ) + return E_INVALIDARG; + + pList->clear(); + + SQL_CALLBACK_DATA callbackData; + callbackData.hCluster = hCls; + callbackData.pSqlDependencies = pList; + callbackData.sSqlInstanceName = szInstanceName ? szInstanceName : TEXT( "" ); + + DWORD dwErr = ResUtilEnumResources( NULL, RESTYPE_SQL, SqlDepCallback, &callbackData ); + + return dwErr; +} + + +//---------------------------------------------------------------------------------------- +// Retrieves the Sql instance owning node +// +DWORD GetSqlNode( LPCWSTR szInstanceName, LPWSTR szNodeNameBuf, DWORD cbBufSize ) +{ + if ( IsBadWritePtr( szNodeNameBuf, cbBufSize * sizeof WCHAR ) || + IsBadStringPtr( szInstanceName, 256 ) ) + return E_INVALIDARG; + + SQL_NODE_CALLBACK_DATA callbackData; + callbackData.sSqlInstanceName = szInstanceName; + callbackData.sNodeName = TEXT( "" ); + + wcscpy( szNodeNameBuf, L"" ); + + DWORD dwErr = ResUtilEnumResources( NULL, RESTYPE_SQL, SqlCallback, &callbackData ); + if ( dwErr == ERROR_SUCCESS ) + { + wcsncpy( szNodeNameBuf, callbackData.sNodeName.c_str(), cbBufSize ); + } + + return dwErr; +} + + +//--------------------------------------------------------------------------------------- +// Physical drive enumeration callback +// all the data filtering and property collecting happens here +// +DWORD PhysDiskCallback( HRESOURCE hOriginal, + HRESOURCE hResource, + PVOID lpParams ) +{ + DWORD dwErr = 0; + HCLUSTER hCls = NULL; + cStrList *pSqlDeps = NULL; + cDrvMap *pMap = NULL; + + if ( IsBadReadPtr( lpParams, sizeof DISK_CALLBACK_DATA ) ) + return E_INVALIDARG; + + try + { + BOOL bFilterDependencies = FALSE; + BOOL bSkipResource = FALSE; + + // + // Grab the parameter block + // + hCls = ((LPDISK_CALLBACK_DATA) lpParams)->hCluster; + pSqlDeps = ((LPDISK_CALLBACK_DATA) lpParams)->pSqlDependencies; + pMap = ((LPDISK_CALLBACK_DATA) lpParams)->pPhysSrvMap; + + // + // Do we need to filter out the SQL dependencies only ? + // + bFilterDependencies = ( pSqlDeps->size() > 0 ); + + + if ( ResUtilResourceTypesEqual( RESTYPE_DISK, hResource ) ) + { + // + // This is a physical disk. Let's collect more data on it + // + CLUSPROP_PARTITION_INFO *pInfo = NULL; + WCHAR szNameBuf[ 512 ], + szNodeBuf[ 512 ], + szGroupBuf[ 512 ], + szLetter[ MAX_PATH + 1 ]; + DWORD cbNameBuf = DIM( szNameBuf ), + cbNodeBuf = DIM( szNodeBuf ), + cbGroupBuf = DIM( szGroupBuf ), + cbLetter = DIM( szLetter ); + + ZeroMemory( szNameBuf, sizeof szNameBuf ); + ZeroMemory( szNodeBuf, sizeof szNodeBuf ); + ZeroMemory( szGroupBuf, sizeof szGroupBuf ); + ZeroMemory( szLetter, sizeof szLetter ); + + dwErr = ResUtilGetResourceName( hResource, szNameBuf, &cbNameBuf ); + if ( dwErr != ERROR_SUCCESS ) + return dwErr; + + // + // See if wee need to consider this resource at all + // + if ( bFilterDependencies ) + bSkipResource = ! IsInList( szNameBuf, pSqlDeps ); + + if ( !bSkipResource ) + { + CLUSTER_RESOURCE_STATE resState = GetClusterResourceState( hResource, + szNodeBuf, &cbNodeBuf, + szGroupBuf, &cbNodeBuf ); + if ( resState != ClusterResourceOnline ) + return ERROR_SUCCESS; + + // + // Now we will retrieve the drive properties and grab the partition info + // + DWORD dwBytes = 0; + LPBYTE pBuf = NULL; + try + { + dwErr = GetClusterResourceControl( hResource, CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO, + &pBuf, &dwBytes ); + if ( dwErr != ERROR_SUCCESS && dwErr != ERROR_MORE_DATA ) + return dwErr; + + if ( !pBuf ) + return E_UNEXPECTED; + + pInfo = (PCLUSPROP_PARTITION_INFO) ParseDiskInfo( pBuf, dwBytes, CLUSPROP_SYNTAX_PARTITION_INFO ); + if ( !pInfo ) + { + // + // failed to parse the property block - just skip the resource + // + LocalFree( pBuf ); + return ERROR_SUCCESS; + } + + // + // First, check the flags to make sure we are not dealing with removable device + // + if ( ! ( pInfo->dwFlags & CLUSPROP_PIFLAG_REMOVABLE ) && + ( pInfo->dwFlags & CLUSPROP_PIFLAG_USABLE ) ) + { + _tcsncpy( szLetter, pInfo->szDeviceName, MAX_PATH ); + } + else + bSkipResource = TRUE; + } + catch (...) + { + } + + LocalFree( pBuf ); + // + // Add the resource to the map + // + if ( !bSkipResource ) + pMap->insert( cDrvMapPair( szNameBuf, cPhysicalDriveInfo( szNameBuf, szNodeBuf, szGroupBuf, szLetter ) ) ); + } + } + } + catch (...) + { + return E_UNEXPECTED; + } + + return ERROR_SUCCESS; +} + + +//-------------------------------------------------------------------------------------- +// Sql resource enumerator callback +// +DWORD SqlDepCallback( HRESOURCE hOriginal, HRESOURCE hResource, PVOID lpParams ) +{ + DWORD dwErr = 0; + HCLUSTER hCls = NULL; + cStrList *pList = NULL; + tstring sSqlInstance; + + if ( IsBadReadPtr( lpParams, sizeof SQL_CALLBACK_DATA ) ) + return E_INVALIDARG; + + try + { + WCHAR szBuf[ 1024 ]; + DWORD dwIdx = 0; + DWORD dwType; + DWORD cbBuf = DIM( szBuf ); + + hCls = ((LPSQL_CALLBACK_DATA) lpParams)->hCluster; + pList = ((LPSQL_CALLBACK_DATA) lpParams)->pSqlDependencies; + sSqlInstance = ((LPSQL_CALLBACK_DATA) lpParams)->sSqlInstanceName; + + // + // if the resource is not a SQL Server, then we just skip it + // + if ( ! ResUtilResourceTypesEqual( RESTYPE_SQL, hResource ) ) + return ERROR_SUCCESS; + + // + // Do we need to check the intance name ? + // + if ( sSqlInstance.length() > 0 ) + { + LPBYTE pBuf = NULL; + LPWSTR szVirtualName = NULL, + szInstanceName = NULL; + DWORD dwReturned = 0; + BOOL bSkipInstance = FALSE; + + dwErr = GetClusterResourceControl( hResource, CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES, + &pBuf, &dwReturned ); + if ( dwErr != ERROR_SUCCESS ) + return dwErr; + + try + { + dwErr = ResUtilFindSzProperty( pBuf, dwReturned, PROPNAME_VIRTUALSERVER, &szVirtualName ); + if ( dwErr != ERROR_SUCCESS ) + throw dwErr; + + dwErr = ResUtilFindSzProperty( pBuf, dwReturned, PROPNAME_INSTANCENAME, &szInstanceName ); + if ( dwErr != ERROR_SUCCESS ) + throw dwErr; + + // + // Do the instance names match ? + // + tstring szTmpInstance = szVirtualName; + szTmpInstance += TEXT( "\\" ); + szTmpInstance += szInstanceName; + + if ( _tcsicmp( sSqlInstance.c_str(), szTmpInstance.c_str() ) ) + bSkipInstance = TRUE; + } + catch (...) + { + if ( dwErr == ERROR_SUCCESS ) + dwErr = E_UNEXPECTED; + } + + LocalFree( pBuf ); + LocalFree( szVirtualName ); + LocalFree( szInstanceName ); + + if ( dwErr != ERROR_SUCCESS ) + return dwErr; + + if ( bSkipInstance ) + return ERROR_SUCCESS; + } + + // + // Now enumerate the dependent resources + // + HRESENUM hEnum = ClusterResourceOpenEnum( hResource, CLUSTER_RESOURCE_ENUM_DEPENDS ); + if ( !hEnum ) + return ERROR_SUCCESS; + + for ( dwErr = ClusterResourceEnum( hEnum, dwIdx, &dwType, szBuf, &cbBuf ); + dwErr == ERROR_SUCCESS; + dwErr = ClusterResourceEnum( hEnum, ++dwIdx, &dwType, szBuf, &cbBuf ) ) + { + cbBuf = DIM( szBuf ); + + pList->push_back( szBuf ); + } + + ClusterResourceCloseEnum( hEnum ); + dwErr = ERROR_SUCCESS; + } + catch (...) + { + dwErr = E_UNEXPECTED; + } + + return dwErr; +} + + +//--------------------------------------------------------------------------------------- +// Filters out the specified instance of SqlServer and retrieves its owning node +// +static DWORD SqlCallback( HRESOURCE hOriginal, HRESOURCE hResource, PVOID lpParams ) +{ + DWORD dwErr = ERROR_SUCCESS; + + if ( IsBadReadPtr( lpParams, sizeof SQL_NODE_CALLBACK_DATA ) ) + return E_INVALIDARG; + + try + { + WCHAR szBuf[ 1024 ]; + DWORD cbBuf = DIM( szBuf ); + + LPBYTE pBuf = NULL; + LPWSTR szVirtualName = NULL, + szInstanceName = NULL; + DWORD dwReturned = 0; + BOOL bSkipInstance = FALSE; + + tstring sSqlInstance = ((LPSQL_NODE_CALLBACK_DATA) lpParams)->sSqlInstanceName; + if ( sSqlInstance.length() == 0 ) + return E_INVALIDARG; + + ((LPSQL_NODE_CALLBACK_DATA) lpParams)->resState = ClusterResourceStateUnknown; + + // + // if the resource is not a SQL Server, then we just skip it + // + if ( ! ResUtilResourceTypesEqual( RESTYPE_SQL, hResource ) ) + return ERROR_SUCCESS; + + dwErr = GetClusterResourceControl( hResource, CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES, + &pBuf, &dwReturned ); + if ( dwErr != ERROR_SUCCESS ) + return dwErr; + + try + { + dwErr = ResUtilFindSzProperty( pBuf, dwReturned, PROPNAME_VIRTUALSERVER, &szVirtualName ); + if ( dwErr != ERROR_SUCCESS ) + throw dwErr; + + dwErr = ResUtilFindSzProperty( pBuf, dwReturned, PROPNAME_INSTANCENAME, &szInstanceName ); + if ( dwErr != ERROR_SUCCESS ) + throw dwErr; + + // + // Do the instance names match ? + // + tstring szTmpInstance = szVirtualName; + szTmpInstance += TEXT( "\\" ); + szTmpInstance += szInstanceName; + + if ( _tcsicmp( sSqlInstance.c_str(), szTmpInstance.c_str() ) ) + bSkipInstance = TRUE; + } + catch (...) + { + if ( dwErr == ERROR_SUCCESS ) + dwErr = E_UNEXPECTED; + } + + LocalFree( pBuf ); + LocalFree( szVirtualName ); + LocalFree( szInstanceName ); + + if ( dwErr != ERROR_SUCCESS ) + return dwErr; + + if ( bSkipInstance ) + return ERROR_SUCCESS; + + // + // Now get the node for the Sql server + // + CLUSTER_RESOURCE_STATE resState = GetClusterResourceState( hResource, szBuf, &cbBuf, NULL, NULL ); + ((LPSQL_NODE_CALLBACK_DATA) lpParams)->resState = resState; + if ( resState == ClusterResourceStateUnknown ) + return GetLastError(); + + ((LPSQL_NODE_CALLBACK_DATA) lpParams)->sNodeName = szBuf; + } + catch (...) + { + dwErr = E_UNEXPECTED; + } + + return dwErr; +} + + +//--------------------------------------------------------------------------------------- +// Clustering Helpers +// +LPBYTE ParseDiskInfo( PBYTE DiskInfo, DWORD DiskInfoSize, DWORD SyntaxValue ) +{ + CLUSPROP_BUFFER_HELPER ListEntry; // used to parse the value list + + DWORD cbOffset = 0; // offset to next entry in the value list + DWORD cbPosition = 0; // tracks the advance through the value list buffer + + LPBYTE returnPtr = NULL; + + ListEntry.pb = DiskInfo; + + while (TRUE) + { + + if ( CLUSPROP_SYNTAX_ENDMARK == *ListEntry.pdw ) + { + break; + } + + cbOffset = ALIGN_CLUSPROP( ListEntry.pValue->cbLength + sizeof(CLUSPROP_VALUE) ); + + // + // Check for specific syntax in the property list. + // + + if ( SyntaxValue == *ListEntry.pdw ) + { + + // + // Make sure the complete entry fits in the buffer specified. + // + + if ( cbPosition + cbOffset > DiskInfoSize ) + { + return NULL; + } + else + { + returnPtr = ListEntry.pb; + } + + break; + } + + // + // Verify that the offset to the next entry is + // within the value list buffer, then advance + // the CLUSPROP_BUFFER_HELPER pointer. + // + cbPosition += cbOffset; + if ( cbPosition > DiskInfoSize ) break; + ListEntry.pb += cbOffset; + } + + return returnPtr; + +} // ParseDiskInfo + + +BOOL IsInList( LPCTSTR szStrToFind, cStrList *pList, BOOL bIgnoreCase ) +{ + if ( IsBadReadPtr( pList, sizeof cStrList ) ) + return FALSE; + + BOOL bFound = FALSE; + for ( cStrList::size_type i = 0; ( i < pList->size() ) && !bFound ; i++ ) + { + LPCTSTR szEntry = (*pList)[i].c_str(); + + if ( bIgnoreCase ) + bFound = !_tcsicmp( szEntry, szStrToFind ); + else + bFound = !_tcscmp( szEntry, szStrToFind ); + } + + return bFound; +} + + +DWORD GetClusterResourceControl( HRESOURCE hResource, + DWORD dwControlCode, + LPBYTE *pOutBuffer, + DWORD *dwBytesReturned ) +{ + DWORD dwError; + + DWORD cbOutBufferSize = 0; + DWORD cbResultSize = 0; + LPBYTE tempOutBuffer = NULL; + + dwError = ClusterResourceControl( hResource, + NULL, + dwControlCode, + NULL, + 0, + tempOutBuffer, + cbOutBufferSize, + &cbResultSize ); + + // + // Reallocation routine if buffer is too small + // + + if ( ERROR_MORE_DATA == dwError || ERROR_SUCCESS == dwError ) + { + cbOutBufferSize = cbResultSize; + tempOutBuffer = (LPBYTE) LocalAlloc( LPTR, cbResultSize + 2 ); + + dwError = ClusterResourceControl( hResource, + NULL, + dwControlCode, + NULL, + 0, + tempOutBuffer, + cbOutBufferSize, + &cbResultSize ); + } + + // + // On success, give the user the allocated buffer. The user is responsible + // for freeing this buffer. On failure, free the buffer and return a status. + // + + if ( NO_ERROR == dwError ) + { + *pOutBuffer = tempOutBuffer; + *dwBytesReturned = cbResultSize; + } + else + { + *pOutBuffer = NULL; + *dwBytesReturned = 0; + LocalFree( tempOutBuffer ); + } + + return dwError; + +} // GetClusterResourceControl + + +//------------------------------------------------------------------------------------- +// Connect to the database instance and get the Schema Version +// +HRESULT GetDBSchemaVersion( LPCTSTR szInstanceName, LPTSTR szVerBuf, size_t cbVerBuf ) +{ + HRESULT hr = S_OK; + TCHAR szConnStr[ 256 ]; + LPCTSTR szConnStrMask = TEXT( "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=uddi;Data Source=%s;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False" ); + + if ( IsBadWritePtr(szVerBuf, cbVerBuf * sizeof(TCHAR) ) || !cbVerBuf ) + return E_INVALIDARG; + + if ( IsBadStringPtr( szInstanceName, 128 ) ) + return E_INVALIDARG; + + _tcscpy( szVerBuf, _T("") ); + + try + { + _stprintf( szConnStr, szConnStrMask, szInstanceName ); + + net_config_get configGet; + configGet.m_connectionString = szConnStr; + + Log( TEXT( "GetDBSchemaVersion: Using connection string: %s." ), szConnStr ); + + DBROWCOUNT rowCount; + hr = configGet.Open(); + + if( FAILED(hr) || 0 != configGet.m_RETURN_VALUE ) + { + try + { + HandleOLEDBError( hr ); + } + catch( ... ) + { + // leave 'hr' the same. + } + } + + bool bStop = false; + while( SUCCEEDED(hr) && hr != DB_S_NORESULT && !bStop ) + { + if( NULL != configGet.GetInterface() ) + { + HRESULT hr2 = configGet.Bind(); + + if( SUCCEEDED( hr2 ) ) + { + while( S_OK == configGet.MoveNext() ) + { + if ( _tcsicmp( configGet.m_configName, PROPNAME_DBSCHEMAVER ) ) + continue; + + _tcsncpy( szVerBuf, configGet.m_configValue, cbVerBuf ); + bStop = true; + break; + } + } + } + + if ( !bStop ) + hr = configGet.GetNextResult( &rowCount ); + } + } + catch (...) + { + Log( TEXT( "GetDBSchemaVersion: caught unexpected exception." ) ); + + hr = E_UNEXPECTED; + } + + Log( TEXT( "GetDBSchemaVersion: Finished with HRESULT %x." ), hr ); + + return hr; + +} + +void HandleOLEDBError( HRESULT hrErr ) +{ + CDBErrorInfo ErrorInfo; + ULONG cRecords = 0; + HRESULT hr; + ULONG i; + CComBSTR bstrDesc, bstrHelpFile, bstrSource, bstrMsg; + GUID guid; + DWORD dwHelpContext; + WCHAR wszGuid[40]; + USES_CONVERSION; + + // If the user passed in an HRESULT then trace it + if( hrErr != S_OK ) + { + TCHAR sz[ 256 ]; + _sntprintf( sz, 256, _T("OLE DB Error Record dump for hr = 0x%x\n"), hrErr ); + sz[ 255 ] = 0x00; + bstrMsg += sz; + } + + LCID lcLocale = GetSystemDefaultLCID(); + + hr = ErrorInfo.GetErrorRecords(&cRecords); + if( FAILED(hr) && ( ErrorInfo.m_spErrorInfo == NULL ) ) + { + TCHAR sz[ 256 ]; + _sntprintf( sz, 256, _T("No OLE DB Error Information found: hr = 0x%x\n"), hr ); + sz[ 255 ] = 0x00; + bstrMsg += sz; + } + else + { + for( i = 0; i < cRecords; i++ ) + { + hr = ErrorInfo.GetAllErrorInfo(i, lcLocale, &bstrDesc, &bstrSource, &guid, + &dwHelpContext, &bstrHelpFile); + if( FAILED(hr) ) + { + TCHAR sz[ 256 ]; + _sntprintf( sz, 256, _T("OLE DB Error Record dump retrieval failed: hr = 0x%x\n"), hr ); + sz[ 255 ] = 0x00; + bstrMsg += sz; + break; + } + + StringFromGUID2( guid, wszGuid, sizeof(wszGuid) / sizeof(WCHAR) ); + TCHAR sz[ 256 ]; + _sntprintf( + sz, 256, + _T("Row #: %4d Source: \"%s\" Description: \"%s\" Help File: \"%s\" Help Context: %4d GUID: %s\n"), + i, OLE2T(bstrSource), OLE2T(bstrDesc), OLE2T(bstrHelpFile), dwHelpContext, OLE2T(wszGuid) ); + + sz[ 255 ] = 0x00; + bstrMsg += sz; + + bstrSource.Empty(); + bstrDesc.Empty(); + bstrHelpFile.Empty(); + } + + bstrMsg += _T("OLE DB Error Record dump end\n"); + } + + Log( TEXT( "HandleOLEDBError: %s" ), bstrMsg ); +} + +//------------------------------------------------------------------------------------- +// Add user to service account in db. +// +HRESULT AddServiceAccount( LPCTSTR szInstanceName, LPCTSTR szUser ) +{ + HRESULT hr = S_OK; + TCHAR szConnStr[ 256 ]; + LPCTSTR szConnStrMask = TEXT( "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=uddi;Data Source=%s;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False" ); + + Log( TEXT( "AddServiceAccount: Starting..." ) ); + + if ( IsBadStringPtr( szInstanceName, 128 ) ) + return E_INVALIDARG; + + try + { + _stprintf( szConnStr, szConnStrMask, szInstanceName ); + + Log( TEXT( "AddServiceAccount: Using connection string: %s." ), szConnStr ); + + ADM_addServiceAccount addServiceAccount; + addServiceAccount.m_connectionString = szConnStr; + _tcsncpy( addServiceAccount.m_accountName, szUser, 129 ); + addServiceAccount.m_accountName[ 128 ] = '\0'; + + hr = addServiceAccount.Open(); + + if( FAILED(hr) || 0 != addServiceAccount.m_RETURNVALUE ) + { + try + { + HandleOLEDBError( hr ); + } + catch( ... ) + { + // leave 'hr' the same. + } + } + } + catch (...) + { + Log( TEXT( "AddServiceAccount: caught unexpected exception." ) ); + + hr = E_UNEXPECTED; + } + + Log( TEXT( "AddServiceAccount: Finished with HRESULT %x." ), hr ); + + return hr; + +} + diff --git a/inetsrv/uddi/source/setup/ocm/uddiinst.h b/inetsrv/uddi/source/setup/ocm/uddiinst.h new file mode 100644 index 0000000..408a196 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/uddiinst.h @@ -0,0 +1,263 @@ +//----------------------------------------------------------------------------------------- + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ocmanage.h" + +using namespace std; +#define tstring basic_string + +#include "..\shared\propertybag.h" + +#define UDDI_SETUP_LOG TEXT( "uddisetup.log" ) +#define DEFAULT_SQL_INSTANCE_NAME TEXT( "(default)" ) +#define DEFAULT_SQL_INSTANCE_NATIVE TEXT( "MSSQLSERVER" ) + +//-------------------------------------------------------------------------- + +#define PROPKEY_UDDIPROVIDER TEXT( "UPRV" ) +#define PROPKEY_ADDSERVICES TEXT( "UDDI_ADDSVC" ) +#define PROPKEY_UPDATE_AD TEXT( "UDDI_UPDATEAD" ) + +#define PROPKEY_SYSPATH TEXT( "SFP" ) +#define PROPKEY_COREPATH_1 TEXT( "C1P" ) +#define PROPKEY_COREPATH_2 TEXT( "C2P" ) +#define PROPKEY_JRNLPATH TEXT( "JRNLP" ) +#define PROPKEY_STGPATH TEXT( "STGP" ) +#define PROPKEY_XLOGPATH TEXT( "XLP" ) + +#define PROPKEY_CLUSTERNODETYPE TEXT( "CNTYPE" ) +#define PROPKEY_ACTIVENODE TEXT( "A" ) +#define PROPKEY_PASSIVENODE TEXT( "P" ) + +//----------------------------------------------------------------------------------------- + +typedef enum { UDDI_MSDE, UDDI_DB, UDDI_WEB, UDDI_ADMIN, UDDI_COMBO } UDDI_PACKAGE_ID; +typedef enum { UDDI_NOACTION, UDDI_UNINSTALL, UDDI_INSTALL } INSTALL_LEVEL; + +#define MAX_PROPERTY_COUNT 10 +#define MSI_GUID_LEN 39 +#define UDDI_MSDE_INSTANCE_NAME TEXT( "UDDI" ) + +const LPCTSTR UDDI_LOCAL_COMPUTER = NULL; +const bool UDDI_INSTALLING_MSDE = true; +const bool UDDI_NOT_INSTALLING_MSDE = false; + +// +// SQL Server 2000 SP3 +// +#define MIN_SQLSP_VERSION TEXT( "8.0.760" ) + +// +// These types are used by the clustering routines +// +#define DIM(x) ( sizeof x )/( sizeof x[0] ) + +typedef struct _cPhysicalDriveInfo +{ + tstring sDriveLetter; + tstring sResName; + tstring sOwningNode; + tstring sGroupName; + + _cPhysicalDriveInfo( LPCTSTR szName, LPCTSTR szNode, LPCTSTR szGroup, LPCTSTR szDriveLetter ) + { + sResName = szName; + sOwningNode = szNode; + sGroupName = szGroup; + sDriveLetter = szDriveLetter; + }; +} +cPhysicalDriveInfo; + + +typedef std::map cDrvMap; +typedef std::pair cDrvMapPair; +typedef cDrvMap::iterator cDrvIterator; + +typedef std::map cStrMap; +typedef std::pair cStrMapPair; +typedef cStrMap::iterator cStrIterator; + +typedef std::vector cStrList; +typedef cStrList::iterator cStrListIterator; + + +// +// this struct holds data describing a SQL database instance +// +typedef struct tagDbInstance +{ + bool bIsLocalComputer; + bool bIsCluster; + tstring cComputerName; + tstring cSQLInstanceName; + tstring cFullName; + tstring cSPVersion; + tstring cSQLVersion; + + tagDbInstance() { bIsLocalComputer = true; bIsCluster = false; } + +} DB_INSTANCE; + +// +// this struct holds all the data needed to install a single UDDI component +// +typedef struct +{ + tstring cOCMName; + bool bOCMComponent; // true if an actual component on the OCM + tstring cMSIName; + tstring cCABName; + INSTALL_LEVEL iInstallLevel; + CPropertyBag installProperties; + TCHAR szMSIPath[ MAX_PATH ]; + TCHAR szUpgradeCode[ MSI_GUID_LEN ]; + TCHAR szProductCode[ MSI_GUID_LEN ]; +} SINGLE_UDDI_PACKAGE_DEF; + +// +// We have 4 "real" packages and one "virtual" - UDDI Combo +// +#define UDDI_PACKAGE_COUNT 5 + +// +// This structure is used for clustered environment drive letter filtering +// +#define MAX_DRIVE_COUNT 255 + +typedef struct +{ + int driveCount; // -1 means no filtering at all + tstring drives[ MAX_DRIVE_COUNT ]; // allowed drive letters +} +CLST_ALLOWED_DRIVES; + +// +// container class for the struct defined above +// +class CUDDIInstall +{ +public: + CUDDIInstall(); + + void SetInstallLevel( UDDI_PACKAGE_ID id, INSTALL_LEVEL iInstallLevel, BOOL bForceInstall = FALSE ); + void SetInstallLevel( LPCTSTR szOCMName, INSTALL_LEVEL iInstallLevel, BOOL bForceInstall = FALSE ); + void AddProperty( UDDI_PACKAGE_ID id, LPCTSTR szProperty, LPCTSTR szValue ); + void AddProperty( UDDI_PACKAGE_ID id, LPCTSTR szProperty, DWORD dwValue ); + LPCTSTR GetProperty ( UDDI_PACKAGE_ID id, LPCTSTR szProperty, LPTSTR szOutBuf ); + void DeleteProperty( UDDI_PACKAGE_ID id, LPCTSTR szProperty ); + void DeleteProperties( UDDI_PACKAGE_ID id ); + void UpdateAllInstallLevel(); + bool IsInstalled( UDDI_PACKAGE_ID id ); + bool IsInstalled( LPCTSTR szOCMName ); + bool IsInstalling( UDDI_PACKAGE_ID id ); + bool IsUninstalling( UDDI_PACKAGE_ID id ); + bool IsInstalling( LPCTSTR szOCMName ); + LPCTSTR GetInstallStateText( LPCTSTR szOCMName ); + LPCTSTR GetInstallStateText( UDDI_PACKAGE_ID id ); + LPCTSTR GetDefaultDataPath (); + UDDI_PACKAGE_ID GetPackageID( LPCTSTR szOCMName ); + void SetInstance( HINSTANCE hInstance ) { m_hInstance = hInstance; } + bool IsAnyInstalling(); + bool IsClusteredDBInstance() { return m_dbinstance.bIsCluster; } + bool SetDBInstanceName( LPCTSTR szComputerName, LPCTSTR szNewInstanceName, bool bIsInstallingMSDE, bool bIsCluster ); + HRESULT DetectOSFlavor(); + UINT GetOSSuiteMask() { return m_uSuiteMask; } + bool IsStdServer() { return ( m_uSuiteMask & VER_SUITE_DATACENTER ) || ( m_uSuiteMask & VER_SUITE_DATACENTER ) ? false : true; } + LPCTSTR GetDBInstanceName(); + LPCTSTR GetFullDBInstanceName(); + LPCTSTR GetDBComputerName(); + UINT Install(); + +private: + bool SetMSIPath( UDDI_PACKAGE_ID id ); + UINT InstallPackage( UDDI_PACKAGE_ID id ); + UINT UninstallPackage( UDDI_PACKAGE_ID id ); + UINT PostInstallPackage( UDDI_PACKAGE_ID id ); + +private: + HINSTANCE m_hInstance; + UINT m_uSuiteMask; + tstring m_cDefaultDataDir; + SINGLE_UDDI_PACKAGE_DEF m_package[ UDDI_PACKAGE_COUNT ]; + DB_INSTANCE m_dbinstance; +}; + +//----------------------------------------------------------------------------------------- +// +// container class of the list of all db instances on a given (local or remote) machine +// + +#define MAX_INSTANCE_COUNT 50 + +class CDBInstance +{ +public: + CDBInstance( LPCTSTR szRemoteMachine = NULL ); + + LONG GetInstalledDBInstanceNames( LPCTSTR szRemoteMachine = NULL ); + bool GetUDDIDBInstanceName( LPCTSTR szRemoteMachine, LPTSTR szInstanceName, PULONG puLen, bool *pbIsClustered = NULL ); + int IsInstanceInstalled( LPCTSTR szInstanceName ); + bool GetInstanceName(int i, PTCHAR szBuffer, UINT uBufLen ); + int GetInstanceCount() { return m_instanceCount; }; + bool GetSqlInstanceVersion( HKEY hParentKey, LPCTSTR szInstanceName, LPTSTR szInstanceVersion, DWORD dwVersionLen, LPTSTR szCDSVersion, DWORD dwCSDVersionLen ); + bool IsClusteredDB( HKEY hParentKey, LPCTSTR szInstanceName, LPTSTR szVirtualMachineName, DWORD dwLen ); + DB_INSTANCE m_dbinstance[ MAX_INSTANCE_COUNT ]; + +private: + int m_instanceCount; +}; + +//----------------------------------------------------------------------------------------- +// +// helper functions +// +DWORD RunMSIEXECCommandLine( tstring &szMSIArgs ); +bool IsExistMinDotNetVersion( LPCTSTR szMinDotNetVersion ); +bool IsSQLRun08AlreadyUsed( bool *bIsUsed ); +bool IsOsWinXP(); +DWORD EnableRemoteRegistry(); +int CompareVersions( LPCTSTR szVersion1, LPCTSTR szVersion2 ); +bool CheckForAdminPrivs(); +void RaiseErrorDialog( LPCTSTR szAction, DWORD dwErrorCode ); +bool IsTSAppCompat(); + +HRESULT GetDBSchemaVersion( LPCTSTR szInstanceName, LPTSTR szVerBuf, size_t cbVerBuf ); +HRESULT AddServiceAccount( LPCTSTR szInstanceName, LPCTSTR szUser ); + +//***************************************************************************************** +// Cluster helper functions +// +// Enumerates SQL Server dependencies for a given instance. NULL -> enumerates all instances +// The instance name is expected to be in a fully-qualified format: \ +// +DWORD EnumSQLDependencies( HCLUSTER hCls, cStrList *pList, LPCTSTR szInstanceNameOnly = NULL ); + +// +// Enumerates physical drives and its characteristics, optionaly filtering out only those +// that appear in the Sql Dependencies list. +// Empty list means no filtering. +// BOTH pointers MUST be valid (no NULLS allowed) +// +DWORD EnumPhysicalDrives( HCLUSTER hCls, cStrList *pSqlDependencies, cDrvMap *pPhysicalDrives ); + +// +// Retrieves the owning node for the specific SQL instance +// The instance name is expected to be in the fully-qualified format +// i.e. \ +// +DWORD GetSqlNode( LPCWSTR szInstanceName, LPWSTR szNodeNameBuf, DWORD cbBufSize ); + diff --git a/inetsrv/uddi/source/setup/ocm/uddiocm.cpp b/inetsrv/uddi/source/setup/ocm/uddiocm.cpp new file mode 100644 index 0000000..bb5341a --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/uddiocm.cpp @@ -0,0 +1,632 @@ +//----------------------------------------------------------------------------------------- +// Go to "OCM" alias for assistance on this "technology" +// +// + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#endif + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. +#define _WIN32_WINNT 0x0510 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#endif + +#include +#include +#include +#include +#include +#include "ocmanage.h" + +#include "uddiocm.h" +#include "uddiinst.h" +#include "ocmcallback.h" +#include "appcompat.h" +#include "..\shared\common.h" +#include "resource.h" + +TCHAR *ocmmsg[100] = +{ + TEXT( "OC_PREINITIALIZE" ), + TEXT( "OC_INIT_COMPONENT" ), + TEXT( "OC_SET_LANGUAGE" ), + TEXT( "OC_QUERY_IMAGE" ), + TEXT( "OC_REQUEST_PAGES" ), + TEXT( "OC_QUERY_CHANGE_SEL_STATE" ), + TEXT( "OC_CALC_DISK_SPACE" ), + TEXT( "OC_QUEUE_FILE_OPS" ), + TEXT( "OC_NOTIFICATION_FROM_QUEUE" ), + TEXT( "OC_QUERY_STEP_COUNT" ), + TEXT( "OC_COMPLETE_INSTALLATION" ), + TEXT( "OC_CLEANUP" ), + TEXT( "OC_QUERY_STATE" ), + TEXT( "OC_NEED_MEDIA" ), + TEXT( "OC_ABOUT_TO_COMMIT_QUEUE" ), + TEXT( "OC_QUERY_SKIP_PAGE" ), + TEXT( "OC_WIZARD_CREATED" ), + TEXT( "OC_FILE_BUSY" ), + TEXT( "OC_EXTRA_ROUTINES" ), + TEXT( "OC_QUERY_IMAGE_EX" ) +}; + +TCHAR *ocmpage[100] = +{ + TEXT("WizPagesWelcome"), + TEXT("WizPagesMode"), + TEXT("WizPagesEarly"), + TEXT("WizPagesPrenet"), + TEXT("WizPagesPostnet"), + TEXT("WizPagesLate"), + TEXT("WizPagesFinal") +}; + +typedef struct +{ + LPCTSTR szComponentName; + LPCTSTR szSubcomponentName; + UINT_PTR Param1; + PVOID Param2; +} OCM_CALLBACK_ARGS, *POCM_CALLBACK_ARGS; + +static DWORD UddiOcmPreinitialize ( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmInitComponent ( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmChangeSelectionState( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmInstallUninstall ( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmRequestPages ( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmQueryState ( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmCalcDiskSpace ( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmQueueUDDIFiles ( OCM_CALLBACK_ARGS& args ); +static DWORD UddiOcmQueryStepCount ( OCM_CALLBACK_ARGS& args ); + +//----------------------------------------------------------------------------------------- + +HINSTANCE g_hInstance = NULL; +CUDDIInstall g_uddiComponents; + +static TCHAR g_szSetupPath[ MAX_PATH ]; +static TCHAR g_szUnattendPath[ MAX_PATH ]; +static HINF g_hComponent; +static bool g_bUnattendMode = false; +static bool g_bPerformedCompInstall = false; + + +//----------------------------------------------------------------------------------------- + +BOOL APIENTRY DllMain( HINSTANCE hInstance, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + g_hInstance = hInstance; + g_uddiComponents.SetInstance( hInstance ); + ClearLog(); + break; + + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +//----------------------------------------------------------------------------------------- + +DWORD __stdcall OcEntry( + IN LPCTSTR szComponentName, + IN LPCTSTR szSubcomponentName, + IN UINT uMsgID, + IN UINT_PTR Param1, + IN OUT PVOID Param2 + ) +{ + if( g_bUnattendMode ) + return NO_ERROR; + + DWORD dwOcEntryReturn = 0; + + OCM_CALLBACK_ARGS args; + args.Param1 = Param1; + args.Param2 = Param2; + args.szComponentName = szComponentName; + args.szSubcomponentName = szSubcomponentName; + + MyOutputDebug( TEXT("--- Component: %15s Subcomponent: %15s Function: %s"), + szComponentName, + NULL == szSubcomponentName ? TEXT( "(NULL) ") : szSubcomponentName, + ocmmsg[uMsgID]); + + switch(uMsgID) + { + case OC_PREINITIALIZE: + dwOcEntryReturn = UddiOcmPreinitialize( args ); + break; + + case OC_INIT_COMPONENT: + dwOcEntryReturn = UddiOcmInitComponent( args ); + break; + + case OC_CALC_DISK_SPACE: + dwOcEntryReturn = UddiOcmCalcDiskSpace( args ); + break; + + case OC_QUERY_STEP_COUNT: + dwOcEntryReturn = UddiOcmQueryStepCount( args ); + break; + + case OC_QUEUE_FILE_OPS: + dwOcEntryReturn = UddiOcmQueueUDDIFiles( args ); + break; + + case OC_ABOUT_TO_COMMIT_QUEUE: + break; + + case OC_COMPLETE_INSTALLATION: + dwOcEntryReturn = UddiOcmInstallUninstall( args ); + break; + + case OC_WIZARD_CREATED: + break; + + case OC_QUERY_STATE: + dwOcEntryReturn = UddiOcmQueryState( args ); + break; + + case OC_REQUEST_PAGES: + dwOcEntryReturn = UddiOcmRequestPages( args ); + break; + + case OC_QUERY_SKIP_PAGE: + break; + + case OC_QUERY_CHANGE_SEL_STATE: + dwOcEntryReturn = UddiOcmChangeSelectionState( args ); + break; + + default: + break; + } + + return dwOcEntryReturn; +} + +//----------------------------------------------------------------------------------------- + +static DWORD UddiOcmPreinitialize( OCM_CALLBACK_ARGS& args ) +{ + DWORD dwOcEntryReturn = 0; + +#ifdef UNICODE + dwOcEntryReturn = OCFLAG_UNICODE; +#else + dwOcEntryReturn = OCFLAG_ANSI; +#endif + + return dwOcEntryReturn; +} + +//----------------------------------------------------------------------------------------- + +static DWORD UddiOcmInitComponent( OCM_CALLBACK_ARGS& args ) +{ + PSETUP_INIT_COMPONENT pSetupInitComp = (PSETUP_INIT_COMPONENT) args.Param2; + SETUP_DATA setupData = pSetupInitComp->SetupData; + + // + // see if we are in unattended mode + // + if( SETUPOP_BATCH & setupData.OperationFlags ) + { + _tcscpy( g_szUnattendPath, pSetupInitComp->SetupData.UnattendFile ); + g_bUnattendMode = true; + Log( _T("*** UDDI does not install in unattended mode ***") ); + return NO_ERROR; + } + + // + // grab the handle to the uddi.inf file + // + g_hComponent = pSetupInitComp->ComponentInfHandle; + + // + // save a copy of the source path (to the CDROM drive) + // + // MessageBox(NULL, TEXT( "attach debugger" ), TEXT( "debug uddi" ), MB_OK); + _tcscpy( g_szSetupPath, pSetupInitComp->SetupData.SourcePath ); + + // + // save a copy of the callback pointers into the OCM + // + COCMCallback::SetOCMRoutines( &pSetupInitComp->HelperRoutines ); + + // + // if the db is already installed, the db instance name is stored in the registry. + // get it and set it for use by the web installer (if the user chooses to install the web component). + // + if( g_uddiComponents.IsInstalled( UDDI_DB ) ) + { + CDBInstance dbinstances; + TCHAR szInstanceName[ 20 ]; + ULONG uLen = 20; + bool bIsClustered = false; + + if( dbinstances.GetUDDIDBInstanceName( NULL, szInstanceName, &uLen, &bIsClustered ) ) + g_uddiComponents.SetDBInstanceName( NULL, szInstanceName, UDDI_NOT_INSTALLING_MSDE, bIsClustered ); + } + + // + // Finally, check the OS flavor (Enterprise, Datacenter etc.) + // + g_uddiComponents.DetectOSFlavor(); + Log( _T( "OS Flavor Mask as reported by WMI: %#x" ), g_uddiComponents.GetOSSuiteMask() ); + + return NO_ERROR; +} + +//----------------------------------------------------------------------------------------- +// +// this function is called for each component and subcomponent +// +static DWORD UddiOcmQueryState( OCM_CALLBACK_ARGS& args ) +{ + if( args.szSubcomponentName && args.Param1 == OCSELSTATETYPE_ORIGINAL ) + { + if ( g_uddiComponents.IsInstalled( (PTCHAR) args.szSubcomponentName ) ) + { + MyOutputDebug( TEXT( "Reporting that component %s is ON"), args.szSubcomponentName ); + return SubcompOn; + } + else + { + MyOutputDebug( TEXT( "Reporting that component %s is OFF"), args.szSubcomponentName ); + return SubcompOff; + } + } + + return SubcompUseOcManagerDefault; +} + +//----------------------------------------------------------------------------------------- +// +// This function is called for each component and subcomponent +// We need to verify that IIS, if installed is not setup for IIS 5 compatability mode. +// If so we will display a message to the user and uncheck the web component portion of the +// install. +// +static DWORD UddiOcmChangeSelectionState( OCM_CALLBACK_ARGS& args ) +{ + bool bSelected = false; + COCMCallback::QuerySelectionState( args.szSubcomponentName, bSelected ); + MyOutputDebug( TEXT( "requested selection state=%08x, flags=%08x, selected=%d" ), args.Param1 , args.Param2, bSelected ); + + // + // ignore if the component name is null + // + if( NULL == args.szSubcomponentName ) + return 0; + + // + // ignore if this is the parent component + // + if( 0 == _tcscmp( args.szSubcomponentName, TEXT( "uddiservices" ) ) ) + return 1; + + // + // if the user has selected the web component to install AND + // IIS is set to "IIS 5.0 Application Compatibility Mode" then + // raise an error and don't allow it + // + if( 1 == args.Param1 && + ( 0 == _tcscmp( args.szSubcomponentName, TEXT( "uddiweb" ) ) || + ( 0 == _tcscmp( args.szSubcomponentName, TEXT( "uddicombo" ) ) ) ) ) + { + static bool bSkipOnce = false; + + // + // if the web component was selected from the parent, then suppress one + // of the two error messages (it gets called twice for some reason) + // + if( OCQ_DEPENDENT_SELECTION & ( DWORD_PTR ) args.Param2 ) + { + bSkipOnce = !bSkipOnce; + if( bSkipOnce ) + return 0; + } + + bool bIsIIS5CompatMode; + TCHAR szMsg[ 500 ]; + TCHAR szTitle[ 50 ]; + + LoadString( g_hInstance, IDS_TITLE, szTitle, sizeof( szTitle ) / sizeof( TCHAR ) ); + + HRESULT hr = IsIIS5CompatMode( &bIsIIS5CompatMode ); + if( SUCCEEDED( hr ) ) + { + if( bIsIIS5CompatMode ) + { + // + // cannot install web component when IIS is in 5.0 compat mode + // raise error and do not accept the change + // + LoadString( g_hInstance, IDS_IIS_ISOLATION_MODE_ERROR, szMsg, sizeof( szMsg ) / sizeof( TCHAR ) ); + MessageBox( NULL, szMsg, szTitle, MB_OK | MB_ICONWARNING ); + Log( szMsg ); + return 0; + } + } + else + { + // + // error occurred getting the app compat mode setting. + // tell the user why and tell OCM that we do not accept the change + // + // REGDB_E_CLASSNOTREG, CLASS_E_NOAGGREGATION, or E_NOINTERFACE + // + if( REGDB_E_CLASSNOTREG == hr ) + { + Log( TEXT( "IIS is not installed on this machine" ) ); + // This is ok 'cause IIS gets installed if the UDDI web component is selected. + } + else if( ERROR_PATH_NOT_FOUND == HRESULT_CODE( hr ) ) + { + Log( TEXT( "WWW Services not installed on this machine." ) ); + // This is ok 'cause WWW Services installed if the UDDI web component is selected. + } + else if( ERROR_SERVICE_DISABLED == HRESULT_CODE( hr ) ) + { + LoadString( g_hInstance, IDS_IIS_SERVICE_DISABLED, szMsg, sizeof( szMsg ) / sizeof( TCHAR ) ); + MessageBox( NULL, szMsg, szTitle, MB_OK | MB_ICONWARNING ); + Log( szMsg ); + return 0; + } + else + { + LoadString( g_hInstance, IDS_IIS_UNKNOWN_ERROR, szMsg, sizeof( szMsg ) / sizeof( TCHAR ) ); + MessageBox( NULL, szMsg, szTitle, MB_OK | MB_ICONWARNING ); + Log( szMsg ); + return 0; + } + } + } + + return 1; // indicates that this state change was ACCEPTED +} + +//----------------------------------------------------------------------------------------- + +static DWORD UddiOcmRequestPages( OCM_CALLBACK_ARGS& args ) +{ + DWORD dwOcEntryReturn = NO_ERROR; + + dwOcEntryReturn = AddUDDIWizardPages( + args.szComponentName, + (WizardPagesType) args.Param1, + (PSETUP_REQUEST_PAGES) args.Param2 ); + + return dwOcEntryReturn; // return the number of pages that was added +} + +//----------------------------------------------------------------------------------------- + +static DWORD UddiOcmInstallUninstall( OCM_CALLBACK_ARGS& args ) +{ + DWORD dwRet = ERROR_SUCCESS; + + // + // for the root component OR if someone is trying + // to install us unattended, simply return + // + if( NULL == args.szSubcomponentName ) + return ERROR_SUCCESS; + + // + // uddiweb "needs" iis, as commanded in uddi.inf, and the only thing we know + // for sure about OCM install order is that OCM will install IIS before it + // installs uddiweb, so let's delay installing all the UDDI components until + // the OCM calls for the installation of uddiweb, 'cause that way we can be sure + // that IIS is already installed. No, that's not a hack. + // + + // + // All installation/uninstallation is deferred until this component is referenced + // This ensures that the IIS dependency is in place prior to installation of any of our + // components. + // + // TODO: Review whether this is necessary anymore. We now declare proper dependencies on netfx (.NET Framework) + // that should make this synchronization unecessary. + // + if( !g_bPerformedCompInstall ) + { + g_bPerformedCompInstall = true; + Log( _T("Installing...") ); + + // + // Even though this method name is Install it handles both install and + // uninstall. + // + dwRet = g_uddiComponents.Install(); + + // + // if we need a reboot, tell the OCM + // + if( ERROR_SUCCESS_REBOOT_REQUIRED == dwRet ) + { + COCMCallback::SetReboot(); + + // + // mute the error, as it's actualy a "success with info" code + // + dwRet = ERROR_SUCCESS; + } + else if( ERROR_SUCCESS != dwRet ) + { + TCHAR szWindowsDirectory[ MAX_PATH + 1 ]; + if( 0 == GetWindowsDirectory( szWindowsDirectory, MAX_PATH + 1 ) ) + { + return GetLastError(); + } + + tstring cLogFile = szWindowsDirectory; + cLogFile.append( TEXT( "\\" ) ); + cLogFile.append( UDDI_SETUP_LOG ); + + TCHAR szMsg[ 500 ]; + TCHAR szTitle[ 50 ]; + if( !LoadString( g_hInstance, IDS_INSTALL_ERROR, szMsg, sizeof( szMsg ) / sizeof( TCHAR ) ) ) + return GetLastError(); + + if( !LoadString( g_hInstance, IDS_TITLE, szTitle, sizeof( szTitle ) / sizeof( TCHAR ) ) ) + return GetLastError(); + + tstring cMsg = szMsg; + cMsg.append( cLogFile ); + + MessageBox( NULL, cMsg.c_str(), szTitle, MB_OK | MB_ICONWARNING | MB_TOPMOST ); + } + else + { + // + // if we installed the Web components only, show the post-install notes + // + if( g_uddiComponents.IsInstalling( UDDI_WEB ) || g_uddiComponents.IsInstalling( UDDI_DB ) ) + { + HINSTANCE hInstance = ShellExecute( + GetActiveWindow(), + TEXT( "open" ), + TEXT( "postinstall.htm" ), + NULL, + TEXT( "\\inetpub\\uddi" ), + SW_SHOWNORMAL); + } + } + } + + // + // on the Standard Server, we want to fail the whole installation if one component fails + // + return ERROR_SUCCESS; +} + +//----------------------------------------------------------------------------------------- + +static DWORD UddiOcmQueryStepCount( OCM_CALLBACK_ARGS& args ) +{ + // + // if this is the main component, tell it we + // need four steps on the gauge + // + if( NULL == args.szSubcomponentName ) + return 4; + + return 0; +} + +//----------------------------------------------------------------------------------------- + +static DWORD UddiOcmQueueUDDIFiles( OCM_CALLBACK_ARGS& args ) +{ + if( !args.szSubcomponentName ) + return 0; + + HSPFILEQ hFileQueue = ( HSPFILEQ ) args.Param2; + BOOL bOK = TRUE; + DWORD dwErrCode = 0; + + if( g_uddiComponents.IsInstalling( args.szSubcomponentName ) ) + { + TCHAR szSectionName[ 100 ]; + _stprintf( szSectionName, TEXT( "Install.%s" ), args.szSubcomponentName ); + + bOK = SetupInstallFilesFromInfSection( + g_hComponent, // handle to the UDDI INF file + NULL, // optional, layout INF handle + hFileQueue, // handle to the file queue + szSectionName, // name of the Install section + NULL, // optional, root path to source files + SP_COPY_NEWER | SP_COPY_NOSKIP // optional, specifies copy behavior + ); + } + + UDDI_PACKAGE_ID pkgSubcompID = g_uddiComponents.GetPackageID( args.szSubcomponentName ); + if( pkgSubcompID == UDDI_DB || pkgSubcompID == UDDI_COMBO ) + { + if( g_uddiComponents.IsInstalling( UDDI_MSDE ) ) + { + // + // copy over the msde msi file, it is stored as a different + // name, and this will rename as it copies (and decomp if needed) + // + if( bOK ) + { + // + // this will copy over the cab file but NOT decomp the file. + // the cab file MUST be named sqlrun.cab on the cd, because + // the SP_COPY_NODECOMP flag foils the renaming scheme built + // into the setup api's + // + bOK = SetupInstallFilesFromInfSection( + g_hComponent, // handle to the INF file + NULL, // optional, layout INF handle + hFileQueue, // handle to the file queue + TEXT( "Install.MSDE" ), // name of the Install section + NULL, // optional, root path to source files + SP_COPY_NEWER | SP_COPY_NODECOMP | SP_COPY_NOSKIP // optional, specifies copy behavior + ); + } + } + } + + if( !bOK ) + { + dwErrCode = GetLastError(); + LogError( TEXT( "Error copying the UDDI files from the Windows CD:" ), dwErrCode ); + } + + return dwErrCode; +} + +//----------------------------------------------------------------------------------------- + +static DWORD UddiOcmCalcDiskSpace( OCM_CALLBACK_ARGS& args ) +{ + BOOL bOK; + HDSKSPC hDiskSpace = ( HDSKSPC ) args.Param2; + + tstring cSection = TEXT( "Install." ); + cSection += args.szSubcomponentName; + + if( args.Param1 ) + { + // + // add component + // + bOK = SetupAddInstallSectionToDiskSpaceList( + hDiskSpace, + g_hComponent, + NULL, + cSection.c_str(), + 0, 0); + } + else + { + // + // remove component + // + bOK = SetupRemoveInstallSectionFromDiskSpaceList( + hDiskSpace, + g_hComponent, + NULL, + cSection.c_str(), + 0, 0); + } + + if( !bOK ) + { + LogError( TEXT( "Error adding disk space requirements" ), GetLastError() ) ; + } + + return NO_ERROR; +} \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/ocm/uddiocm.def b/inetsrv/uddi/source/setup/ocm/uddiocm.def new file mode 100644 index 0000000..1243588 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/uddiocm.def @@ -0,0 +1,4 @@ +LIBRARY uddiocm + +EXPORTS + OcEntry @1 \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/ocm/uddiocm.h b/inetsrv/uddi/source/setup/ocm/uddiocm.h new file mode 100644 index 0000000..30dca9f --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/uddiocm.h @@ -0,0 +1,8 @@ +//----------------------------------------------------------------------------------------- + +#pragma once + +DWORD AddUDDIWizardPages( + IN const TCHAR *ComponentId, + IN const WizardPagesType WhichOnes, + IN OUT SETUP_REQUEST_PAGES *SetupPages ); diff --git a/inetsrv/uddi/source/setup/ocm/uddiocm.rc b/inetsrv/uddi/source/setup/ocm/uddiocm.rc new file mode 100644 index 0000000..c6619cf --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/uddiocm.rc @@ -0,0 +1,430 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include \r\n" + "\r\n" + "#define\tVER_FILETYPE\t\t VFT_DLL\r\n" + "#define VER_FILESUBTYPE\t\t VFT2_UNKNOWN\r\n" + "#define VER_FILEDESCRIPTION_STR ""uddiocm Module""\r\n" + "#define VER_INTERNALNAME_STR\t ""UDDIOCM.DLL""\r\n" + "#define VER_ORIGINALFILENAME_STR ""UDDIOCM.DLL""\r\n" + "\r\n" + "#include ""common.ver""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +ID_MAINICON BITMAP "logo.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DB_INSTANCE DIALOGEX 0, 0, 310, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "&Create a new MSDE database instance for UDDI Services named ""UDDI.""", + IDC_RADIO_INSTALL_MSDE,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE | WS_GROUP | WS_TABSTOP,45,57,204,19 + CONTROL "&Use the following SQL Server 2000 database instance already installed on this computer:", + IDC_RADIO_USE_EXISTING_INSTANCE,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,45,81,204,20 + COMBOBOX IDC_LIST_DB_INSTANCES,57,106,128,43,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "Database components are installed to either a new instance of Microsoft SQL Server 2000 Desktop Engine (MSDE) or to a new database instance in an existing SQL Server 2000 database server.", + IDC_STATIC,31,18,239,35 +END + +IDD_SSL DIALOGEX 0, 0, 309, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "&Require SSL (Recommended)",IDC_SSL_YES,"Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,85,83,166,10 + CONTROL "&Do not require SSL",IDC_SSL_NO,"Button", + BS_AUTORADIOBUTTON,85,99,112,10 + LTEXT "To require SSL-encryption for this site, select ""Require SSL""", + IDC_STATIC,30,22,242,56 +END + +IDD_REMOTE_DB DIALOGEX 0, 0, 310, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Select the computer that hosts the UDDI Services database components for this site, and then select the instance that hosts the UDDI Services database components.", + IDC_STATIC,24,18,239,45 + CONTROL "Computer name:",IDC_REMOTE_MACHINE_PROMPT,"Static", + SS_LEFTNOWORDWRAP | WS_GROUP,23,75,77,10 + LTEXT "",IDC_REMOTE_MACHINE,104,72,118,15,SS_CENTERIMAGE | + WS_BORDER + PUSHBUTTON "B&rowse...",IDC_BROWSE_MACHINES,228,72,60,15 + LTEXT "Database instance:",IDC_REMOTE_INSTANCES_PROMPT,23,96, + 88,17 + LTEXT "",IDC_REMOTE_INSTANCE,104,92,118,15,SS_CENTERIMAGE | + WS_BORDER +END + +IDD_LOGIN DIALOGEX 0, 0, 310, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "Network &Service",IDC_RADIO_NETWORK_SERVICE,"Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,25,20,204,10 + CONTROL "&Domain account",IDC_RADIO_DOMAIN_ACCT,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,25,41,112,10 + LTEXT "&User name:",IDC_USER_NAME_PROMPT,40,65,50,8 + EDITTEXT IDC_USER_NAME,94,62,132,15,ES_AUTOHSCROLL + PUSHBUTTON "B&rowse...",IDC_BROWSE_USERS,235,62,60,15 + LTEXT "&Password:",IDC_PASSWORD_PROMPT,40,89,50,8 + EDITTEXT IDC_PASSWORD,94,86,132,15,ES_PASSWORD | ES_AUTOHSCROLL +END + +IDD_CONFIRM_PW DIALOGEX 0, 0, 233, 90 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | + WS_CAPTION | WS_SYSMENU +CAPTION "Confirm Password" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "To &confirm the password, type it again.",IDC_STATIC, + 10,15,215,13 + EDITTEXT IDC_CONFIRM_PW,10,35,210,15,ES_PASSWORD | ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,63,65,50,14 + PUSHBUTTON "Cancel",IDCANCEL,120,65,50,14 +END + +IDD_SITE_NAME DIALOGEX 0, 0, 310, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "&Please type the name of this UDDI Services site. A site name helps users and Administrators identify this site.", + IDC_STATIC,48,24,222,27 + EDITTEXT IDC_SITE_NAME,48,57,211,15,ES_AUTOHSCROLL +END + +IDD_ADD_SERVICES DIALOGEX 0, 0, 310, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "&Self-register (recommended)",IDC_CHECK_ADDSVC,"Button", + BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,36, + 54,240,37 + LTEXT "Select self-register to document the available interfaces within this UDDI Services site. When deploying multiple web servers for a UDDI Services site, this should only be selected for one of the web servers.", + IDC_STATIC,36,17,225,32 +END + +IDD_DATAPATHS DIALOGEX 0, 0, 310, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "Specify a location to install all database files, or click ""More"" to specify a location for each database file.", + IDC_STATIC,22,17,240,16 + LTEXT "",IDC_SYSPATH,86,41,192,12,SS_CENTERIMAGE | + SS_PATHELLIPSIS | WS_BORDER,WS_EX_CLIENTEDGE + PUSHBUTTON "...",IDC_BROWSESYSPATH,284,41,19,12 + RTEXT "System data file",IDC_STATIC_SYS,13,42,67,10 + LTEXT "",IDC_COREPATH_1,86,55,192,12,SS_CENTERIMAGE | + SS_PATHELLIPSIS | WS_BORDER,WS_EX_CLIENTEDGE + PUSHBUTTON "...",IDC_BROWSECOREPATH1,284,55,19,12 + RTEXT "Core data file 1",IDC_STATIC_C1,13,56,67,10 + LTEXT "",IDC_COREPATH_2,86,69,192,12,SS_CENTERIMAGE | + SS_PATHELLIPSIS | WS_BORDER,WS_EX_CLIENTEDGE + PUSHBUTTON "...",IDC_BROWSECOREPATH2,284,69,19,12 + RTEXT "Core data file 2",IDC_STATIC_C2,13,70,67,10 + LTEXT "",IDC_JRNLPATH,86,83,192,12,SS_CENTERIMAGE | + SS_PATHELLIPSIS | WS_BORDER,WS_EX_CLIENTEDGE + PUSHBUTTON "...",IDC_BROWSEJRNLPATH,284,83,19,12 + RTEXT "Journal data file",IDC_STATIC_JRNL,13,84,67,10 + LTEXT "",IDC_STAGINGPATH,86,97,192,12,SS_CENTERIMAGE | + SS_PATHELLIPSIS | WS_BORDER,WS_EX_CLIENTEDGE + PUSHBUTTON "...",IDC_BROWSESTAGINGPATH,284,97,19,12 + RTEXT "Staging data file",IDC_STATIC_STG,13,98,67,10 + LTEXT "",IDC_XLOGPATH,86,111,192,12,SS_CENTERIMAGE | + SS_PATHELLIPSIS | WS_BORDER,WS_EX_CLIENTEDGE + PUSHBUTTON "...",IDC_BROWSEXLOGPATH,284,111,19,12,0, + WS_EX_TRANSPARENT + RTEXT "Transaction log file",IDC_STATIC_XLOG,13,112,67,10 + PUSHBUTTON "<< &Less",IDC_LESS_BTN,248,135,55,14 + PUSHBUTTON "&More >>",IDC_MORE_BTN,248,62,55,14 +END + +IDD_EXISTING_DBINSTANCE DIALOGEX 0, 0, 310, 157 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "Setup has found a UDDI Services database on this computer and will use the following database instance for this site:", + IDC_STATIC,31,18,239,24,SS_NOPREFIX + CONTROL "",IDC_INSTANCENAME,"Static",SS_LEFTNOWORDWRAP | + SS_NOPREFIX | SS_CENTERIMAGE | WS_BORDER | WS_GROUP,31, + 47,239,14 +END + +IDD_CLUSTDATA DIALOGEX 0, 0, 309, 156 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION +CAPTION "UDDI Services" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_DB_INSTANCE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_SSL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 302 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_REMOTE_DB, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_LOGIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_CONFIRM_PW, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 226 + TOPMARGIN, 7 + BOTTOMMARGIN, 83 + END + + IDD_SITE_NAME, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_ADD_SERVICES, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 302 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_DATAPATHS, DIALOG + BEGIN + LEFTMARGIN, 6 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_EXISTING_DBINSTANCE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 150 + END + + IDD_CLUSTDATA, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 302 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_TITLE "UDDI Services" +END + +STRINGTABLE +BEGIN + IDS_DB_SUBTITLE "Select or create a local database instance for the UDDI Services database components." + IDS_NO_INSTANCE_MSG "Select an instance name." + IDS_LOGIN_ERROR "Unable to authenticate the account." + IDS_MSDE_ALREADY_USED "This instance of MSDE is already installed on this computer. You must install another instance of MSDE or install Microsoft SQL Server 2000." + IDS_NO_LOCAL_ACCT_ALLOWED + "You must specify an existing domain account. Please check the user name and try again." + IDS_IIS_ISOLATION_MODE_ERROR + "UDDI Services is not compatible with IIS 5.0 isolation mode. The UDDI Services Web server components will not be installed." + IDS_UDDI_DB_NOT_EXIST "The specified computer does not host UDDI Services database components. Please select a different computer or install UDDI Services database components onto that computer and try again." + IDS_SELECT_REMOTE_COMPUTER "Please select a remote computer" + IDS_SSL_SUBTITLE "Secure Sockets Layer (SSL) encryption provides a secure channel for communication with a UDDI Services site." + IDS_REMOTE_DB_SUBTITLE "Select a remote database instance for UDDI Services." + IDS_LOGIN_SUBTITLE "Select the security credentials that UDDI Services will use." + IDS_PW_MISMATCH "The passwords do not match." + IDS_ZERO_LEN_USER_NAME "Please enter a user name." + IDS_INSTALL "Installing %s..." + IDS_UNINSTALL "Uninstalling %s. %s" + IDS_REMOTE_DB_NOT_FOUND "The specified computer does not host Microsoft SQL Server 2000. Please select a different computer or install Microsoft SQL Server 2000 on that computer and try again.\n\nError:" +END + +STRINGTABLE +BEGIN + IDS_EXISTINGDB_SUBTITLE "Existing UDDI database instance detected." + IDS_UDDI_ILLEGALCHARACTERS + "The instance name cannot contain any of the following characters: ""?:*;/\\" +END + +STRINGTABLE +BEGIN + IDS_WIZARD_SUMMARY_SUBTITLE "UDDI Services Setup Wizard Summary" + IDS_WIZARD_SUMMARY_GENERAL "The UDDI Services Setup Wizard is complete." + IDS_WIZARD_SUMMARY_DB "Wizard summary notes for the DB component go here." + IDS_WIZARD_SUMMARY_WEB "Wizard summary notes for the Web component go here." + IDS_WIZARD_SUMMARY_ADMIN + "Wizard summary notes for the Admin component go here." + IDS_INSTALL_ERROR "Errors occurred during the installation of UDDI Services.\nSee the log file for details:\n" + IDS_MSDE_NAME "Microsoft SQL Server Desktop Edition (MSDE) for UDDI Services" + IDS_DB_NAME "UDDI Services Database Components" + IDS_WEB_NAME "UDDI Services Web Server Components" + IDS_ADMIN_NAME "UDDI Services Administration Console" + IDS_IIS_SERVICE_DISABLED + "Setup cannot install the UDDI Services Web server components because IIS is disabled. You must enable IIS before the UDDI Services Web server components can be installed." + IDS_IIS_UNKNOWN_ERROR "IIS has reported an unknown error. You must correct this problem before the UDDI Services Web server components can be installed." + IDS_ZERO_LEN_PROVIDER_NAME "Specify a site name." + IDS_UDDIPROV_SUBTITLE "Specify a site name." + IDS_UDDIADDSVC_SUBTITLE "Register available site interfaces." + IDS_FILEPATHS_SUBTITLE "Select where to install the UDDI Services database files." +END + +STRINGTABLE +BEGIN + IDS_PROMPT_SELSYSDATAPATH "Select the location for the System Data file" + IDS_PROMPT_SELCOREPATH_1 + "Select the location for the Core file 1" + IDS_PROMPT_SELCOREPATH_2 + "Select the location for the Core file 2" + IDS_PROMPT_SELJRNLPATH "Select the location for the Journal Data file" + IDS_PROMPT_SELSTGPATH "Select the location for the Staging Data file" + IDS_PROMPT_SELXLOGPATH "Select the location for the Transaction Log file" + IDS_LABEL_SYSPATHSIMPLE "Database files" + IDS_LABEL_SYSPATH_ADV "System data file" + IDS_GETSID_ERROR "Unable to retrieve the SID for the account." + IDS_GETREMOTEACCT_ERROR "Unable to lookup the remote account by the local account SID." + IDS_SQLSPVERSION_TOO_LOW + "This database instance does not meet the minimum version or Service Pack level requirements and cannot be used for installation. Please upgrade this instance or select another one." + IDS_CANTOPENCLUSTER "Setup was unable to contact the Cluster Management Service on the virtual server that hosts this database instance.\nPlease correct this problem and try again." + IDS_NOCLUSTERRESAVAIL "This database instance has no physical resources available. Please select a different database instance or correct the problem and try again." + IDS_GENERALCLUSTERR "Error while inspecting the cluster environment." + IDS_PASSIVENODE_DB "Setup has detected that this computer is a passive node of the virtual server that hosts the instance you have selected. Setup will install and register the UDDI Services tools and configuration settings. You must install the UDDI Services database components to the same instance on each node of this virtual server.\n\nDo you want to continue to install to this instance?" + IDS_ACTIVENODE_DB "Setup has detected that this computer is an active node of the virtual server that hosts the instance you have selected. Setup will install and register the UDDI Services database, tools and configuration settings. You must install the UDDI Services database components to the same instance on each node of this virtual server.\n\nDo you want to continue to install to this instance?" + IDS_DB_ANALYSING_MSG "Please wait" +END + +STRINGTABLE +BEGIN + IDS_WRONGLOGONTYPE "Installing to a virtual server requires domain-level credentials with privileges to install applications and services on this computer. Please specify a domain-level username and password with sufficient privileges and try again." + IDS_CANTCONNTOSTD "The specified target computer does not support distributed installations. Distributed support is available only with Windows Server 2003, Enterprise Edition and Windows Server 2003, Datacenter Edition. Please select a new target computer and try again." + IDS_DB_EXISTS "Setup has detected existing UDDI Services database components. Setup will install and register the tools and configuration settings only - the database will not be modified.\n\nDo you want to continue to install to this database instance?" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "uddiocm Module" +#define VER_INTERNALNAME_STR "UDDIOCM.DLL" +#define VER_ORIGINALFILENAME_STR "UDDIOCM.DLL" + +#include "common.ver" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/inetsrv/uddi/source/setup/ocm/uddiocm.sln b/inetsrv/uddi/source/setup/ocm/uddiocm.sln new file mode 100644 index 0000000..1d0614a --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/uddiocm.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ocm", "ocm.vcproj", "{65F02C2E-479D-415E-BF3B-FBFAADEB22A4}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Debug.ActiveCfg = Debug|Win32 + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Debug.Build.0 = Debug|Win32 + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Release.ActiveCfg = Release|Win32 + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/inetsrv/uddi/source/setup/ocm/wizpage.cpp b/inetsrv/uddi/source/setup/ocm/wizpage.cpp new file mode 100644 index 0000000..f69c160 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocm/wizpage.cpp @@ -0,0 +1,2719 @@ +//-------------------------------------------------------------------------- + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#endif + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. +#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#endif + +// Windows Header Files: +#include +#include +#include +#include + +#include "ocmanage.h" + +#include "uddiocm.h" +#include "uddiinst.h" +#include "assert.h" +#include "..\shared\common.h" +#include "resource.h" +#include "objectpicker.h" +#include +#include + +#include // MD_ & IIS_MD_ defines +#ifndef MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM +#define MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM 0 +#define MD_APPPOOL_IDENTITY_TYPE_LOCALSERVICE 1 +#define MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE 2 +#define MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER 3 +#endif + +#define NOT_FIRST_OR_LAST_WIZARD_PAGE false +#define FINAL_WIZARD_PAGE true +#define WELCOME_WIZARD_PAGE true + +#ifndef STATUS_SUCCESS +#define STATUS_SUCCESS 0 +#endif + +//-------------------------------------------------------------------------- + +#define PASSWORD_LEN PWLEN // maximum password length +#define USERNAME_LEN UNLEN // maximum user name length +#define UDDI_MAXPROVNAME_LEN 255 // maximum UDDI Business Entity name length + +#define UDDI_ILLEGALNAMECHARS TEXT( "\":;/\\?*" ) + +extern HINSTANCE g_hInstance; +extern CUDDIInstall g_uddiComponents; + +static CDBInstance g_dbLocalInstances; +static CDBInstance g_dbRemoteInstances; +static HWND g_hPropSheet = NULL ; +static HFONT g_hTitleFont = 0; +static TCHAR g_szPwd[ PASSWORD_LEN + 1 ]; + +// +// "allowed" drive letters for a clustered environment scenario. +// Not used for a "regular" installation +// +static CLST_ALLOWED_DRIVES gAllowedClusterDrives; + +// +// This controls whether the Data Paths page will be shown in "simple" mode by default +// +static BOOL g_bSimpleDatapathUI = TRUE; +static BOOL g_bResetPathFields = FALSE; + +// +// This controls whether we do clustering data collection. This variable is used +// to coordinate operation between pages +// +static BOOL g_bSkipClusterAnalysis = FALSE; +static BOOL g_bOnActiveClusterNode = TRUE; +static BOOL g_bPreserveDatabase = FALSE; + + +static int DisplayUDDIErrorDialog( HWND hDlg, UINT uMsgID, UINT uType = MB_OK | MB_ICONWARNING, DWORD dwError = 0 ); +static void ParseUserAccount( PTCHAR szDomainAndUser, UINT uDomainAndUserSize, PTCHAR szUser, UINT uUserSize, PTCHAR szDomain, UINT uDomainSize, bool &bLocalAccount ); +static BOOL GetWellKnownAccountName( WELL_KNOWN_SID_TYPE sidWellKnown, TCHAR *pwszName, DWORD *pcbSize ); + +BOOL ShowBrowseDirDialog( HWND hParent, LPCTSTR szTitle, LPTSTR szOutBuf ); +int CALLBACK BrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData ); + +static BOOL GrantNetworkLogonRights( LPCTSTR pwszDomainUser ); +//-------------------------------------------------------------------------- + +INT_PTR CALLBACK LocalDBInstanceDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK RemoteDBInstanceDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK SSLDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK ProviderInstanceDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK AddSvcDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK LoginDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK WizardSummaryDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK DataPathsDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK ExistingDBInstanceProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK ClusterDataDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ); + +BOOL CALLBACK ConfirmPasswordDlgProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam ); + +//-------------------------------------------------------------------------- + +static int DisplayUDDIErrorDialog( HWND hDlg, UINT uMsgID, UINT uType, DWORD dwError ) +{ + TCHAR szMsg[ 1000 ]; + TCHAR szTitle[ 100 ]; + + LoadString( g_hInstance, uMsgID, szMsg, sizeof( szMsg ) / sizeof( TCHAR ) ); + LoadString( g_hInstance, IDS_TITLE, szTitle, sizeof( szTitle ) / sizeof( TCHAR ) ); + tstring cMsg = szMsg; + + if( dwError ) + { + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dwError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + + // + // FIX: 718923: this used to throw an exception if lpMsgBuf was NULL + // + if( lpMsgBuf ) + { + if ( cMsg.length() > 0 ) + cMsg.append( TEXT( " " ) ); + + cMsg.append( (LPTSTR) lpMsgBuf ); + LocalFree( lpMsgBuf ); + } + } + + return MessageBox( hDlg, cMsg.c_str(), szTitle, uType ); +} + +//-------------------------------------------------------------------------- + +inline int SkipWizardPage( const HWND hdlg ) +{ + SetWindowLongPtr( hdlg, DWLP_MSGRESULT, -1 ); + return 1; //Must return 1 for the page to be skipped +} + +//-------------------------------------------------------------------------- + +static HPROPSHEETPAGE CreatePage( + const int nID, + const DLGPROC pDlgProc, + const PTCHAR szTitle, + const PTCHAR szSubTitle, + bool bFirstOrLast ) +{ + PROPSHEETPAGE Page; + memset( &Page, 0, sizeof( PROPSHEETPAGE ) ); + + Page.dwSize = sizeof( PROPSHEETPAGE ); + Page.dwFlags = PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE | PSP_USETITLE; + // use PSP_USETITLE without specifying szTitle to keep from overwriting the default propery page title + + if ( bFirstOrLast ) + { + Page.dwFlags |= PSP_HIDEHEADER; + } + Page.hInstance = ( HINSTANCE )g_hInstance; + Page.pszTemplate = MAKEINTRESOURCE( nID ); + Page.pfnDlgProc = pDlgProc; + Page.pszHeaderTitle = _tcsdup( szTitle ); + Page.pszHeaderSubTitle = _tcsdup( szSubTitle ); + + HPROPSHEETPAGE PageHandle = CreatePropertySheetPage( &Page ); + + return PageHandle; +} + +//-------------------------------------------------------------------------- + +DWORD AddUDDIWizardPages( const TCHAR *ComponentId, const WizardPagesType WhichOnes, SETUP_REQUEST_PAGES *SetupPages ) +{ + ENTER(); + + HPROPSHEETPAGE pPage = NULL; + DWORD iPageIndex = 0 ; + + TCHAR szTitle[ 256 ]; + TCHAR szSubtitle[ 256 ]; + LoadString( g_hInstance, IDS_TITLE, szTitle, sizeof( szTitle ) / sizeof( TCHAR ) ); + + // + // only add our pages when the OCM asks for the "Late Pages" + // + if( WizPagesLate == WhichOnes ) + { + if( SetupPages->MaxPages < 9 ) + return 9; + + // + // add the local db instance selection page + // + LoadString( g_hInstance, IDS_DB_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_DB_INSTANCE, LocalDBInstanceDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_DB_INSTANCE Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + // + // add the hidden clustering "data collector" page + // + pPage = CreatePage( IDD_CLUSTDATA, ClusterDataDlgProc, TEXT( "" ), TEXT( "" ), NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_CLUSTDATA Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + // + // add the "uddi instance found" info page + // + LoadString( g_hInstance, IDS_EXISTINGDB_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_EXISTING_DBINSTANCE, ExistingDBInstanceProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_EXISTING_DBINSTANCE Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + + // + // add the SSL page + // + LoadString( g_hInstance, IDS_SSL_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_SSL, SSLDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_SSL Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + // + // add the remote db instance selection page + // + LoadString( g_hInstance, IDS_REMOTE_DB_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_REMOTE_DB, RemoteDBInstanceDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_REMOTE_DB Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + // + // add the data file path(s) selection page + // + LoadString( g_hInstance, IDS_FILEPATHS_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_DATAPATHS, DataPathsDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_DATAPATHS Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + // + // add the authentication page + // + LoadString( g_hInstance, IDS_LOGIN_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_LOGIN, LoginDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_LOGIN Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + + // + // add the UDDI Provider Name page + // + LoadString( g_hInstance, IDS_UDDIPROV_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_SITE_NAME, ProviderInstanceDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_SITE_NAME Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + // + // add the UDDI "Add Service / Update AD" + // + LoadString( g_hInstance, IDS_UDDIADDSVC_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_ADD_SERVICES, AddSvcDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_ADD_SERVICES Property Page" ) ); + return( (DWORD)( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + + // + // add the wizard summary page + // + /* + LoadString( g_hInstance, IDS_WIZARD_SUMMARY_SUBTITLE, szSubtitle, sizeof( szSubtitle ) / sizeof( TCHAR ) ); + pPage = CreatePage( IDD_WIZARD_SUMMARY, WizardSummaryDlgProc, szTitle, szSubtitle, NOT_FIRST_OR_LAST_WIZARD_PAGE ); + //pPage = CreatePage( IDD_WIZARD_SUMMARY, WizardSummaryDlgProc, szTitle, szSubtitle, FINAL_WIZARD_PAGE ); + if ( NULL == pPage ) + { + Log( TEXT( "***Unable to add the IDD_LOGIN Property Page" ) ); + return( ( DWORD )( -1 ) ); + } + + SetupPages->Pages[iPageIndex] = pPage; + iPageIndex++; + */ + } + + return iPageIndex; +} + +//-------------------------------------------------------------------------- + +INT_PTR CALLBACK LocalDBInstanceDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_INITDIALOG: + { + // + // start off with MSDE to not install + // + g_uddiComponents.SetInstallLevel( UDDI_MSDE, UDDI_NOACTION ); + + // + // get a handle to the list box + // + HWND hwndList = GetDlgItem( hDlg, IDC_LIST_DB_INSTANCES ); + + // + // Get the list of SQL 2000 ( only ) database instances and, if any are found, populate the list box + // + LONG iRet = g_dbLocalInstances.GetInstalledDBInstanceNames(); + if( ERROR_SUCCESS == iRet ) + { + TCHAR szBuffer[ 50 ]; + for( int i = 0; i < g_dbLocalInstances.GetInstanceCount(); i++ ) + { + if( g_dbLocalInstances.GetInstanceName( i, szBuffer, 50 ) ) + { + DWORD iIndex = (DWORD) SendMessage( hwndList, CB_ADDSTRING, 0, (LPARAM)szBuffer ); + SendMessage( hwndList, CB_SETITEMDATA, (WPARAM) iIndex, (LPARAM)i ); + } + } + } + + // + // Is SQL on this box? + // + if( g_dbLocalInstances.GetInstanceCount() > 0 ) + { + // + // select the SQL radio button + // + CheckRadioButton( hDlg, + IDC_RADIO_INSTALL_MSDE, + IDC_RADIO_USE_EXISTING_INSTANCE, + IDC_RADIO_USE_EXISTING_INSTANCE ); + + // + // is there an instance named "UDDI" on this machine? + // + // If NO, then select the 1st entry in the combo box. + // + // If YES, then select the "UDDI" entry from the combo box. Also, disable + // the option to select MSDE. + // + // FIX: 763442 There was a problem with the test to determine if a SQL Instance named + // "UDDI" was installed. + // + // BUGBUG:CREEVES This function is named improperly Is...() should return a bool + // + if( g_dbLocalInstances.IsInstanceInstalled( UDDI_MSDE_INSTANCE_NAME ) >= 0 ) + { + // + // Found a SQL Instance named "UDDI" + // + + // + // Disable the MSDE radio, as there is another UDDI instance found + // + EnableWindow( GetDlgItem( hDlg, IDC_RADIO_INSTALL_MSDE ), false ); + SendMessage( hwndList, CB_SETCURSEL, 0, 0 ); + } + else + { + // + // A SQL Instance named "UDDI" was not found + // + SendMessage( hwndList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) UDDI_MSDE_INSTANCE_NAME ); + } + } + else + { + // + // there are no sql instances on this machine + // disable the SQL radio button and list box + // + EnableWindow( GetDlgItem( hDlg, IDC_LIST_DB_INSTANCES ), false ); + EnableWindow( GetDlgItem( hDlg, IDC_RADIO_USE_EXISTING_INSTANCE ), false ); + // + // select the MSDE radio button + // + CheckRadioButton( hDlg, + IDC_RADIO_INSTALL_MSDE, + IDC_RADIO_USE_EXISTING_INSTANCE, + IDC_RADIO_INSTALL_MSDE ); + } + + // + // find out if our instance of MSDE ( SqlRun08.msi ) is already used on this machine + // + bool bIsSqlRun08AlreadyUsed = false; + if( !IsSQLRun08AlreadyUsed( &bIsSqlRun08AlreadyUsed ) ) + { + Log( TEXT( "IsSQLRun08AlreadyUsed() failed" ) ); + break; + } + + if( bIsSqlRun08AlreadyUsed ) + { + // + // MSDE is already installed, so disable the MSDE radio button + // + EnableWindow( GetDlgItem( hDlg, IDC_RADIO_INSTALL_MSDE ), false ); + } + else + { + // + // MSDE is NOT on this box, but before we select the MSDE radio button + // we want to see if there is a SQL instance named UDDI, + // if so we'll make that the default. + // + if( -1 == g_dbLocalInstances.IsInstanceInstalled( UDDI_MSDE_INSTANCE_NAME ) ) + { + CheckRadioButton( hDlg, + IDC_RADIO_INSTALL_MSDE, + IDC_RADIO_USE_EXISTING_INSTANCE, + IDC_RADIO_INSTALL_MSDE ); + } + } + + // + // enable/disable the list box + // + EnableWindow( GetDlgItem( hDlg, IDC_LIST_DB_INSTANCES ), IsDlgButtonChecked( hDlg, IDC_RADIO_USE_EXISTING_INSTANCE ) ); + } + break; + + case WM_COMMAND: + + // + // someone clicked a radio button: + // + if( LOWORD( wParam ) == IDC_RADIO_INSTALL_MSDE || LOWORD( wParam ) == IDC_RADIO_USE_EXISTING_INSTANCE ) + { + if( HIWORD( wParam ) == BN_CLICKED ) + { + // disable the list box if its radio button is not clicked + EnableWindow( GetDlgItem( hDlg, IDC_LIST_DB_INSTANCES ), IsDlgButtonChecked( hDlg, IDC_RADIO_USE_EXISTING_INSTANCE ) ); + } + } + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // this page needed only if we are installing the DB + // + g_uddiComponents.UpdateAllInstallLevel(); + + // + // Set the flag for ClusterDataProc so that when the user clicks "Next" + // it won't skip the data collection step + // + g_bSkipClusterAnalysis = FALSE; + + if( g_uddiComponents.IsInstalling( UDDI_DB ) ) + { + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + // + // this message is sent when the user presses the "next" button + // + case PSN_WIZNEXT: + { + // + // are we installing MSDE? + // + bool bInstallMSDE = ( BST_CHECKED == IsDlgButtonChecked( hDlg, IDC_RADIO_INSTALL_MSDE ) ); + if( bInstallMSDE ) + { + // + // check to see if SqlRun08 is already on this box + // + bool bIsSqlRun08AlreadyUsed = false; + IsSQLRun08AlreadyUsed( &bIsSqlRun08AlreadyUsed ); + if( bIsSqlRun08AlreadyUsed ) + { + DisplayUDDIErrorDialog( hDlg, IDS_MSDE_ALREADY_USED ); + SetWindowLongPtr( hDlg,DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // set the MSDE instance name to "UDDI" + // + g_uddiComponents.SetDBInstanceName( UDDI_LOCAL_COMPUTER, UDDI_MSDE_INSTANCE_NAME, UDDI_INSTALLING_MSDE, false ); + + // + // set MSDE to install + // + g_uddiComponents.SetInstallLevel( UDDI_MSDE, UDDI_INSTALL, TRUE ); + + // + // exit this property page + // + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; // done + } + // + // we are using an existing instance of SQL + // + else + { + // + // get a handle to the combobox + // + HWND hwndList = GetDlgItem( hDlg, IDC_LIST_DB_INSTANCES ); + + // + // get the index of the string that is currently selected in the combobox + // + int nItem = ( int ) SendMessage( hwndList, CB_GETCURSEL, 0, 0 ); + + // + // if no string is selected, raise an error + // + if( CB_ERR == nItem ) + { + DisplayUDDIErrorDialog( hDlg, IDS_NO_INSTANCE_MSG ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // get the index into the instance array of the selected item + // + int nInstanceIndex = ( int ) SendMessage( hwndList, CB_GETITEMDATA, nItem, ( LPARAM ) 0 ); + + // + // Now verify that the selected instance meets our requirements + // + if( CompareVersions( g_dbLocalInstances.m_dbinstance[ nInstanceIndex ].cSPVersion.c_str(), + MIN_SQLSP_VERSION ) < 0 ) + { + DisplayUDDIErrorDialog( hDlg, IDS_SQLSPVERSION_TOO_LOW ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // set the instance name + // + g_uddiComponents.SetDBInstanceName( + g_dbLocalInstances.m_dbinstance[ nInstanceIndex ].cComputerName.c_str(), + g_dbLocalInstances.m_dbinstance[ nInstanceIndex ].cSQLInstanceName.c_str(), + UDDI_NOT_INSTALLING_MSDE, + g_dbLocalInstances.m_dbinstance[ nInstanceIndex ].bIsCluster ); + + // + // Set MSDE to NOT INSTALL + // + g_uddiComponents.SetInstallLevel( UDDI_MSDE, UDDI_NOACTION ); + + // + // exit this property page + // + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; // done + } + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + +//-------------------------------------------------------------------------- + +INT_PTR CALLBACK SSLDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_INITDIALOG: + // + // turn SSL on by default + // + CheckRadioButton( hDlg, IDC_SSL_YES, IDC_SSL_NO, IDC_SSL_YES ); + break; + + case WM_COMMAND: + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // this page needed only if we are installing the DB + // + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsInstalling( UDDI_DB ) && g_bOnActiveClusterNode && !g_bPreserveDatabase ) + { + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + case PSN_WIZNEXT: + { + // + // set the SSL mode by adding a property to the DB setup command line + // + bool bUseSSL = ( BST_CHECKED == IsDlgButtonChecked( hDlg, IDC_SSL_YES ) ); + g_uddiComponents.AddProperty( UDDI_DB, TEXT( "SSL" ), bUseSSL ? 1 : 0 ); + + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + +// +//-------------------------------------------------------------------------- +// +INT_PTR CALLBACK ProviderInstanceDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_INITDIALOG: + // + // set the maximum edit field length + // + SendMessage( GetDlgItem( hDlg, IDC_SITE_NAME ), EM_LIMITTEXT, ( WPARAM ) UDDI_MAXPROVNAME_LEN, 0 ); + break; + + case WM_COMMAND: + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // this page needed only if we are installing the DB + // + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsInstalling( UDDI_DB ) && g_bOnActiveClusterNode && !g_bPreserveDatabase ) + { + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + case PSN_WIZNEXT: + { + // + // set the Provider Instance Name by adding a property to the DB setup command line + // + TCHAR buf[ UDDI_MAXPROVNAME_LEN + 1 ]; + ZeroMemory( buf, sizeof buf ); + + int iChars = GetWindowText( GetDlgItem( hDlg, IDC_SITE_NAME ), buf, ( sizeof( buf ) / sizeof( buf[0] ) ) -1 ); + if( 0 == iChars ) + { + DisplayUDDIErrorDialog( hDlg, IDS_ZERO_LEN_PROVIDER_NAME ); + SetFocus( GetDlgItem( hDlg, IDC_SITE_NAME ) ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // Now verify that the instance name does not contain illegal characters + // + TCHAR *pIllegalChar = _tcspbrk( buf, UDDI_ILLEGALNAMECHARS ); + if ( pIllegalChar ) + { + DisplayUDDIErrorDialog( hDlg, IDS_UDDI_ILLEGALCHARACTERS ); + SetFocus( GetDlgItem( hDlg, IDC_SITE_NAME ) ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_UDDIPROVIDER, buf ); + + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + +// +//----------------------------------------------------------------------------------- +// +void ToggleDatapathUI ( HWND hDlg, BOOL bToSimple ) +{ + TCHAR szBuf[ 256 ]; + + if ( bToSimple ) + { + // + // Hide fields + // + ShowWindow( GetDlgItem( hDlg, IDC_COREPATH_1 ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_COREPATH_2 ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_JRNLPATH ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_STAGINGPATH ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_XLOGPATH ), SW_HIDE ); + + // + // Hide buttons + // + ShowWindow( GetDlgItem( hDlg, IDC_BROWSECOREPATH1 ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSECOREPATH2 ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSEJRNLPATH ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSESTAGINGPATH ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSEXLOGPATH ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_LESS_BTN ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_MORE_BTN ), SW_SHOW ); + + // + // Hide labels and adjust the text + // + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_C1 ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_C2 ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_JRNL ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_STG ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_XLOG ), SW_HIDE ); + + LoadString( g_hInstance, IDS_LABEL_SYSPATHSIMPLE, szBuf, (sizeof szBuf / sizeof szBuf[0]) - 1 ); + SetDlgItemText( hDlg, IDC_STATIC_SYS, szBuf ); + } + else + { + // + // Show fields + // + ShowWindow( GetDlgItem( hDlg, IDC_COREPATH_1 ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_COREPATH_2 ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_JRNLPATH ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_STAGINGPATH ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_XLOGPATH ), SW_SHOW ); + + // + // Show buttons + // + ShowWindow( GetDlgItem( hDlg, IDC_MORE_BTN ), SW_HIDE ); + ShowWindow( GetDlgItem( hDlg, IDC_LESS_BTN ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSECOREPATH1 ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSECOREPATH2 ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSEJRNLPATH ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSESTAGINGPATH ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_BROWSEXLOGPATH ), SW_SHOW ); + + // + // Show labels and adjust the text + // + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_C1 ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_C2 ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_JRNL ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_STG ), SW_SHOW ); + ShowWindow( GetDlgItem( hDlg, IDC_STATIC_XLOG ), SW_SHOW ); + + LoadString( g_hInstance, IDS_LABEL_SYSPATH_ADV, szBuf, (sizeof szBuf / sizeof szBuf[0]) - 1 ); + SetDlgItemText( hDlg, IDC_STATIC_SYS, szBuf ); + } +} + + +void SetAllDatapathFields ( HWND hDlg, LPCTSTR szValue ) +{ + SetDlgItemText( hDlg, IDC_SYSPATH, szValue ); + SetDlgItemText( hDlg, IDC_COREPATH_1, szValue ); + SetDlgItemText( hDlg, IDC_COREPATH_2, szValue ); + SetDlgItemText( hDlg, IDC_JRNLPATH, szValue ); + SetDlgItemText( hDlg, IDC_STAGINGPATH, szValue ); + SetDlgItemText( hDlg, IDC_XLOGPATH, szValue ); +} + + +INT_PTR CALLBACK ClusterDataDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + bool bSuppressInactiveWarning = false; + + // + // We ALWAYS skip the page, but if this is a DB installation, then we + // also need to do some data collection here + // + g_uddiComponents.UpdateAllInstallLevel(); + if( !g_bSkipClusterAnalysis ) + { + // + // Here we do our cluster environment checks + // + gAllowedClusterDrives.driveCount = 0; + g_bOnActiveClusterNode = TRUE; + + // + // Make sure we keep out installation properties in sync with the + // cluster configuration + // + g_uddiComponents.DeleteProperty( UDDI_DB, PROPKEY_CLUSTERNODETYPE ); + g_uddiComponents.DeleteProperty( UDDI_WEB, PROPKEY_CLUSTERNODETYPE ); + + if ( g_uddiComponents.IsClusteredDBInstance() ) + { + // + // First, try connecting to the database + // If the database already exists, then just leave it + // intact and skip the drive enumeration process + // + TCHAR szVerBuf[ 256 ] = {0}; + size_t cbVerBuf = DIM( szVerBuf ) - 1; + + HCURSOR hcrHourglass = LoadCursor( NULL, IDC_WAIT ); + HCURSOR hcrCurr = SetCursor( hcrHourglass ); + + HRESULT hr = GetDBSchemaVersion( g_uddiComponents.GetFullDBInstanceName(), + szVerBuf, cbVerBuf ); + + SetCursor( hcrCurr ); + + if ( SUCCEEDED( hr ) && _tcslen( szVerBuf ) ) + { + g_bPreserveDatabase = TRUE; + int iRes = DisplayUDDIErrorDialog( hDlg, IDS_DB_EXISTS, MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 ); + if ( iRes == IDNO ) + { + // force user to the instance selection page + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, IDD_DB_INSTANCE ); + return 1; + } + + bSuppressInactiveWarning = true; + } + else + { + g_bPreserveDatabase = FALSE; + } + + cDrvMap::size_type nDrivesFound = 0; + + HCLUSTER hCls = OpenCluster( NULL ); + if ( !hCls ) + { + DisplayUDDIErrorDialog( hDlg, IDS_CANTOPENCLUSTER ); + + // force user to the previous page + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, IDD_DB_INSTANCE ); + return 1; + } + + hcrCurr = SetCursor( hcrHourglass ); + + // + // now we will format the instance name and collect the data + // + try + { + TCHAR szComputerName[ 256 ] = {0}; + WCHAR szNode[ 256 ] = {0}; + DWORD dwErr = ERROR_SUCCESS; + DWORD cbComputerName = DIM( szComputerName ); + DWORD cbNode = DIM( szNode ); + cStrList cDependencies; + cDrvMap cPhysicalDrives; + + tstring sServerName = g_uddiComponents.GetDBComputerName(); + tstring sInstance = g_uddiComponents.GetDBInstanceName(); + + if ( !_tcsicmp( sInstance.c_str(), DEFAULT_SQL_INSTANCE_NAME ) ) + sInstance = DEFAULT_SQL_INSTANCE_NATIVE; + + sServerName += TEXT( "\\" ); + sServerName += sInstance; + + dwErr = GetSqlNode( sServerName.c_str(), szNode, cbNode ); + if ( dwErr != ERROR_SUCCESS ) + throw dwErr; + + GetComputerName( szComputerName, &cbComputerName ); + + // + // Are we on the same node as the Sql server instance? + // + g_bOnActiveClusterNode = ( !_tcsicmp( szComputerName, szNode ) ); + + gAllowedClusterDrives.driveCount = 0; + + // + // if we are installing database components, + // then we will need to go one step further and analyse + // the drive dependencies etc. + // + if ( g_bOnActiveClusterNode ) + { + if ( g_uddiComponents.IsInstalling( UDDI_DB ) && !g_bPreserveDatabase ) + { + // + // We are on an active (owning) node. Let's collect the drive data + // + dwErr = EnumSQLDependencies( hCls, &cDependencies, sServerName.c_str() ); + if ( dwErr != ERROR_SUCCESS ) + throw dwErr; + + dwErr = EnumPhysicalDrives( hCls, &cDependencies, &cPhysicalDrives ); + if ( dwErr != ERROR_SUCCESS ) + throw dwErr; + + int idx = 0; + nDrivesFound = cPhysicalDrives.size(); + if ( nDrivesFound == 0 ) + { + DisplayUDDIErrorDialog( hDlg, IDS_NOCLUSTERRESAVAIL ); + + // force user to the previous page + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, IDD_DB_INSTANCE ); + return 1; + } + + // + // We are in an active node, make sure the user wants to continue + // + int iRes = DisplayUDDIErrorDialog( hDlg, IDS_ACTIVENODE_DB, MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 ); + if ( iRes == IDNO ) + { + // force user to the instance selection page + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, IDD_DB_INSTANCE ); + return 1; + } + + for ( cDrvIterator it = cPhysicalDrives.begin(); it != cPhysicalDrives.end(); it++ ) + { + gAllowedClusterDrives.drives[ idx ] = it->second.sDriveLetter; + idx++; + } + gAllowedClusterDrives.driveCount = idx; + } + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_CLUSTERNODETYPE, PROPKEY_ACTIVENODE ); + g_uddiComponents.AddProperty( UDDI_WEB, PROPKEY_CLUSTERNODETYPE, PROPKEY_ACTIVENODE ); + } + else + { + if ( g_uddiComponents.IsInstalling( UDDI_DB ) && + !bSuppressInactiveWarning ) + { + // + // We are on a passive node. Make a note + // + int iRes = DisplayUDDIErrorDialog( hDlg, IDS_PASSIVENODE_DB, MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 ); + if ( iRes == IDNO ) + { + // force user to the instance selection page + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, IDD_DB_INSTANCE ); + return 1; + } + } + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_CLUSTERNODETYPE, PROPKEY_PASSIVENODE ); + g_uddiComponents.AddProperty( UDDI_WEB, PROPKEY_CLUSTERNODETYPE, PROPKEY_PASSIVENODE ); + } + } + catch (...) + { + DisplayUDDIErrorDialog( hDlg, IDS_GENERALCLUSTERR ); + + // force user to the previous page (SSL) + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, IDD_SSL ); + return 1; + } + + CloseCluster( hCls ); + SetCursor( hcrCurr ); + + // + // Finally, signal the next page that the data has changed + // + g_bResetPathFields = TRUE; + } + else + { + gAllowedClusterDrives.driveCount = -1; + g_bPreserveDatabase = FALSE; + } + + // + // Finally, set the flag to indicate that the job is done + // + g_bSkipClusterAnalysis = TRUE; + } + + return SkipWizardPage( hDlg ); + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + + +INT_PTR CALLBACK DataPathsDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + tstring sTmpString; + BOOL bRes = FALSE; + TCHAR szTmpPath[ MAX_PATH + 1 ]; + TCHAR szTmpTitle[ 256 ]; + + switch( msg ) + { + case WM_INITDIALOG: + // + // set the maximum edit field length + // + SendMessage( GetDlgItem( hDlg, IDC_SYSPATH ), EM_LIMITTEXT, ( WPARAM ) MAX_PATH, 0 ); + SendMessage( GetDlgItem( hDlg, IDC_COREPATH_1 ), EM_LIMITTEXT, ( WPARAM ) MAX_PATH, 0 ); + SendMessage( GetDlgItem( hDlg, IDC_COREPATH_2 ), EM_LIMITTEXT, ( WPARAM ) MAX_PATH, 0 ); + SendMessage( GetDlgItem( hDlg, IDC_JRNLPATH ), EM_LIMITTEXT, ( WPARAM ) MAX_PATH, 0 ); + SendMessage( GetDlgItem( hDlg, IDC_STAGINGPATH ), EM_LIMITTEXT, ( WPARAM ) MAX_PATH, 0 ); + SendMessage( GetDlgItem( hDlg, IDC_XLOGPATH ), EM_LIMITTEXT, ( WPARAM ) MAX_PATH, 0 ); + + // + // are we in a clustered environment ? + // + if ( g_uddiComponents.IsClusteredDBInstance() ) + { + if ( gAllowedClusterDrives.driveCount > 0 ) + { + sTmpString = gAllowedClusterDrives.drives[ 0 ]; + sTmpString += TEXT( "\\uddi\\data" ); + } + else + { + // + // falling back on a default data path. This should never happen, + // this is just a safety net for us + // + sTmpString = g_uddiComponents.GetDefaultDataPath(); + } + } + else + sTmpString = g_uddiComponents.GetDefaultDataPath(); + + // + // Set the fields + // + SetAllDatapathFields( hDlg, sTmpString.c_str() ); + + // + // now hide the controls and set the dialog into the default mode + // + if ( g_bSimpleDatapathUI ) + ToggleDatapathUI( hDlg, TRUE ); + else + ToggleDatapathUI( hDlg, FALSE ); + + break; + + case WM_COMMAND: + switch( LOWORD( wParam ) ) + { + case IDC_MORE_BTN: // toggle to the "advanced mode" + { + g_bSimpleDatapathUI = FALSE; + ToggleDatapathUI( hDlg, FALSE ); + } + break; + + case IDC_LESS_BTN: // toggle to the "simple mode" + { + g_bSimpleDatapathUI = TRUE; + ToggleDatapathUI( hDlg, TRUE ); + } + break; + + + case IDC_BROWSESYSPATH: + { + LoadString( g_hInstance, IDS_PROMPT_SELSYSDATAPATH, szTmpTitle, sizeof szTmpTitle / sizeof szTmpTitle[0] ); + bRes = ShowBrowseDirDialog( hDlg, szTmpTitle, szTmpPath ); + if ( bRes ) + { + SetDlgItemText( hDlg, IDC_SYSPATH, szTmpPath ); + if ( g_bSimpleDatapathUI ) + SetAllDatapathFields( hDlg, szTmpPath ); + } + + break; + } + + case IDC_BROWSECOREPATH1: + { + LoadString( g_hInstance, IDS_PROMPT_SELCOREPATH_1, szTmpTitle, sizeof szTmpTitle / sizeof szTmpTitle[0] ); + bRes = ShowBrowseDirDialog( hDlg, szTmpTitle, szTmpPath ); + if ( bRes ) + SetDlgItemText( hDlg, IDC_COREPATH_1, szTmpPath ); + + break; + } + + case IDC_BROWSECOREPATH2: + { + LoadString( g_hInstance, IDS_PROMPT_SELCOREPATH_2, szTmpTitle, sizeof szTmpTitle / sizeof szTmpTitle[0] ); + bRes = ShowBrowseDirDialog( hDlg, szTmpTitle, szTmpPath ); + if ( bRes ) + SetDlgItemText( hDlg, IDC_COREPATH_2, szTmpPath ); + + break; + } + + case IDC_BROWSEJRNLPATH: + { + LoadString( g_hInstance, IDS_PROMPT_SELJRNLPATH, szTmpTitle, sizeof szTmpTitle / sizeof szTmpTitle[0] ); + bRes = ShowBrowseDirDialog( hDlg, szTmpTitle, szTmpPath ); + if ( bRes ) + SetDlgItemText( hDlg, IDC_JRNLPATH, szTmpPath ); + + break; + } + + case IDC_BROWSESTAGINGPATH: + { + LoadString( g_hInstance, IDS_PROMPT_SELSTGPATH, szTmpTitle, sizeof szTmpTitle / sizeof szTmpTitle[0] ); + bRes = ShowBrowseDirDialog( hDlg, szTmpTitle, szTmpPath ); + if ( bRes ) + SetDlgItemText( hDlg, IDC_STAGINGPATH, szTmpPath ); + + break; + } + + case IDC_BROWSEXLOGPATH: + { + LoadString( g_hInstance, IDS_PROMPT_SELXLOGPATH, szTmpTitle, sizeof szTmpTitle / sizeof szTmpTitle[0] ); + bRes = ShowBrowseDirDialog( hDlg, szTmpTitle, szTmpPath ); + if ( bRes ) + SetDlgItemText( hDlg, IDC_XLOGPATH, szTmpPath ); + + break; + } + + default: + break; + + } + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // this page needed only if we are installing the DB + // + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsInstalling( UDDI_DB ) && g_bOnActiveClusterNode && !g_bPreserveDatabase ) + { + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + + // + // Check whether we need to update the data path fileds + // due to a change in the clustering data + // + if ( g_bResetPathFields ) + { + if ( g_uddiComponents.IsClusteredDBInstance() ) + { + if ( gAllowedClusterDrives.driveCount > 0 ) + { + sTmpString = gAllowedClusterDrives.drives[ 0 ]; + sTmpString += TEXT( "\\uddi\\data" ); + } + else // falling back on a default data path + { + sTmpString = g_uddiComponents.GetDefaultDataPath(); + } + } + else + sTmpString = g_uddiComponents.GetDefaultDataPath(); + + // + // Set the fields + // + SetAllDatapathFields( hDlg, sTmpString.c_str() ); + } + + g_bResetPathFields = FALSE; + + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + case PSN_WIZNEXT: + { + // + // set the Provider Instance Name by adding a property to the DB setup command line + // + TCHAR buf[ MAX_PATH + 1 ]; + ZeroMemory( buf, sizeof buf ); + + // + // System Data File path + // + GetWindowText( GetDlgItem( hDlg, IDC_SYSPATH ), buf, ( sizeof buf / sizeof buf[0] ) - 1 ); + if ( _tcslen( buf ) && ( buf[ _tcslen( buf ) - 1 ] == TEXT( '\\' ) ) ) + _tcscat( buf, TEXT( "\\" ) ); + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_SYSPATH, buf ); + ZeroMemory( buf, sizeof buf ); + + // + // Core Data File path #1 + // + GetWindowText( GetDlgItem( hDlg, IDC_COREPATH_1 ), buf, ( sizeof( buf ) / sizeof( buf[0] ) ) -1 ); + if ( _tcslen( buf ) && ( buf[ _tcslen( buf ) - 1 ] == TEXT( '\\' ) ) ) + _tcscat( buf, TEXT( "\\" ) ); + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_COREPATH_1, buf ); + ZeroMemory( buf, sizeof buf ); + + // + // Core Data File path #2 + // + GetWindowText( GetDlgItem( hDlg, IDC_COREPATH_2 ), buf, ( sizeof( buf ) / sizeof( buf[0] ) ) -1 ); + if ( _tcslen( buf ) && ( buf[ _tcslen( buf ) - 1 ] == TEXT( '\\' ) ) ) + _tcscat( buf, TEXT( "\\" ) ); + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_COREPATH_2, buf ); + ZeroMemory( buf, sizeof buf ); + + // + // Journal Data File path + // + GetWindowText( GetDlgItem( hDlg, IDC_JRNLPATH ), buf, ( sizeof( buf ) / sizeof( buf[0] ) ) -1 ); + if ( _tcslen( buf ) && ( buf[ _tcslen( buf ) - 1 ] == TEXT( '\\' ) ) ) + _tcscat( buf, TEXT( "\\" ) ); + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_JRNLPATH, buf ); + ZeroMemory( buf, sizeof buf ); + + // + // Staging Data File path + // + GetWindowText( GetDlgItem( hDlg, IDC_STAGINGPATH ), buf, ( sizeof( buf ) / sizeof( buf[0] ) ) -1 ); + if ( _tcslen( buf ) && ( buf[ _tcslen( buf ) - 1 ] == TEXT( '\\' ) ) ) + _tcscat( buf, TEXT( "\\" ) ); + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_STGPATH, buf ); + ZeroMemory( buf, sizeof buf ); + + // + // Xact Log File path + // + GetWindowText( GetDlgItem( hDlg, IDC_XLOGPATH ), buf, ( sizeof( buf ) / sizeof( buf[0] ) ) -1 ); + if ( _tcslen( buf ) && ( buf[ _tcslen( buf ) - 1 ] == TEXT( '\\' ) ) ) + _tcscat( buf, TEXT( "\\" ) ); + + g_uddiComponents.AddProperty( UDDI_DB, PROPKEY_XLOGPATH, buf ); + ZeroMemory( buf, sizeof buf ); + + // + // Finally, we can leave the page + // + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + + +// +//-------------------------------------------------------------------------- +// +INT_PTR CALLBACK ExistingDBInstanceProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + TCHAR buf[ 1024 ]; + ULONG cbBuf = ( sizeof buf / sizeof buf[0] ); + bool bRes = false; + + switch( msg ) + { + case WM_INITDIALOG: + // + // set the database instance name field + // + ZeroMemory( buf, sizeof buf ); + + bRes = g_dbLocalInstances.GetUDDIDBInstanceName( NULL, buf, &cbBuf ); + if ( bRes ) + { + if ( !_tcsstr( buf, TEXT( "\\") ) ) + { + // + // Add the machine name + // + TCHAR szMachineName[ MAX_COMPUTERNAME_LENGTH + 1 ]; + DWORD dwLen = MAX_COMPUTERNAME_LENGTH + 1; + + ZeroMemory (szMachineName, sizeof szMachineName ); + if ( GetComputerName( szMachineName, &dwLen ) ) + { + TCHAR szTmp[ 1024 ]; + + _tcscpy( szTmp, szMachineName ); + _tcscat( szTmp, TEXT( "\\" ) ); + _tcscat( szTmp, buf ); + _tcscpy( buf, szTmp ); + } + + } + SetDlgItemText( hDlg, IDC_INSTANCENAME, buf ); + } + break; + + case WM_COMMAND: + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // this page needed only if we are installing the Web & DB is here + // + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsInstalled( UDDI_DB ) && + !g_uddiComponents.IsUninstalling( UDDI_DB ) && + g_uddiComponents.IsInstalling( UDDI_WEB ) ) + { + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + case PSN_WIZNEXT: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + + +// +//-------------------------------------------------------------------------- +// +INT_PTR CALLBACK AddSvcDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_INITDIALOG: + // + // Check the Publish This Site checkbox + // + CheckDlgButton( hDlg, IDC_CHECK_ADDSVC, BST_CHECKED ); + break; + + case WM_COMMAND: + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // this page needed only if we are installing the DB + // + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsInstalling( UDDI_WEB ) ) + { + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + case PSN_WIZNEXT: + { + // + // set the "Add Services" and "Update AD" flags by adding the installation properties + // + bool bChecked = ( BST_CHECKED == IsDlgButtonChecked( hDlg, IDC_CHECK_ADDSVC ) ); + g_uddiComponents.AddProperty( UDDI_WEB, PROPKEY_ADDSERVICES, ( bChecked ? 1 : 0 ) ); + g_uddiComponents.AddProperty( UDDI_WEB, PROPKEY_UPDATE_AD, ( bChecked ? 1 : 0 ) ); + + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + + +// +//-------------------------------------------------------------------------- +// + +INT_PTR CALLBACK RemoteDBInstanceDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_COMMAND: + if( LOWORD( wParam ) == IDC_BROWSE_MACHINES ) + { + // + // use the object picker to select the remote machine name + // + HRESULT hr; + BOOL bIsStd = FALSE; + TCHAR szComputerName[ 256 ] = {0}; + + if ( !ObjectPicker( hDlg, OP_COMPUTER, szComputerName, 256 ) ) + break; // user pressed cancel + + hr = IsStandardServer( szComputerName, &bIsStd ); + if ( SUCCEEDED( hr ) && bIsStd ) + { + DisplayUDDIErrorDialog( hDlg, IDS_CANTCONNTOSTD, MB_OK | MB_ICONWARNING ); + break; + } + + // + // write the machine name into the static text box, and them clear the combo box + // + SendMessage( GetDlgItem( hDlg, IDC_REMOTE_MACHINE ), WM_SETTEXT, 0, ( LPARAM ) szComputerName ); + + // + // find out if a UDDI database already exists on that remote machine + // + TCHAR szInstanceName[ 100 ]; + ULONG uLen = 100; + if( g_dbRemoteInstances.GetUDDIDBInstanceName( szComputerName, szInstanceName, &uLen ) ) + { + // + // write the db instance name into the static text box + // + SendMessage( GetDlgItem( hDlg, IDC_REMOTE_INSTANCE ), WM_SETTEXT, 0, ( LPARAM ) szInstanceName ); + } + else + { + // + // remote machine was not accessable or did not have any instances + // + DisplayUDDIErrorDialog( hDlg, IDS_UDDI_DB_NOT_EXIST, MB_OK | MB_ICONWARNING ); + } + } + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // needed if user is installing web and NOT the db, or the db is not installed + // + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsInstalling( UDDI_WEB ) && !g_uddiComponents.IsInstalling( UDDI_DB ) && + ( !g_uddiComponents.IsInstalled( UDDI_DB ) || g_uddiComponents.IsUninstalling( UDDI_DB ) ) ) + { + UINT osMask = g_uddiComponents.GetOSSuiteMask(); + BOOL bAdv = ( osMask & VER_SUITE_DATACENTER ) || ( osMask & VER_SUITE_ENTERPRISE ); + + EnableWindow( GetDlgItem( hDlg, IDC_BROWSE_MACHINES ), bAdv ); + + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg,DWLP_MSGRESULT,0 ); + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + // + // this is called when the user presses "next" + // + case PSN_WIZNEXT: + { + // + // get the remote machine name from the edit control + // + TCHAR szComputerName[ 129 ]; + UINT iChars = ( UINT ) SendMessage( GetDlgItem( hDlg, IDC_REMOTE_MACHINE ), WM_GETTEXT, 129, ( LPARAM ) szComputerName ); + if( 0 == iChars ) + { + DisplayUDDIErrorDialog( hDlg, IDS_SELECT_REMOTE_COMPUTER ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // get the index of the database instance selection in the combobox + // + TCHAR szRemoteDBInstance[ 100 ]; + iChars = ( UINT ) SendMessage( GetDlgItem( hDlg, IDC_REMOTE_INSTANCE ), WM_GETTEXT, 100, ( LPARAM ) szRemoteDBInstance ); + if( 0 == iChars ) + { + DisplayUDDIErrorDialog( hDlg, IDS_UDDI_DB_NOT_EXIST ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // save the computer and instance name. As we are using a remote node here, + // we don't really care whether it is on cluster or not + // + g_uddiComponents.SetDBInstanceName( szComputerName, szRemoteDBInstance, UDDI_NOT_INSTALLING_MSDE, false ); + + // + // the web installer needs the remote machine name to properly add the login + // + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "REMOTE_MACHINE_NAME" ), szComputerName ); + + + Log( TEXT( "User selected remote computer %s and database instance %s" ), szComputerName, szRemoteDBInstance ); + + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; // done + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + +//-------------------------------------------------------------------------- + +INT_PTR CALLBACK LoginDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_INITDIALOG: + // + // set the limit of the length of the password + // + SendMessage( GetDlgItem( hDlg, IDC_PASSWORD ), EM_LIMITTEXT, ( WPARAM ) PASSWORD_LEN, 0 ); + SendMessage( GetDlgItem( hDlg, IDC_USER_NAME ), EM_LIMITTEXT, ( WPARAM ) USERNAME_LEN, 0 ); + break; + + case WM_COMMAND: + // + // user clicked a radio button: + // + if( LOWORD( wParam ) == IDC_RADIO_NETWORK_SERVICE || LOWORD( wParam ) == IDC_RADIO_DOMAIN_ACCT ) + { + if( HIWORD( wParam ) == BN_CLICKED ) + { + EnableWindow( GetDlgItem( hDlg, IDC_USER_NAME ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_USER_NAME_PROMPT ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_PASSWORD ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_PASSWORD_PROMPT ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_BROWSE_USERS ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + } + } + // + // if the user clicked the "Browse" button + // + else if( LOWORD( wParam ) == IDC_BROWSE_USERS ) + { + // + // use the object picker to select the user + // + TCHAR szDomainUser[ 256 ]; + if ( !ObjectPicker( hDlg, OP_USER, szDomainUser, 256 ) ) + break; + + // + // write the machine name into the static text box + // + SendMessage( GetDlgItem( hDlg, IDC_USER_NAME ), WM_SETTEXT, 0, ( LPARAM ) szDomainUser ); + + } + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + // + // this page is needed only when the WEB is being installed + // + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsInstalling( UDDI_WEB ) ) + { + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + + bool bIsClustered = g_uddiComponents.IsClusteredDBInstance(); + + if( ( g_uddiComponents.IsInstalling( UDDI_DB ) || + ( g_uddiComponents.IsInstalled( UDDI_DB ) && !g_uddiComponents.IsUninstalling( UDDI_DB ) ) ) && + !bIsClustered ) + { + CheckRadioButton( hDlg, IDC_RADIO_NETWORK_SERVICE, IDC_RADIO_DOMAIN_ACCT, IDC_RADIO_NETWORK_SERVICE ); + } + // + // db is not on the local box, so disable the network service account option + // + else + { + CheckRadioButton( hDlg, IDC_RADIO_NETWORK_SERVICE, IDC_RADIO_DOMAIN_ACCT, IDC_RADIO_DOMAIN_ACCT ); + EnableWindow( GetDlgItem( hDlg, IDC_RADIO_NETWORK_SERVICE ), FALSE ); + SetFocus( GetDlgItem( hDlg, IDC_USER_NAME ) ); + } + + EnableWindow( GetDlgItem( hDlg, IDC_USER_NAME ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_USER_NAME_PROMPT ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_PASSWORD ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_PASSWORD_PROMPT ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + EnableWindow( GetDlgItem( hDlg, IDC_BROWSE_USERS ), IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + } + else + { + return SkipWizardPage( hDlg ); + } + + return 1; + } + + // + // this is called when the user presses "next" + // + case PSN_WIZNEXT: + { + // + // Get ready for the SID-to-user name conversions + // + TCHAR szSidStr[ 1024 ]; + TCHAR szRemote[ 1024 ]; + TCHAR szRemoteUser[ 1024 ]; + DWORD cbSidStr = sizeof szSidStr / sizeof szSidStr[0]; + DWORD cbRemoteUser = sizeof szRemoteUser / sizeof szRemoteUser[0]; + + TCHAR szComputerName[ MAX_COMPUTERNAME_LENGTH + 1 ]; + DWORD dwCompNameLen = MAX_COMPUTERNAME_LENGTH + 1; + GetComputerName( szComputerName, &dwCompNameLen ); + + ZeroMemory( szRemote, sizeof szRemote ); + + if( NULL == g_uddiComponents.GetProperty( UDDI_WEB, TEXT( "REMOTE_MACHINE_NAME" ), szRemote ) ) + { + _tcscpy( szRemote, szComputerName ); + } + + // + // set the property that defines whether we are using "Network Service" or a "User Login" + // + bool bUserAcct = ( BST_CHECKED == IsDlgButtonChecked( hDlg, IDC_RADIO_DOMAIN_ACCT ) ); + + // + // set the properties that denotes a domain user + // + if( bUserAcct ) + { + TCHAR szDomainUser[ USERNAME_LEN + 1 ]; + + // + // verify the user name length > 0 + // + int iChars = GetWindowText( GetDlgItem( hDlg, IDC_USER_NAME ), szDomainUser, sizeof( szDomainUser ) / sizeof( TCHAR ) ); + if( 0 == iChars ) + { + DisplayUDDIErrorDialog( hDlg, IDS_ZERO_LEN_USER_NAME ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // make the user retype the password + // + GetWindowText( GetDlgItem( hDlg, IDC_PASSWORD ), g_szPwd, sizeof( g_szPwd ) / sizeof( TCHAR ) ); + + INT_PTR iRet = DialogBox( + g_hInstance, + MAKEINTRESOURCE( IDD_CONFIRM_PW ), + hDlg, + ConfirmPasswordDlgProc ); + + if( IDCANCEL == iRet ) + { + // + // user pressed Cancel to the confirm dialog + // + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + TCHAR szUser[ USERNAME_LEN + 1 ]; + TCHAR szDomain[ 256 ]; + DWORD cbDomain = sizeof( szDomain ) / sizeof( szDomain[0] ); + bool bLocalAccount; + + ZeroMemory( szUser, sizeof( szUser ) ); + ZeroMemory( szDomain, sizeof( szDomain ) ); + + ParseUserAccount( + szDomainUser, sizeof( szDomainUser ) / sizeof ( TCHAR ), + szUser, sizeof( szUser ) / sizeof ( TCHAR ), + szDomain, sizeof( szDomain ) / sizeof ( TCHAR ), + bLocalAccount ); + + // + // try to login as this account + // if there is no domain name specified + // then assume local account + // + if ( bLocalAccount ) + { + _tcscpy( szDomain, TEXT( "." ) ); + + // + // are we on a cluster ? + // + if ( g_uddiComponents.IsClusteredDBInstance() ) + { + DisplayUDDIErrorDialog( hDlg, IDS_WRONGLOGONTYPE, MB_OK | MB_ICONWARNING, GetLastError() ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + } + + BOOL fLogonRights = GrantNetworkLogonRights( szDomainUser ); + if( !fLogonRights ) + { + // + // FIX: 727877: needed error dialog + // + DisplayUDDIErrorDialog( hDlg, IDS_LOGIN_ERROR, MB_OK | MB_ICONWARNING, E_FAIL ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; + } + + HANDLE hToken = NULL; + BOOL bIsGoodLogin = LogonUser( + szUser, + _tcslen( szDomain ) > 0 ? szDomain : NULL, + g_szPwd, + LOGON32_LOGON_INTERACTIVE, + LOGON32_PROVIDER_DEFAULT, + &hToken); + + if( bIsGoodLogin ) + { + HRESULT hr = S_OK; + + Log( _T( "LogonUser succeeded with %s." ), szDomainUser ); + + // + // FIX: 718923: needed to test connectivity with SQL server via impersonation and OLEDB call + // + + // + // If we're not installing MSDE, then a database exists for us to check connectivity. + // + if( !g_uddiComponents.IsInstalling( UDDI_MSDE ) ) + { + // + // Only check this when we're not installing the db components (i.e. off-machine setup) + // + if( !g_uddiComponents.IsInstalling( UDDI_DB ) ) + { + HCURSOR hcrHourglass = LoadCursor( NULL, IDC_WAIT ); + HCURSOR hcrCurr = SetCursor( hcrHourglass ); + + // + // If workgroup account, we need to give AddServiceAccount the workgroup account on the db server. + // Else, just pass the domain account. + // + tstring sServerName; + if( bLocalAccount ) + { + sServerName = g_uddiComponents.GetDBComputerName(); + sServerName += _T( "\\" ); + sServerName += szUser; + } + else + { + sServerName = szDomainUser; + } + + Log( _T( "Before AddServiceAccount for user %s, instance %s." ), sServerName.c_str(), g_uddiComponents.GetFullDBInstanceName() ); + + // + // Add user to service account on db. + // + hr = AddServiceAccount( g_uddiComponents.GetFullDBInstanceName(), sServerName.c_str() ); + + if( SUCCEEDED( hr ) ) + { + if( ImpersonateLoggedOnUser( hToken ) ) + { + Log( _T( "Successfully impersonated user %s\\%s." ), szDomain, szUser); + + TCHAR szVerBuf[ 256 ] = {0}; + size_t cbVerBuf = DIM( szVerBuf ) - 1; + + Log( _T( "Before GetDBSchemaVersion for instance %s." ), g_uddiComponents.GetFullDBInstanceName() ); + + // + // Try connecting to the database with the impersonated user token. + // + hr = GetDBSchemaVersion( g_uddiComponents.GetFullDBInstanceName(), szVerBuf, cbVerBuf ); + + Log( _T( "GetDBSchemaVersion returned %s, HRESULT %x." ), szVerBuf, hr ); + + RevertToSelf(); + } + else + { + // + // Get error from ImpersonateLoggedOnUser + // + hr = GetLastError(); + } + } + else + { + Log( _T( "AddServiceAccount failed, HRESULT %x." ), hr ); + } + + SetCursor( hcrCurr ); + } + } + + CloseHandle( hToken ); + + if( FAILED( hr ) ) + { + Log( _T( "Failed to verify connectivity, putting up error dialog, HRESULT %x" ), hr ); + + // + // not a good login, so raise error dialog and keep focus on this property page + // + DisplayUDDIErrorDialog( hDlg, IDS_LOGIN_ERROR, MB_OK | MB_ICONWARNING, hr ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + + Log( _T( "Put up error dialog, returning." ) ); + + return 1; // to keep the focus on this page + } + } + else + { + Log( _T( "LogonUser failed, %x." ), GetLastError() ); + + // + // not a good login, so raise error dialog and keep focus on this property page + // + DisplayUDDIErrorDialog( hDlg, IDS_LOGIN_ERROR, MB_OK | MB_ICONWARNING, GetLastError() ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + // + // set the property that denotes a domain user login will be used in the iis app pool + // + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "APPPOOL_IDENTITY_TYPE" ), MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER ); + + + // + // the web and installer needs the user name + // + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "WAM_USER_NAME" ), szDomainUser ); + g_uddiComponents.AddProperty( UDDI_WEB, TEXT("WAM_PWD"), g_szPwd ); + + // + // the web installer needs to put the pw into the IIS app pool settings + // + _tcscpy( szRemoteUser, szRemote ); + _tcscat( szRemoteUser, TEXT( "\\" ) ); + _tcscat( szRemoteUser, szUser ); + + if( bLocalAccount ) + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "LCL_USER_NAME" ), szRemoteUser ); + else + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "LCL_USER_NAME" ), szDomainUser ); + } + // + // the user specified the Network Service account + // + else + { + // + // set the property that denotes "Network Service" + // + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "APPPOOL_IDENTITY_TYPE" ), MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE ); + + // + // the web and db installers need the user name + // + TCHAR wszNetworkServiceName[ 512 ]; + DWORD cbSize = 512 * sizeof( TCHAR ); + BOOL b = GetWellKnownAccountName( WinNetworkServiceSid, wszNetworkServiceName, &cbSize ); + if( !b ) + { + Log( _T( "Call to GetNetworkServiceAccountName failed." ) ); + } + else + { + Log( _T( "Network Service account name on this machine = %s" ), wszNetworkServiceName ); + } + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "WAM_USER_NAME" ), wszNetworkServiceName ); + + // + // no need for the pw, so clear out this property + // + g_uddiComponents.DeleteProperty( UDDI_WEB, TEXT( "WAM_PWD" ) ); + + // + // Now also save the SID for the WAM_USER + // + TCHAR szUser[ USERNAME_LEN + 1 ]; + TCHAR szDomain[ 256 ]; + DWORD cbUser = sizeof szUser / sizeof szUser[0]; + DWORD cbDomain = sizeof szDomain / sizeof szDomain[0]; + + if( !GetLocalSidString( WinNetworkServiceSid, szSidStr, cbSidStr ) ) + { + DisplayUDDIErrorDialog( hDlg, IDS_GETSID_ERROR, MB_OK | MB_ICONWARNING, GetLastError() ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + if( !GetRemoteAcctName( szRemote, szSidStr, szUser, &cbUser, szDomain, &cbDomain ) ) + { + DisplayUDDIErrorDialog( hDlg, IDS_GETREMOTEACCT_ERROR, MB_OK | MB_ICONWARNING, GetLastError() ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 1 ); + return 1; // to keep the focus on this page + } + + _tcscpy( szRemoteUser, szDomain ); + _tcscat( szRemoteUser, TEXT( "\\" ) ); + _tcscat( szRemoteUser, szUser ); + + g_uddiComponents.AddProperty( UDDI_WEB, TEXT( "LCL_USER_NAME" ), szRemoteUser ); + } + + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + + case PSN_QUERYCANCEL: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + +//-------------------------------------------------------------------------- + +BOOL CALLBACK ConfirmPasswordDlgProc( + HWND hwndDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + switch( message ) + { + case WM_INITDIALOG: + { + // + // set the limit of the length of the password + // + SendMessage( GetDlgItem( hwndDlg, IDC_CONFIRM_PW ), EM_LIMITTEXT, ( WPARAM ) PASSWORD_LEN, 0 ); + } + break; + + case WM_COMMAND: + switch( LOWORD( wParam ) ) + { + case IDOK: + TCHAR szPW[ PASSWORD_LEN + 1 ]; + GetDlgItemText( hwndDlg, IDC_CONFIRM_PW, szPW, sizeof( szPW ) / sizeof( TCHAR ) ); + + if( 0 != _tcscmp( szPW, g_szPwd ) ) + { + DisplayUDDIErrorDialog( hwndDlg, IDS_PW_MISMATCH ); + ::SetDlgItemText( hwndDlg, IDC_CONFIRM_PW, TEXT( "" ) ); + return TRUE; + } + // fall through... + + case IDCANCEL: + EndDialog( hwndDlg, wParam ); + return TRUE; + } + } + + return FALSE; +} + +//-------------------------------------------------------------------------- + +INT_PTR CALLBACK WizardSummaryDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch( msg ) + { + case WM_INITDIALOG: + { + tstring msg; + TCHAR szMsg[ 2048 ] = { 0 }; + DWORD dwLen = sizeof( szMsg ) / sizeof( TCHAR ) ; + int iStrLen = LoadString( g_hInstance, IDS_WIZARD_SUMMARY_GENERAL, szMsg, dwLen ); + assert( iStrLen ); + + msg = szMsg; + + if( g_uddiComponents.IsInstalling( UDDI_DB ) ) + { + iStrLen = LoadString( g_hInstance, IDS_WIZARD_SUMMARY_DB, szMsg, dwLen ); + assert( iStrLen ); + msg += TEXT( "\n\n" ); + msg += szMsg; + } + + if( g_uddiComponents.IsInstalling( UDDI_WEB ) ) + { + iStrLen = LoadString( g_hInstance, IDS_WIZARD_SUMMARY_WEB, szMsg, dwLen ); + assert( iStrLen ); + msg += TEXT( "\n\n" ); + msg += szMsg; + } + + if( g_uddiComponents.IsInstalling( UDDI_ADMIN ) ) + { + iStrLen = LoadString( g_hInstance, IDS_WIZARD_SUMMARY_ADMIN, szMsg, dwLen ); + assert( iStrLen ); + msg += TEXT( "\n\n" ); + msg += szMsg; + } + + SetWindowText( GetDlgItem( hDlg, IDC_SUMMARY ), msg.c_str() ); + + break; + } + + case WM_COMMAND: + break; + + case WM_NOTIFY: + { + switch( ( ( NMHDR * )lParam )->code ) + { + // + // this is called once when the page is created + // + case PSN_SETACTIVE: + { + g_uddiComponents.UpdateAllInstallLevel(); + if( g_uddiComponents.IsAnyInstalling() ) + { + //PropSheet_SetWizButtons( GetParent( hDlg ), 0 ); + PropSheet_SetWizButtons( GetParent( hDlg ), PSWIZB_NEXT | PSWIZB_BACK ); + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + else + { + return SkipWizardPage( hDlg ); + } + } + + case PSN_KILLACTIVE: + case PSN_WIZBACK: + case PSN_WIZFINISH: + case PSN_QUERYCANCEL: + case PSN_WIZNEXT: + { + SetWindowLongPtr( hDlg, DWLP_MSGRESULT, 0 ); + return 1; + } + } + } + } + + return 0; +} + +//-------------------------------------------------------------------------- + +static void ParseUserAccount( PTCHAR szDomainAndUser, UINT uDomainAndUserSize, PTCHAR szUser, UINT uUserSize, PTCHAR szDomain, UINT uDomainSize, bool &bLocalAccount ) +{ + // + // see if the user picked a local machine account + // + TCHAR szComputerName[ MAX_COMPUTERNAME_LENGTH + 1 ]; + DWORD dwCompNameLen = MAX_COMPUTERNAME_LENGTH + 1; + + szComputerName[ 0 ] = 0x00; + GetComputerName( szComputerName, &dwCompNameLen ); + + bLocalAccount = false; + + // + // this string is in the format \, + // so look for a whack, if found parse out the domain and user name + // + _tcsncpy( szDomain, szDomainAndUser, uDomainSize ); + szDomain[ uDomainSize - 1 ] = NULL; + + PTCHAR pWhack = _tcschr( szDomain, '\\' ); + + // + // a whack was not found, so assume it is a user on the local machine + // + if( NULL == pWhack ) + { + // + // return the user name and a blank domain name + // + _tcsncpy( szUser, szDomainAndUser, uUserSize ); + szUser[ uUserSize - 1 ] = NULL; + + _tcscpy( szDomain, TEXT( "" ) ); + + // + // if the domain or machine was not specified, then + // assume the local machine and prepend it + // + tstring cDomainAndUser = szComputerName; + cDomainAndUser.append( TEXT( "\\" ) ); + cDomainAndUser.append( szUser ); + + _tcsncpy( szDomainAndUser, cDomainAndUser.c_str(), uDomainAndUserSize ); + + bLocalAccount = true; + + return; + } + + // + // null the "whack" and step to the next character + // + *pWhack = NULL; + pWhack++; + + _tcsncpy( szUser, pWhack, uUserSize ); + szUser[ uUserSize - 1 ] = NULL; + + // + // see if the user picked a local machine account. + // if he did pick a local machine account, + // null the domain and return only the login + // + if( 0 == _tcsicmp( szDomain, szComputerName ) ) + { + *szDomain = NULL; + bLocalAccount = true; + } +} + + +//--------------------------------------------------------------------------------------- +// Shows the shell dialog that allows user to browse for a directory +// Returns FALSE if the dialog was cancelled, or TRUE and the chosen directory +// otherwise. The buffer is expected to be at least MAX_PATH character long +// +BOOL ShowBrowseDirDialog( HWND hParent, LPCTSTR szTitle, LPTSTR szOutBuf ) +{ + BOOL bRes = FALSE; + TCHAR szDispName[ MAX_PATH + 1 ]; + + if ( IsBadStringPtr( szOutBuf, MAX_PATH ) ) return FALSE; + + HRESULT hr = ::CoInitialize( NULL ); + if ( FAILED( hr ) ) + return FALSE; + + try + { + BROWSEINFO binfo; + LPITEMIDLIST lpItemID = NULL; + + ZeroMemory ( &binfo, sizeof binfo ); + + SHGetFolderLocation( NULL, CSIDL_DRIVES, NULL, NULL, &lpItemID ); + + binfo.hwndOwner = hParent; + binfo.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_UAHINT | BIF_DONTGOBELOWDOMAIN; + binfo.lpszTitle = szTitle; + binfo.pszDisplayName = szDispName; + binfo.lpfn = BrowseCallbackProc; + binfo.pidlRoot = lpItemID; + + if ( gAllowedClusterDrives.driveCount >= 0 ) + binfo.lParam = (LPARAM) &gAllowedClusterDrives; + else + binfo.lParam = NULL; + + lpItemID = SHBrowseForFolder( &binfo ); + if ( !lpItemID ) + bRes = FALSE; + else + { + bRes = SHGetPathFromIDList( lpItemID, szOutBuf ); + } + } + catch (...) + { + bRes = FALSE; + } + + ::CoUninitialize(); + return bRes; +} + + +int CALLBACK BrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData ) +{ + TCHAR szBuf[ MAX_PATH + 1 ]; + + if ( uMsg == BFFM_SELCHANGED ) + { + TCHAR szDrive[ _MAX_DRIVE + 2 ]; + LPITEMIDLIST lpItemID = (LPITEMIDLIST) lParam; + CLST_ALLOWED_DRIVES *lpAllowedDrives = (CLST_ALLOWED_DRIVES *) lpData; + + BOOL bEnableOK = FALSE; + + if ( SHGetPathFromIDList( lpItemID, szBuf ) ) + { + bEnableOK = TRUE; + try + { + _tsplitpath( szBuf, szDrive, NULL, NULL, NULL ); + size_t iDriveLen = _tcslen( szDrive ); + + _tcscat( szDrive, TEXT( "\\" ) ); + + UINT uiDevType = GetDriveType( szDrive ); + if ( uiDevType != DRIVE_FIXED ) + { + bEnableOK = FALSE; + } + else if ( lpAllowedDrives ) + { + if ( lpAllowedDrives->driveCount > 0 ) + { + szDrive[ iDriveLen ] = 0; // drop the slash + BOOL bFound = FALSE; + + for ( int idx = 0; idx < lpAllowedDrives->driveCount; idx++ ) + { + if ( !_tcsicmp( lpAllowedDrives->drives[ idx ].c_str(), szDrive ) ) + { + bFound = TRUE; + break; + } + } + + bEnableOK = bFound; + } + else if ( lpAllowedDrives->driveCount == 0 ) + { + bEnableOK = FALSE; + } + } + + } + catch (...) + { + } + } + + SendMessage ( hwnd, BFFM_ENABLEOK, 0, bEnableOK ); + } + + return 0; +} + +// +// GetWellKnownAccountName +// +// WELL_KNOWN_SID_TYPE is a system enumeration on Win XP & later, and +// Windows Server 2003 & later. It enumerates the well known SIDs. +// +// Using the functions CreateWellKnownSid, and LookupAccountSid, we +// can retrieve the account name & domain. These functions are locale +// independent. +// +BOOL +GetWellKnownAccountName( WELL_KNOWN_SID_TYPE idSidWellKnown, TCHAR *pwszName, DWORD *pcbSize ) +{ + ENTER(); + + // + // Initialize our output varable. + // + memset( pwszName, 0, *pcbSize ); + + // + // These are used for the call to LookupAccountSid. + // + TCHAR wszUserName[ 512 ]; + DWORD cbUserName = 512 * sizeof( TCHAR ); + TCHAR wszDomainName[ 512 ]; + DWORD cbDomainName = 512 * sizeof( TCHAR ); + + memset( wszUserName, 0, cbUserName ); + memset( wszDomainName, 0, cbDomainName ); + + // + // Try to allocate a buffer for the SID. + // + DWORD cbMaxSid = SECURITY_MAX_SID_SIZE; + PSID psidWellKnown = LocalAlloc( LMEM_FIXED, cbMaxSid ); + if( NULL == psidWellKnown ) + { + Log( _T( "Call to LocalAlloc failed." ) ); + return FALSE; + } + + // + // Create the SID. + // + BOOL b = CreateWellKnownSid( idSidWellKnown, NULL, psidWellKnown, &cbMaxSid ); + if( !b ) + { + Log( _T( "Call to CreateWellKnownSid failed." ) ); + LocalFree( psidWellKnown ); + return FALSE; + } + + // + // Use the SID to determine the user name & domain name. + // + // For example, for idSidWellKnown = WinNetworkServiceSid, + // wszDomainName = "NT AUTHORITY" + // wszUserName = "NETWORK SERVICE" + // + SID_NAME_USE snu; + b = LookupAccountSid( NULL, psidWellKnown, wszUserName, &cbUserName, wszDomainName, &cbDomainName, &snu ); + LocalFree( psidWellKnown ); + if( !b ) + { + Log( _T( "Call to LookupAccountSid failed." ) ); + return FALSE; + } + else + { + Log( _T( "LookupAccountSid succeeded! domain name = %s, account name = %s" ), wszDomainName, wszUserName ); + _tcsncat( pwszName, wszDomainName, *pcbSize ); + _tcsncat( pwszName, _T( "\\" ), *pcbSize ); + _tcsncat( pwszName, wszUserName, *pcbSize ); + + *pcbSize = _tcslen( pwszName ) * sizeof( TCHAR ); + return TRUE; + } +} + + +BOOL +GrantNetworkLogonRights( LPCTSTR pwszUser ) +{ + // + // 1. Check our params. + // + if( NULL == pwszUser ) + { + Log( _T( "NULL specified as domain user to function: GrantNetworkLogonRights. Returning FALSE." ) ); + return FALSE; + } + + TCHAR wszUser[ 1024 ]; + memset( wszUser, 0, 1024 * sizeof( TCHAR ) ); + + // + // If the user account is a local account, it will be prefixed + // with ".\" For example: ".\Administrator". + // + // For some reason, LookupAccountName (which we rely on just below) wants + // local accounts not to be prefixed with ".\". + // + if( 0 == _tcsnicmp( _T( ".\\" ), pwszUser, 2 ) ) + { + _tcsncpy( wszUser, &pwszUser[ 2 ], _tcslen( pwszUser ) - 2 ); + } + else + { + _tcsncpy( wszUser, pwszUser, _tcslen( pwszUser ) ); + } + + Log( _T( "Account we will attempt to grant network logon rights = %s." ), wszUser ); + + + // + // 2. Get the SID of the specified user. + // + PSID pUserSID = NULL; + DWORD cbUserSID = SECURITY_MAX_SID_SIZE; + TCHAR wszDomain[ 1024 ]; + DWORD cbDomain = 1024 * sizeof( TCHAR ); + SID_NAME_USE pUse; + + pUserSID = LocalAlloc( LMEM_FIXED, cbUserSID ); + if( NULL == pUserSID ) + { + Log( _T( "Call to LocalAlloc failed." ) ); + return FALSE; + } + memset( pUserSID, 0, cbUserSID ); + + BOOL fAPISuccess = LookupAccountName( NULL, wszUser, pUserSID, &cbUserSID, wszDomain, &cbDomain, &pUse ); + + if( !fAPISuccess ) + { + Log( _T( "Call to LookupAccountName failed for user: %s." ), wszUser ); + LocalFree( pUserSID ); + return FALSE; + } + else + { + Log( _T( "Call to LookupAccountName succeeded for user: %s." ), wszUser ); + } + + // + // 3. Get a handle to Policy Object. + // + LSA_UNICODE_STRING lusMachineName; + lusMachineName.Length = 0; + lusMachineName.MaximumLength = 0; + lusMachineName.Buffer = NULL; + + LSA_OBJECT_ATTRIBUTES loaObjAttrs; + memset( &loaObjAttrs, 0, sizeof( LSA_OBJECT_ATTRIBUTES ) ); + + ACCESS_MASK accessMask = POLICY_LOOKUP_NAMES | POLICY_CREATE_ACCOUNT; + + LSA_HANDLE lhPolicy = NULL; + + NTSTATUS status = LsaOpenPolicy( &lusMachineName, &loaObjAttrs, accessMask, &lhPolicy ); + if( STATUS_SUCCESS != status ) + { + Log( _T( "Call to LsaOpenPolicy failed." ) ); + LocalFree( pUserSID ); + return FALSE; + } + else + { + Log( _T( "Call to LsaOpenPolicy succeeded." ) ); + } + + // + // 4. Check & see if the user already has the account rights they need. + // + PLSA_UNICODE_STRING plusRights = NULL; + ULONG ulRightsCount = 0; + BOOL fHasNetworkLogonRights = FALSE; + + status = LsaEnumerateAccountRights( lhPolicy, pUserSID, &plusRights, &ulRightsCount ); + if( STATUS_SUCCESS == status ) + { + for( ULONG i = 0; i < ulRightsCount; i++ ) + { + if( 0 == wcscmp( plusRights[ i ].Buffer, SE_NETWORK_LOGON_NAME ) ) + { + fHasNetworkLogonRights = TRUE; + Log( _T( "User account: %s already has network logon rights." ), wszUser ); + break; + } + } + + LsaFreeMemory( plusRights ); + } + else + { + fHasNetworkLogonRights = FALSE; + } + + // + // 5. If we need to add account rights, then add them. + // + BOOL fRet = FALSE; + if( !fHasNetworkLogonRights ) + { + WCHAR wszNetworkLogon[] = L"SeNetworkLogonRight"; + int iLen = wcslen( wszNetworkLogon ); + + LSA_UNICODE_STRING lusNetworkLogon; + lusNetworkLogon.Length = iLen * sizeof( WCHAR ); + lusNetworkLogon.MaximumLength = ( iLen + 1 ) * sizeof( WCHAR ); + lusNetworkLogon.Buffer = wszNetworkLogon; + + status = LsaAddAccountRights( lhPolicy, pUserSID, &lusNetworkLogon, 1 ); + if( STATUS_SUCCESS == status ) + { + Log( _T( "User account: %s now has network logon rights." ), wszUser ); + fRet = TRUE; + } + else + { + Log( _T( "Attempt to grant user account: %s logon rights failed." ), wszUser ); + fRet = FALSE; + } + } + else + { + fRet = TRUE; + } + + LocalFree( pUserSID ); + LsaClose( lhPolicy ); + + return fRet; +} diff --git a/inetsrv/uddi/source/setup/ocmtestmsi/ocmtestmsi.vdproj b/inetsrv/uddi/source/setup/ocmtestmsi/ocmtestmsi.vdproj new file mode 100644 index 0000000..2754b27 --- /dev/null +++ b/inetsrv/uddi/source/setup/ocmtestmsi/ocmtestmsi.vdproj @@ -0,0 +1,788 @@ +"DeployProject" +{ +"VSVersion" = "3:700" +"ProjectType" = "8:{5443560c-dbb4-11d2-8724-00a0c9a8b90c}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:ocmtestmsi" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_0288447088760000FDB0271777C63F08" + "OwnerKey" = "8:_7B91057F52B842BA9D0D06C312A48D8A" + "MsmSig" = "8:C:\\WINDOWS\\SYSTEM32\\MSI.DLL" + } + "Entry" + { + "MsmKey" = "8:_16B084CEE03B4F4B8476DBFEF46FCB42" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\IMAGES\\SETUP.ICO" + } + "Entry" + { + "MsmKey" = "8:_35E4C4726E414A67B1DC0FB084D60F1F" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\SETUP\\OCM\\MISC\\UNATTEND.TXT" + } + "Entry" + { + "MsmKey" = "8:_58DF96C9C8504215ADFABF6368AB4452" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\SETUP\\OCM\\MISC\\SYSOC.INF" + } + "Entry" + { + "MsmKey" = "8:_7B91057F52B842BA9D0D06C312A48D8A" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\SETUP\\OCM\\DEBUG\\UDDIOCM.DLL" + } + "Entry" + { + "MsmKey" = "8:_9D71BA083C69459E94021AC0D19A1B35" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\SETUP\\OCM\\MISC\\UDDI.INF" + } + "Entry" + { + "MsmKey" = "8:_A29BABD9C52940C04071A72683FA76CC" + "OwnerKey" = "8:_7B91057F52B842BA9D0D06C312A48D8A" + "MsmSig" = "8:C:\\WINDOWS\\SYSTEM32\\SECUR32.DLL" + } + "Entry" + { + "MsmKey" = "8:_B044B737298F491BA6743FA9261088E3" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\SETUP\\OCM\\MISC\\SYSOCMGR.EXE" + } + "Entry" + { + "MsmKey" = "8:_BE7931FA0E3395D03BB9FEBF1CED6680" + "OwnerKey" = "8:_7B91057F52B842BA9D0D06C312A48D8A" + "MsmSig" = "8:C:\\WINDOWS\\SYSTEM32\\SETUPAPI.DLL" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\ocmtestmsi.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:1" + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\ocmtestmsi.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:1" + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "Feature" + { + } + "File" + { + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_0288447088760000FDB0271777C63F08" + { + "Signature" = "8:20000000a816a7f8ba2dc1019c7f0b5b53a4c10100207c22cb2bc1010000000000341f0000000000000000006d00730069002e0064006c006c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "SourcePath" = "8:msi.dll" + "TargetName" = "8:msi.dll" + "Tag" = "8:" + "Folder" = "8:_89B8DCC372B148DCB346623E4FEC6664" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_16B084CEE03B4F4B8476DBFEF46FCB42" + { + "SourcePath" = "8:..\\..\\..\\images\\setup.ico" + "TargetName" = "8:setup.ico" + "Tag" = "8:" + "Folder" = "8:_A5D700EDC5E64A56A97D462D97F37E86" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_35E4C4726E414A67B1DC0FB084D60F1F" + { + "SourcePath" = "8:..\\ocm\\misc\\unattend.txt" + "TargetName" = "8:unattend.txt" + "Tag" = "8:" + "Folder" = "8:_A5D700EDC5E64A56A97D462D97F37E86" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_58DF96C9C8504215ADFABF6368AB4452" + { + "SourcePath" = "8:..\\ocm\\misc\\sysoc.inf" + "TargetName" = "8:sysoctest.inf" + "Tag" = "8:" + "Folder" = "8:_8ECA0978D6CE41C487414F48AF6143F2" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_9D71BA083C69459E94021AC0D19A1B35" + { + "SourcePath" = "8:..\\ocm\\misc\\uddi.inf" + "TargetName" = "8:udditest.inf" + "Tag" = "8:" + "Folder" = "8:_8ECA0978D6CE41C487414F48AF6143F2" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_A29BABD9C52940C04071A72683FA76CC" + { + "Signature" = "8:2000000068e75568bb2dc1010c4f5a7f5da4c10100207c22cb2bc1010000000000cc0000000000000000000073006500630075007200330032002e0064006c006c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "SourcePath" = "8:Secur32.dll" + "TargetName" = "8:Secur32.dll" + "Tag" = "8:" + "Folder" = "8:_89B8DCC372B148DCB346623E4FEC6664" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_B044B737298F491BA6743FA9261088E3" + { + "SourcePath" = "8:..\\ocm\\misc\\sysocmgr.exe" + "TargetName" = "8:sysocmgr.exe" + "Tag" = "8:" + "Folder" = "8:_68B477575CD44BBA9BE542A2CE29866F" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_BE7931FA0E3395D03BB9FEBF1CED6680" + { + "Signature" = "8:2000000088fe166bbb2dc101fcfbfe5853a4c10100207c22cb2bc1010000000000140e000000000000000000730065007400750070006100700069002e0064006c006c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "SourcePath" = "8:SETUPAPI.dll" + "TargetName" = "8:SETUPAPI.dll" + "Tag" = "8:" + "Folder" = "8:_89B8DCC372B148DCB346623E4FEC6664" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{777C097F-0ED8-11D3-8D6C-00A0C9CFCEE6}:_403013A69EBE4BF5A445556140EEFEFC" + { + "Name" = "8:#1924" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:WindowsFolder" + "Folders" + { + "{461E96AF-1495-11D3-8D6C-00A0C9CFCEE6}:_8ECA0978D6CE41C487414F48AF6143F2" + { + "Name" = "8:inf" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_E31CE5D4ECA244E79D3E0F3D6A9161A4" + "Folders" + { + } + } + } + } + "{777C097F-0ED8-11D3-8D6C-00A0C9CFCEE6}:_41C9F10B14694E2F8B87196EE7AE7114" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + "{777C097F-0ED8-11D3-8D6C-00A0C9CFCEE6}:_68B477575CD44BBA9BE542A2CE29866F" + { + "Name" = "8:#1914" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:SystemFolder" + "Folders" + { + "{461E96AF-1495-11D3-8D6C-00A0C9CFCEE6}:_89B8DCC372B148DCB346623E4FEC6664" + { + "Name" = "8:Setup" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_37AFA5157048406F8559E12CA2CC2F9D" + "Folders" + { + } + } + } + } + "{EE62640D-12F2-11D3-8D6C-00A0C9CFCEE6}:_A5D700EDC5E64A56A97D462D97F37E86" + { + "DefaultLocation" = "8:[ProgramFilesFolder]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "Shortcut" + { + "{D0C99CFE-1238-11D3-8E00-00C04F6837D0}:_C4988F79DA0447E08B2A9AABE94D6F19" + { + "Name" = "8:Unattend UDDI OCM" + "Arguments" = "8:/i:%windir%\\inf\\sysoctest.inf /u:\"[TARGETDIR]unattend.txt\"" + "Description" = "8:Attempt to install UDDI in Ocm unattend mode" + "ShowCmd" = "3:1" + "IconIndex" = "3:0" + "Transitive" = "11:FALSE" + "Target" = "8:_B044B737298F491BA6743FA9261088E3" + "Folder" = "8:_41C9F10B14694E2F8B87196EE7AE7114" + "WorkingFolder" = "8:_A5D700EDC5E64A56A97D462D97F37E86" + "Icon" = "8:_16B084CEE03B4F4B8476DBFEF46FCB42" + "Feature" = "8:" + } + "{D0C99CFE-1238-11D3-8E00-00C04F6837D0}:_C8B5547A38494E1E8CE6204CD5AAB76F" + { + "Name" = "8:UDDI OCM" + "Arguments" = "8:/i:%windir%\\inf\\sysoctest.inf" + "Description" = "8:" + "ShowCmd" = "3:1" + "IconIndex" = "3:0" + "Transitive" = "11:FALSE" + "Target" = "8:_B044B737298F491BA6743FA9261088E3" + "Folder" = "8:_41C9F10B14694E2F8B87196EE7AE7114" + "WorkingFolder" = "8:_68B477575CD44BBA9BE542A2CE29866F" + "Icon" = "8:_16B084CEE03B4F4B8476DBFEF46FCB42" + "Feature" = "8:" + } + } + "Sequences" + { + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_794C261364884256ADE2D90AA17F6348" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_56D543939D634A18B1462A853314A52F" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_2A170BEB9A6A418686AF7737C80C37B5" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_0407A42B196B48488E308C5EFFCCD3D7" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "ProjectOutput" + { + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_7B91057F52B842BA9D0D06C312A48D8A" + { + "SourcePath" = "8:..\\ocm\\Debug\\uddiocm1.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_89B8DCC372B148DCB346623E4FEC6664" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:ocm\\ocm.vcproj" + "OutputProjectGuid" = "8:{65F02C2E-479D-415E-BF3B-FBFAADEB22A4}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:UDDI OCM Tester" + "ProductCode" = "8:{15A0D505-5B15-44E1-9D33-2B9AA1252FA5}" + "PackageCode" = "8:{33F65987-68E4-4C5E-A2B1-D2F3AA94749C}" + "UpgradeCode" = "8:{A1FBBE77-BB3F-4737-BE44-AFC199237728}" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:TRUE" + "DetectNewerInstalledVersion" = "11:TRUE" + "ProductVersion" = "8:2.0.0" + "Manufacturer" = "8:Microsoft" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:UDDI OCM Tester" + "Subject" = "8:" + "ARPCONTACT" = "8:MS" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:_16B084CEE03B4F4B8476DBFEF46FCB42" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + } + "MsiBootstrapper" + { + "LangId" = "3:1033" + } + "MergeModule" + { + } + "UserInterface" + { + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_3CC7F8DD3C4446F58500DB095A4BC4BF" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_C5AFFE794F204075AF427A7F8BE75B01" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "ModuleSignature" = "8:VsdDialogs.EE9A1AFA_41DD_4514_B727_DF0ACA1D7389" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_7195AF11F6C44583B9353B442714B287" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_A3365F0BC7F94EE9967F5EA000BFA051" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "ModuleSignature" = "8:VsdDialogs.6DBC9783_3677_4D68_8BF5_D749558A0AC1" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{E4ECAB26-4AB7-11D3-8D78-00A0C9CFCEE6}:_845E947C27564D49A799703F2BA4FCCD" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + "ModuleSignature" = "8:VsdUserInterface.524F4245_5254_5341_4C45_534153783400" + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_85D03221BE954FD0900FA3D7A2D943B3" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_A938AF49CAF44D51AEA3F27E1ECE8B74" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "ModuleSignature" = "8:VsdDialogs.FA58E60A_A1E8_4876_95FC_2AC3B5AAA5F8" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_B9F1FED9B48347FB8284FC42D939305A" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_9313F41BA452467E8FE97277FB6FB05D" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "ModuleSignature" = "8:VsdDialogs.1DB77F5A_BA5C_4470_89B6_0B0EC07E3A10" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_BF9A5C54A1444D50AF1634F8148788C5" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_7FECAC2DDCCA4CDDA8632CAADE4C9CFA" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "ModuleSignature" = "8:VsdDialogs.83D22742_1B79_46f6_9A99_DF0F2BD4C077" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_D468BCDED5434DE8943A8E76C7698511" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_C695454E35F84BE2A36EFE786224C97F" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "ModuleSignature" = "8:VsdDialogs.4FB12620_0D15_42D0_8677_2766FFA6923F" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{E4ECAB26-4AB7-11D3-8D78-00A0C9CFCEE6}:_E634D2A9E0064C3EA1B22E7E56B0134A" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + "ModuleSignature" = "8:VsdDialogs.CE4B864F_F1C1_4B85_98D4_2A2BF5FFB12B" + } + } + } +} diff --git a/inetsrv/uddi/source/setup/replication.sln b/inetsrv/uddi/source/setup/replication.sln new file mode 100644 index 0000000..f731d58 --- /dev/null +++ b/inetsrv/uddi/source/setup/replication.sln @@ -0,0 +1,65 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "..\api\api.csproj", "{11742B5A-F929-4DA7-8378-F82AB3B69491}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "config", "..\tools\config\config.csproj", "{98461AFB-A08D-477B-A982-EEC643F04902}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "core", "..\core\core.csproj", "{C792705F-C4F9-41F7-AE03-B9C87FAD9151}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "operator", "..\operator\operator.csproj", "{D6075C1E-793D-4AAC-8E9F-D6765A013C9E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "replicate", "..\replicate\replicate.csproj", "{864978F9-A5AA-4F39-BA06-CC2A66949D33}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rcf", "..\tools\rcf\rcf.csproj", "{FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "replicationmsi", "replicationmsi\replicationmsi.vdproj", "{5F1ABFDA-1CF9-441E-946C-6B17D741002F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "monitor", "..\tools\monitor\monitor.csproj", "{C79124C5-432B-4CAD-A3D2-A88127E56519}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.0 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {11742B5A-F929-4DA7-8378-F82AB3B69491}.1 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.ActiveCfg = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.Build.0 = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.Build.0 = Release|.NET + {98461AFB-A08D-477B-A982-EEC643F04902}.Debug.ActiveCfg = Debug|.NET + {98461AFB-A08D-477B-A982-EEC643F04902}.Debug.Build.0 = Debug|.NET + {98461AFB-A08D-477B-A982-EEC643F04902}.Release.ActiveCfg = Release|.NET + {98461AFB-A08D-477B-A982-EEC643F04902}.Release.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.ActiveCfg = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.Build.0 = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug.ActiveCfg = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug.Build.0 = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release.Build.0 = Release|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Debug.ActiveCfg = Debug|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Debug.Build.0 = Debug|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Release.ActiveCfg = Release|.NET + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Release.Build.0 = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Debug.ActiveCfg = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Debug.Build.0 = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Release.ActiveCfg = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Release.Build.0 = Release|.NET + {5F1ABFDA-1CF9-441E-946C-6B17D741002F}.Debug.ActiveCfg = Debug + {5F1ABFDA-1CF9-441E-946C-6B17D741002F}.Debug.Build.0 = Debug + {5F1ABFDA-1CF9-441E-946C-6B17D741002F}.Release.ActiveCfg = Release + {5F1ABFDA-1CF9-441E-946C-6B17D741002F}.Release.Build.0 = Release + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Debug.ActiveCfg = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Debug.Build.0 = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Release.ActiveCfg = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/inetsrv/uddi/source/setup/replicationmsi/replicationmsi.vdproj b/inetsrv/uddi/source/setup/replicationmsi/replicationmsi.vdproj new file mode 100644 index 0000000..bc626f6 --- /dev/null +++ b/inetsrv/uddi/source/setup/replicationmsi/replicationmsi.vdproj @@ -0,0 +1,1128 @@ +"DeployProject" +{ +"VSVersion" = "3:700" +"ProjectType" = "8:{5443560c-dbb4-11d2-8724-00a0c9a8b90c}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:replicationmsi" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_026A13EC217245608353E768FC2E129A" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\TOOLS\\RCF\\OBJ\\DEBUG\\RCF.EXE" + } + "Entry" + { + "MsmKey" = "8:_14F73A3CF1EC441682285F570E28345C" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\CONTENT\\UDDI.MICROSOFT.COM\\WEBROOT\\OPERATOR\\OPERATOR.ASMX" + } + "Entry" + { + "MsmKey" = "8:_18264D55857E4466B1D54CD9CE16F090" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:uddi.api_a309b9d84b80420558ad082336cd8382" + } + "Entry" + { + "MsmKey" = "8:_40C6F51AEB3447949D7B6707D5C2C7B5" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:uddi.operatorc:\\dev\\uddi\\main\\source\\operator\\obj\\debug\\uddi.operator.dll" + } + "Entry" + { + "MsmKey" = "8:_4AA38452BAFC4A3EA0F759964E163AFD" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\REPLICATE\\OBJ\\DEBUG\\REPLICATE.EXE" + } + "Entry" + { + "MsmKey" = "8:_596DBE93ECAA4D6D977B0D1D3D07441B" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:uddi.core_8ecfd8632307055098a9bb634c16f273" + } + "Entry" + { + "MsmKey" = "8:_6B6664BD5DFF980A8F3A96BD502CBE0C" + "OwnerKey" = "8:_18264D55857E4466B1D54CD9CE16F090" + "MsmSig" = "8:passportlib_5199ea76a7acd4c7584f1fe34776ef46" + } + "Entry" + { + "MsmKey" = "8:_6B6664BD5DFF980A8F3A96BD502CBE0C" + "OwnerKey" = "8:_6E83B0137D264EC98EFBA5A42244BE1D" + "MsmSig" = "8:passportlib_5199ea76a7acd4c7584f1fe34776ef46" + } + "Entry" + { + "MsmKey" = "8:_6B6664BD5DFF980A8F3A96BD502CBE0C" + "OwnerKey" = "8:_FE14371615FD4111A86DD0D5659C4E07" + "MsmSig" = "8:passportlib_5199ea76a7acd4c7584f1fe34776ef46" + } + "Entry" + { + "MsmKey" = "8:_6B6664BD5DFF980A8F3A96BD502CBE0C" + "OwnerKey" = "8:_4AA38452BAFC4A3EA0F759964E163AFD" + "MsmSig" = "8:passportlib_5199ea76a7acd4c7584f1fe34776ef46" + } + "Entry" + { + "MsmKey" = "8:_6B6664BD5DFF980A8F3A96BD502CBE0C" + "OwnerKey" = "8:_40C6F51AEB3447949D7B6707D5C2C7B5" + "MsmSig" = "8:passportlib_5199ea76a7acd4c7584f1fe34776ef46" + } + "Entry" + { + "MsmKey" = "8:_6B6664BD5DFF980A8F3A96BD502CBE0C" + "OwnerKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "MsmSig" = "8:passportlib_5199ea76a7acd4c7584f1fe34776ef46" + } + "Entry" + { + "MsmKey" = "8:_6E83B0137D264EC98EFBA5A42244BE1D" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:C:\\DEV\\UDDI\\MAIN\\SOURCE\\TOOLS\\MONITOR\\OBJ\\RELEASE\\MONITOR.EXE" + } + "Entry" + { + "MsmKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "OwnerKey" = "8:_40C6F51AEB3447949D7B6707D5C2C7B5" + "MsmSig" = "8:uddi.api_2f7e2b5a16d4b3779dc5b29df042c139" + } + "Entry" + { + "MsmKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "OwnerKey" = "8:_6E83B0137D264EC98EFBA5A42244BE1D" + "MsmSig" = "8:uddi.api_2f7e2b5a16d4b3779dc5b29df042c139" + } + "Entry" + { + "MsmKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "OwnerKey" = "8:_FE14371615FD4111A86DD0D5659C4E07" + "MsmSig" = "8:uddi.api_2f7e2b5a16d4b3779dc5b29df042c139" + } + "Entry" + { + "MsmKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "OwnerKey" = "8:_AD3A13B568FC93E4FB4A386313BC4BE1" + "MsmSig" = "8:uddi.api_2f7e2b5a16d4b3779dc5b29df042c139" + } + "Entry" + { + "MsmKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "OwnerKey" = "8:_4AA38452BAFC4A3EA0F759964E163AFD" + "MsmSig" = "8:uddi.api_2f7e2b5a16d4b3779dc5b29df042c139" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_6E83B0137D264EC98EFBA5A42244BE1D" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_FE14371615FD4111A86DD0D5659C4E07" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_596DBE93ECAA4D6D977B0D1D3D07441B" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_4AA38452BAFC4A3EA0F759964E163AFD" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_AD3A13B568FC93E4FB4A386313BC4BE1" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_40C6F51AEB3447949D7B6707D5C2C7B5" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_18264D55857E4466B1D54CD9CE16F090" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_A5998E997E9B478FB579FC1C2188CFE1" + "OwnerKey" = "8:_026A13EC217245608353E768FC2E129A" + "MsmSig" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + } + "Entry" + { + "MsmKey" = "8:_AD3A13B568FC93E4FB4A386313BC4BE1" + "OwnerKey" = "8:_4AA38452BAFC4A3EA0F759964E163AFD" + "MsmSig" = "8:uddi.operatorc:\\dev\\uddi\\main\\source\\operator\\obj\\release\\uddi.operator.dll" + } + "Entry" + { + "MsmKey" = "8:_AD3A13B568FC93E4FB4A386313BC4BE1" + "OwnerKey" = "8:_6E83B0137D264EC98EFBA5A42244BE1D" + "MsmSig" = "8:uddi.operatorc:\\dev\\uddi\\main\\source\\operator\\obj\\release\\uddi.operator.dll" + } + "Entry" + { + "MsmKey" = "8:_FE14371615FD4111A86DD0D5659C4E07" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:uddi.operatorc:\\dev\\uddi\\main\\source\\operator\\obj\\debug\\uddi.operator.dll" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_026A13EC217245608353E768FC2E129A" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_6E83B0137D264EC98EFBA5A42244BE1D" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_FE14371615FD4111A86DD0D5659C4E07" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_AD3A13B568FC93E4FB4A386313BC4BE1" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_4AA38452BAFC4A3EA0F759964E163AFD" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_40C6F51AEB3447949D7B6707D5C2C7B5" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_89185E0AB733A875A21AB83D69BAD134" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + "Entry" + { + "MsmKey" = "8:_FE78A1465FDD10A14BFEB4D547B9F7AB" + "OwnerKey" = "8:_18264D55857E4466B1D54CD9CE16F090" + "MsmSig" = "8:uddi.core_00c82bd5411f77fa64ae21d8e375b684" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\replicationmsi.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:3" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:1" + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\replicationmsi.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:3" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:1" + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "Feature" + { + } + "File" + { + "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_14F73A3CF1EC441682285F570E28345C" + { + "SourcePath" = "8:..\\..\\..\\content\\uddi.microsoft.com\\webroot\\operator\\operator.asmx" + "TargetName" = "8:operator.asmx" + "Tag" = "8:" + "Folder" = "8:_9B45B2605DE7449CA694C35C4DCACCD9" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{C7BF5952-4B9D-11D3-8E24-00C04F6837D0}:_6B6664BD5DFF980A8F3A96BD502CBE0C" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:PassportLib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8f2407ee28f6d866" + "ScatterAssemblies" + { + "_6B6664BD5DFF980A8F3A96BD502CBE0C" + { + "Name" = "8:PassportLib.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:PassportLib.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_E9F7ACF68C4349628651B51A9BCBC86C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{C7BF5952-4B9D-11D3-8E24-00C04F6837D0}:_89185E0AB733A875A21AB83D69BAD134" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:uddi.api, Version=2.0.2332.1, Culture=neutral, PublicKeyToken=37bb3771bd87f6a6" + "ScatterAssemblies" + { + "_89185E0AB733A875A21AB83D69BAD134" + { + "Name" = "8:uddi.api.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:uddi.api.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_E9F7ACF68C4349628651B51A9BCBC86C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{C7BF5952-4B9D-11D3-8E24-00C04F6837D0}:_AD3A13B568FC93E4FB4A386313BC4BE1" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:uddi.operator, Version=2.0.2332.1, Culture=neutral" + "ScatterAssemblies" + { + "_AD3A13B568FC93E4FB4A386313BC4BE1" + { + "Name" = "8:uddi.operator.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:uddi.operator.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_52F4010FC0144B34B15BBD6E3CEE54F8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{C7BF5952-4B9D-11D3-8E24-00C04F6837D0}:_FE78A1465FDD10A14BFEB4D547B9F7AB" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:uddi.core, Version=2.0.2332.1, Culture=neutral, PublicKeyToken=fdc55eb20e0dd137" + "ScatterAssemblies" + { + "_FE78A1465FDD10A14BFEB4D547B9F7AB" + { + "Name" = "8:uddi.core.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:uddi.core.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_E9F7ACF68C4349628651B51A9BCBC86C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{EE62640D-12F2-11D3-8D6C-00A0C9CFCEE6}:_4AB5F74AFA59489FB06DFFE5975D190F" + { + "DefaultLocation" = "8:[WindowsVolume]InetPub\\uddi" + "Name" = "8:#1925" + "AlwaysCreate" = "11:TRUE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + "{461E96AF-1495-11D3-8D6C-00A0C9CFCEE6}:_345FEE1E90754442A43F2849B80D8D96" + { + "Name" = "8:webroot" + "AlwaysCreate" = "11:TRUE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_098B43CD11D24416BAA8E755EAD306CC" + "Folders" + { + "{461E96AF-1495-11D3-8D6C-00A0C9CFCEE6}:_9B45B2605DE7449CA694C35C4DCACCD9" + { + "Name" = "8:operator" + "AlwaysCreate" = "11:TRUE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_E0B24A16377640E797543F7327A51F44" + "Folders" + { + "{461E96AF-1495-11D3-8D6C-00A0C9CFCEE6}:_E9F7ACF68C4349628651B51A9BCBC86C" + { + "Name" = "8:bin" + "AlwaysCreate" = "11:TRUE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_3AAB50BD656943D58AE3CD823FB84315" + "Folders" + { + } + } + } + } + } + } + "{461E96AF-1495-11D3-8D6C-00A0C9CFCEE6}:_52F4010FC0144B34B15BBD6E3CEE54F8" + { + "Name" = "8:bin" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_09822D99B1F94CF1AA831A25E9499A85" + "Folders" + { + } + } + } + } + } + "LaunchCondition" + { + "{B26CFB94-18E3-45BF-8D42-933BDAF5E76C}:_5883881E88D84673AB12EBE356677ACF" + { + "Name" = "8:MsiNetAssemblySupport" + "Condition" = "8:MsiNetAssemblySupport" + "Message" = "8:[VSDNETMSG]" + } + } + "Locator" + { + } + "Shortcut" + { + } + "Sequences" + { + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_9A66D4FCD88D4CD088C0EA51DAD9BAE2" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_C0B70E441A8440B98CCFD2F6B62F71F2" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_F8C64CB0774D4D15AD3867478DD455EA" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_81255A434B1F41AB8DF9371740EECEDB" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "ProjectOutput" + { + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_026A13EC217245608353E768FC2E129A" + { + "SourcePath" = "8:..\\..\\tools\\rcf\\obj\\Release\\rcf.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_52F4010FC0144B34B15BBD6E3CEE54F8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:..\\tools\\rcf\\rcf.csproj" + "OutputProjectGuid" = "8:{FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_18264D55857E4466B1D54CD9CE16F090" + { + "SourcePath" = "8:..\\..\\api\\obj\\Release\\uddi.api.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_E9F7ACF68C4349628651B51A9BCBC86C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:..\\api\\api.csproj" + "OutputProjectGuid" = "8:{11742B5A-F929-4DA7-8378-F82AB3B69491}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_40C6F51AEB3447949D7B6707D5C2C7B5" + { + "SourcePath" = "8:..\\..\\operator\\obj\\Release\\uddi.operator.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_52F4010FC0144B34B15BBD6E3CEE54F8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:..\\operator\\operator.csproj" + "OutputProjectGuid" = "8:{D6075C1E-793D-4AAC-8E9F-D6765A013C9E}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_4AA38452BAFC4A3EA0F759964E163AFD" + { + "SourcePath" = "8:..\\..\\replicate\\obj\\Release\\replicate.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_52F4010FC0144B34B15BBD6E3CEE54F8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:..\\replicate\\replicate.csproj" + "OutputProjectGuid" = "8:{864978F9-A5AA-4F39-BA06-CC2A66949D33}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_596DBE93ECAA4D6D977B0D1D3D07441B" + { + "SourcePath" = "8:..\\..\\core\\obj\\Release\\uddi.core.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_E9F7ACF68C4349628651B51A9BCBC86C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:..\\core\\core.csproj" + "OutputProjectGuid" = "8:{C792705F-C4F9-41F7-AE03-B9C87FAD9151}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_6E83B0137D264EC98EFBA5A42244BE1D" + { + "SourcePath" = "8:..\\..\\tools\\monitor\\obj\\Release\\monitor.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_52F4010FC0144B34B15BBD6E3CEE54F8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:..\\tools\\monitor\\monitor.csproj" + "OutputProjectGuid" = "8:{C79124C5-432B-4CAD-A3D2-A88127E56519}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_FE14371615FD4111A86DD0D5659C4E07" + { + "SourcePath" = "8:..\\..\\operator\\obj\\Release\\uddi.operator.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_E9F7ACF68C4349628651B51A9BCBC86C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectCanonicalName" = "8:..\\operator\\operator.csproj" + "OutputProjectGuid" = "8:{D6075C1E-793D-4AAC-8E9F-D6765A013C9E}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:UDDI Replication Components" + "ProductCode" = "8:{922C5F5B-BFBD-4D56-A3F2-5488B99DDD64}" + "PackageCode" = "8:{18B29126-0F9E-4419-B129-BE55AD75F658}" + "UpgradeCode" = "8:{FBF88DFB-E414-400E-82EE-5FD9741CD817}" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:TRUE" + "DetectNewerInstalledVersion" = "11:TRUE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:MS" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:UDDI Replication Components" + "Subject" = "8:" + "ARPCONTACT" = "8:Microsoft Corporation" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:UDDI Replication Components" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + } + "MsiBootstrapper" + { + "LangId" = "3:1033" + } + "MergeModule" + { + "{AC8774A4-3E09-11D3-8E14-00C04F6837D0}:_A5998E997E9B478FB579FC1C2188CFE1" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:TRUE" + "SourcePath" = "8:dotnetfxredist_x86_enu.msm" + "ModuleSignature" = "8:mondo.E4183BB4_18A8_11D5_A549_0090278A1BB8" + "Properties" + { + } + "LanguageId" = "3:1033" + "Exclude" = "11:TRUE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + } + "UserInterface" + { + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_210FD031BCB44502BB60350F280C45EF" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_CC3E5090786C467AA6FE93E7ECC77087" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "ModuleSignature" = "8:VsdDialogs.1DB77F5A_BA5C_4470_89B6_0B0EC07E3A10" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_278F7E32560D4E56949BB86387687280" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_5962AD13A2FB4382A8E4234D0A8F6431" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "ModuleSignature" = "8:VsdDialogs.83D22742_1B79_46f6_9A99_DF0F2BD4C077" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{E4ECAB26-4AB7-11D3-8D78-00A0C9CFCEE6}:_4590F9F9691949509A3962EFB7C62E35" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + "ModuleSignature" = "8:VsdDialogs.CE4B864F_F1C1_4B85_98D4_2A2BF5FFB12B" + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_4C707911D3954C4381A3F6156564D507" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_171C9E276D5943B687E4DA4F79F349B6" + { + "Sequence" = "3:100" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "ModuleSignature" = "8:VsdDialogs.6DBC9783_3677_4D68_8BF5_D749558A0AC1" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_3BCF032258F243428B51994F32609B6A" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "ModuleSignature" = "8:VsdDialogs.C113BC36_2532_4D45_8099_4818B1133B2F" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_69B312E676BB489C9F1FF4083F84A93A" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_4AE0E2F93FCD4197B002A2F85EC7E964" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "ModuleSignature" = "8:VsdDialogs.EE9A1AFA_41DD_4514_B727_DF0ACA1D7389" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_779DECA6E5964F629D5A23BDDD22D5B5" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_4842A38B1FFA4101870FA1DFC49462FB" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "ModuleSignature" = "8:VsdDialogs.FA58E60A_A1E8_4876_95FC_2AC3B5AAA5F8" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{E4ECAB26-4AB7-11D3-8D78-00A0C9CFCEE6}:_8F7ED74248F847E7B426E59FBD93BBBC" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + "ModuleSignature" = "8:VsdUserInterface.524F4245_5254_5341_4C45_534153783400" + } + "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_97BA1FE282B24D8C9CDCD6DAD6F64569" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_25FA3C7662DA4C9691E632DBD12B66F1" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "ModuleSignature" = "8:VsdDialogs.4FB12620_0D15_42D0_8677_2766FFA6923F" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + } +} diff --git a/inetsrv/uddi/source/setup/setup.sln b/inetsrv/uddi/source/setup/setup.sln new file mode 100644 index 0000000..9faca9c --- /dev/null +++ b/inetsrv/uddi/source/setup/setup.sln @@ -0,0 +1,137 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "..\api\api.csproj", "{11742B5A-F929-4DA7-8378-F82AB3B69491}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bootstrap", "..\tools\bootstrap\bootstrap.csproj", "{241E0512-30BD-44B6-8313-CAEC59AC57A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "core", "..\core\core.csproj", "{C792705F-C4F9-41F7-AE03-B9C87FAD9151}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dbca", "db\ca\dbca.csproj", "{0E1075E2-D3B3-45CE-82B5-AC2E3C43461F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "filter", "..\filter\filter.vcproj", "{70731D7E-08C5-4555-9707-71665BFC642A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "send", "..\tools\send\send.csproj", "{F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "web", "..\web\web.csproj", "{BF191EA0-B0CF-4502-A290-A183AC71998F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "webca", "web\ca\webca.csproj", "{14D279A8-4433-411B-BCF6-6F9B723A9BD4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webcaum", "web\ca.unmanaged\webcaum.vcproj", "{7674AC93-5C5B-46EE-89FC-4AF5F6B2AC9A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ocm", "ocm\ocm.vcproj", "{65F02C2E-479D-415E-BF3B-FBFAADEB22A4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmc", "..\mmc\mmc.vcproj", "{CA6FA2C8-BD59-49BE-947D-A85C64CA2033}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resetkey", "..\tools\resetkey\resetkey.csproj", "{02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbcaum", "db\ca.unmanaged\dbcaum.vcproj", "{F9C6C06E-365C-4C59-A8C9-F1198DBFFF58}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msitoddf", "msitoddf\msitoddf.vcproj", "{461EED9B-8165-4AA3-9DCA-2FB49E373F44}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uddimsifiler", "uddimsifiler\uddimsifiler.vcproj", "{461EED9B-8165-4AA3-9DCA-2FB49E373F44}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\common\common.vcproj", "{42FADC75-6E66-4178-B727-6B48F352D8E6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xp", "..\xp\xp.vcproj", "{35D639CF-608C-4810-95A3-4895185E6A54}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "recalcstats", "..\tools\recalcstats\recalcstats.csproj", "{F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.0 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {11742B5A-F929-4DA7-8378-F82AB3B69491}.1 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {11742B5A-F929-4DA7-8378-F82AB3B69491}.2 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {11742B5A-F929-4DA7-8378-F82AB3B69491}.3 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.0 = {11742B5A-F929-4DA7-8378-F82AB3B69491} + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.1 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.2 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.3 = {11742B5A-F929-4DA7-8378-F82AB3B69491} + {BF191EA0-B0CF-4502-A290-A183AC71998F}.0 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {BF191EA0-B0CF-4502-A290-A183AC71998F}.1 = {11742B5A-F929-4DA7-8378-F82AB3B69491} + {BF191EA0-B0CF-4502-A290-A183AC71998F}.2 = {11742B5A-F929-4DA7-8378-F82AB3B69491} + {BF191EA0-B0CF-4502-A290-A183AC71998F}.3 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.0 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.1 = {11742B5A-F929-4DA7-8378-F82AB3B69491} + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.ActiveCfg = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.Build.0 = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.Build.0 = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Debug.ActiveCfg = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Debug.Build.0 = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Release.ActiveCfg = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Release.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.ActiveCfg = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.Build.0 = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.Build.0 = Release|.NET + {0E1075E2-D3B3-45CE-82B5-AC2E3C43461F}.Debug.ActiveCfg = Debug|.NET + {0E1075E2-D3B3-45CE-82B5-AC2E3C43461F}.Debug.Build.0 = Debug|.NET + {0E1075E2-D3B3-45CE-82B5-AC2E3C43461F}.Release.ActiveCfg = Release|.NET + {0E1075E2-D3B3-45CE-82B5-AC2E3C43461F}.Release.Build.0 = Release|.NET + {70731D7E-08C5-4555-9707-71665BFC642A}.Debug.ActiveCfg = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Debug.Build.0 = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Release.ActiveCfg = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Release.Build.0 = Unicode Release|Win32 + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Debug.ActiveCfg = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Debug.Build.0 = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Release.ActiveCfg = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Release.Build.0 = Release|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Debug.ActiveCfg = Debug|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Debug.Build.0 = Debug|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Release.ActiveCfg = Release|.NET + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Release.Build.0 = Release|.NET + {14D279A8-4433-411B-BCF6-6F9B723A9BD4}.Debug.ActiveCfg = Debug|.NET + {14D279A8-4433-411B-BCF6-6F9B723A9BD4}.Debug.Build.0 = Debug|.NET + {14D279A8-4433-411B-BCF6-6F9B723A9BD4}.Release.ActiveCfg = Release|.NET + {14D279A8-4433-411B-BCF6-6F9B723A9BD4}.Release.Build.0 = Release|.NET + {7674AC93-5C5B-46EE-89FC-4AF5F6B2AC9A}.Debug.ActiveCfg = Debug|Win32 + {7674AC93-5C5B-46EE-89FC-4AF5F6B2AC9A}.Debug.Build.0 = Debug|Win32 + {7674AC93-5C5B-46EE-89FC-4AF5F6B2AC9A}.Release.ActiveCfg = Release|Win32 + {7674AC93-5C5B-46EE-89FC-4AF5F6B2AC9A}.Release.Build.0 = Release|Win32 + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Debug.ActiveCfg = Debug|Win32 + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Debug.Build.0 = Debug|Win32 + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Release.ActiveCfg = Release|Win32 + {65F02C2E-479D-415E-BF3B-FBFAADEB22A4}.Release.Build.0 = Release|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Debug.ActiveCfg = Debug|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Debug.Build.0 = Debug|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Release.ActiveCfg = Release|Win32 + {CA6FA2C8-BD59-49BE-947D-A85C64CA2033}.Release.Build.0 = Release|Win32 + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Debug.ActiveCfg = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Debug.Build.0 = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Release.ActiveCfg = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Release.Build.0 = Release|.NET + {F9C6C06E-365C-4C59-A8C9-F1198DBFFF58}.Debug.ActiveCfg = Debug|Win32 + {F9C6C06E-365C-4C59-A8C9-F1198DBFFF58}.Debug.Build.0 = Debug|Win32 + {F9C6C06E-365C-4C59-A8C9-F1198DBFFF58}.Release.ActiveCfg = Release|Win32 + {F9C6C06E-365C-4C59-A8C9-F1198DBFFF58}.Release.Build.0 = Release|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Debug.ActiveCfg = Debug|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Debug.Build.0 = Debug|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Release.ActiveCfg = Release|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Release.Build.0 = Release|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Debug.ActiveCfg = Debug|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Debug.Build.0 = Debug|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Release.ActiveCfg = Release|Win32 + {461EED9B-8165-4AA3-9DCA-2FB49E373F44}.Release.Build.0 = Release|Win32 + {42FADC75-6E66-4178-B727-6B48F352D8E6}.Debug.ActiveCfg = Debug|Win32 + {42FADC75-6E66-4178-B727-6B48F352D8E6}.Debug.Build.0 = Debug|Win32 + {42FADC75-6E66-4178-B727-6B48F352D8E6}.Release.ActiveCfg = Release|Win32 + {42FADC75-6E66-4178-B727-6B48F352D8E6}.Release.Build.0 = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Debug.ActiveCfg = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Debug.Build.0 = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Release.ActiveCfg = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Release.Build.0 = Release|Win32 + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Debug.ActiveCfg = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Debug.Build.0 = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Release.ActiveCfg = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/inetsrv/uddi/source/setup/shared/apppool.cpp b/inetsrv/uddi/source/setup/shared/apppool.cpp new file mode 100644 index 0000000..0387486 --- /dev/null +++ b/inetsrv/uddi/source/setup/shared/apppool.cpp @@ -0,0 +1,162 @@ +#ifndef INITGUID +#define INITGUID +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#include +#include +#include // MD_ & IIS_MD_ defines + +#include "apppool.h" +#include "common.h" + +//-------------------------------------------------------------------------- + +HRESULT CUDDIAppPool::Init( void ) +{ + ENTER(); + + HRESULT hr = CoInitializeEx( NULL, COINIT_MULTITHREADED ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "RecycleApplicationPool(): CoInitializeEx() failed" ), HRESULT_CODE( hr ) ); + return hr; + } + + hr = CoCreateInstance( + CLSID_WamAdmin, + NULL, + CLSCTX_ALL, + IID_IWamAdmin, + (void**)&pIWamAdmin ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "RecycleApplicationPool(): CoCreateInstance() failed" ), HRESULT_CODE(hr) ); + return hr; + } + + hr = pIWamAdmin->QueryInterface( IID_IIISApplicationAdmin, (void **) &pIIISApplicationAdmin ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "RecycleApplicationPool(): QueryInterface() failed" ), HRESULT_CODE(hr) ); + return hr; + } + + return ERROR_SUCCESS; +} + +//-------------------------------------------------------------------------- + +CUDDIAppPool::~CUDDIAppPool( void ) +{ + ENTER(); + + if( pIIISApplicationAdmin ) + pIIISApplicationAdmin->Release(); + + CoUninitialize(); +} + +//-------------------------------------------------------------------------- +// recycle the UDDI app pool +HRESULT CUDDIAppPool::Recycle( void ) +{ + ENTER(); + + HRESULT hr = Init(); + if( FAILED( hr ) ) + { + Log( TEXT( "Error recycling the UDDI application pool = %d" ), HRESULT_CODE( hr ) ); + return hr; + } + + hr = pIIISApplicationAdmin->RecycleApplicationPool( APPPOOLNAME ); + + if( HRESULT_CODE(hr) == ERROR_OBJECT_NOT_FOUND ) + { + // + // the RecycleApplicationPool() method returns an Object Not Found error if you try to + // recycle the app pool when the app pool is not running + // + Log( TEXT( "The Application Pool %s is NOT running - unable to recycle this pool" ), APPPOOLNAME ); + } + else if( FAILED( hr ) ) + { + Log( TEXT( "Error recycling the UDDI application pool = %d" ), HRESULT_CODE( hr ) ); + } + + return hr; +} + +//-------------------------------------------------------------------------- +// delete an app pool +HRESULT CUDDIAppPool::Delete( void ) +{ + ENTER(); + + // + // init the com interface to the IIS metabase + // + HRESULT hr = Init(); + if( FAILED( hr ) ) + { + Log( TEXT( "Error stopping UDDI application pool = %d" ), HRESULT_CODE( hr ) ); + return hr; + } + + // + // enumerate all the applications in the app pool and delete them + // + BSTR bstrBuffer; + while( ERROR_SUCCESS == pIIISApplicationAdmin->EnumerateApplicationsInPool( APPPOOLNAME, &bstrBuffer ) ) + { + // + // returns an empty string when done + // + if( 0 == _tcslen( bstrBuffer ) ) + break; + + // + // unload the application + // + if ( pIWamAdmin ) + { + pIWamAdmin->AppUnLoad( bstrBuffer, true ); + } + + // + // delete this application + // + hr = pIIISApplicationAdmin->DeleteApplication( bstrBuffer, true ); + + SysFreeString( bstrBuffer ); + + if( FAILED( hr ) ) + { + Log( TEXT( "Error deleting UDDI application from the app pool, error = %d" ), HRESULT_CODE( hr ) ); + return hr; + } + } + + // + // delete the application pool + // + hr = pIIISApplicationAdmin->DeleteApplicationPool( APPPOOLNAME ); + if( FAILED( hr ) ) + { + Log( TEXT( "Error deleting the UDDI application pool = %d" ), HRESULT_CODE( hr ) ); + return hr; + } + + return ERROR_SUCCESS; +} diff --git a/inetsrv/uddi/source/setup/shared/apppool.h b/inetsrv/uddi/source/setup/shared/apppool.h new file mode 100644 index 0000000..752edf6 --- /dev/null +++ b/inetsrv/uddi/source/setup/shared/apppool.h @@ -0,0 +1,49 @@ +#pragma once + +#ifndef INITGUID +#define INITGUID +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#include +#include // MD_ & IIS_MD_ defines +//#include "webcaum.h" + +#define APPPOOLNAME TEXT( "MSUDDIAppPool" ) + +#define DEFAULTLOADFILE TEXT( "default.aspx" ) + +#define UDDIAPPLICATIONNAME TEXT( "uddi" ) +#define UDDIAPPLICATIONFRIENDLYNAME TEXT( "UDDI Services User Interface" ) + +#define APIAPPLICATIONNAME TEXT( "uddipublic" ) +#define APIAPPLICATIONFRIENDLYNAME TEXT( "UDDI Services API" ) + +#ifndef MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM +#define MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM 0 +#define MD_APPPOOL_IDENTITY_TYPE_LOCALSERVICE 1 +#define MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE 2 +#define MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER 3 +#endif + + +class CUDDIAppPool +{ +private: + IWamAdmin* pIWamAdmin; + IIISApplicationAdmin* pIIISApplicationAdmin; + HRESULT Init( void ); + +public: + CUDDIAppPool( void ) { pIIISApplicationAdmin = NULL; } + ~CUDDIAppPool( void ); + HRESULT Recycle( void ); + HRESULT Delete( void ); +}; diff --git a/inetsrv/uddi/source/setup/shared/common.cpp b/inetsrv/uddi/source/setup/shared/common.cpp new file mode 100644 index 0000000..aa29ad0 --- /dev/null +++ b/inetsrv/uddi/source/setup/shared/common.cpp @@ -0,0 +1,531 @@ +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0510 +#endif + +#include +#include + +#include +#include + +#include "common.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit +#include + +//-------------------------------------------------------------------------- + +void MyOutputDebug(TCHAR *fmt, ...) +{ +#if defined( DBG ) || defined( _DEBUG ) + TCHAR szTime[ 10 ]; + TCHAR szDate[ 10 ]; + ::_tstrtime( szTime ); + ::_tstrdate( szDate ); + + va_list marker; + TCHAR szBuf[1024]; + + size_t cbSize = ( sizeof( szBuf ) / sizeof( TCHAR ) ) - 1; // one byte for null + _sntprintf( szBuf, cbSize, TEXT( "%s %s: " ), szDate, szTime ); + szBuf[ 1023 ] = '\0'; + cbSize -= _tcslen( szBuf ); + + va_start( marker, fmt ); + + _vsntprintf( szBuf + _tcslen( szBuf ), cbSize, fmt, marker ); + szBuf[ 1023 ] = '\0'; + cbSize -= _tcslen( szBuf ); + + va_end( marker ); + + _tcsncat(szBuf, TEXT("\r\n"), cbSize ); + + OutputDebugString(szBuf); +#endif +} +//-------------------------------------------------------------------------- + +void Log( LPCTSTR fmt, ... ) +{ + TCHAR szTime[ 10 ]; + TCHAR szDate[ 10 ]; + ::_tstrtime( szTime ); + ::_tstrdate( szDate ); + + va_list marker; + TCHAR szBuf[1024]; + + size_t cbSize = ( sizeof( szBuf ) / sizeof( TCHAR ) ) - 1; // one byte for null + _sntprintf( szBuf, cbSize, TEXT( "%s %s: " ), szDate, szTime ); + szBuf[ 1023 ] = '\0'; + cbSize -= _tcslen( szBuf ); + + va_start( marker, fmt ); + + _vsntprintf( szBuf + _tcslen( szBuf ), cbSize, fmt, marker ); + szBuf[ 1023 ] = '\0'; + cbSize -= _tcslen( szBuf ); + + va_end( marker ); + + _tcsncat(szBuf, TEXT("\r\n"), cbSize ); + +#if defined( DBG ) || defined( _DEBUG ) + OutputDebugString(szBuf); +#endif + + // write the data out to the log file + //char szBufA[ 1024 ]; + //WideCharToMultiByte( CP_ACP, 0, szBuf, -1, szBufA, 1024, NULL, NULL ); + + TCHAR szLogFile[ MAX_PATH + 1 ]; + if( 0 == GetWindowsDirectory( szLogFile, MAX_PATH + 1 ) ) + return; + + _tcsncat( szLogFile, TEXT( "\\uddisetup.log" ), MAX_PATH - _tcslen( szLogFile ) ); + szLogFile[ MAX_PATH ] = NULL; + + HANDLE hFile = CreateFile( + szLogFile, // file name + GENERIC_WRITE, // open for writing + 0, // do not share + NULL, // no security + OPEN_ALWAYS, // open and create if not exists + FILE_ATTRIBUTE_NORMAL, // normal file + NULL); // no attr. template + + if( hFile == INVALID_HANDLE_VALUE ) + { + assert( false ); + return; + } + + // + // move the file pointer to the end so that we can append + // + SetFilePointer( hFile, 0, NULL, FILE_END ); + + DWORD dwNumberOfBytesWritten; + BOOL bOK = WriteFile( + hFile, + szBuf, + (UINT) _tcslen( szBuf ) * sizeof( TCHAR ), // number of bytes to write + &dwNumberOfBytesWritten, // number of bytes written + NULL); // overlapped buffer + + assert( bOK ); + + FlushFileBuffers ( hFile ); + CloseHandle( hFile ); +} + +//----------------------------------------------------------------------------------------- + +void ClearLog() +{ + /* + TCHAR szLogFile[ MAX_PATH ]; + if( 0 == GetWindowsDirectory( szLogFile, MAX_PATH )) + { + return; + } + _tcscat( szLogFile, TEXT( "\\" ) ); + _tcscat( szLogFile, UDDI_SETUP_LOG ); + + ::DeleteFile( szLogFile ); + */ + Log( TEXT( "*******************************************************" ) ); + Log( TEXT( "********** Starting a new log *************************" ) ); + Log( TEXT( "*******************************************************" ) ); + + // + // now get the resource stamp + // + TCHAR szVerStamp[ 256 ]; + ZeroMemory( szVerStamp, sizeof szVerStamp ); + + int iRet = GetFileVersionStr( szVerStamp, sizeof szVerStamp / sizeof szVerStamp[0] ); + if ( iRet ) + { + Log( TEXT( "OCM DLL Version is not available" ) ); + } + else + { + Log( TEXT( "OCM DLL Version is '%s'" ), szVerStamp ); + } +} + +//----------------------------------------------------------------------------------------- + +void LogError( PTCHAR szAction, DWORD dwErrorCode ) +{ + LPVOID lpMsgBuf = NULL; + + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dwErrorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + + Log( TEXT( "----------------------------------------------------------" ) ); + Log( TEXT( "An error occurred during installation. Details follow:" ) ); + Log( TEXT( "Action: %s" ), szAction ); + Log( TEXT( "Message: %s" ), lpMsgBuf ); + Log( TEXT( "----------------------------------------------------------" ) ); + + LocalFree( lpMsgBuf ); +} + +//-------------------------------------------------------------------------- +/* +void Enter( PTCHAR szMsg ) +{ +#ifdef _DEBUG + TCHAR szEnter[ 512 ]; + _stprintf( szEnter, TEXT( "Entering %s..." ), szMsg ); + Log( szEnter ); +#endif +} +*/ +//-------------------------------------------------------------------------- +// +// NOTE: The install path has a trailing backslash +// +bool GetUDDIInstallPath( PTCHAR szInstallPath, DWORD dwLen ) +{ + HKEY hKey; + + // + // get the UDDI installation folder [TARGETDIR] from the registry. The installer squirrels it away there. + // + LONG iRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, TEXT( "SOFTWARE\\Microsoft\\UDDI" ), NULL, KEY_READ, &hKey ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "Unable to open the UDDI registry key" ), iRet ); + return false; + } + + DWORD dwType = REG_SZ; + iRet = RegQueryValueEx( hKey, TEXT( "InstallRoot" ), 0, &dwType, (PBYTE) szInstallPath, &dwLen ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "UDDI registry key did not have the InstallRoot value or buffer size was too small" ), iRet ); + } + + RegCloseKey( hKey ); + return ERROR_SUCCESS == iRet ? true : false; +} + +//--------------------------------------------------------------------------------- +// Retrieves the calling module file version string +// +int GetFileVersionStr( LPTSTR outBuf, DWORD dwBufCharSize ) +{ + if ( IsBadStringPtr( outBuf, dwBufCharSize ) ) + return E_INVALIDARG; + + TCHAR fname[ MAX_PATH + 1 ]; + UINT cbSize; + DWORD dwTmp; + ZeroMemory (fname, sizeof fname); + + GetModuleFileName( NULL, fname, MAX_PATH ); + + DWORD dwSize = GetFileVersionInfoSize( fname, &dwTmp ); + + if (dwSize) + { + LANGANDCODEPAGE *lpCodePage = NULL; + LPTSTR lpBlock = NULL; + TCHAR subBlock[ 256 ]; + + LPBYTE pVerBlock = new BYTE[dwSize + 1]; + if ( !pVerBlock ) + return E_OUTOFMEMORY; + + ZeroMemory (pVerBlock, dwSize + 1); + + BOOL bRes = GetFileVersionInfo( fname, dwTmp, dwSize, pVerBlock ); + if (!bRes) // there is no resource block + { + delete[] pVerBlock; + return GetLastError(); + } + + bRes = VerQueryValue(pVerBlock, TEXT("\\VarFileInfo\\Translation"), + (LPVOID*)&lpCodePage, + &cbSize); + if (!bRes) + { + delete[] pVerBlock; + return GetLastError(); + } + + _stprintf( subBlock, TEXT("\\StringFileInfo\\%04x%04x\\FileVersion"), + lpCodePage->wLanguage, + lpCodePage->wCodePage); + + // Retrieve file description for language and code page "i". + bRes = VerQueryValue(pVerBlock, subBlock, (LPVOID *)&lpBlock, &cbSize); + if (!bRes) + { + delete[] pVerBlock; + return GetLastError(); + } + + _tcsncpy( outBuf, lpBlock, dwBufCharSize ); + delete[] pVerBlock; + return 0; + } + + return ERROR_RESOURCE_DATA_NOT_FOUND; +} + + +//--------------------------------------------------------------------------------------- +// Retrieves the SID and converts it to the string representation +// +BOOL GetLocalSidString( WELL_KNOWN_SID_TYPE sidType, LPTSTR szOutBuf, DWORD cbOutBuf ) +{ + BYTE tmpBuf[ 1024 ]; + LPTSTR szTmpStr = NULL; + DWORD cbBuf = sizeof tmpBuf; + + BOOL bRes = CreateWellKnownSid( sidType, NULL, tmpBuf, &cbBuf ); + if( !bRes ) + return FALSE; + + bRes = ConvertSidToStringSid( tmpBuf, &szTmpStr ); + if( !bRes ) + return FALSE; + + _tcsncpy( szOutBuf, szTmpStr, cbOutBuf ); + LocalFree( szTmpStr ); + + return TRUE; +} + + +BOOL GetLocalSidString( LPCTSTR szUserName, LPTSTR szOutBuf, DWORD cbOutBuf ) +{ + TCHAR szDomain[ 1024 ]; + LPTSTR szTmpStr = NULL; + DWORD cbDomain = sizeof( szDomain ) / sizeof( szDomain[0] ); + + SID_NAME_USE pUse; + + // + // Try to allocate a buffer for the SID. + // + DWORD cbMaxSid = SECURITY_MAX_SID_SIZE; + PSID psidUser = LocalAlloc( LMEM_FIXED, cbMaxSid ); + if( NULL == psidUser ) + { + Log( _T( "Call to LocalAlloc failed." ) ); + return FALSE; + } + memset( psidUser, 0, cbMaxSid ); + + BOOL bRes = LookupAccountName( NULL, szUserName, psidUser, &cbMaxSid, szDomain, &cbDomain, &pUse ); + if( !bRes ) + { + LocalFree( psidUser ); + return FALSE; + } + + bRes = ConvertSidToStringSid( psidUser, &szTmpStr ); + if( !bRes ) + { + LocalFree( psidUser ); + return FALSE; + } + + _tcsncpy( szOutBuf, szTmpStr, cbOutBuf ); + LocalFree( szTmpStr ); + LocalFree( psidUser ); + + return TRUE; +} + + +BOOL GetRemoteAcctName( LPCTSTR szMachineName, LPCTSTR szSidStr, LPTSTR szOutStr, LPDWORD cbOutStr, LPTSTR szDomain, LPDWORD cbDomain ) +{ + PSID pSid = NULL; + SID_NAME_USE puse; + + BOOL bRes = ConvertStringSidToSid( szSidStr, &pSid ); + if( !bRes ) + return FALSE; + + bRes = LookupAccountSid( szMachineName, pSid, szOutStr, cbOutStr, szDomain, cbDomain, &puse ); + LocalFree( pSid ); + + return bRes; +} + + + +HRESULT GetOSProductSuiteMask( LPCTSTR szRemoteServer, UINT *pdwMask ) +{ + HRESULT hr = S_OK; + BSTR bstrWQL = NULL; + + if ( IsBadWritePtr( pdwMask, sizeof UINT ) ) + return E_INVALIDARG; + + hr = CoInitializeEx( 0, COINIT_SPEED_OVER_MEMORY | COINIT_MULTITHREADED ); + if ( FAILED( hr ) ) + return hr; + + try + { + DWORD retCount = 0; + TCHAR buf[ 512 ] = {0}; + LPCTSTR locatorPath = L"//%s/root/cimv2"; + CComBSTR objQry = L"SELECT * FROM Win32_OperatingSystem"; + + CComPtr pWMIOS; + CComPtr pWMISvc; + CComPtr pWMILocator; + CComPtr pWMIEnum; + + // + // First, compose the locator string + // + if ( szRemoteServer ) + { + _stprintf( buf, locatorPath, szRemoteServer ); + } + else + { + _stprintf( buf, locatorPath, _T(".") ); + } + + BSTR bstrBuf = ::SysAllocString( buf ); + if( NULL == bstrBuf ) + { + throw hr; + } + + // + // now create the locator and set up the security blanket + // + hr = CoInitializeSecurity( NULL, -1, NULL, NULL, + RPC_C_AUTHN_LEVEL_DEFAULT, + RPC_C_IMP_LEVEL_IMPERSONATE, + NULL, EOAC_NONE, NULL); + if ( FAILED( hr ) && hr != RPC_E_TOO_LATE ) + { + ::SysFreeString( bstrBuf ); + throw hr; + } + + hr = pWMILocator.CoCreateInstance( CLSID_WbemLocator ); + if( FAILED(hr) ) + { + ::SysFreeString( bstrBuf ); + throw hr; + } + + hr = pWMILocator->ConnectServer( bstrBuf, NULL, NULL, NULL, + WBEM_FLAG_CONNECT_USE_MAX_WAIT, + NULL, NULL, &pWMISvc ); + + ::SysFreeString( bstrBuf ); + if( FAILED(hr) ) + { + throw hr; + } + + hr = CoSetProxyBlanket( pWMISvc, + RPC_C_AUTHN_WINNT, + RPC_C_AUTHZ_NONE, + NULL, + RPC_C_AUTHN_LEVEL_CALL, + RPC_C_IMP_LEVEL_IMPERSONATE, + NULL, + EOAC_NONE ); + if( FAILED(hr) ) + { + throw hr; + } + + // + // Now get the Win32_OperatingSystem instances and check the first one found + // + bstrWQL = ::SysAllocString( L"WQL" ); + if( NULL == bstrWQL ) + { + throw hr; + } + + hr = pWMISvc->ExecQuery( bstrWQL, objQry, + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_ENSURE_LOCATABLE, + NULL, &pWMIEnum ); + if (FAILED(hr)) + throw hr; + + hr = pWMIEnum->Next( 60000, 1, &pWMIOS, &retCount ); + if ( hr == WBEM_S_NO_ERROR ) + { + VARIANT vt; + CIMTYPE cimType; + long flavor = 0; + + ZeroMemory( &vt, sizeof vt ); + VariantInit ( &vt ); + + hr = pWMIOS->Get( L"SuiteMask", 0, &vt, &cimType, &flavor ); + if ( FAILED( hr ) ) + throw hr; + + if ( vt.vt == VT_NULL || vt.vt == VT_EMPTY ) + throw E_FAIL; + + hr = VariantChangeType( &vt, &vt, 0, VT_UINT ); + if ( FAILED( hr ) ) + throw hr; + + *pdwMask = vt.uintVal; + VariantClear( &vt ); + } + } + catch ( HRESULT hrErr ) + { + hr = hrErr; + ::SysFreeString( bstrWQL ); // it's OK to call SysFreeString with NULL. + } + catch (...) + { + hr = E_UNEXPECTED; + } + + CoUninitialize(); + return hr; +} + + +HRESULT IsStandardServer( LPCTSTR szRemoteServer, BOOL *bResult ) +{ + if ( IsBadWritePtr( bResult, sizeof BOOL ) ) + return E_INVALIDARG; + + UINT uMask = 0; + HRESULT hr = GetOSProductSuiteMask( szRemoteServer, &uMask ); + if ( FAILED( hr ) ) + return hr; + + if ( ( uMask & VER_SUITE_DATACENTER ) || ( uMask & VER_SUITE_ENTERPRISE ) ) + *bResult = FALSE; + else + *bResult = TRUE; + + return S_OK; +} diff --git a/inetsrv/uddi/source/setup/shared/common.h b/inetsrv/uddi/source/setup/shared/common.h new file mode 100644 index 0000000..3ed338c --- /dev/null +++ b/inetsrv/uddi/source/setup/shared/common.h @@ -0,0 +1,66 @@ +#pragma once + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. +#define _WIN32_WINNT 0x0510 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#endif + +#include +#include +#include + +#include + +// +// This struct is used by the version api +// +typedef struct +{ + WORD wLanguage; + WORD wCodePage; +} LANGANDCODEPAGE; + + +void MyOutputDebug(TCHAR *fmt, ...); +void ClearLog(); +void Log( LPCTSTR fmt, ... ); +void LogError( PTCHAR szAction, DWORD dwErrorCode ); +bool GetUDDIInstallPath( PTCHAR szInstallPath, DWORD dwLen ); +int GetFileVersionStr( LPTSTR outBuf, DWORD dwBufCharSize ); + +HRESULT GetOSProductSuiteMask( LPCTSTR szRemoteServer, UINT *pdwMask ); +HRESULT IsStandardServer( LPCTSTR szRemoteServer, BOOL *bResult ); + +BOOL GetLocalSidString( WELL_KNOWN_SID_TYPE sidType, LPTSTR szOutBuf, DWORD cbOutBuf ); +BOOL GetLocalSidString( LPCTSTR szUserName, LPTSTR szOutBuf, DWORD cbOutBuf ); +BOOL GetRemoteAcctName( LPCTSTR szMachineName, LPCTSTR szSidStr, LPTSTR szOutStr, LPDWORD cbOutStr, LPTSTR szDomain, LPDWORD cbDomain ); + + +#define ENTER() CFunctionMarker fa( __FUNCTION__ ) + +class CFunctionMarker +{ +private: + TCHAR m_szFunctionName[100]; + +public: + CFunctionMarker( char *aszFunctionName ) + { +#ifdef _UNICODE + int iCount = MultiByteToWideChar( + CP_ACP, + 0, + aszFunctionName, + -1, + m_szFunctionName, + sizeof( m_szFunctionName ) / sizeof( TCHAR ) ); +#else + strncpy( m_szFunctionName, aszFunctionName, sizeof( m_szFunctionName ) ); +#endif + Log( TEXT( "Entering %s" ), m_szFunctionName ); + } + + ~CFunctionMarker() + { + Log( TEXT( "Leaving %s" ), m_szFunctionName ); + } +}; diff --git a/inetsrv/uddi/source/setup/shared/propertybag.h b/inetsrv/uddi/source/setup/shared/propertybag.h new file mode 100644 index 0000000..b43c2c8 --- /dev/null +++ b/inetsrv/uddi/source/setup/shared/propertybag.h @@ -0,0 +1,195 @@ +//----------------------------------------------------------------------------------------- + +#pragma once + +#include +#include +#include "strlist.h" + +#define CA_PROPERTY_LEN 100 +#define CA_VALUE_LEN 100 + +//----------------------------------------------------------------------------------------- +// define a list that will hold MSI property/value pairs +// + +class CPropertyBag +{ +private: + CStrList list; + +public: + + CPropertyBag( void ) + { + } + + //--------------------------------------------------------- + + void Add( LPCTSTR szProperty, LPCTSTR szValue ) + { + list.AddValue ( szProperty, szValue ); + } + + + //--------------------------------------------------------- + + void Add( LPCTSTR szProperty, DWORD dwValue ) + { + TCHAR szValue[ 100 ]; + _stprintf( szValue, TEXT( "%d" ), dwValue ); + Add( szProperty, szValue ); + } + + //--------------------------------------------------------- + + void Delete( LPCTSTR szProperty ) + { + list.RemoveByKey ( szProperty ); + } + + //--------------------------------------------------------- + + LPTSTR ConcatValuePairs (LPCTSTR separator, LPTSTR outBuf) + { + if (!outBuf) + return NULL; + + list.ConcatKeyValues ( separator, outBuf ); + return outBuf; + } + + + //--------------------------------------------------------- + + void Clear( void ) + { + list.RemoveAll (); + } + + //--------------------------------------------------------- + + LPCTSTR GetString( LPCTSTR szProperty, LPTSTR buf ) + { + return list.Lookup (szProperty, buf); + } + + //--------------------------------------------------------- + + DWORD GetValue( LPCTSTR szProperty ) + { + TCHAR buf [256]; + + if ( list.Lookup (szProperty, buf) ) + { + DWORD numRes = _ttoi( buf ); + return numRes; + } + else + return (DWORD)-1; + } + + //--------------------------------------------------------- + + bool Parse( LPTSTR szPropertyString, DWORD dwStrLen ) + { + // property1=value1;property2=value2; + assert( szPropertyString ); + assert( _tcslen(szPropertyString) > 0 ); + + if( NULL == szPropertyString || 0 == _tcslen( szPropertyString ) ) + { + return false; + } + + // + // trim space, commas and semicolons + // + StrTrim( szPropertyString, TEXT( " ;," ) ); + + // + // add a semicolon to the end + // + if( _tcslen( szPropertyString ) < dwStrLen - 1) + _tcscat( szPropertyString, TEXT( ";" ) ); + else + { + assert( false ); + return false; + } + + // parse out the pairs + PTCHAR pProperty = szPropertyString; + PTCHAR pValue = NULL; + + TCHAR szProperty[ 100 ]; + TCHAR szValue[ 100 ]; + + while( *pProperty ) + { + // + // the value starts 1 char after the next "=" + // + pValue = _tcschr(pProperty, TEXT('=')); + if( NULL == pValue ) + { + assert( false ); + return false; + } + + // + // make sure the property value was not blank + // + if( pProperty == pValue ) + { + assert( false ); + return false; + } + + // + // put a NULL there to mark the end of the Property + // + *pValue = NULL; + + // + // the value starts after the "=" + // + pValue++; + + // + // capture the Property + // + _tcsncpy( szProperty, pProperty, sizeof( szProperty ) / sizeof( TCHAR ) ); + + // + // move the property pointer ahead to the next ";" + // + // + pProperty = _tcschr(pValue, TEXT(';')); + if( NULL == pProperty ) + { + assert( false ); + return false; + } + + // + // null it out to mark the end of the previous value + // + *pProperty = NULL; + + // + // set over the null to the start of the next property (or the end of the string) + // + pProperty++; + + // + // capture the value + // + _tcsncpy( szValue, pValue, sizeof( szValue ) / sizeof( TCHAR ) ); + + Add( szProperty, szValue ); + } + + return true; + } +}; diff --git a/inetsrv/uddi/source/setup/shared/strlist.cpp b/inetsrv/uddi/source/setup/shared/strlist.cpp new file mode 100644 index 0000000..34609f0 --- /dev/null +++ b/inetsrv/uddi/source/setup/shared/strlist.cpp @@ -0,0 +1,195 @@ +#include +#include +#include + +#include "strlist.h" + +//********************************************************************************** +// Implements the StrList, a double-linked list that maintains a list of value +// entries, each assosiated with a unique key +// + +elt* CStrList::FindElement ( LPCTSTR key ) +{ + elt* pelt = NULL; + + if (!count) + return NULL; + + if (!key) + return NULL; + + if (!_tcslen(key)) + return NULL; + + try + { + Lock(); + + for ( pelt = head; pelt; pelt = pelt->next ) + { + if (!_tcscmp(key, pelt->key)) // found it! + { + Unlock (); + return pelt; + } + } + + Unlock (); + } + catch (...) + { + Unlock (); + } + + return NULL; +} + + +bool CStrList::AddValue ( LPCTSTR key, LPCTSTR val ) +{ + elt *pelt = NULL; + + if (!key || !val) + return false; + + if (!_tcslen(key)) + return false; + + try + { + Lock (); + + pelt = FindElement (key); + if (pelt) + { + free (pelt->val); + pelt->val = _tcsdup (val); + } + else + { + pelt = new elt; + if ( !pelt ) + return false; + + pelt->key = _tcsdup (key); + pelt->val = _tcsdup (val); + pelt->next = head; + pelt->prev = NULL; + if (head) + head->prev = pelt; + head = pelt; + count++; + } + + Unlock (); + } + catch (...) + { + Unlock (); + return false; + } + + return true; +} + + +LPTSTR CStrList::Lookup ( LPCTSTR key, LPTSTR outBuf ) +{ + elt *pelt = FindElement (key); + if (!pelt) + return NULL; + + _tcscpy (outBuf, pelt->val); + return outBuf; +} + + +void CStrList::RemoveByKey ( LPCTSTR key ) +{ + Lock (); + + try + { + elt *pelt = FindElement (key); + if (!pelt) + { + Unlock (); + return; + } + + if (pelt->prev) + pelt->prev->next = pelt->next; + else + head = pelt->next; + + if (pelt->next) + pelt->next->prev = pelt->prev; + + count--; + delete pelt; + } + catch (...) + { + } + + Unlock (); +} + + +void CStrList::RemoveAll () +{ + elt *pelt = NULL; + + Lock (); + + try + { + while (head) + { + pelt = head; + head = head->next; + count--; + delete pelt; + } + } + catch (...) + { + } + + Unlock (); +} + + +LPTSTR CStrList::ConcatKeyValues ( LPCTSTR separator, LPTSTR outBuf ) +{ + if (!outBuf) + return NULL; + + if (!separator) + return NULL; + + Lock (); + + try + { + _tcscpy (outBuf, _T("")); + for (elt *pelt = head; pelt; pelt = pelt->next) + { + _tcscat (outBuf, pelt->key); + _tcscat (outBuf, _T("=\"")); + _tcscat (outBuf, pelt->val); + _tcscat (outBuf, _T("\"")); + _tcscat (outBuf, separator); + } + } + catch (...) + { + Unlock (); + return NULL; + } + + Unlock (); + return outBuf; +} + diff --git a/inetsrv/uddi/source/setup/shared/strlist.h b/inetsrv/uddi/source/setup/shared/strlist.h new file mode 100644 index 0000000..d2e26b5 --- /dev/null +++ b/inetsrv/uddi/source/setup/shared/strlist.h @@ -0,0 +1,77 @@ +#pragma once + +class elt +{ +public: + LPTSTR key; + LPTSTR val; + + elt *next, + *prev; + + elt() + { + next = NULL; + prev = NULL; + + key = NULL; + val = NULL; + } + + virtual ~elt() + { + if (key) + free (key); + + if (val) + free (val); + } +}; + + +class CStrList +{ +protected: + elt *head; + int count; + HANDLE hmtxLock; + + elt *FindElement ( LPCTSTR key ); + + void Lock () + { + if ( hmtxLock ) + WaitForSingleObject ( hmtxLock, INFINITE ); + } + + void Unlock () + { + if ( hmtxLock ) + ReleaseMutex ( hmtxLock ); + } + +public: + CStrList() + { + head = NULL; + count = 0; + hmtxLock = CreateMutex ( NULL, FALSE, NULL ); + } + + virtual ~CStrList() + { + RemoveAll(); + CloseHandle ( hmtxLock ); + } + + bool AddValue ( LPCTSTR key, LPCTSTR val ); + LPTSTR Lookup ( LPCTSTR key, LPTSTR outBuf ); + void RemoveByKey ( LPCTSTR key ); + void RemoveAll (); + LPTSTR ConcatKeyValues ( LPCTSTR separator, LPTSTR outBuf ); + + int GetCount () + { + return count; + } +}; diff --git a/inetsrv/uddi/source/setup/uddimsifiler/makefile b/inetsrv/uddi/source/setup/uddimsifiler/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/uddimsifiler/obj/_objects.mac b/inetsrv/uddi/source/setup/uddimsifiler/obj/_objects.mac new file mode 100644 index 0000000..dc42bcb --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/obj/_objects.mac @@ -0,0 +1,24 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\uddimsifiler.res \ + $(_OBJ_DIR)\i386\uddimsifiler.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\uddimsifiler.res \ + $(_OBJ_DIR)\ia64\uddimsifiler.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\uddimsifiler.res \ + $(_OBJ_DIR)\amd64\uddimsifiler.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\uddimsifiler.res \ + $(_OBJ_DIR)\arm\uddimsifiler.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/stdafx.obj b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/stdafx.obj new file mode 100644 index 0000000..6ed165c Binary files /dev/null and b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/stdafx.obj differ diff --git a/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/stdafx.pch b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/stdafx.pch new file mode 100644 index 0000000..f377d07 Binary files /dev/null and b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/stdafx.pch differ diff --git a/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.exe b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.exe new file mode 100644 index 0000000..2f0cb1a Binary files /dev/null and b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.exe differ diff --git a/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.obj b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.obj new file mode 100644 index 0000000..6b02f9d Binary files /dev/null and b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.obj differ diff --git a/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.pdb b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.pdb new file mode 100644 index 0000000..3afd84b Binary files /dev/null and b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.pdb differ diff --git a/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.res b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.res new file mode 100644 index 0000000..ad927ce Binary files /dev/null and b/inetsrv/uddi/source/setup/uddimsifiler/obj/i386/uddimsifiler.res differ diff --git a/inetsrv/uddi/source/setup/uddimsifiler/placefil.txt b/inetsrv/uddi/source/setup/uddimsifiler/placefil.txt new file mode 100644 index 0000000..83703de --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/placefil.txt @@ -0,0 +1 @@ +uddimsifiler.exe uddi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/uddimsifiler/resource.h b/inetsrv/uddi/source/setup/uddimsifiler/resource.h new file mode 100644 index 0000000..350e3ea --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by CreateMSICABMakefile.rc +// +#define IDS_HELLO 1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/inetsrv/uddi/source/setup/uddimsifiler/sources b/inetsrv/uddi/source/setup/uddimsifiler/sources new file mode 100644 index 0000000..6b72f42 --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/sources @@ -0,0 +1,49 @@ +TARGETNAME=uddimsifiler +TARGETPATH=obj +TARGETTYPE=PROGRAM + +UMENTRY=wmain +UMTYPE=console +UMAPPL=uddimsifiler + + +INCLUDES=$(INCLUDES);$(_NTROOT)\public\sdk\inc\atl30;C:\nt\public\sdk\inc\mfc42 + + +PRECOMPILED_CXX=1 +PRECOMPILED_OBJ=stdafx.obj +PRECOMPILED_INCLUDE=stdafx.h +USE_MFCUNICODE=1 +USE_STL=1 +USE_ATL=1 +USE_MSVCRT=1 +ATL_VER=30 + + +TARGETLIBS=\ + $(SDK_LIB_PATH)\atl.lib \ + $(SDK_LIB_PATH)\adsiid.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\oleaut32.lib \ + $(SDK_LIB_PATH)\ole32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\rpcrt4.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\gdi32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\netapi32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\Secur32.lib \ + $(SDK_LIB_PATH)\msi.lib + +SOURCES=\ + uddimsifiler.cpp \ + uddimsifiler.rc + +C_DEFINES=$(C_DEFINES) /DWIN32 /D_CONSOLE /D_UNICODE /DUNICODE + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/setup/uddimsifiler/stdafx.cpp b/inetsrv/uddi/source/setup/uddimsifiler/stdafx.cpp new file mode 100644 index 0000000..fd4f341 --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/stdafx.cpp @@ -0,0 +1 @@ +#include "stdafx.h" diff --git a/inetsrv/uddi/source/setup/uddimsifiler/stdafx.h b/inetsrv/uddi/source/setup/uddimsifiler/stdafx.h new file mode 100644 index 0000000..74e2ac4 --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/stdafx.h @@ -0,0 +1,20 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include +#include +#include +#include + +#ifdef _WIN32_MSI +#undef _WIN32_MSI +#endif + +#define _WIN32_MSI 200 + +#include +#include diff --git a/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.cpp b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.cpp new file mode 100644 index 0000000..0e63543 --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.cpp @@ -0,0 +1,554 @@ +//----------------------------------------------------------------------------- + +#include "stdafx.h" +#include "uddimsifiler.h" + +static PTCHAR GetFileLongName( PTCHAR szFileName ); +static PTCHAR GetErrorMsg( UINT iRet ); +static bool UpdateFileTable( void ); +static bool FileExists( PTCHAR szFileName ); +static bool UpdateFile( PTCHAR szFile, PTCHAR szFilePath ); +static bool LookupComponentTargetFolder( PTCHAR szComponent, PTCHAR szComponentFolder ); +static bool UpdateFileHash( PTCHAR szFile, PTCHAR szFilePath ); +static bool UpdateMSIVerFromFile( LPCTSTR szFile ); +static void LogError( LPCTSTR fmt, ... ); + +PMSIHANDLE g_hDatabase; +TCHAR g_MSIFile[ MAX_PATH + 1 ]; +TCHAR g_LogFile[ MAX_PATH + 1 ]; +TCHAR g_SourceDir[ MAX_PATH + 1 ]; +TCHAR g_VerFile[ MAX_PATH + 1 ]; + +//-------------------------------------------------------------- + +int __cdecl _tmain( int argc, TCHAR* argv[], TCHAR* envp[] ) +{ + UINT iRet = 0; + + bool bDisplayUsage = false; + + ZeroMemory( g_MSIFile, sizeof g_MSIFile ); + ZeroMemory( g_LogFile, sizeof g_LogFile ); + ZeroMemory( g_VerFile, sizeof g_VerFile ); + ZeroMemory( g_SourceDir, sizeof g_SourceDir ); + + if ( argc > 1 ) + { + // loop through all the arguments + for ( int i=1; i= argc ) + { + bDisplayUsage = true; + break; + } + + _tcscpy( g_MSIFile, argv[ i ] ); + + continue; + } + + // -s is the path to the source files + if( 0 == _tcscmp( argv[ i ], TEXT( "-s" ) ) ) + { + i++; + if ( i >= argc ) + { + bDisplayUsage = true; + break; + } + + _tcscpy( g_SourceDir, argv[ i ] ); + + continue; + } + + // -L is the log file + if( 0 == _tcsicmp( argv[ i ], TEXT( "-L" ) ) ) + { + i++; + if ( i >= argc ) + { + bDisplayUsage = true; + break; + } + + _tcscpy( g_LogFile, argv[ i ] ); + + continue; + } + + // -v is a file containing the version stamp + if( 0 == _tcsicmp( argv[ i ], TEXT( "-v" ) ) ) + { + i++; + if ( i >= argc ) + { + bDisplayUsage = true; + break; + } + + _tcscpy( g_VerFile, argv[ i ] ); + + continue; + } + + } + } + + // usage + if ( bDisplayUsage || argc == 1 || NULL != _tcsrchr( argv[ 1 ], '?' ) ) + { + _tprintf( TEXT( "Updates the File Table with files in a folder ( using File.File key names )\n\n" ) ); + _tprintf( TEXT( "Usage: %s -d -s [ -L ] [-v ]\n\n" ), argv[ 0 ] ); + return 0; + } + + // + // open the database + // + if( !FileExists( g_MSIFile ) ) + { + LogError( TEXT( "***ERROR: MSI File does not exist: %s" ), g_MSIFile ); + return 1; + } + + // + // open the MSI file + // + iRet = MsiOpenDatabase( g_MSIFile, MSIDBOPEN_TRANSACT, &g_hDatabase ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "***ERROR: MsiOpenDatabase Error: %s" ), GetErrorMsg( iRet ) ); + return 1; + } + + bool bRet = UpdateFileTable(); + + // + // update the ProductVersion property + // + UpdateMSIVerFromFile( g_VerFile ); + + iRet = MsiDatabaseCommit( g_hDatabase ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "***ERROR: MsiDatabaseCommit Error: %s" ), GetErrorMsg( iRet ) ); + return 0; + } + + return bRet ? 0 : 1; +} + +//-------------------------------------------------------------- + +static bool UpdateFileTable( void ) +{ + UINT iRet; + PMSIHANDLE hView; + PMSIHANDLE hRecord = 0; + + // + // open a view and submit the SQL query + // + iRet = MsiDatabaseOpenView( g_hDatabase, TEXT( "select File from File" ), &hView ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "***ERROR: MsiDatabaseOpenView Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // + // execute the SQL query + // + iRet = MsiViewExecute( hView, hRecord ); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "***ERROR: MsiViewExecute Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // + // fetch the data + // + TCHAR szFile[ 256 ]; + TCHAR szFilePath[ 256 ]; + DWORD cchValueBuf; + + while( ERROR_NO_MORE_ITEMS != MsiViewFetch( hView, &hRecord ) ) + { + cchValueBuf = 256; + MsiRecordGetString( hRecord, 1, szFile, &cchValueBuf ); + + // + // create the full path to the file in \binaries folder + // + _stprintf( szFilePath, TEXT( "%s\\%s" ), g_SourceDir, szFile ); + //LogError( TEXT( "Updating: %s\n" ), szFilePath ); + + // + // does the file exist? + // + if( !FileExists( szFilePath ) ) + { + LogError( TEXT( "***ERROR: Source File does not exist: %s" ), szFilePath ); + return false; + } + + // + // update the size, version, language and hash table + // + if( !UpdateFile( szFile, szFilePath ) ) + { + LogError( TEXT( "***ERROR: Unable to update file %s\n" ), szFile ); + return false; + } + } + + return true; +} + +//-------------------------------------------------------------- + +static bool UpdateFile( PTCHAR szFile, PTCHAR szFilePath ) +{ + PMSIHANDLE hView; + PMSIHANDLE hRecord = 0; + + // + // get the version and language of this file + // + TCHAR szVersionBuf[ 100 ]; + DWORD dwVersionBuf = 100; + TCHAR szLanguageBuf[ 100 ]; + DWORD dwLanguageBuf = 100; + UINT iRet = MsiGetFileVersion( + szFilePath, // path to the file + szVersionBuf, // returned version string + &dwVersionBuf, // buffer byte count + szLanguageBuf, // returned language string + &dwLanguageBuf ); // buffer byte count + + if ( ERROR_SUCCESS != iRet ) + { + _tcscpy( szVersionBuf, TEXT( "" ) ); + _tcscpy( szLanguageBuf, TEXT( "" ) ); + UpdateFileHash( szFile, szFilePath ); + } + + // + // get the file's size + // + HANDLE hFile = CreateFile( szFilePath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); + if( INVALID_HANDLE_VALUE == hFile ) + { + return false; + } + + LARGE_INTEGER liSize; + if( 0 == GetFileSizeEx( hFile, &liSize ) ) + { + LogError( TEXT( "***ERROR: Unable to get file size for file %s\n" ), szFilePath ); + CloseHandle( hFile ); + return false; + } + + CloseHandle( hFile ); + + // + // update the file's version, language and size + // + TCHAR szSQLQuery[ 256 ]; + _stprintf( szSQLQuery, TEXT( "UPDATE File SET FileSize = ?, Version = ?, Language = ? where File = ?" ) ); + + iRet = MsiDatabaseOpenView( g_hDatabase, szSQLQuery, &hView ); + + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiDatabaseOpenView Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // create a temp record to store the replacable values + hRecord = MsiCreateRecord( 4 ); + if ( NULL == hRecord ) + { + LogError( 0, TEXT( "***ERROR: MsiCreateRecord failed" ) ); + return false; + } + + int index = 1; + + // Size goes in #1 + iRet = MsiRecordSetInteger( hRecord, index++, liSize.LowPart ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiRecordSetString Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // Version goes in #2 + iRet = MsiRecordSetString( hRecord, index++, szVersionBuf ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiRecordSetString Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // Language goes in #3 + iRet = MsiRecordSetString( hRecord, index++, szLanguageBuf ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiRecordSetString Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // File goes in #4 + iRet = MsiRecordSetString( hRecord, index++, szFile ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiRecordSetString Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // execute the update query + iRet = MsiViewExecute( hView, hRecord ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiViewExecute Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + return true; +} + + +//-------------------------------------------------------------- + +static bool UpdateMSIVerFromFile( LPCTSTR szFileName ) +{ + MSIHANDLE hView; + TCHAR szVersionBuf[ 256 ]; + TCHAR szLanguageBuf[ 256 ]; + TCHAR szQuery[ 256 ]; + DWORD dwLanguageBuf = 0, dwVersionBuf = 0; + + if ( !szFileName ) + return false; + + if ( !FileExists( (LPTSTR)szFileName ) ) + return false; + + dwVersionBuf = sizeof szVersionBuf / sizeof szVersionBuf[0]; + dwLanguageBuf = sizeof szLanguageBuf / sizeof szLanguageBuf[0]; + UINT iRet = MsiGetFileVersion( szFileName, // path to the file + szVersionBuf, // returned version string + &dwVersionBuf, // buffer byte count + szLanguageBuf, // returned language string + &dwLanguageBuf ); // buffer byte count + if ( iRet != ERROR_SUCCESS ) + { + LogError( TEXT( "***ERROR: MsiGetFileVersion Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + _tcscpy( szQuery, TEXT( "UPDATE Property SET Property.Value='" ) ); + _tcscat( szQuery, szVersionBuf ); + _tcscat( szQuery, TEXT("' WHERE Property.Property='ProductVersion'") ); + + iRet = MsiDatabaseOpenView( g_hDatabase, szQuery, &hView ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "***ERROR: MsiDatabaseOpenView Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // execute the update query + iRet = MsiViewExecute( hView, NULL ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "***ERROR: MsiViewExecute Error: %s" ), GetErrorMsg( iRet ) ); + MsiCloseHandle( hView ); + return false; + } + + MsiCloseHandle( hView ); + return true; +} + + +//-------------------------------------------------------------- + +static bool UpdateFileHash( PTCHAR szFile, PTCHAR szFilePath ) +{ + PMSIHANDLE hView; + PMSIHANDLE hRecord = 0; + + // + // get the file's size + // + MSIFILEHASHINFO hashinfo; + hashinfo.dwFileHashInfoSize = sizeof( MSIFILEHASHINFO ); + UINT iRet = MsiGetFileHash( szFilePath, 0, &hashinfo ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiGetFileHash Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // + // update the file's version, language and size + // + TCHAR szSQLQuery[ 256 ]; + _stprintf( szSQLQuery, TEXT( "UPDATE MsiFileHash SET HashPart1 = ?, HashPart2 = ?, HashPart3 = ?, HashPart4 = ? where File_ = ?" ) ); + + iRet = MsiDatabaseOpenView( g_hDatabase, szSQLQuery, &hView ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiDatabaseOpenView Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // create a temp record to store the replacable values + hRecord = MsiCreateRecord( 5 ); + if ( NULL == hRecord ) + { + LogError( 0, TEXT( "***ERROR: MsiCreateRecord failed" ) ); + return false; + } + + int index = 1; + + for( int i=0; i<4; i++ ) + { + iRet = MsiRecordSetInteger( hRecord, index++, hashinfo.dwData[ i ] ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiRecordSetInteger Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + } + + // File goes in #5 + iRet = MsiRecordSetString( hRecord, index++, szFile ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiRecordSetString Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + // execute the update query + iRet = MsiViewExecute( hView, hRecord ); + if ( ERROR_SUCCESS != iRet ) + { + LogError( 0, TEXT( "***ERROR: MsiViewExecute Error: %s" ), GetErrorMsg( iRet ) ); + return false; + } + + return true; +} + +//-------------------------------------------------------------- + +static bool FileExists( PTCHAR szFileName ) +{ + FILE *file = _tfopen( szFileName, TEXT( "rt" ) ); + if( NULL == file ) + { + return false; + } + + fclose( file ); + + return true; +} + +//-------------------------------------------------------------- + +static PTCHAR GetErrorMsg( UINT iRet ) +{ + static TCHAR szErrMsg[ 100 ]; + + FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + iRet, + MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // Default language + ( LPTSTR ) szErrMsg, + 100, + NULL ); + + return szErrMsg; +} + +//-------------------------------------------------------------------------- + +static void LogError( LPCTSTR fmt, ... ) +{ + TCHAR szTime[ 10 ]; + TCHAR szDate[ 10 ]; + ::_tstrtime( szTime ); + ::_tstrdate( szDate ); + + va_list marker; + TCHAR szBuf[ 1024 ]; + + size_t cbSize = ( sizeof( szBuf ) / sizeof( TCHAR ) ) - 1; // one byte for null + _sntprintf( szBuf, cbSize, TEXT( "%s %s: " ), szDate, szTime ); + szBuf[ 1023 ] = '\0'; + cbSize -= _tcslen( szBuf ); + + va_start( marker, fmt ); + + _vsntprintf( szBuf + _tcslen( szBuf ), cbSize, fmt, marker ); + szBuf[ 1023 ] = '\0'; + cbSize -= _tcslen( szBuf ); + + va_end( marker ); + + _tcsncat( szBuf, TEXT( "\r\n" ), cbSize ); + + _tprintf( TEXT( "%s" ), szBuf ); + + if( 0 == _tcslen( g_LogFile ) ) + return; + + // write the data out to the log file + char szBufA[ 1024 ]; + WideCharToMultiByte( CP_ACP, 0, szBuf, -1, szBufA, 1024, NULL, NULL ); + + HANDLE hFile = CreateFile( + g_LogFile, // file name + GENERIC_WRITE, // open for writing + 0, // do not share + NULL, // no security + OPEN_ALWAYS, // open and create if not exists + FILE_ATTRIBUTE_NORMAL, // normal file + NULL ); // no attr. template + + if( hFile == INVALID_HANDLE_VALUE ) + { + return; + } + + // + // move the file pointer to the end so that we can append + // + SetFilePointer( hFile, 0, NULL, FILE_END ); + + DWORD dwNumberOfBytesWritten; + BOOL bOK = WriteFile( + hFile, + szBufA, + ( UINT ) strlen( szBufA ), // number of bytes to write + &dwNumberOfBytesWritten, // number of bytes written + NULL ); // overlapped buffer + + FlushFileBuffers ( hFile ); + CloseHandle( hFile ); +} diff --git a/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.h b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.h new file mode 100644 index 0000000..05dd5f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.h @@ -0,0 +1,2 @@ +#pragma once +#include "resource.h" diff --git a/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.rc b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.rc new file mode 100644 index 0000000..17b2fed --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.rc @@ -0,0 +1,70 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELLO "Hello from MFC!" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.vcproj b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.vcproj new file mode 100644 index 0000000..254ccbb --- /dev/null +++ b/inetsrv/uddi/source/setup/uddimsifiler/uddimsifiler.vcproj @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/apppool.cpp b/inetsrv/uddi/source/setup/web/ca.unmanaged/apppool.cpp new file mode 100644 index 0000000..62be2fc --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/apppool.cpp @@ -0,0 +1 @@ +#include "..\..\shared\apppool.cpp" diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/common.cpp b/inetsrv/uddi/source/setup/web/ca.unmanaged/common.cpp new file mode 100644 index 0000000..873d552 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/common.cpp @@ -0,0 +1 @@ +#include "..\..\shared\common.cpp" diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/iis.metabase.cpp b/inetsrv/uddi/source/setup/web/ca.unmanaged/iis.metabase.cpp new file mode 100644 index 0000000..f713505 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/iis.metabase.cpp @@ -0,0 +1,973 @@ +#ifndef INITGUID +#define INITGUID +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + + +#include +#include +#include +#include // Interface header +#include // MD_ & IIS_MD_ defines + +#include + +#include "..\..\shared\common.h" // needed for GetUDDIInstallPath + +#include "webcaum.h" +#include "resource.h" + +#include +#include + +using namespace std; +#define tstring basic_string + +typedef std::vector cStrList; + +#define APPPOOLNAME TEXT( "MSUDDIAppPool" ) + +#define DEFAULTLOADFILE TEXT( "default.aspx" ) + +#define UDDIAPPLICATIONNAME TEXT( "uddi" ) +#define UDDIAPPLICATIONDEPENDENCY TEXT( "UDDI;ASP.NET v1.1.4322" ) +#define UDDINTAUTHPROVIDERS TEXT( "NTLM" ) + +#define APIAPPLICATIONNAME TEXT( "uddipublic" ) + +#ifndef MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM +#define MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM 0 +#define MD_APPPOOL_IDENTITY_TYPE_LOCALSERVICE 1 +#define MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE 2 +#define MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER 3 +#endif + +#define REASONABLE_TIMEOUT 1000 + +BOOL IsInList( LPCTSTR szStrToFind, cStrList *pList, BOOL bIgnoreCase ) +{ + if( IsBadReadPtr( pList, sizeof cStrList ) ) + return FALSE; + + BOOL bFound = FALSE; + for( cStrList::size_type i = 0; ( i < pList->size() ) && !bFound ; i++ ) + { + LPCTSTR szEntry = (*pList)[i].c_str(); + + if ( bIgnoreCase ) + bFound = !_tcsicmp( szEntry, szStrToFind ); + else + bFound = !_tcscmp( szEntry, szStrToFind ); + } + + return bFound; +} + +BOOL RemoveFromList( LPCTSTR szStrToFind, cStrList *pList, BOOL bIgnoreCase ) +{ + if( IsBadReadPtr( pList, sizeof cStrList ) ) + return FALSE; + + BOOL bFound = FALSE; + for( cStrList::size_type i = 0; ( i < pList->size() ) && !bFound ; i++ ) + { + LPCTSTR szEntry = (*pList)[i].c_str(); + + if ( bIgnoreCase ) + bFound = !_tcsicmp( szEntry, szStrToFind ); + else + bFound = !_tcscmp( szEntry, szStrToFind ); + + if( bFound ) + { + pList->erase(pList->begin() + i); + } + } + + return bFound; +} + +//-------------------------------------------------------------------------- + +class CIISObjectBase +{ +protected: + static IMSAdminBase* pIMSAdminBase; + METADATA_HANDLE m_hMetabase; + PTCHAR m_szKeyName; + PTCHAR m_szRoot; + +public: + CIISObjectBase() : m_hMetabase( NULL ), m_szKeyName( NULL ), m_szRoot( NULL ) + { + } + + virtual ~CIISObjectBase() + { + Release(); + } + + static void Initialize() + { + HRESULT hr = CoCreateInstance( + CLSID_MSAdminBase, + NULL, + CLSCTX_ALL, + IID_IMSAdminBase, + (void**)&pIMSAdminBase ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "CIISObjectBase::Initialize::CoCreateInstance() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + } + + static void Uninitialize() + { + if( pIMSAdminBase ) + { + pIMSAdminBase->Release(); + pIMSAdminBase = NULL; + } + } + + void SetData( DWORD dwIdentifier, DWORD dwValue, DWORD dwAttributes, DWORD dwUserType ) + { + HRESULT hr; + METADATA_RECORD mr; + + mr.dwMDIdentifier = dwIdentifier; + mr.dwMDAttributes = dwAttributes; + mr.dwMDUserType = dwUserType; + mr.dwMDDataType = DWORD_METADATA; + mr.dwMDDataLen = sizeof( DWORD ); + mr.pbMDData = reinterpret_cast(&dwValue); + hr = pIMSAdminBase->SetData( m_hMetabase, m_szKeyName, &mr ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "CIISObjectBase::SetData::pIMSAdminBase->SetData() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + } + + void SetData( DWORD dwIdentifier, PTCHAR szValue, DWORD dwAttributes, DWORD dwUserType ) + { + HRESULT hr; + METADATA_RECORD mr; + + mr.dwMDIdentifier = dwIdentifier; + mr.dwMDAttributes = dwAttributes; + mr.dwMDUserType = dwUserType; + mr.dwMDDataType = STRING_METADATA; + mr.dwMDDataLen = (DWORD) ( _tcslen( szValue ) + 1) * sizeof( TCHAR ); + mr.pbMDData = reinterpret_cast(szValue); + hr = pIMSAdminBase->SetData( m_hMetabase, m_szKeyName, &mr ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "CIISObjectBase::SetData::pIMSAdminBase->SetData() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + } + + void GetData( DWORD dwIdentifier, PTCHAR szValue, DWORD dwBufferLen, DWORD dwAttributes, DWORD dwUserType ) + { + HRESULT hr; + METADATA_RECORD mr; + DWORD dwMDRequiredDataLen = 0; + + mr.dwMDIdentifier = dwIdentifier; + mr.dwMDAttributes = dwAttributes; + mr.dwMDUserType = dwUserType; + mr.dwMDDataType = STRING_METADATA; + mr.dwMDDataLen = 0; + mr.pbMDData = NULL; + mr.dwMDDataLen = dwBufferLen; + mr.pbMDData = reinterpret_cast(szValue); + + hr = pIMSAdminBase->GetData( m_hMetabase, m_szKeyName, &mr, &dwMDRequiredDataLen ); + + if( FAILED( hr ) ) + { + Log( TEXT( "CIISObjectBase::GetData::pIMSAdminBase->GetData() failed with HRESULT 0x%x." ), hr ); + throw hr; + } + } + + void GetMultiSzData( DWORD dwIdentifier, cStrList* pList, DWORD dwAttributes, DWORD dwUserType ) + { + HRESULT hr; + METADATA_RECORD mr; + DWORD dwMDRequiredDataLen = 0; + PTCHAR szValue = NULL; + + mr.dwMDIdentifier = dwIdentifier; + mr.dwMDAttributes = dwAttributes; + mr.dwMDUserType = dwUserType; + mr.dwMDDataType = MULTISZ_METADATA; + mr.dwMDDataLen = 0; + mr.pbMDData = NULL; + + hr = pIMSAdminBase->GetData( m_hMetabase, m_szKeyName, &mr, &dwMDRequiredDataLen ); + + DWORD dwMDDataLen = dwMDRequiredDataLen / sizeof(TCHAR); + + // + // Let API calculate needed buffer size, then allocate + // + if( ERROR_INSUFFICIENT_BUFFER == HRESULT_CODE(hr) ) + { + szValue = new TCHAR[ dwMDDataLen ]; + if( NULL == szValue ) + { + hr = E_OUTOFMEMORY; + LogError( TEXT( "CIISObjectBase::GetMultiSzData::new TCHAR[] failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + + mr.dwMDDataLen = dwMDRequiredDataLen; + mr.pbMDData = reinterpret_cast(szValue); + + hr = pIMSAdminBase->GetData( m_hMetabase, m_szKeyName, &mr, &dwMDRequiredDataLen ); + } + else + { + // + // Should never get here, should always fail with insufficient buffer + // + hr = E_FAIL; + + LogError( TEXT( "CIISObjectBase::GetMultiSzData::pIMSAdminBase->GetData() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + + if( FAILED( hr ) ) + { + // + // Don't forget to free buffer before throwing exception + // + if( NULL != szValue ) + { + delete [] szValue; + } + + LogError( TEXT( "CIISObjectBase::GetMultiSzData::pIMSAdminBase->GetData() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + + if( NULL != szValue ) + { + while( *szValue ) + { + // + // Add value at front to cStrList + // + pList->push_back( szValue ); + + // + // Walk past null-delimited string + // + while( *szValue ) + szValue++; + + // + // Walk past null character + // + szValue++; + } + + // + // Free allocated buffer + // + delete [] szValue; + } + } + + void SetMultiSzData( DWORD dwIdentifier, cStrList* pList, DWORD dwAttributes, DWORD dwUserType ) + { + HRESULT hr; + METADATA_RECORD mr; + DWORD dwMDDataLen = 0; + tstring szValue; + + // + // Convert cStrList to multisz string + // + for( cStrList::size_type i = 0; ( i < pList->size() ); i++ ) + { + LPCTSTR szEntry = (*pList)[i].c_str(); + + szValue += szEntry; + szValue += TEXT( '\t' ); + } + + // + // Add trailing tab (which will become null) character + // + szValue += TEXT( '\t' ); + + // + // Calculate string data length + // + dwMDDataLen = (DWORD)szValue.length() * sizeof(TCHAR); + + // + // Replace /t with /0, to properly create multisz string + // + PTCHAR szTemp = (PTCHAR)szValue.c_str(); + while( *szTemp ) + { + if( TEXT( '\t' ) == *szTemp ) + *szTemp = TEXT( '\0' ); + + szTemp++; + } + + mr.dwMDIdentifier = dwIdentifier; + mr.dwMDAttributes = dwAttributes; + mr.dwMDUserType = dwUserType; + mr.dwMDDataType = MULTISZ_METADATA; + mr.dwMDDataLen = dwMDDataLen; + mr.pbMDData = reinterpret_cast( (PTCHAR)szValue.c_str() ); + + hr = pIMSAdminBase->SetData( m_hMetabase, m_szKeyName, &mr ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "CIISObjectBase::SetMultiSzData::pIMSAdminBase->SetData() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + } + + void Delete() + { + HRESULT hr; + + // + // Attempt to open the virtual dir set on Web server #1 (default server) + // + hr = pIMSAdminBase->OpenKey( METADATA_MASTER_ROOT_HANDLE, + m_szRoot, + METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, + REASONABLE_TIMEOUT, + &m_hMetabase ); + + if( FAILED( hr )) + { + LogError( TEXT( "CIISObjectBase::Delete::pIMSAdminBase->OpenKey() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + + // + // We don't check the return value since the key may already + // not exist and we could get an error for that reason. + // + pIMSAdminBase->DeleteKey( m_hMetabase, m_szKeyName ); + pIMSAdminBase->CloseKey( m_hMetabase ); + m_hMetabase = NULL; + } + + void Release() + { + if( m_hMetabase && pIMSAdminBase ) + { + pIMSAdminBase->CloseKey( m_hMetabase ); + m_hMetabase = NULL; + } + } +}; + +//-------------------------------------------------------------------------- + +IMSAdminBase* CIISObjectBase::pIMSAdminBase = NULL; + +class CIISApplicationPool : public CIISObjectBase +{ +public: + CIISApplicationPool( PTCHAR szName ) + { + m_szKeyName = szName; + m_szRoot = TEXT( "/LM/W3SVC/AppPools" ); + } + + void Create() + { + HRESULT hr; + METADATA_RECORD mr = {0}; + DWORD dwMDRequiredDataLen = 0; + TCHAR achBuffer[ 256 ]; + + // + // Attempt to open the UDDI Application Pool + // + hr = pIMSAdminBase->OpenKey( METADATA_MASTER_ROOT_HANDLE, + m_szRoot, + METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, + REASONABLE_TIMEOUT, + &m_hMetabase ); + + // + // Create the key if it does not exist. + // + if( FAILED( hr )) + { + LogError( TEXT( "CIISApplicationPool::pIMSAdminBase->OpenKey() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + + mr.dwMDIdentifier = MD_KEY_TYPE; + mr.dwMDAttributes = 0; + mr.dwMDUserType = IIS_MD_UT_SERVER; + mr.dwMDDataType = STRING_METADATA; + mr.dwMDDataLen = sizeof(achBuffer); + mr.pbMDData = reinterpret_cast(achBuffer); + + // + // See if MD_KEY_TYPE exists + // + hr = pIMSAdminBase->GetData( m_hMetabase, m_szKeyName, &mr, &dwMDRequiredDataLen ); + + if( FAILED( hr )) + { + if( MD_ERROR_DATA_NOT_FOUND == hr || ERROR_PATH_NOT_FOUND == HRESULT_CODE(hr) ) + { + // + // Write both the key and the values if GetData() failed with any of the two errors. + // + hr = pIMSAdminBase->AddKey( m_hMetabase, m_szKeyName ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "CIISApplicationPool::pIMSAdminBase->AddKey() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + } + else + { + LogError( TEXT( "CIISApplicationPool::pIMSAdminBase->GetData() failed..." ), HRESULT_CODE(hr)); + throw hr; + } + + // + // Setup default properties + // + // TODO: Need to use #define for IIsApplicationPool + // + SetData( MD_KEY_TYPE, TEXT( "IIsApplicationPool" ), 0, IIS_MD_UT_SERVER ); + } + } +}; + +//-------------------------------------------------------------------------- + +class CIISWebService : public CIISObjectBase +{ +public: + CIISWebService() + { + m_szKeyName = TEXT( "/W3SVC" ); + m_szRoot = TEXT( "/LM" ); + } + + void Create() + { + HRESULT hr; + METADATA_RECORD mr = {0}; + DWORD dwMDRequiredDataLen = 0; + TCHAR achBuffer[ 256 ]; + + // + // Attempt to open the IIS Web Service + // + hr = pIMSAdminBase->OpenKey( METADATA_MASTER_ROOT_HANDLE, + m_szRoot, + METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, + REASONABLE_TIMEOUT, + &m_hMetabase ); + + // + // Create the key if it does not exist. + // + if( FAILED( hr )) + { + LogError( TEXT( "CIISWebService::pIMSAdminBase->OpenKey() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + + mr.dwMDIdentifier = MD_KEY_TYPE; + mr.dwMDAttributes = 0; + mr.dwMDUserType = IIS_MD_UT_SERVER; + mr.dwMDDataType = STRING_METADATA; + mr.dwMDDataLen = sizeof(achBuffer); + mr.pbMDData = reinterpret_cast(achBuffer); + + // + // See if MD_KEY_TYPE exists + // + hr = pIMSAdminBase->GetData( m_hMetabase, m_szKeyName, &mr, &dwMDRequiredDataLen ); + + if( FAILED( hr )) + { + LogError( TEXT( "CIISWebService::pIMSAdminBase->GetData() failed..." ), HRESULT_CODE(hr)); + throw hr; + } + } +}; + +class CIISApplication : public CIISObjectBase +{ +private: + PTCHAR m_szPath; + +public: + CIISApplication( PTCHAR szVDir, PTCHAR szPath ) + { + m_szKeyName = szVDir; + m_szPath = szPath; + m_szRoot = TEXT( "/LM/W3SVC/1/ROOT" ); + } + + void Create() + { + HRESULT hr; + METADATA_RECORD mr; + DWORD dwMDRequiredDataLen = 0; + TCHAR szTempPath[ MAX_PATH ]; + + // + // Attempt to open the virtual dir set on Web server #1 (default server) + // + hr = pIMSAdminBase->OpenKey( METADATA_MASTER_ROOT_HANDLE, + m_szRoot, + METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, + REASONABLE_TIMEOUT, + &m_hMetabase ); + + // + // Create the key if it does not exist. + // + if( FAILED( hr )) + { + LogError( TEXT( "CIISApplication::pIMSAdminBase->OpenKey() failed..." ), HRESULT_CODE( hr ) ); + throw hr; + } + + mr.dwMDIdentifier = MD_VR_PATH; + mr.dwMDAttributes = METADATA_INHERIT; + mr.dwMDUserType = IIS_MD_UT_FILE; + mr.dwMDDataType = STRING_METADATA; + mr.dwMDDataLen = sizeof( szTempPath ); + mr.pbMDData = reinterpret_cast(szTempPath); + + // + // See if MD_VR_PATH exists. + // + hr = pIMSAdminBase->GetData( m_hMetabase, m_szKeyName, &mr, &dwMDRequiredDataLen ); + + if( FAILED( hr )) + { + if( MD_ERROR_DATA_NOT_FOUND == hr || + ERROR_PATH_NOT_FOUND == HRESULT_CODE(hr) ) + { + // + // Write both the key and the values if GetData() failed with any of the two errors. + // + hr = pIMSAdminBase->AddKey( m_hMetabase, m_szKeyName ); + + if( FAILED( hr ) ) + { + LogError( TEXT( "CIISApplication::pIMSAdminBase->AddKey() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + } + else + { + LogError( TEXT( "CIISApplication::pIMSAdminBase->GetData() failed..." ), HRESULT_CODE(hr) ); + throw hr; + } + } + + // + // Set default property information + // + SetData( MD_VR_PATH, m_szPath, METADATA_INHERIT, IIS_MD_UT_FILE ); + SetData( MD_KEY_TYPE, IIS_CLASS_WEB_VDIR_W, 0, IIS_MD_UT_SERVER ); + + // + // Setup the path to the application root + // + TCHAR szAppRoot [ MAX_PATH + 1 ]; + _sntprintf( szAppRoot, MAX_PATH, TEXT( "%s/%s" ), m_szRoot, m_szKeyName ); + SetData( MD_APP_ROOT, szAppRoot, METADATA_INHERIT, IIS_MD_UT_FILE ); + } +}; + +//-------------------------------------------------------------------------- + +UINT SetupIISUDDIMetabase( int AppPoolIdentityType, LPCTSTR szUserName, LPCTSTR szPwd ) +{ + ENTER(); + + UINT errCode = ERROR_SUCCESS; + +// ::MessageBox( NULL, TEXT( "Attach Debugger" ), TEXT( "SetupIISUDDIMetabase" ), MB_OK ); + + if( FAILED( CoInitializeEx( NULL, COINIT_MULTITHREADED ) ) ) + { + Log( TEXT( "SetupIISUDDIMetabase() failed: CoInitializeEx() failed" ) ); + return ERROR_INSTALL_FAILURE; + } + + // + // Get the root UDDI application path from the registry + // + // + TCHAR szUddiApplicationFilePath[ MAX_PATH ]; + if( !GetUDDIInstallPath( szUddiApplicationFilePath , MAX_PATH ) ) + { + return ERROR_INSTALL_FAILURE; + } + + _tcscat( szUddiApplicationFilePath, TEXT( "webroot" ) ); + + // + // Set the api application path to the root UDDI path also + // + TCHAR szApiApplicationFilePath[ MAX_PATH ]; + _tcscpy( szApiApplicationFilePath, szUddiApplicationFilePath ); + + try + { + // + // Initialize the connection the the IIS metabase + // + try + { + CIISObjectBase::Initialize(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "CIISObjectBase::Initialize() failed" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Create the application pool for the SOAP API and the User Interface + // + try + { + + CIISApplicationPool pool( APPPOOLNAME ); + pool.Create(); + + // + // These values are set by the user on an OCM property page + // + pool.SetData( MD_APPPOOL_IDENTITY_TYPE, AppPoolIdentityType, METADATA_INHERIT, IIS_MD_UT_SERVER ); + + // + // If the user type is "Specific User," then set the user name and password + // + if( MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER == AppPoolIdentityType ) + { + pool.SetData( MD_WAM_USER_NAME, ( PTCHAR ) szUserName, METADATA_INHERIT, IIS_MD_UT_FILE ); + pool.SetData( MD_WAM_PWD, ( PTCHAR ) szPwd, METADATA_INHERIT | METADATA_SECURE, IIS_MD_UT_FILE ); + } + + pool.SetData( MD_APPPOOL_MAX_PROCESS_COUNT, 1, METADATA_INHERIT, IIS_MD_UT_SERVER ); + pool.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error creating application pool" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Create the uddi application for access to the user interface + // + try + { + TCHAR wszBuf[ 512 ]; + wszBuf[ 0 ] = 0x00; + + LoadString( g_hinst, IDS_UDDI_APPLICATION_FRIENDLY_NAME, wszBuf, 512 ); + + CIISApplication uddi( UDDIAPPLICATIONNAME, szUddiApplicationFilePath ); + uddi.Create(); + uddi.SetData( MD_AUTHORIZATION, MD_AUTH_BASIC | MD_AUTH_NT, METADATA_INHERIT, IIS_MD_UT_FILE ); + uddi.SetData( MD_ACCESS_PERM, MD_ACCESS_READ | MD_ACCESS_SCRIPT, METADATA_INHERIT, IIS_MD_UT_FILE ); + uddi.SetData( MD_DEFAULT_LOAD_FILE, DEFAULTLOADFILE, 0, IIS_MD_UT_FILE ); + uddi.SetData( MD_APP_ISOLATED, 2, 0, IIS_MD_UT_WAM ); + uddi.SetData( MD_APP_FRIENDLY_NAME, wszBuf, 0, IIS_MD_UT_WAM ); + uddi.SetData( MD_APP_APPPOOL_ID, APPPOOLNAME, METADATA_INHERIT, IIS_MD_UT_SERVER ); + uddi.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error creating uddi application for access to the user interface" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Create the api application for access to the SOAP interface + // + try + { + TCHAR wszBuf[ 512 ]; + wszBuf[ 0 ] = 0x00; + LoadString( g_hinst, IDS_API_APPLICATION_FRIENDLY_NAME, wszBuf, 512 ); + + CIISApplication api( APIAPPLICATIONNAME, szApiApplicationFilePath ); + api.Create(); + api.SetData( MD_AUTHORIZATION, MD_AUTH_ANONYMOUS /* todo remove by Mark Patton | MD_AUTH_NT*/, METADATA_INHERIT, IIS_MD_UT_FILE ); + api.SetData( MD_ACCESS_PERM, MD_ACCESS_READ | MD_ACCESS_SCRIPT, METADATA_INHERIT, IIS_MD_UT_FILE ); + // api.SetData( MD_DEFAULT_LOAD_FILE, DEFAULTLOADFILE, 0, IIS_MD_UT_FILE ); + api.SetData( MD_APP_ISOLATED, 2, 0, IIS_MD_UT_WAM ); + api.SetData( MD_APP_FRIENDLY_NAME, wszBuf, 0, IIS_MD_UT_WAM ); + api.SetData( MD_APP_APPPOOL_ID, APPPOOLNAME, METADATA_INHERIT, IIS_MD_UT_SERVER ); + +// +// Use the default account. +// +#if 0 + // + // Set the anonymous user name and password + // + if ( MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER == AppPoolIdentityType ) + { + // + // Domain account: + // + api.SetData( MD_ANONYMOUS_USER_NAME, (PTCHAR) szUserName, METADATA_INHERIT, IIS_MD_UT_FILE ); + + if( szPwd && _tcslen( szPwd ) ) + { + api.SetData( MD_ANONYMOUS_PWD, (PTCHAR) szPwd, METADATA_INHERIT | METADATA_SECURE, IIS_MD_UT_FILE ); + } + } + else + { + // + // Network service account: + // + api.SetData( MD_ANONYMOUS_USER_NAME, (PTCHAR) szUserName, METADATA_NO_ATTRIBUTES, IIS_MD_UT_WAM ); + } +#endif + api.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error creating the api application for access to the SOAP interface" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Create the UDDI application dependency + // + try + { + cStrList cAppDep; + + CIISWebService ws; + ws.Create(); + ws.GetMultiSzData( MD_APP_DEPENDENCIES, &cAppDep, 0, IIS_MD_UT_SERVER ); + + if( !IsInList( UDDIAPPLICATIONDEPENDENCY, &cAppDep, FALSE ) ) + { + // + // Append UDDI app dependency string + // + cAppDep.push_back( UDDIAPPLICATIONDEPENDENCY ); + + // + // Set new app dependency string into record + // + ws.SetMultiSzData( MD_APP_DEPENDENCIES, &cAppDep, 0, IIS_MD_UT_SERVER ); + } + + TCHAR szAuthProv[ 256 ]; + + Log( TEXT( "Attempting to get string value for MD_NTAUTHENTICATION_PROVIDERS." ) ); + + try + { + ws.GetData( MD_NTAUTHENTICATION_PROVIDERS, szAuthProv, sizeof(szAuthProv), 0, IIS_MD_UT_FILE ); + Log( TEXT( "Found NT Authentication Providers: %s" ), szAuthProv ); + } + catch( HRESULT hr ) + { + // + // Not an error if it doesn't exist already. + // + Log( TEXT( "Failed to get MD_NTAUTHENTICATION_PROVIDERS as IIS_MD_UT_FILE, HRESULT 0x%x." ), hr ); + } + + try + { + ws.SetData( MD_NTAUTHENTICATION_PROVIDERS, UDDINTAUTHPROVIDERS, METADATA_INHERIT, IIS_MD_UT_FILE ); + Log( TEXT( "Set NT Authentication Providers: %s" ), UDDINTAUTHPROVIDERS ); + } + catch( HRESULT hr ) + { + Log( TEXT( "Failed to set MD_NTAUTHENTICATION_PROVIDERS as IIS_MD_UT_FILE, HRESULT 0x%x." ), hr ); + throw hr; + } + + ws.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error creating application dependency" ), HRESULT_CODE( hr ) ); + throw hr; + } + } + catch( ... ) + { + errCode = ERROR_INSTALL_FAILURE; + } + + CIISObjectBase::Uninitialize(); + CoUninitialize(); + + return errCode; +} + +//-------------------------------------------------------------------------- + +UINT RemoveIISUDDIMetabase(void) +{ + ENTER(); + + UINT errCode = ERROR_INSTALL_FAILURE; + +// ::MessageBox( NULL, TEXT( "Attach Debugger" ), TEXT( "RemoveIISUDDIMetabase" ), MB_OK ); + + // + // Get the root UDDI application path from the registry + // + TCHAR szUddiApplicationFilePath[ MAX_PATH + 1 ]; + if( !GetUDDIInstallPath( szUddiApplicationFilePath , MAX_PATH ) ) + { + return ERROR_INSTALL_FAILURE; + } + + if( FAILED( CoInitializeEx( NULL, COINIT_MULTITHREADED ) ) ) + { + Log( TEXT( "RemoveIISUDDIMetabase() failed: CoInitializeEx() failed" ) ); + return ERROR_INSTALL_FAILURE; + } + + _tcsncat( szUddiApplicationFilePath, TEXT( "webroot" ), MAX_PATH - _tcslen( szUddiApplicationFilePath ) ); + szUddiApplicationFilePath[ MAX_PATH ] = NULL; + + // + // Set the api application path to the root UDDI path also + // + TCHAR szApiApplicationFilePath[ MAX_PATH+1 ]; + memset( szApiApplicationFilePath, 0, sizeof szApiApplicationFilePath ); + _tcsncpy( szApiApplicationFilePath, szUddiApplicationFilePath, MAX_PATH ); + + try + { + try + { + CIISObjectBase::Initialize(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "CIISObjectBase::Initialize() failed" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Delete the api application for access to the SOAP interface + // + try + { + CIISApplication api( APIAPPLICATIONNAME, szApiApplicationFilePath ); + api.Delete(); + api.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error deleting the api application for access to the SOAP interface" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Delete the uddi application for access to the user interface + // + try + { + CIISApplication uddi( UDDIAPPLICATIONNAME, szUddiApplicationFilePath ); + uddi.Delete(); + uddi.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error deleting uddi application for access to the user interface" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Delete the application pool entry + // + try + { + CIISApplicationPool pool( APPPOOLNAME ); + pool.Delete(); + pool.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error deleting application pool" ), HRESULT_CODE( hr ) ); + throw hr; + } + + // + // Remove the UDDI application dependency + // + try + { + cStrList cAppDep; + + CIISWebService ws; + ws.Create(); + ws.GetMultiSzData( MD_APP_DEPENDENCIES, &cAppDep, 0, IIS_MD_UT_SERVER ); + + if( RemoveFromList( UDDIAPPLICATIONDEPENDENCY, &cAppDep, FALSE ) ) + { + // + // Set new app dependency string into record + // + ws.SetMultiSzData( MD_APP_DEPENDENCIES, &cAppDep, 0, IIS_MD_UT_SERVER ); + } + + ws.Release(); + } + catch( HRESULT hr ) + { + LogError( TEXT( "Error deleting application dependency" ), HRESULT_CODE( hr ) ); + throw hr; + } + } + catch( ... ) + { + errCode = ERROR_INSTALL_FAILURE; + } + + CIISObjectBase::Uninitialize(); + CoUninitialize(); + + return errCode; +} diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/makefile b/inetsrv/uddi/source/setup/web/ca.unmanaged/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/_objects.mac b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/_objects.mac new file mode 100644 index 0000000..5f99bc9 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/_objects.mac @@ -0,0 +1,44 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\webcaum.res \ + $(_OBJ_DIR)\i386\apppool.obj \ + $(_OBJ_DIR)\i386\common.obj \ + $(_OBJ_DIR)\i386\strlist.obj \ + $(_OBJ_DIR)\i386\iis.metabase.obj \ + $(_OBJ_DIR)\i386\setdacl.obj \ + $(_OBJ_DIR)\i386\webcaum.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\webcaum.res \ + $(_OBJ_DIR)\ia64\apppool.obj \ + $(_OBJ_DIR)\ia64\common.obj \ + $(_OBJ_DIR)\ia64\strlist.obj \ + $(_OBJ_DIR)\ia64\iis.metabase.obj \ + $(_OBJ_DIR)\ia64\setdacl.obj \ + $(_OBJ_DIR)\ia64\webcaum.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\webcaum.res \ + $(_OBJ_DIR)\amd64\apppool.obj \ + $(_OBJ_DIR)\amd64\common.obj \ + $(_OBJ_DIR)\amd64\strlist.obj \ + $(_OBJ_DIR)\amd64\iis.metabase.obj \ + $(_OBJ_DIR)\amd64\setdacl.obj \ + $(_OBJ_DIR)\amd64\webcaum.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\webcaum.res \ + $(_OBJ_DIR)\arm\apppool.obj \ + $(_OBJ_DIR)\arm\common.obj \ + $(_OBJ_DIR)\arm\strlist.obj \ + $(_OBJ_DIR)\arm\iis.metabase.obj \ + $(_OBJ_DIR)\arm\setdacl.obj \ + $(_OBJ_DIR)\arm\webcaum.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/apppool.obj b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/apppool.obj new file mode 100644 index 0000000..bfc143d Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/apppool.obj differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/common.obj b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/common.obj new file mode 100644 index 0000000..aa3d417 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/common.obj differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/iis.metabase.obj b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/iis.metabase.obj new file mode 100644 index 0000000..421f9a9 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/iis.metabase.obj differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/setdacl.obj b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/setdacl.obj new file mode 100644 index 0000000..e86b514 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/setdacl.obj differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/strlist.obj b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/strlist.obj new file mode 100644 index 0000000..6334682 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/strlist.obj differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.dll b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.dll new file mode 100644 index 0000000..35a53f5 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.dll differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.exp b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.exp new file mode 100644 index 0000000..04f812f Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.exp differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.lib b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.lib new file mode 100644 index 0000000..d07a50c Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.lib differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.obj b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.obj new file mode 100644 index 0000000..082a7bc Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.obj differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.pdb b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.pdb new file mode 100644 index 0000000..15b9c30 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.pdb differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.res b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.res new file mode 100644 index 0000000..7b5cab7 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca.unmanaged/obj/i386/webcaum.res differ diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/placefil.txt b/inetsrv/uddi/source/setup/web/ca.unmanaged/placefil.txt new file mode 100644 index 0000000..f7f3576 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/placefil.txt @@ -0,0 +1 @@ +webcaum.dll uddi\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/resource.h b/inetsrv/uddi/source/setup/web/ca.unmanaged/resource.h new file mode 100644 index 0000000..f2a8ed8 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/resource.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by webcaum.rc +// +#define IDS_UDDI_APPLICATION_FRIENDLY_NAME 101 +#define IDS_API_APPLICATION_FRIENDLY_NAME 102 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 103 +#endif +#endif diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/setdacl.cpp b/inetsrv/uddi/source/setup/web/ca.unmanaged/setdacl.cpp new file mode 100644 index 0000000..bdbe505 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/setdacl.cpp @@ -0,0 +1,481 @@ +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#include +#include +#include + +#include "webcaum.h" +#include "..\..\shared\common.h" +#include "..\..\shared\apppool.h" + + +bool AddAccessRights( TCHAR *lpszFileName, TCHAR *szUserName, DWORD dwAccessMask ) +{ + // + // SID variables. + // + SID_NAME_USE snuType; + TCHAR * szDomain = NULL; + DWORD cbDomain = 0; + + // + // User name variables. + // + LPVOID pUserSID = NULL; + DWORD cbUserSID = 0; + DWORD cbUserName = 0; + + // + // File SD variables. + // + PSECURITY_DESCRIPTOR pFileSD = NULL; + DWORD cbFileSD = 0; + + // + // New SD variables. + // + PSECURITY_DESCRIPTOR pNewSD = NULL; + + // + // ACL variables. + // + PACL pACL = NULL; + BOOL fDaclPresent; + BOOL fDaclDefaulted; + ACL_SIZE_INFORMATION AclInfo; + + // + // New ACL variables. + // + PACL pNewACL = NULL; + DWORD cbNewACL = 0; + + // + // Temporary ACE. + // + LPVOID pTempAce = NULL; + UINT CurrentAceIndex; + bool fResult = false; + BOOL fAPISuccess; + + // error code + DWORD lastErr = 0; + + try + { + // + // Call this API once to get the buffer sizes ( it will return ERROR_INSUFFICIENT_BUFFER ) + // + fAPISuccess = LookupAccountName( NULL, szUserName, pUserSID, &cbUserSID, szDomain, &cbDomain, &snuType ); + + if( fAPISuccess ) + { + throw E_FAIL; // we throw some fake error to skip through to the exit door + } + else if( GetLastError() != ERROR_INSUFFICIENT_BUFFER ) + { + lastErr = GetLastError(); + LogError( TEXT( "LookupAccountName() failed" ), lastErr ); + throw lastErr; + } + + // + // allocate the buffers + // + pUserSID = calloc( cbUserSID, 1 ); + if( !pUserSID ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for UserSID failed" ), lastErr ); + throw lastErr; + } + + szDomain = ( TCHAR * ) calloc( cbDomain + sizeof TCHAR, sizeof TCHAR ); + if( !szDomain ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for szDomain failed" ), lastErr ); + throw lastErr; + } + + // + // The LookupAccountName function accepts the name of a system and an account as input. + // It retrieves a security identifier ( SID ) for the account and + // the name of the domain on which the account was found + // + fAPISuccess = LookupAccountName( NULL /* = local computer */, szUserName, pUserSID, &cbUserSID, szDomain, &cbDomain, &snuType ); + if( !fAPISuccess ) + { + lastErr = GetLastError(); + LogError( TEXT( "LookupAccountName() failed" ), lastErr ); + throw lastErr; + } + + // + // call this API once to get the buffer sizes + // API should have failed with insufficient buffer. + // + fAPISuccess = GetFileSecurity( lpszFileName, DACL_SECURITY_INFORMATION, pFileSD, 0, &cbFileSD ); + if( fAPISuccess ) + { + throw E_FAIL; + } + else if( GetLastError() != ERROR_INSUFFICIENT_BUFFER ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetFileSecurity() failed" ), lastErr ); + throw lastErr; + } + + // + // allocate the buffers + // + pFileSD = calloc( cbFileSD, 1 ); + if( !pFileSD ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for pFileSD failed" ), lastErr ); + throw lastErr; + } + + // + // call the api to get the actual data + // + fAPISuccess = GetFileSecurity( lpszFileName, DACL_SECURITY_INFORMATION, pFileSD, cbFileSD, &cbFileSD ); + if( !fAPISuccess ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetFileSecurity() failed" ), lastErr ); + throw lastErr; + } + + // + // Initialize new SD. + // + pNewSD = calloc( cbFileSD, 1 ); // Should be same size as FileSD. + if( !pNewSD ) + { + lastErr = GetLastError(); + LogError( TEXT( "Alloc() for pNewDS failed" ), GetLastError() ); + throw lastErr; + } + + if( !InitializeSecurityDescriptor( pNewSD, SECURITY_DESCRIPTOR_REVISION ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "InitializeSecurityDescriptor() failed" ), lastErr ); + throw lastErr; + } + + // + // Get DACL from SD. + // + if( !GetSecurityDescriptorDacl( pFileSD, &fDaclPresent, &pACL, &fDaclDefaulted ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetSecurityDescriptorDacl() failed" ), lastErr ); + throw lastErr; + } + + // + // Get size information for DACL. + // + AclInfo.AceCount = 0; // Assume NULL DACL. + AclInfo.AclBytesFree = 0; + AclInfo.AclBytesInUse = sizeof( ACL ); // If not NULL DACL, gather size information from DACL. + if( fDaclPresent && pACL ) + { + if( !GetAclInformation( pACL, &AclInfo, sizeof( ACL_SIZE_INFORMATION ), AclSizeInformation ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetAclInformation() failed" ), lastErr ); + throw lastErr; + } + } + + // + // Compute size needed for the new ACL. + // + cbNewACL = AclInfo.AclBytesInUse + sizeof( ACCESS_ALLOWED_ACE ) + GetLengthSid( pUserSID ); + + // + // Allocate memory for new ACL. + // + pNewACL = ( PACL ) calloc( cbNewACL, 1 ); + if( !pNewACL ) + { + lastErr = GetLastError(); + LogError( TEXT( "HeapAlloc() failed" ), lastErr ); + throw lastErr; + } + + // + // Initialize the new ACL. + // + if( !InitializeAcl( pNewACL, cbNewACL, ACL_REVISION2 ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "InitializeAcl() failed" ), lastErr ); + throw lastErr; + } + + // + // Add the access-allowed ACE to the new DACL. + // + ACE_HEADER aceheader = {0}; + aceheader.AceFlags = CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE; + aceheader.AceSize = sizeof( ACE_HEADER ); + aceheader.AceType = ACCESS_ALLOWED_OBJECT_ACE_TYPE; + if( !AddAccessAllowedAceEx( pNewACL, ACL_REVISION2, aceheader.AceFlags, dwAccessMask, pUserSID ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "AddAccessAllowedAce() failed" ), lastErr ); + throw lastErr; + } + + // + // If DACL is present, copy it to a new DACL. + // + if( fDaclPresent ) + { + // + // Copy the file's ACEs to the new ACL + // + if( AclInfo.AceCount ) + { + for( CurrentAceIndex = 0; CurrentAceIndex < AclInfo.AceCount; CurrentAceIndex++ ) + { + // + // Get an ACE. + // + if( !GetAce( pACL, CurrentAceIndex, &pTempAce ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "GetAce() failed" ), lastErr ); + throw lastErr; + } + + // + // Add the ACE to the new ACL. + // + if( !AddAce( pNewACL, ACL_REVISION, MAXDWORD, pTempAce, ( ( PACE_HEADER ) pTempAce )->AceSize ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "AddAce() failed" ), lastErr ); + throw lastErr; + } + } + } + } + + // + // Set the new DACL to the file SD. + // + if( !SetSecurityDescriptorDacl( pNewSD, TRUE, pNewACL, FALSE ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "SetSecurityDescriptorDacl() failed" ), lastErr ); + lastErr; + } + + // + // Set the SD to the File. + // + if( !SetFileSecurity( lpszFileName, DACL_SECURITY_INFORMATION, pNewSD ) ) + { + lastErr = GetLastError(); + LogError( TEXT( "SetFileSecurity() failed" ), lastErr ); + throw lastErr; + } + + fResult = TRUE; + } + catch (...) + { + fResult = FALSE; + } + + // + // Free allocated memory + // + if( pUserSID ) + free( pUserSID ); + if( szDomain ) + free( szDomain ); + if( pFileSD ) + free( pFileSD ); + if( pNewSD ) + free( pNewSD ); + if( pNewACL ) + free( pNewACL ); + + return fResult; +} + +//---------------------------------------------------------------------------- +// give the domain account read access to the webroot folder and subfolders +// +bool SetUDDIFolderDacls( TCHAR *szUserName ) +{ + ENTER(); + + TCHAR szUDDIInstallPath[ MAX_PATH + 1 ]; + TCHAR szSubfolderPath[ MAX_PATH + 1 ]; + + // + // get UDDI install location ( it already has a backslash ) + // + if( !GetUDDIInstallPath( szUDDIInstallPath, MAX_PATH ) ) + return false; + + // + // give read access to the webroot folder + // + _sntprintf( szSubfolderPath, MAX_PATH, TEXT( "%s%s" ), szUDDIInstallPath, TEXT( "webroot\\" ) ); + + SetFolderAclRecurse( szSubfolderPath, szUserName ); + + return true; +} + +//-------------------------------------------------------------------* + +bool SetFolderAclRecurse( PTCHAR szDirName, PTCHAR szUserName, DWORD dwAccessMask ) +{ + // + // add the ACE for this folder + // + Log( TEXT( "Giving %s access to folder %s" ), szUserName, szDirName ); + + if( !AddAccessRights( szDirName, szUserName, dwAccessMask ) ) + { + LogError( TEXT( "Error:" ), GetLastError() ); + return false; + } + + // + // search any subdirectories: + // + TCHAR tmpFileName[MAX_PATH]; + _tcscpy( tmpFileName, szDirName ); + _tcscat( tmpFileName, TEXT( "*" ) ); + + WIN32_FIND_DATA FindData; + HANDLE hFindFile = FindFirstFileEx( tmpFileName, FindExInfoStandard, &FindData, + FindExSearchLimitToDirectories, NULL, 0 ); + + if( hFindFile == INVALID_HANDLE_VALUE ) + { + return true; + } + + do + { + // make sure it's really a directory + if( FILE_ATTRIBUTE_DIRECTORY & FindData.dwFileAttributes && + 0 != _tcscmp( FindData.cFileName, TEXT( "." ) ) && + 0 != _tcscmp( FindData.cFileName, TEXT( ".." ) ) ) + { + _tcscpy( tmpFileName, szDirName ); + _tcscat( tmpFileName, FindData.cFileName ); + _tcscat( tmpFileName, TEXT( "\\" ) ); + + // recursively call this routine + if( !SetFolderAclRecurse( tmpFileName, szUserName ) ) + { + FindClose( hFindFile ); + return false; + } + } + } + while( FindNextFile( hFindFile, &FindData ) ); + + // clean up + FindClose( hFindFile ); + + return true; +} + +//-------------------------------------------------------------------* + +bool SetWindowsTempDacls( TCHAR *szUserName ) +{ + // + // Get the windows temp directory. + // + TCHAR *systemTemp = GetSystemTemp(); + + if( NULL == systemTemp ) + { + return false; + } + + // + // Add the rights + // + bool rightsAdded = AddAccessRights( systemTemp, szUserName, GENERIC_READ ); + + // + // Clean up + // + delete[] systemTemp; + systemTemp = NULL; + + return rightsAdded; +} + +TCHAR * GetSystemTemp() +{ + TCHAR *TEMP = _T( "\\TEMP\\" ); + + // + // Get the WINDIR environment variable + // + DWORD valueSize = GetEnvironmentVariable( L"WINDIR", NULL, NULL ); + + if( 0 == valueSize ) + { + return NULL; + } + + // + // Keep in mind that we need to append \\TEMP to our string as well. + // + valueSize += ( DWORD) _tcslen( TEMP ); + + TCHAR *valueBuffer = NULL; + valueBuffer = new TCHAR[ valueSize ]; + ZeroMemory( valueBuffer, valueSize ); + + if( NULL == valueBuffer ) + { + return NULL; + } + + DWORD realSize = GetEnvironmentVariable( L"WINDIR", valueBuffer, valueSize ); + + if( 0 == realSize || realSize > valueSize ) + { + delete[] valueBuffer; + valueBuffer = NULL; + + return NULL; + } + + // + // Append a \\TEMP to it + // + _tcsncat( valueBuffer, TEMP, _tcslen( TEMP ) ); + + // + // Make sure we have null terminated. + // + valueBuffer[ valueSize - 1] = 0; + + // + // Return the value + // + return valueBuffer; +} \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/sources b/inetsrv/uddi/source/setup/web/ca.unmanaged/sources new file mode 100644 index 0000000..9a6e04f --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/sources @@ -0,0 +1,55 @@ +TARGETNAME=webcaum +TARGETPATH=obj +TARGETTYPE=DYNLINK +DLLDEF=webcaum.def +DLLENTRY=_DllMainCRTStartup + +# +# Added include path of $(FROOT)\src\common for using ocmres.h +# +INCLUDES=$(INCLUDES);$(_NTROOT)\public\sdk\inc\atl30;C:\nt\public\sdk\inc\mfc42 + + +#PRECOMPILED_CXX=1 +#PRECOMPILED_OBJ=pch.obj +#PRECOMPILED_INCLUDE=stdafx.h +USE_MFCUNICODE=1 +USE_STL=1 +USE_ATL=1 +USE_MSVCRT=1 +ATL_VER=30 + + +TARGETLIBS=\ + $(SDK_LIB_PATH)\atl.lib \ + $(SDK_LIB_PATH)\adsiid.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\oleaut32.lib \ + $(SDK_LIB_PATH)\ole32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\rpcrt4.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\gdi32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\netapi32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\Secur32.lib \ + $(SDK_LIB_PATH)\msi.lib \ + $(SDK_LIB_PATH)\wbemuuid.lib + +SOURCES=\ + apppool.cpp \ + common.cpp \ + strlist.cpp \ + iis.metabase.cpp \ + setdacl.cpp \ + webcaum.cpp \ + webcaum.rc + +C_DEFINES= $(C_DEFINES) -DWEBCAUM_EXPORTS /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/strlist.cpp b/inetsrv/uddi/source/setup/web/ca.unmanaged/strlist.cpp new file mode 100644 index 0000000..a424011 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/strlist.cpp @@ -0,0 +1 @@ +#include "..\..\shared\strlist.cpp" \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.cpp b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.cpp new file mode 100644 index 0000000..c015b4f --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.cpp @@ -0,0 +1,180 @@ +//#ifndef WIN32_LEAN_AND_MEAN +//#define WIN32_LEAN_AND_MEAN +//#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#include +#include + +#include +#include +#include +#include +#include + +#include "webcaum.h" +#include "..\..\shared\common.h" +#include "..\..\shared\propertybag.h" +#include "..\..\shared\apppool.h" + +HINSTANCE g_hinst; + +//-------------------------------------------------------------------------- + +BOOL APIENTRY DllMain( HANDLE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + { + g_hinst = (HINSTANCE)hModule; + break; + } + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +//-------------------------------------------------------------------------- +// +// This function is exported +// +UINT _stdcall Install(MSIHANDLE hInstall) +{ + //::MessageBox( NULL, TEXT( "attach debugger" ), TEXT( "uddi" ), MB_OK ); + + ENTER(); + + TCHAR szCustomActionData[ 256 ]; + DWORD dwLen = sizeof( szCustomActionData ) / sizeof( szCustomActionData[0] ); + + UINT iRet = MsiGetProperty( hInstall, TEXT( "CustomActionData" ), szCustomActionData, &dwLen); + if( ERROR_SUCCESS != iRet ) + { + LogError( TEXT( "Error getting custom action data in Web installer" ), iRet ); + return iRet; + } + + //::MessageBox( NULL, TEXT( "got CustomActionaData" ), TEXT( "uddi" ), MB_OK ); + + // + // get rid of any lefover entries first... + // + RemoveIISUDDIMetabase(); + + //::MessageBox( NULL, TEXT( "removed metabase" ), TEXT( "uddi" ), MB_OK ); + + // + // put our entries into the IIS metabase + // + TCHAR szUserName[CA_VALUE_LEN+1]; + TCHAR szPwd[CA_VALUE_LEN+1]; + TCHAR szTmpBuf[ 1024 ]; + TCHAR szTmpProperty[ 256 ]; + TCHAR szLogPath[ MAX_PATH + 1 ] = {0}; + ATOM at = 0; + int poolidtype = 0; + + memset (szUserName, 0, sizeof szUserName); + memset (szPwd, 0, sizeof szPwd); + memset (szTmpProperty, 0, sizeof szTmpProperty ); + + CPropertyBag pb; + if( !pb.Parse( szCustomActionData, sizeof( szCustomActionData ) / sizeof( TCHAR ) ) ) + { + return ERROR_INSTALL_FAILURE; + } + + //::MessageBox( NULL, TEXT( "parsed properties" ), TEXT( "uddi" ), MB_OK ); + poolidtype = pb.GetValue( TEXT( "APPPOOL_IDENTITY_TYPE" ) ); + _tcsncpy( szUserName, pb.GetString( TEXT( "WAM_USER_NAME" ), szTmpBuf ), CA_VALUE_LEN ); + _tcsncpy( szTmpProperty, pb.GetString( TEXT( "C9E18" ), szTmpProperty ), CA_VALUE_LEN ); + _tcsncpy( szLogPath, pb.GetString( TEXT( "LOGDIR" ), szLogPath ), MAX_PATH ); + + //::MessageBox( NULL, szTmpProperty, TEXT( "C9E18" ), MB_OK ); + + if ( _tcslen( szTmpProperty ) ) + { + at = (ATOM)_ttoi( szTmpProperty ); + GlobalGetAtomName( at, szPwd, CA_VALUE_LEN ); + } + + //::MessageBox( NULL, szPwd, TEXT( "C9E18 Atom value" ), MB_OK ); + + iRet = SetupIISUDDIMetabase( poolidtype, szUserName, szPwd ); + + //::MessageBox( NULL, TEXT( "metabase set up ok" ), TEXT( "uddi" ), MB_OK ); + + //iRet = SetupIISUDDIMetabase( 3, TEXT( "A-MARKPA11\\Guest" ), TEXT( "" ) ); + if( ERROR_SUCCESS != iRet ) + { + return iRet; + } + + // + // stop and start the app pool + // + CUDDIAppPool apppool; + apppool.Recycle(); + + //::MessageBox( NULL, TEXT( "app pool recycled" ), TEXT( "uddi" ), MB_OK ); + + // + // set permissions on the UDDI folders + // + if ( !SetUDDIFolderDacls( szUserName ) ) + { + return ERROR_INSTALL_FAILURE; + } + + // + // now set permissions on the log folders + // + if ( _tcslen( szLogPath ) ) + { + if ( !SetFolderAclRecurse( szLogPath, szUserName, GENERIC_READ | GENERIC_WRITE | DELETE ) ) + return ERROR_INSTALL_FAILURE; + } + + // + // Set permissions on the Windows TEMP folder; we need access to this directory because our code + // does CLR serialization. + if( !SetWindowsTempDacls( szUserName ) ) + { + return ERROR_INSTALL_FAILURE; + } + + //::MessageBox( NULL, TEXT( "finishing this part..." ), TEXT( "uddi" ), MB_OK ); + + Log (_T("About to leave Install with retcode %d"), iRet); + return iRet; +} + +//-------------------------------------------------------------------------- +// +// This function is exported +// +UINT _stdcall Uninstall(MSIHANDLE hInstall) +{ + ENTER(); + //::MessageBox( NULL, TEXT( "attach debugger" ), TEXT( "uddi" ), MB_OK ); + + RemoveIISUDDIMetabase(); + + // + // delete the app pool + // + CUDDIAppPool apppool; + apppool.Delete(); + + return ERROR_SUCCESS; +} diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.def b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.def new file mode 100644 index 0000000..7deaf7a --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.def @@ -0,0 +1,3 @@ +EXPORTS + Install @1 + Uninstall @2 diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.h b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.h new file mode 100644 index 0000000..81a600b --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.h @@ -0,0 +1,22 @@ +#pragma once + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + +#include +#include + +extern HINSTANCE g_hinst; + +UINT SetupIISUDDIMetabase( int AppPoolIdentityType, LPCTSTR szUserName, LPCTSTR szPwd ); +bool SetFolderAclRecurse( PTCHAR szDirName, PTCHAR szfileName, DWORD dwAccessMask = GENERIC_READ ); +UINT RemoveIISUDDIMetabase( void ); +UINT RecycleApplicationPool( void ); +bool SetUDDIFolderDacls( TCHAR *szUserName ); +bool SetWindowsTempDacls( TCHAR* szUserName ); +TCHAR* GetSystemTemp(); diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.rc b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.rc new file mode 100644 index 0000000..95b490d --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.rc @@ -0,0 +1,91 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include \r\n" + "\r\n" + "#define VER_FILETYPE VFT_DLL\r\n" + "#define VER_FILESUBTYPE VFT2_UNKNOWN\r\n" + "#define VER_FILEDESCRIPTION_STR ""Web Component Installer Module""\r\n" + "#define VER_INTERNALNAME_STR ""WEBCAUM.DLL""\r\n" + "#define VER_ORIGINALFILENAME_STR ""WEBCAUM.DLL""\r\n" + "\r\n" + "#include ""common.ver""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_UDDI_APPLICATION_FRIENDLY_NAME "UDDI Services User Interface" + IDS_API_APPLICATION_FRIENDLY_NAME "UDDI Services API" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "Web Component Installer Module" +#define VER_INTERNALNAME_STR "WEBCAUM.DLL" +#define VER_ORIGINALFILENAME_STR "WEBCAUM.DLL" + +#include "common.ver" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.vcproj b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.vcproj new file mode 100644 index 0000000..e90b5ea --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca.unmanaged/webcaum.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/setup/web/ca/assemblyinfo.cs b/inetsrv/uddi/source/setup/web/ca/assemblyinfo.cs new file mode 100644 index 0000000..6117ae5 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/assemblyinfo.cs @@ -0,0 +1,45 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("webca.dll")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright (c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/inetsrv/uddi/source/setup/web/ca/assemblyversioninfo.cs b/inetsrv/uddi/source/setup/web/ca/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/setup/web/ca/build.log b/inetsrv/uddi/source/setup/web/ca/build.log new file mode 100644 index 0000000..bc4ba88 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/build.log @@ -0,0 +1,63 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\setup\web\ca directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\setup\web\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\setup\web\ca +Elapsed time [0:00:00.000] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 webca D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module webca not found in D:\OpenXP\Tools\coffbase.txt +1> resgen.exe .\webca.resx obj\i386\webca.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\setup\web\ca directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 webca D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module webca not found in D:\OpenXP\Tools\coffbase.txt +1> resgen.exe .\webca.resx obj\i386\webca.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\webca.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.xml.dll,system.management.dll,system.configuration.install.dll,system.directoryservices.dll,system.windows.forms.dll,..\..\..\api\obj\I386\uddi.api.dll,..\..\..\api\PassportLib.dll,..\..\..\core\obj\I386\uddi.core.dll assemblyinfo.cs assemblyversioninfo.cs webca.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\setup\web\ca\obj\i386\webca.dll +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:03.437] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/setup/web/ca/makefile b/inetsrv/uddi/source/setup/web/ca/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/web/ca/makefile.inc b/inetsrv/uddi/source/setup/web/ca/makefile.inc new file mode 100644 index 0000000..6f6ce0e --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/setup/web/ca/obj/_objects.mac b/inetsrv/uddi/source/setup/web/ca/obj/_objects.mac new file mode 100644 index 0000000..c3411ec --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\webca.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\webca.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\webca.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\webca.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/web/ca/obj/i386/webca.dll b/inetsrv/uddi/source/setup/web/ca/obj/i386/webca.dll new file mode 100644 index 0000000..c62aad1 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca/obj/i386/webca.dll differ diff --git a/inetsrv/uddi/source/setup/web/ca/obj/i386/webca.pdb b/inetsrv/uddi/source/setup/web/ca/obj/i386/webca.pdb new file mode 100644 index 0000000..4b044a4 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/ca/obj/i386/webca.pdb differ diff --git a/inetsrv/uddi/source/setup/web/ca/placefil.txt b/inetsrv/uddi/source/setup/web/ca/placefil.txt new file mode 100644 index 0000000..826b388 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/placefil.txt @@ -0,0 +1 @@ +webca.dll uddi\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/ca/sources b/inetsrv/uddi/source/setup/web/ca/sources new file mode 100644 index 0000000..3a81c0b --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/sources @@ -0,0 +1,37 @@ +# +# sources file for a managed code DLL +# +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=webca +TARGETPATH=obj +TARGETTYPE=DYNLINK +SYNCHRONIZE_PASS2_BLOCK=1 + +# +# tell the system to build the resources file +# +NTTARGETFILE1=$(O)\webca.resources foo.cs + +# +# this get passed to the csc.exe command line, so specify the resources +# also, we assign the "logical names" to the resources so that the VS-generated +# code could find them +# +#USER_CS_FLAGS=/resource:$(O)\webca.resources + +# +# add all the other assembly references here +# +REFERENCES=system.dll, system.data.dll, system.xml.dll, system.management.dll, system.configuration.install.dll, system.directoryservices.dll, system.windows.forms.dll, ..\..\..\api\obj\*\uddi.api.dll, ..\..\..\api\PassportLib.dll, ..\..\..\core\obj\*\uddi.core.dll + +# +# csharp source code +# +SOURCES=\ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + webca.cs + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/setup/web/ca/webca.cs b/inetsrv/uddi/source/setup/web/ca/webca.cs new file mode 100644 index 0000000..6adf240 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/webca.cs @@ -0,0 +1,1471 @@ +/// ************************************************************************ +/// Microsoft UDDI version 2.0 +/// Copyright (c) 2000-2001 Microsoft Corporation +/// All rights reserved +/// +/// ** Microsoft Confidential ** +/// ------------------------------------------------------------------------ +/// +/// +/// ************************************************************************ +/// +using System; +using System.IO; +using System.Net; +using System.Text; +using System.Data; +using Microsoft.Win32; +using System.Diagnostics; +using System.Reflection; +using System.Collections; +using System.Data.SqlClient; +using System.ComponentModel; +using System.ServiceProcess; +using System.DirectoryServices; +using System.Configuration.Install; +using System.Runtime.InteropServices; +using System.Xml.Serialization; +using System.Resources; +using System.Windows.Forms; +using System.Security.Permissions; +using System.Security.Principal; +using System.Globalization; + +using UDDI; +using UDDI.Diagnostics; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.Binding; +using UDDI.API.ServiceType; +using UDDI.ActiveDirectory; + + +namespace UDDI.WebCA +{ + /// + /// Summary description for installer. + /// + [RunInstaller(true)] + public class Installer : System.Configuration.Install.Installer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + private string serviceAccountPassword = null; + private string targetDirectory = null; + private string compileDirectory = null; + private const int ERROR_USER_NOT_FOUND = -2147463164; + private const int ERROR_USER_ALREADY_IN_GROUP = -2147023518; + + private const string busEntityKeyName = "Site.Key"; // we use this name to save the key in the Config + private const string defaultHelpDir = "default"; + + // + // These values are set in the MSI + // + private const string addServicesKeyName = "UDDI_ADDSVC"; // "Add Services" context flag name + private const string updateADKeyName = "UDDI_UPDATEAD"; // "Update Active Dir" context flag name + private const string sslRequiredKey = "Security.HTTPS"; + private const string cultureID = "CultureID"; + + private const string clustNodeTypeParam = "CNTYPE"; // cluster node type + private const string clustNodeActive = "A"; // Denotes an "active" node + private const string clustNodePassive = "P"; // Denotes a "passive" aka non-owning node + + private const string tmodelWinAuthMode = "uuid:0C61E2C3-73C5-4743-8163-6647AF5B4B9E"; + private const string tmodelUDDIAuthMode = "uuid:F358808C-E939-4813-A407-8873BFDC3D57"; + private const string tmodelAnonAuthMode = "uuid:E4A56494-4946-4805-ACA5-546B8D08EEFD"; + + private const string tmodelUddiOrgPub = "uuid:64C756D1-3374-4E00-AE83-EE12E38FAE63"; + private const string tmodelUddiOrgPubV2 = "uuid:A2F36B65-2D66-4088-ABC7-914D0E05EB9E"; + private const string tmodelUddiOrgHttp = "uuid:68DE9E80-AD09-469D-8A37-088422BFBC36"; + private const string tmodelUddiOrgHomepage = "uuid:4CEC1CEF-1F68-4B23-8CB7-8BAA763AEB89"; + private const string tmodelUddiOrgInquiry = "uuid:4CD7E4BC-648B-426D-9936-443EAAC8AE23"; + private const string tmodelUddiOrgInquiryV2 = "uuid:AC104DCC-D623-452F-88A7-F8ACD94D9B2B"; + private const string tmodelMSComAddWebRef = "uuid:CE653789-F6D4-41B7-B7F4-31501831897D"; + private const string tmodelMSComUddiExtV2 = "uuid:B3C0835E-7206-41E0-9311-C8AD8FB19F73"; + + // + // ActiveDirectory Class Names and reserved Keywords + // + private const string pubInqClassName = "UddiInquireUrl"; + private const string pubPubClassName = "UddiPublishUrl"; + private const string pubWebClassName = "UddiWebSiteUrl"; + private const string pubDiscoClassName = "UddiDiscoveryUrl"; + private const string pubAddRefClassName = "UddiAddWebReferenceUrl"; + + private const string kwdWinAuthMode = "WindowsAuthentication"; + private const string kwdUDDIAuthMode = "UDDIAuthentication"; + private const string kwdAnonAuthMode = "AnonymousAuthentication"; + + private const string kwdWinAuthModeUuid = "0C61E2C3-73C5-4743-8163-6647AF5B4B9E"; + private const string kwdUDDIAuthModeUuid = "F358808C-E939-4813-A407-8873BFDC3D57"; + private const string kwdAnonAuthModeUuid = "E4A56494-4946-4805-ACA5-546B8D08EEFD"; + + private const string kwdDiscoveryUrlID = "1276768A-1488-4C6F-A8D8-19556C6BE583"; + private const string kwdPublishServiceID = "64C756D1-3374-4E00-AE83-EE12E38FAE63"; + private const string kwdInquiryServiceID = "4CD7E4BC-648B-426D-9936-443EAAC8AE23"; + private const string kwdAddWebRefServiceID = "CE653789-F6D4-41B7-B7F4-31501831897D"; + private const string kwdWebSiteServiceID = "4CEC1CEF-1F68-4B23-8CB7-8BAA763AEB89"; + + private const string kwdDiscoveryUrl = "Discovery Url"; + private const string kwdPublishService = "Publish API"; + private const string kwdInquiryService = "Inquire API"; + private const string kwdAddWebRefService= "Add Web Reference"; + private const string kwdWebSiteService = "Web Site"; + + private const string addXPAccessSQL = @" +USE master +IF EXISTS ( SELECT * FROM sysusers where name = '{0}' ) +BEGIN + EXEC sp_revokedbaccess '{0}' +END +EXEC sp_grantdbaccess '{0}' + +GRANT EXEC ON xp_recalculate_statistics TO public +GRANT EXEC ON xp_reset_key TO public"; + + public Installer() + { + Enter(); + + // + // This call is required by the Designer. + // + InitializeComponent(); + + Leave(); + } + + public override void Install( System.Collections.IDictionary state ) + { + Enter(); + + try + { + base.Install( state ); + + Log( String.Format( "Running under the '{0}' user credentials", WindowsIdentity.GetCurrent().Name ) ); + + targetDirectory = (string) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstallRoot" ); + compileDirectory = targetDirectory + @"webroot\compile"; + + //foreach( System.Reflection.Assembly a in System.AppDomain.CurrentDomain.GetAssemblies() ) + //{ + // Log( "Name: " + a.FullName + "\tLocation: " + a.Location ); + //} + + // + // Generate a random password + // + serviceAccountPassword = GenerateRandomString(); + + //System.Windows.Forms.MessageBox.Show( "UDDI Application Installer Stop", "UDDI.Debug" ); + + // + // obtain installation options + // + string szAddServiceFlag = Context.Parameters[ addServicesKeyName ]; + string szUpdateADFlag = Context.Parameters[ updateADKeyName ]; + + if ( szAddServiceFlag == null ) + throw new InstallException( string.Format( "Required context value is not set: '{0}'", addServicesKeyName ) ); + + if ( szUpdateADFlag == null ) + throw new InstallException( string.Format( "Required context value is not set: '{0}'", szUpdateADFlag ) ); + + bool bAddServices = szAddServiceFlag.Equals( "1" ); + bool bUpdateActiveDir = szUpdateADFlag.Equals( "1" ); + + // + // First, are we on a cluster node ? + // + bool bActiveNode = false; + string sClusterNodeType = Context.Parameters[ clustNodeTypeParam ]; + + if ( sClusterNodeType == null || sClusterNodeType == "" ) + bActiveNode = true; // we are not on a node, assume "active" mode + else if ( String.Compare( sClusterNodeType, clustNodeActive, true ) == 0 ) + bActiveNode = true; + else + bActiveNode = false; + + if ( bActiveNode ) + { + CreateLogin(); + } + + RegisterWebServer(); + ImportCertificate(); + InitializeCounters(); + AddUserToIIS_WPG(); + RenameHelp( targetDirectory, true ); + + if ( bActiveNode ) + { + UpdateDiscoveryUrl( bAddServices ); + if ( bAddServices ) + { + AddDefaultServices(); + } + + if ( bUpdateActiveDir ) + { + PublishToActiveDirectory( true ); + } + } + + try + { + StartService( "RemoteRegistry", 30 ); + } + catch ( Exception e ) + { + LogException( string.Format( "Exception occured during database install: '{0}'", "RemoteRegistry Start" ) , e ); + } + } + catch( Exception e ) + { + LogException( "Exception thrown in Install()", e ); + throw e; + } + finally + { + Leave(); + } + } + + public override void Uninstall( System.Collections.IDictionary state ) + { + Enter(); + + try + { + base.Uninstall( state ); + + UnRegisterWebServer(); + DeleteCounters(); + + // + // Uninstall is called first during install; make sure our registry is laid down before + // trying to move files. + // + RegistryKey uddiKey = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ); + if( null != uddiKey ) + { + RenameHelp( ( string ) uddiKey.GetValue( "InstallRoot" ), false ); + } + } + catch + { + // do nothing + } + finally + { + Leave(); + } + } + + public override void Rollback( System.Collections.IDictionary state ) + { + Enter(); + base.Rollback( state ); + Uninstall( state ); + Leave(); + } + + public void ImportData() + { + // + // TODO: Import the initial data set + // we need to get this from ckurt + // + } + + public void ImportCertificate() + { + // + // TODO: Get the specified certificate name from the registry + // and import it into the certificate store using certmgr.exe + // + } + + private void AddUserToIIS_WPG() + { + Enter(); + string userName = null; + + try + { + userName = Context.Parameters[ "WAM_USER_NAME" ]; + if( 0 == userName.Length ) + { + throw new InstallException( "User name was not specified for the CreateLogin() function" ); + } + + // + // replace any "\" with "/" + // + userName = userName.Replace( '\\', '/' ); + + Log( "Attempting to add " + userName + " to the IIS_WPG group..." ); + string rootName = "WinNT://" + SystemInformation.ComputerName; + DirectoryEntry computer = new DirectoryEntry( rootName ); + DirectoryEntry group = computer.Children.Find( "IIS_WPG", "group" ); + group.Invoke( "Add", new object[] { rootName + "/" + userName } ); + group.CommitChanges(); // actual store of entry + } + catch( Exception e ) + { + // + // check to see if the exception is because this user + // is already in the group + // + COMException ce = ( COMException ) e.InnerException; + + if( ERROR_USER_ALREADY_IN_GROUP == ce.ErrorCode ) + { + Log( "This user is already in the group" ); + } + else + { + LogError( "Error adding " + userName + " to the IIS_WPG group: " + e.InnerException.Message ); + } + } + finally + { + Leave(); + } + } + + private string GenerateRandomString() + { + byte[] begin = Guid.NewGuid().ToByteArray(); + byte[] end = Guid.NewGuid().ToByteArray(); + string str = Convert.ToBase64String( begin ) + "29.?" + Convert.ToBase64String( end ); + return str; + } + + + protected void AddDefaultServices() + { + Enter(); + + try + { + // + // set up the connection and other environment settings + // + ConnectionManager.Open( true, true ); + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + UDDI.Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + + // + // now retrieve the config options (site key etc.) + // + string key = UDDI.Config.GetString( busEntityKeyName, "*" ); + if ( key.Equals( "*" ) ) // there is no business entity key in the config + throw new InstallException( string.Format( "Required configuration parameter is missing: '{0}'", busEntityKeyName ) ); + + // + // now as we know the site key, we can populate the Services data + // First, generate the URL stubs + // + IPHostEntry hostInfo = Dns.GetHostByName( Dns.GetHostName() ); + + string szUDDIPrivatePath = "http://" + hostInfo.HostName + "/uddi"; + string szUDDIPublicPath = "http://" + hostInfo.HostName + "/uddipublic"; + string szPublishPublicPath; + string szPublishPrivatePath; + + string szRequireSSL = Config.GetString( sslRequiredKey, "0" ); + if ( szRequireSSL.Equals( "1" ) ) + { + szPublishPrivatePath = "https://" + hostInfo.HostName + "/uddi"; + szPublishPublicPath = "https://" + hostInfo.HostName + "/uddipublic"; + } + else + { + szPublishPrivatePath = "http://" + hostInfo.HostName + "/uddi"; + szPublishPublicPath = "http://" + hostInfo.HostName + "/uddipublic"; + } + + string szServiceName = Localization.GetString( "WEBCA_UDDI_SERVICE_NAME" ); + string szServiceDesc = Localization.GetString( "WEBCA_UDDI_DESC_SERVICE" ); + string szPublishAPIDesc = Localization.GetString( "WEBCA_UDDI_DESC_PUBGENERIC" ); + string szPublishAPIDesc_V1 = Localization.GetString( "WEBCA_UDDI_DESC_PUBVER1" ); + string szPublishAPIDesc_V2 = Localization.GetString( "WEBCA_UDDI_DESC_PUBVER2" ); + string szInquiryAPIDesc = Localization.GetString( "WEBCA_UDDI_DESC_INQUIRYGENERIC" ); + string szInquiryAPIDesc_V1 = Localization.GetString( "WEBCA_UDDI_DESC_INQUIRYV1" ); + string szInquiryAPIDesc_V2 = Localization.GetString( "WEBCA_UDDI_DESC_INQUIRYV2" ); + string szOrgHttpDesc = Localization.GetString( "WEBCA_UDDI_DESC_HTTP" ); + string szOrgHomepageDesc = Localization.GetString( "WEBCA_UDDI_DESC_HOMEPAGE" ); + string szWinAuthDesc = Localization.GetString( "WEBCA_UDDI_DESC_WINAUTH" ); + string szAnonAuthDesc = Localization.GetString( "WEBCA_UDDI_DESC_ANONAUTH" ); + string szUDDIAuthDesc = Localization.GetString( "WEBCA_UDDI_DESC_UDDIAUTH" ); + string szAddRefDesc = Localization.GetString( "WEBCA_UDDI_DESC_ADDREF" ); + string szExtensionsDesc = Localization.GetString( "WEBCA_UDDI_DESC_MSCOM_EXT" ); + string szExtensionsDesc_V2 = Localization.GetString( "WEBCA_UDDI_DESC_MSCOM_EXTV2" ); + + // + // Now let's update the services + // + int itemPos = 0; + UDDI.API.Service.BusinessService defService = new UDDI.API.Service.BusinessService(); + defService.BusinessKey = key; + defService.Names.Add( szServiceName ); + defService.Descriptions.Add( szServiceDesc ); + + // + // publish API, Windows authentication + // + BindingTemplate bindPublish = new BindingTemplate(); + bindPublish.AccessPoint.Value = szPublishPrivatePath + "/publish.asmx"; + bindPublish.Descriptions.Add( szPublishAPIDesc ); + + itemPos = bindPublish.TModelInstanceInfos.Add( tmodelUddiOrgPub, "", "" ); + bindPublish.TModelInstanceInfos[ itemPos ].Descriptions.Add( szPublishAPIDesc_V1 ); + + itemPos = bindPublish.TModelInstanceInfos.Add( tmodelUddiOrgPubV2, "", "" ); + bindPublish.TModelInstanceInfos[ itemPos ].Descriptions.Add( szPublishAPIDesc_V2 ); + + itemPos = bindPublish.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + bindPublish.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = bindPublish.TModelInstanceInfos.Add( tmodelWinAuthMode, "", "" ); + bindPublish.TModelInstanceInfos[ itemPos ].Descriptions.Add( szWinAuthDesc ); + + defService.BindingTemplates.Add( bindPublish ); + + // + // AddWebRef API, Windows authentication + // + BindingTemplate bindAddWebRef = new BindingTemplate(); + bindAddWebRef.Descriptions.Add( szAddRefDesc ); + bindAddWebRef.AccessPoint.Value = szUDDIPrivatePath + "/addwebreference"; + + itemPos = bindAddWebRef.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + bindAddWebRef.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = bindAddWebRef.TModelInstanceInfos.Add( tmodelWinAuthMode, "", "" ); + bindAddWebRef.TModelInstanceInfos[ itemPos ].Descriptions.Add( szWinAuthDesc ); + + itemPos = bindAddWebRef.TModelInstanceInfos.Add( tmodelMSComAddWebRef, "", "" ); + bindAddWebRef.TModelInstanceInfos[ itemPos ].Descriptions.Add( szAddRefDesc ); + + defService.BindingTemplates.Add( bindAddWebRef ); + + // + // UI public (R/O) API, Anonymous authentication + // + BindingTemplate bindUIRO = new BindingTemplate(); + bindUIRO.AccessPoint.Value = szUDDIPublicPath; + bindUIRO.Descriptions.Add( szOrgHomepageDesc ); + + itemPos = bindUIRO.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + bindUIRO.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = bindUIRO.TModelInstanceInfos.Add( tmodelUddiOrgHomepage, "", "" ); + bindUIRO.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHomepageDesc ); + + itemPos = bindUIRO.TModelInstanceInfos.Add( tmodelAnonAuthMode, "", "" ); + bindUIRO.TModelInstanceInfos[ itemPos ].Descriptions.Add( szAnonAuthDesc ); + + defService.BindingTemplates.Add( bindUIRO ); + + // + // UI private API, Windows authentication + // + BindingTemplate bindUI = new BindingTemplate(); + bindUI.AccessPoint.Value = szUDDIPrivatePath; + bindUI.Descriptions.Add( szOrgHomepageDesc ); + + itemPos = bindUI.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + bindUI.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = bindUI.TModelInstanceInfos.Add( tmodelUddiOrgHomepage, "", "" ); + bindUI.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHomepageDesc ); + + itemPos = bindUI.TModelInstanceInfos.Add( tmodelWinAuthMode, "", "" ); + bindUI.TModelInstanceInfos[ itemPos ].Descriptions.Add( szWinAuthDesc ); + + defService.BindingTemplates.Add( bindUI ); + + // + // publish API, UDDI authentication + // + BindingTemplate bindPublishUDDI = new BindingTemplate(); + bindPublishUDDI.AccessPoint.Value = szPublishPublicPath + "/publish.asmx"; + bindPublishUDDI.Descriptions.Add( szPublishAPIDesc ); + + itemPos = bindPublishUDDI.TModelInstanceInfos.Add( tmodelUddiOrgPub, "", "" ); + bindPublishUDDI.TModelInstanceInfos[ itemPos ].Descriptions.Add( szPublishAPIDesc_V1 ); + + itemPos = bindPublishUDDI.TModelInstanceInfos.Add( tmodelUddiOrgPubV2, "", "" ); + bindPublishUDDI.TModelInstanceInfos[ itemPos ].Descriptions.Add( szPublishAPIDesc_V2 ); + + itemPos = bindPublishUDDI.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + bindPublishUDDI.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = bindPublishUDDI.TModelInstanceInfos.Add( tmodelUDDIAuthMode, "", "" ); + bindPublishUDDI.TModelInstanceInfos[ itemPos ].Descriptions.Add( szUDDIAuthDesc ); + + defService.BindingTemplates.Add( bindPublishUDDI ); + + // + // inquiry API, Windows authentication + // + BindingTemplate bindInq = new BindingTemplate(); + bindInq.AccessPoint.Value = szUDDIPrivatePath + "/inquire.asmx"; + bindInq.Descriptions.Add( szInquiryAPIDesc ); + + itemPos = bindInq.TModelInstanceInfos.Add( tmodelWinAuthMode, "", "" ); + bindInq.TModelInstanceInfos[ itemPos ].Descriptions.Add( szWinAuthDesc ); + + itemPos = bindInq.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + bindInq.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = bindInq.TModelInstanceInfos.Add( tmodelUddiOrgInquiry, "", "" ); + bindInq.TModelInstanceInfos[ itemPos ].Descriptions.Add( szInquiryAPIDesc_V1 ); + + itemPos = bindInq.TModelInstanceInfos.Add( tmodelUddiOrgInquiryV2, "", "" ); + bindInq.TModelInstanceInfos[ itemPos ].Descriptions.Add( szInquiryAPIDesc_V2 ); + + defService.BindingTemplates.Add( bindInq ); + + // + // inquiry API, Anonymous authentication + // + BindingTemplate bindInqPub = new BindingTemplate(); + bindInqPub.AccessPoint.Value = szUDDIPublicPath + "/inquire.asmx"; + bindInqPub.Descriptions.Add( szInquiryAPIDesc ); + + itemPos = bindInqPub.TModelInstanceInfos.Add( tmodelAnonAuthMode, "", "" ); + bindInqPub.TModelInstanceInfos[ itemPos ].Descriptions.Add( szAnonAuthDesc ); + + itemPos = bindInqPub.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + bindInqPub.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = bindInqPub.TModelInstanceInfos.Add( tmodelUddiOrgInquiry, "", "" ); + bindInqPub.TModelInstanceInfos[ itemPos ].Descriptions.Add( szInquiryAPIDesc_V1 ); + + itemPos = bindInqPub.TModelInstanceInfos.Add( tmodelUddiOrgInquiryV2, "", "" ); + bindInqPub.TModelInstanceInfos[ itemPos ].Descriptions.Add( szInquiryAPIDesc_V2 ); + + defService.BindingTemplates.Add( bindInqPub ); + + // + // categorization API (V2 Ext), UDDI authentication + // + BindingTemplate categoryPub = new BindingTemplate(); + categoryPub.AccessPoint.Value = szUDDIPublicPath + "/extension.asmx"; // #1509 - rename category.asmx to extension.asmx + categoryPub.Descriptions.Add( szExtensionsDesc ); + + itemPos = categoryPub.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + categoryPub.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = categoryPub.TModelInstanceInfos.Add( tmodelUDDIAuthMode, "", "" ); + categoryPub.TModelInstanceInfos[ itemPos ].Descriptions.Add( szUDDIAuthDesc ); + + itemPos = categoryPub.TModelInstanceInfos.Add( tmodelMSComUddiExtV2, "", "" ); + categoryPub.TModelInstanceInfos[ itemPos ].Descriptions.Add( szUDDIAuthDesc ); + + defService.BindingTemplates.Add( categoryPub ); + + // + // categorization API (V2 Ext), Windows authentication + // + BindingTemplate categoryWin = new BindingTemplate(); + categoryWin.AccessPoint.Value = szUDDIPrivatePath + "/extension.asmx"; // #1509 - rename category.asmx to extension.asmx + categoryWin.Descriptions.Add( szExtensionsDesc ); + + itemPos = categoryWin.TModelInstanceInfos.Add( tmodelUddiOrgHttp, "", "" ); + categoryWin.TModelInstanceInfos[ itemPos ].Descriptions.Add( szOrgHttpDesc ); + + itemPos = categoryWin.TModelInstanceInfos.Add( tmodelWinAuthMode, "", "" ); + categoryWin.TModelInstanceInfos[ itemPos ].Descriptions.Add( szWinAuthDesc ); + + itemPos = categoryWin.TModelInstanceInfos.Add( tmodelMSComUddiExtV2, "", "" ); + categoryWin.TModelInstanceInfos[ itemPos ].Descriptions.Add( szExtensionsDesc_V2 ); + + defService.BindingTemplates.Add( categoryWin ); + + //---------------------------------------- + // now save the service + // + defService.Save(); + + // + // Commit pending DB changes + // + ConnectionManager.Commit(); + } + catch ( Exception e ) + { + ConnectionManager.Abort(); + LogException( "AddDefaultServices", e ); + Log( string.Format( "Failed to create the default service bindings. Reason: {0}", e.Message ) ); + throw e; + } + finally + { + ConnectionManager.Close(); + Leave(); + } + } + + + protected void PublishToActiveDirectory( bool bOverwrite ) + { + Enter(); + try + { + ConnectionManager.Open( false, false ); + + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + UDDI.Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + + // + // now retrieve the config options (site key etc.) + // + string key = UDDI.Config.GetString( busEntityKeyName, "*" ); + if ( key.Equals( "*" ) ) // there is no business entity key in the config + throw new Exception( "Missing value: " + busEntityKeyName ); + + + // + // grab the business entity and all the related parts + // + BusinessEntity busEntity = new BusinessEntity( key ); + busEntity.Get(); + + // + // now get the entity name + // + string entityName = key; // in case we can't retrieve the name + try + { + entityName = busEntity.Names[ 0 ].Value; + } + catch (Exception) + { + } + + // + // now load the strings we need to have handy while creating the service + // entries. + // Note that we use the "main" resource from uddi.resources rather than + // the "local" project-level one + // + string szInqClassDispName = Localization.GetString( "WEBCA_ADTAG_UDDI_INQUIRE" ); + string szPubClassDispName = Localization.GetString( "WEBCA_ADTAG_UDDI_PUBLISH" ); + string szWebClassDispName = Localization.GetString( "WEBCA_ADTAG_UDDI_WEBSITE" ); + string szDiscoClassDispName = Localization.GetString( "WEBCA_ADTAG_UDDI_DISCOVERY" ); + string szAddRefClassDispName= Localization.GetString( "WEBCA_ADTAG_UDDI_ADDWEBREF" ); + + string szInqClassDesc = String.Format( Localization.GetString( "WEBCA_ADTAG_UDDI_INQUIREDESC" ), entityName ); + string szPubClassDesc = String.Format( Localization.GetString( "WEBCA_ADTAG_UDDI_PUBLISHDESC" ), entityName ); + string szWebClassDesc = String.Format( Localization.GetString( "WEBCA_ADTAG_UDDI_WEBSITEDESC" ), entityName ); + string szDiscoClassDesc = String.Format( Localization.GetString( "WEBCA_ADTAG_UDDI_DISCOVERYDESC" ), entityName ); + string szAddRefClassDesc= String.Format( Localization.GetString( "WEBCA_ADTAG_UDDI_ADDWEBREFDESC" ), entityName ); + + string szWinAuthDescMask = Localization.GetString( "WEBCA_ADTAG_UDDI_AUTHWIN_DESC" ); + string szUDDIAuthDescMask = Localization.GetString( "WEBCA_ADTAG_UDDI_AUTHUDDI_DESC" ); + string szAnonAuthDescMask = Localization.GetString( "WEBCA_ADTAG_UDDI_AUTHANON_DESC" ); + + // + // wipe out the existing entry if needed + // + if ( bOverwrite ) + UDDIServiceConnPoint.ResetSiteEntry( key ); + else + UDDIServiceConnPoint.CreateSiteEntry( key ); + + // + // then take care of the DiscoveryURL's + // + foreach ( DiscoveryUrl url in busEntity.DiscoveryUrls ) + { + string tmpKey = Guid.NewGuid().ToString(); + string tmpUrl = url.Value; + + UDDIServiceConnPoint.CreateEntryPoint( key, tmpKey, tmpUrl, + pubDiscoClassName, szDiscoClassDispName, + szDiscoClassDesc, + kwdDiscoveryUrl, kwdDiscoveryUrlID ); + } + + // + // now we can iterate through the list of services + // and publish them + // + BusinessService[] services = busEntity.BusinessServices.ToArray(); + foreach (BusinessService svc in services) + { + string svcKey = svc.ServiceKey; + BindingTemplate[] templates = svc.BindingTemplates.ToArray(); + + foreach (BindingTemplate busTemplate in templates) + { + string accPoint = busTemplate.AccessPoint.Value; + string bindingKey = busTemplate.BindingKey; + string svcClass = ""; + string svcDispName = ""; + string svcDesc = ""; + string svcDescMask = ""; + + bool bWinAuth = false; + bool bUDDIAuth = false; + bool bAnonAuth = false; + bool bInquiry = false; + bool bPublish = false; + bool bWebSite = false; + bool bAddRef = false; + ArrayList tmpKwds = new ArrayList(); + + // + // now let's go through the TModel list and figure out what + // service is this + // + foreach (TModelInstanceInfo tmdInfo in busTemplate.TModelInstanceInfos) + { + string szTemp = tmdInfo.TModelKey; + + // + // checking the authentication mode and service type + // + if ( String.Compare( szTemp, tmodelWinAuthMode, true ) == 0 ) + { + bWinAuth = true; + tmpKwds.Add( kwdWinAuthMode ); + tmpKwds.Add( kwdWinAuthModeUuid ); + svcDescMask = szWinAuthDescMask; + } + else if ( String.Compare( szTemp, tmodelUDDIAuthMode, true ) == 0 ) + { + bUDDIAuth = true; + tmpKwds.Add( kwdUDDIAuthMode ); + tmpKwds.Add( kwdUDDIAuthModeUuid ); + svcDescMask = szUDDIAuthDescMask; + } + else if ( String.Compare( szTemp, tmodelAnonAuthMode, true ) == 0 ) + { + bAnonAuth = true; + tmpKwds.Add( kwdAnonAuthMode ); + tmpKwds.Add( kwdAnonAuthModeUuid ); + svcDescMask = szAnonAuthDescMask; + } + else if ( String.Compare( szTemp, tmodelUddiOrgPub, true ) == 0 || + String.Compare( szTemp, tmodelUddiOrgPubV2, true ) == 0 ) + { + if ( !bPublish ) + { + bPublish = true; + tmpKwds.Add( kwdPublishService ); + tmpKwds.Add( kwdPublishServiceID ); + + svcClass = pubPubClassName; + svcDispName = szPubClassDispName; + svcDesc = szPubClassDesc; + } + } + else if ( String.Compare( szTemp, tmodelUddiOrgInquiry, true ) == 0 || + String.Compare( szTemp, tmodelUddiOrgInquiryV2, true ) == 0 ) + { + if ( !bInquiry ) + { + bInquiry = true; + tmpKwds.Add( kwdInquiryService ); + tmpKwds.Add( kwdInquiryServiceID ); + + svcClass = pubInqClassName; + svcDispName = szInqClassDispName; + svcDesc = szInqClassDesc; + } + } + else if ( String.Compare( szTemp, tmodelMSComAddWebRef, true ) == 0 ) + { + bAddRef = true; + tmpKwds.Add( kwdAddWebRefServiceID ); + tmpKwds.Add( kwdAddWebRefService ); + + svcClass = pubAddRefClassName; + svcDispName = szAddRefClassDispName; + svcDesc = szAddRefClassDesc; + } + else if ( String.Compare( szTemp, tmodelUddiOrgHomepage, true ) == 0 ) + { + bWebSite = true; + tmpKwds.Add( kwdWebSiteService ); + tmpKwds.Add( kwdWebSiteServiceID ); + + svcClass = pubWebClassName; + svcDispName = szWebClassDispName; + svcDesc = szWebClassDesc; + } + } + + // + // first, a quick sanity check. If more than one authmode is set, or + // if there is no authmode at all, then we should skip the entry as invalid + // + if ( !( bWinAuth | bUDDIAuth | bAnonAuth ) || !( bWinAuth ^ bUDDIAuth ^ bAnonAuth ) ) + continue; + + // + // now same thing with the service types + // + if ( !( bPublish | bInquiry | bAddRef | bWebSite ) || !( bPublish ^ bInquiry ^ bAddRef ^ bWebSite ) ) + continue; + + // + // now we are ready to create the AD entry + // + if ( svcDescMask.Length > 0 ) + svcDesc = String.Format( svcDescMask, svcDesc ); + + UDDIServiceConnPoint.CreateEntryPoint( key, bindingKey, accPoint, + svcClass, svcDispName, + svcDesc, tmpKwds.ToArray() ); + } + } + } + catch (Exception e) + { + LogException( string.Format( "Exception occured during web install: {0}", e.Message ), e ); + } + finally + { + ConnectionManager.Close(); + Leave(); + } + } + + + // + // Here we attempt to format the Discovery URL. If bForceUpdate is set to true + // then the URL gets updated unconditionally. + // Otherwise, we update the URL only and if only we are the first web site + // installation that connectes to that database (in which case the DiscoveryURL + // will point to localhost) + // + protected void UpdateDiscoveryUrl( bool bForceUpdate ) + { + Enter(); + + try + { + IPHostEntry hostInfo = Dns.GetHostByName( Dns.GetHostName() ); + string defaultDiscoveryUrl = "http://" + hostInfo.HostName + "/uddipublic/discovery.ashx?businessKey="; + + ConnectionManager.Open( true, true ); + UDDI.Context.User.SetRole( new WindowsPrincipal( WindowsIdentity.GetCurrent() ) ); + + bool bUpdate = bForceUpdate; + if ( !bUpdate ) + { + // + // now retrieve the Default URL from config options + // + string url = UDDI.Config.GetString( "DefaultDiscoveryURL", "*" ); + if ( url.Equals( "*" ) ) // there is no business entity key in the config + bUpdate = true; + else + { + if ( url.ToLower().IndexOf( "localhost" ) > 0 ) + bUpdate = true; + } + } + + // + // Now we know whether the Discovery URL should be updated or not + // + if ( bUpdate ) + { + UDDI.Config.SetString( "DefaultDiscoveryURL", defaultDiscoveryUrl ); + UDDI.Config.Refresh(); + ConnectionManager.Commit(); + } + } + catch( Exception e ) + { + // + // this method will throw if the database has not yet been created, + // so do not rethrow this error! + // + ConnectionManager.Abort(); + LogException( "Error in DefaultDiscoveryURL() in web installer", e ); + } + finally + { + ConnectionManager.Close(); + Leave(); + } + } + + + + public void SetStartType( string svcName, ServiceStartMode startType ) + { + Enter(); + + try + { + // + // open the registry entry for the service + // + RegistryKey HKLM = Registry.LocalMachine; + RegistryKey svcKey = HKLM.OpenSubKey( "SYSTEM\\CurrentControlSet\\Services\\" + svcName, true ); + + // + // now set the start type + // + switch( startType ) + { + case ServiceStartMode.Automatic: + svcKey.SetValue ( "Start", 2 ); + break; + + case ServiceStartMode.Manual: + svcKey.SetValue ( "Start", 3 ); + break; + + case ServiceStartMode.Disabled: + svcKey.SetValue ( "Start", 4 ); + break; + } + + svcKey.Close(); + HKLM.Close(); + } + catch( Exception e ) + { + throw new InstallException( LogException( string.Format( "Unable to set the start type for the service: {0}", svcName ), e ) ); + } + finally + { + Leave(); + } + } + + + public void StartService ( string svcName, int timeoutSec ) + { + Enter(); + + try + { + ServiceController controller; + ServiceControllerStatus srvStatus; + TimeSpan timeout = new TimeSpan ( 0, 0, timeoutSec ); + + // + // first, connect to the SCM on the local box + // and attach to the service, then get its status + // + controller = new ServiceController ( svcName ); + srvStatus = controller.Status; + + // + // what is the service state? + // + switch ( srvStatus) + { + // + // stopped ? + // + case ServiceControllerStatus.Stopped: + controller.Start(); + break; + + // + // are we trying to start? + // + case ServiceControllerStatus.StartPending: + case ServiceControllerStatus.ContinuePending: + break; + + // + // are we trying to stop? + // + case ServiceControllerStatus.StopPending: + controller.WaitForStatus( ServiceControllerStatus.Stopped, timeout ); + controller.Start(); + break; + + // + // pausing ? + // + case ServiceControllerStatus.PausePending: + controller.WaitForStatus ( ServiceControllerStatus.Paused, timeout ); + controller.Continue(); + break; + + default: // the service is already running. Just leave it alone + break; + } + + // + // wait 'till the service wakes up + // + controller.WaitForStatus ( ServiceControllerStatus.Running, timeout ); + } + catch( Exception e ) + { + Log( e.Source ); + throw new InstallException( LogException( string.Format( "Unable to start the service: {0}", svcName ), e ) ); + } + finally + { + Leave(); + } + } + + protected void RegisterWebServer() + { + // + // Get the value for Site.WebServers + // + string webServerList = Config.GetString( "Site.WebServers" ); + + // + // Add ourselves to it + // + if( webServerList.Length > 0) + { + webServerList += "%"; + } + webServerList += System.Environment.MachineName; + + // + // Store the setting + // + Config.SetString( "Site.WebServers", webServerList ); + } + + protected void UnRegisterWebServer() + { + // + // Get the value for Site.WebServers + // + string webServerList = Config.GetString( "Site.WebServers" ); + + // + // Remove ourselves to it + // + string machineName = System.Environment.MachineName; + StringBuilder newWebServerList = new StringBuilder(); + string[] webServers = webServerList.Split(new char[]{'%'}); + + for( int i = 0; i < webServers.Length; i++ ) + { + if( false == webServers[i].Equals( machineName ) ) + { + if( i > 0 && i < webServers.Length - 1 ) + { + newWebServerList.Append( '%' ); + } + newWebServerList.Append( webServers[i] ); + } + } + + // + // Store the setting + // + Config.SetString( "Site.WebServers", newWebServerList.ToString() ); + } + + protected SqlDataReader ExecuteSql( SqlCommand cmd, bool nonQuery ) + { + Enter(); + + string connectionString = ""; + SqlDataReader reader = null; + + try + { + // + // get the connection string and connect to the db + // + connectionString = ( string ) Registry.LocalMachine.OpenSubKey( "SOFTWARE\\Microsoft\\UDDI\\Database" ).GetValue( "WriterConnectionString" ); + SqlConnection conn = new SqlConnection( connectionString ); + + try + { + conn.Open(); + } + catch( Exception e ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "Createlogin()", connectionString ) ); + LogException( "conn.Open() failed", e ); + throw e; + } + + try + { + if( true == nonQuery ) + { + cmd.ExecuteNonQuery(); + } + else + { + reader = cmd.ExecuteReader(); + } + } + catch( Exception e ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "Createlogin()", connectionString ) ); + LogException( cmd.CommandText, e ); + + throw new InstallException( LogException( string.Format( "Error while executing the stored procedure '{0}': {1}", cmd.CommandText, e.Message ), e ) ); + } + finally + { + conn.Close(); + } + } + catch( Exception e ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "Createlogin()", connectionString ) ); + + throw new InstallException( LogException( string.Format( "Error while executing the stored procedure '{0}': {1}", cmd.CommandText, e.Message ), e ) ); + } + finally + { + Leave(); + } + + return reader; + } + + protected void CreateLogin() + { + Enter(); + + // + // Create the user login and add the login to the Admin role + // + string connectionString = ""; + + try + { + // + // get the user name from the properties passed to this Custom Action + // + string userName = Context.Parameters[ "LCL_USER_NAME" ]; + if( 0 == userName.Length ) + { + throw new InstallException( "User name was not specified for the CreateLogin() function" ) ; + } + + Log( "Windows Identity = " + WindowsIdentity.GetCurrent().Name ); + Log( "Thread Identity = " + System.Threading.Thread.CurrentPrincipal.Identity.Name ); + Log( "Creating db login for = " + userName ); + + // + // get the connection string and connect to the db + // + connectionString = ( string ) Registry.LocalMachine.OpenSubKey( "SOFTWARE\\Microsoft\\UDDI\\Database" ).GetValue( "WriterConnectionString" ); + SqlConnection conn = new SqlConnection( connectionString ); + SqlCommand cmd = new SqlCommand( "ADM_addServiceAccount", conn ); + + try + { + conn.Open(); + } + catch( Exception e ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "Createlogin()", connectionString ) ); + LogException( "conn.Open() failed", e ); + throw e; + } + + try + { + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.Add( new SqlParameter( "@accountName", SqlDbType.NVarChar, 128 ) ).Direction = ParameterDirection.Input; + + Log( "Creating login for username=" + userName ); + cmd.Parameters[ "@accountName" ].Value = userName; + cmd.ExecuteNonQuery(); + + // + // We need to also give ourselves permission to access the extended stored procedures on the DB. Do this + // in a separate try-catch so we can preserve the actual exception that is occuring. + // + try + { + cmd.CommandType = CommandType.Text; + cmd.CommandText = string.Format( addXPAccessSQL, userName ); + + cmd.ExecuteNonQuery(); + } + catch( Exception innerException ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "Createlogin()", connectionString ) ); + LogException( "ADM_addServiceAccount", innerException ); + + throw new InstallException( LogException( string.Format( "Error while requesting execute permissions on UDDI Services extended stored procedures: {0}", innerException.Message ), innerException ) ); + } + } + catch (InstallException installException ) + { + // + // If we got an inner exception, just re-throw it. + // + throw installException; + } + catch( Exception e ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "Createlogin()", connectionString ) ); + LogException( "ADM_addServiceAccount", e ); + throw new InstallException( LogException( string.Format( "Error while executing the stored procedure '{0}': {1}", "ADM_addServiceAccount", e.Message ), e ) ); + } + finally + { + conn.Close(); + } + } + catch( Exception e ) + { + Log( string.Format( "SQL Server raised an exception in {0}. Connection string used: '{1}'", "Createlogin()", connectionString ) ); + throw new InstallException( LogException( string.Format( "Error while executing the stored procedure '{0}': {1}", "ADM_addServiceAccount", e.Message ), e ) ); + } + finally + { + Leave(); + } + } + + + + public void DeleteCounters() + { + Enter(); + + try + { + PerformanceCounterCategory.Delete( "UDDI.API.Times" ); + PerformanceCounterCategory.Delete( "UDDI.API.Counts" ); + } + catch + { + // don't care if it fails + } + finally + { + Leave(); + } + } + + public void InitializeCounters() + { + Enter(); + + try + { + Performance.InitializeCounters(); + } + finally + { + Leave(); + } + } + + private void Enter() + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "Entering " + method.ReflectedType.FullName + "." + method.Name + "..." ); + } + + private void Leave() + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "Leaving " + method.ReflectedType.FullName + "." + method.Name ); + } + + protected string CheckForSlash( string str ) + { + if( !str.EndsWith( @"\" ) ) + { + return ( str + @"\" ); + } + + return str; + } + + private string LogError( string errmsg ) + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "----------------------------------------------------------" ); + Log( "An error occurred during installation. Details follow:" ); + Log( "Method: " + method.ReflectedType.FullName + "." + method.Name ); + Log( "Message: " + errmsg ); + Log( "----------------------------------------------------------" ); + + return errmsg; + } + + private string LogException( string context, Exception e ) + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace( 1, false ); + System.Reflection.MethodBase method = trace.GetFrame( 0 ).GetMethod(); + + Log( "----------------------------------------------------------" ); + Log( "An exception occurred during installation. Details follow:" ); + Log( "Method: " + method.ReflectedType.FullName + "." + method.Name ); + Log( "Context: " + context ); + Log( "Stack Trace: " + e.StackTrace ); + Log( "Source: " + e.Source ); + Log( "Message: " + e.Message ); + Log( "----------------------------------------------------------" ); + + return context + ": " + e.Message; + } + + private void Log( string str ) + { + try + { + System.Diagnostics.Debug.WriteLine( str ); + + FileStream f = new FileStream( System.Environment.ExpandEnvironmentVariables( "%systemroot%" ) + @"\uddisetup.log", FileMode.Append, FileAccess.Write ); + StreamWriter s = new StreamWriter( f, System.Text.Encoding.Unicode ); + s.WriteLine( "{0}: {1}", DateTime.Now.ToString(), str ); + s.Close(); + f.Close(); + } + catch( Exception e ) + { + System.Diagnostics.Debug.WriteLine( "Error in Log():" + e.Message ); + } + } + + private string GetPathToHelp( string installDir ) + { + // + // The value 'default' must match the value in the MSI. + // + return string.Format( "{0}webroot/default", installDir ); + } + + private void RenameHelp( string installDir, bool install ) + { + int lcid = 0; + string cultureIDValue = Context.Parameters[ cultureID ]; + + // + // 'cultureIDValue is expected to contain a neutral culture. ie, + // 'en', or 'ko', or 'de'. All but a few neutral cultures have + // a default specific culture. For example, the default specific + // culture of 'en' is 'en-US'. + // + // Traditional & simplified Chinese (zh-CHT and zh-CHS respectively) + // are examples of neutral cultures which have no default specific + // culture! + // + // So what happens below is this: First we try to lookup the default + // specific culture for the neutral culture that we were given. If that + // fails (ie, if CreateSpecificCulture throws), we just get the lcid + // of the neutral culture. + // + try + { + lcid = CultureInfo.CreateSpecificCulture( cultureIDValue ).LCID; + } + catch + { + CultureInfo ci = new CultureInfo( cultureIDValue ); + lcid = ci.LCID; + } + + + // + // Build default paths to the main and add web reference help directories. + // + string defaultMainHelpPath = string.Format( @"{0}webroot\help\{1}", installDir, defaultHelpDir ); + string defaultAWRHelpPath = string.Format( @"{0}webroot\addwebreference\{1}", installDir, defaultHelpDir ); + + // + // Build lang-specific paths to the main and add web reference help directories. + // + string langMainHelpPath = string.Format( @"{0}webroot\help\{1}", installDir, lcid ); + string langAWRHelpPath = string.Format( @"{0}webroot\addwebreference\{1}", installDir, lcid ); + + if( true == install ) + { + // + // If we are installing, then rename the default help directory to one that is language specific. Delete + // existing directories if we have to. + // + // FIX: UDDI#2443: catch any exceptions, don't pass error back if directories can't be deleted. added + // LogException call to watch when this ever happens. + // + try + { + if( true == Directory.Exists( langMainHelpPath ) ) + { + Directory.Delete( langMainHelpPath, true ); + } + + if( true == Directory.Exists( langAWRHelpPath ) ) + { + Directory.Delete( langAWRHelpPath, true ); + } + } + catch( Exception e ) + { + LogException( "Caught exception deleting lang-specific help directories.", e ); + } + + try + { + Directory.Move( defaultMainHelpPath, langMainHelpPath ); + Directory.Move( defaultAWRHelpPath, langAWRHelpPath ); + } + catch( Exception e ) + { + LogException( "Caught exception moving default help directories to lang-specific directories.", e ); + } + } + else + { + // + // If we are uninstalling, then rename the language specific help directory back to the default; this + // will let MSI clean up these files. Catch any exceptions, it's not a big deal if this directory can't + // be moved. + // + // FIX: UDDI#2443: added LogException call to watch when this ever happens. + // + try + { + Directory.Move( langMainHelpPath, defaultMainHelpPath ); + Directory.Move( langAWRHelpPath, defaultAWRHelpPath ); + } + catch( Exception e ) + { + LogException( "Caught exception moving lang-specific help directories to default.", e ); + } + } + } + + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion + } +} diff --git a/inetsrv/uddi/source/setup/web/ca/webca.csproj b/inetsrv/uddi/source/setup/web/ca/webca.csproj new file mode 100644 index 0000000..98a99fe --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/webca.csproj @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/setup/web/ca/webca.resx b/inetsrv/uddi/source/setup/web/ca/webca.resx new file mode 100644 index 0000000..1767da8 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/ca/webca.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader + + + System.Resources.ResXResourceWriter + + \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/dirs b/inetsrv/uddi/source/setup/web/dirs new file mode 100644 index 0000000..9ba0531 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/dirs @@ -0,0 +1 @@ +dirs = ca.unmanaged ca wsi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/wsi/makefile b/inetsrv/uddi/source/setup/web/wsi/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/wsi/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/setup/web/wsi/obj/_objects.mac b/inetsrv/uddi/source/setup/web/wsi/obj/_objects.mac new file mode 100644 index 0000000..8c49520 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/wsi/obj/_objects.mac @@ -0,0 +1,16 @@ +386_OBJECTS= + +PASS0_386_OBJECTS= + +IA64_OBJECTS= + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/setup/web/wsi/placefil.txt b/inetsrv/uddi/source/setup/web/wsi/placefil.txt new file mode 100644 index 0000000..0419cb2 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/wsi/placefil.txt @@ -0,0 +1 @@ +uddiweb.msi uddi \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/wsi/sources b/inetsrv/uddi/source/setup/web/wsi/sources new file mode 100644 index 0000000..bbe1676 --- /dev/null +++ b/inetsrv/uddi/source/setup/web/wsi/sources @@ -0,0 +1,8 @@ +TARGETNAME= +TARGETTYPE=NOTARGET +TARGETPATH=. +SOURCES= + +MISCFILES = uddiweb.msi + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/setup/web/wsi/uddiweb.msi b/inetsrv/uddi/source/setup/web/wsi/uddiweb.msi new file mode 100644 index 0000000..92bffaa Binary files /dev/null and b/inetsrv/uddi/source/setup/web/wsi/uddiweb.msi differ diff --git a/inetsrv/uddi/source/setup/web/wsi/uddiweb.wsi b/inetsrv/uddi/source/setup/web/wsi/uddiweb.wsi new file mode 100644 index 0000000..e4525e3 Binary files /dev/null and b/inetsrv/uddi/source/setup/web/wsi/uddiweb.wsi differ diff --git a/inetsrv/uddi/source/tools/bootstrap/assemblyinfo.cs b/inetsrv/uddi/source/tools/bootstrap/assemblyinfo.cs new file mode 100644 index 0000000..7b30f18 --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("bootstrap.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/bootstrap/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/bootstrap/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/bootstrap/bootstrap.cs b/inetsrv/uddi/source/tools/bootstrap/bootstrap.cs new file mode 100644 index 0000000..f177a77 --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/bootstrap.cs @@ -0,0 +1,287 @@ +using System; +using System.IO; +using System.Security.Principal; +using System.Xml.Serialization; +using System.Data; +using System.Data.SqlClient; +using System.Resources; + +using UDDI.API; +using UDDI.API.Extensions; + +namespace UDDI.Tools +{ + class Bootstrap + { + static string filename; + static string username; + + static int Main( string[] args ) + { + int retCode = 1; // assume error + + // + // Check if CurrentUICulture needs to be overridden + // + UDDI.Localization.SetConsoleUICulture(); + + Console.WriteLine( FormatFromResource( "BOOTSTRAP_COPYRIGHT_1" ) ); + Console.WriteLine( FormatFromResource( "BOOTSTRAP_COPYRIGHT_2" ) ); + Console.WriteLine(); + + // + // parse the command line + // + if(!ProcessCommandLine( args ) ) + return 1; + + WindowsPrincipal prin = new WindowsPrincipal( WindowsIdentity.GetCurrent() ); + + try + { + ConnectionManager.Open( true, true ); + } + catch + { + Console.WriteLine( FormatFromResource( "BOOTSTRAP_DB_CONNECT_FAILED" ) ); + return 1; + } + + try + { + // + // Setup the UDDI user credentials + // + Context.User.SetRole( prin ); + + // + // Verify that the user is a member of the administrators group + // + if( !Context.User.IsAdministrator ) + { + // + // 735728 - Show an error to the user and exit the program. + // + Console.WriteLine( FormatFromResource( "BOOTSTRAP_ACCESS_DENIED" ) ); + Console.WriteLine( FormatFromResource( "BOOTSTRAP_ADMIN_GROUP_ONLY" ) ); + Console.WriteLine( FormatFromResource( "BOOTSTRAP_USER_NOT_ADMIN" , WindowsIdentity.GetCurrent().Name ) ); + + return 1; + } + + if( null != username && 0 != username.Length ) + { + // + // The /u option was specified + // + + Context.User.SetPublisherRole( username ); + if( !Context.User.IsRegistered ) + { + // + // 735728 - Show an error to the user and exit the program. + // + Console.WriteLine( FormatFromResource( "BOOTSTRAP_USER_NOT_REGISTERED" , username ) ); + + return 1; + } + + // + // If the current user is not the same as the publisher, set up impersonation + // + + if ( Context.User.ID != WindowsIdentity.GetCurrent().Name ) + Context.User.ImpersonatorID = WindowsIdentity.GetCurrent().Name; + } + else + { + // + // Default is to save data under the default publisher + // + Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + } + + // + // If user is not system publisher, a temporary operator must be added to support pre-assigned key behavior + // + + string operatorkey = System.Guid.NewGuid().ToString(); + + if( Context.User.ID != UDDI.Utility.GetDefaultPublisher() ) + Context.User.SetAllowPreassignedKeys( true ); + + XmlSerializer serializer = new XmlSerializer( typeof( UDDI.API.Extensions.Resources ) ); + + // + // Load the XML file. + // + Console.WriteLine( FormatFromResource( "BOOTSTRAP_PROCESSING_MSG" , filename, Context.User.ID ) ); + + FileStream strm = new FileStream( filename, FileMode.Open, FileAccess.Read ); + Resources.Validate( strm ); + Resources resources = (Resources) serializer.Deserialize( strm ); + strm.Close(); + + // + // Save the TModel + // + Console.WriteLine( FormatFromResource( "BOOTSTRAP_SAVING" ) ); + + // + // Determine the number of tModels that we imported. + // + int tModelCount = 0; + if( null != resources.TModelDetail) + { + tModelCount += resources.TModelDetail.TModels.Count; + } + + if( null != resources.CategorizationSchemes ) + { + foreach( CategorizationScheme scheme in resources.CategorizationSchemes ) + { + if( null != scheme.TModel ) + { + tModelCount ++; + } + } + } + Console.WriteLine( FormatFromResource( "BOOTSTRAP_TMODELS", tModelCount ) ); + + if( null != resources.CategorizationSchemes ) + Console.WriteLine( FormatFromResource( "BOOTSTRAP_CATEGORIZATION_SCHEMES", resources.CategorizationSchemes.Count ) ); + else + Console.WriteLine( FormatFromResource( "BOOTSTRAP_CATEGORIZATION_SCHEMES", 0 ) ); + + if( null != resources.BusinessDetail ) + Console.WriteLine( FormatFromResource( "BOOTSTRAP_PROVIDERS", resources.BusinessDetail.BusinessEntities.Count ) ); + else + Console.WriteLine( FormatFromResource( "BOOTSTRAP_PROVIDERS", 0 ) ); + + if( null != resources.ServiceDetail ) + Console.WriteLine( FormatFromResource( "BOOTSTRAP_SERVICES", resources.ServiceDetail.BusinessServices.Count ) ); + else + Console.WriteLine( FormatFromResource( "BOOTSTRAP_SERVICES", 0 ) ); + + if( null != resources.BindingDetail ) + Console.WriteLine( FormatFromResource( "BOOTSTRAP_BINDINGS", resources.BindingDetail.BindingTemplates.Count ) ); + else + Console.WriteLine( FormatFromResource( "BOOTSTRAP_BINDINGS", 0 ) ); + + resources.Save(); + + Console.WriteLine( FormatFromResource( "BOOTSTRAP_COMPLETE" ) ); + + ConnectionManager.Commit(); + + retCode = 0; // no error + } + catch( Exception e ) + { + Console.WriteLine(); + Console.WriteLine( FormatFromResource( "BOOTSTRAP_FAILED" , e.Message ) ); + + // + // 735713 - Output an additional message if the user did not have permissions to modify an entity. + // + SqlException sqlException = e as SqlException; + if( null != sqlException ) + { + if( sqlException.Number - UDDI.Constants.ErrorTypeSQLOffset == ( int ) ErrorType.E_userMismatch ) + { + Console.WriteLine( FormatFromResource( "ERROR_USER_MISMATCH" ) ); + } + } + + ConnectionManager.Abort(); + } + finally + { + ConnectionManager.Close(); + } + + return retCode; + } + + private static bool ProcessCommandLine( string [] args ) + { + bool bOK = false; + for( int i = 0; i < args.Length; i ++ ) + { + if( '-' == args[i][0] || '/' == args[i][0] ) + { + string option = args[i].Substring( 1 ); + + if( "help" == option.ToLower() || "?" == option ) + { + break; + } + else if( "f" == option.ToLower() ) + { + i++; // move to the next arg + if( i >= args.Length ) + { + break; + } + + filename = args[i]; + bOK = true; + } + else if( "u" == option.ToLower() ) + { + i++; // move to the next arg + if( i >= args.Length ) + { + break; + } + + username = args[i]; + } + else + { + DisplayUsage(); + return false; + } + } + } + + if( !bOK ) + { + DisplayUsage(); + return false; + } + + return true; + } + + static void DisplayUsage() + { + Console.WriteLine( FormatFromResource( "BOOTSTRAP_USAGE_1" ) ); + Console.WriteLine(); + Console.WriteLine( FormatFromResource( "BOOTSTRAP_USAGE_2" ) ); + Console.WriteLine(); + Console.WriteLine( FormatFromResource( "BOOTSTRAP_USAGE_3" ) ); + Console.WriteLine( FormatFromResource( "BOOTSTRAP_USAGE_4" ) ); + Console.WriteLine(); + } + + static string FormatFromResource( string resID, params object[] inserts ) + { + try + { + string resourceStr = UDDI.Localization.GetString( resID ); + if( null != resourceStr ) + { + string resultStr = string.Format( resourceStr, inserts ); + return resultStr; + } + + return "String not specified in the resources: " + resID; + } + catch( Exception e ) + { + return "FormatFromResource failed to load the resource string for ID: " + resID + " Reason: " + e.Message; + } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/bootstrap/bootstrap.csproj b/inetsrv/uddi/source/tools/bootstrap/bootstrap.csproj new file mode 100644 index 0000000..e84bb15 --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/bootstrap.csproj @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/bootstrap/bootstrap.snk b/inetsrv/uddi/source/tools/bootstrap/bootstrap.snk new file mode 100644 index 0000000..82facfa Binary files /dev/null and b/inetsrv/uddi/source/tools/bootstrap/bootstrap.snk differ diff --git a/inetsrv/uddi/source/tools/bootstrap/makefile b/inetsrv/uddi/source/tools/bootstrap/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/bootstrap/makefile.inc b/inetsrv/uddi/source/tools/bootstrap/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/bootstrap/obj/_objects.mac b/inetsrv/uddi/source/tools/bootstrap/obj/_objects.mac new file mode 100644 index 0000000..e75c870 --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\bootstrap.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\bootstrap.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\bootstrap.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\bootstrap.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/bootstrap/obj/i386/Bootstrap.exe b/inetsrv/uddi/source/tools/bootstrap/obj/i386/Bootstrap.exe new file mode 100644 index 0000000..6bb689b Binary files /dev/null and b/inetsrv/uddi/source/tools/bootstrap/obj/i386/Bootstrap.exe differ diff --git a/inetsrv/uddi/source/tools/bootstrap/obj/i386/Bootstrap.pdb b/inetsrv/uddi/source/tools/bootstrap/obj/i386/Bootstrap.pdb new file mode 100644 index 0000000..8ce2fc7 Binary files /dev/null and b/inetsrv/uddi/source/tools/bootstrap/obj/i386/Bootstrap.pdb differ diff --git a/inetsrv/uddi/source/tools/bootstrap/placefil.txt b/inetsrv/uddi/source/tools/bootstrap/placefil.txt new file mode 100644 index 0000000..5a46a7f --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/placefil.txt @@ -0,0 +1 @@ +bootstrap.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/bootstrap/sources b/inetsrv/uddi/source/tools/bootstrap/sources new file mode 100644 index 0000000..59ebebd --- /dev/null +++ b/inetsrv/uddi/source/tools/bootstrap/sources @@ -0,0 +1,24 @@ +# +# Sources for bootstrap.exe +# + +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=Bootstrap +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + + +NTTARGETFILE1=foo.cs + + +REFERENCES= ..\..\core\obj\*\uddi.core.dll, ..\..\api\obj\*\uddi.api.dll + +SOURCES= bootstrap.cs \ + assemblyversioninfo.cs \ + assemblyinfo.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/build.err b/inetsrv/uddi/source/tools/build.err new file mode 100644 index 0000000..77b55c9 --- /dev/null +++ b/inetsrv/uddi/source/tools/build.err @@ -0,0 +1,4 @@ +1>replicationadmin\. : error CS1566: Error reading resource file 'd:\OpenXP\inetsrv\uddi\source\tools\replicationadmin\obj\i386\changelogcontrol.resources' -- 'The system cannot find the file specified. ' +1>replicationadmin\. : error CS1566: Error reading resource file 'd:\OpenXP\inetsrv\uddi\source\tools\replicationadmin\obj\i386\adminframe.resources' -- 'The system cannot find the file specified. ' +1>replicationadmin\. : error CS1566: Error reading resource file 'd:\OpenXP\inetsrv\uddi\source\tools\replicationadmin\obj\i386\correctionadmin.resources' -- 'The system cannot find the file specified. ' +1>replicationadmin\binplace : error BNP0000: Unable to place file obj\i386\replicationadmin.exe - exiting. diff --git a/inetsrv/uddi/source/tools/build.log b/inetsrv/uddi/source/tools/build.log new file mode 100644 index 0000000..a00744c --- /dev/null +++ b/inetsrv/uddi/source/tools/build.log @@ -0,0 +1,312 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\tools directory tree for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\tools\rcf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\rcf +Elapsed time [0:00:00.015] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\monitor directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +2>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\monitor +Elapsed time [0:00:00.015] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\send directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\send +Elapsed time [0:00:00.015] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\resetkey directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +4>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\resetkey +Elapsed time [0:00:00.031] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\validate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +5>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\validate +Elapsed time [0:00:00.031] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\bootstrap directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +6>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\bootstrap +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 rcf D:\OpenXP\Tools\coffbase.txt +Elapsed time [0:00:00.047] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\migrate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +7>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\migrate +2>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 monitor D:\OpenXP\Tools\coffbase.txt +3>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 send D:\OpenXP\Tools\coffbase.txt +Elapsed time [0:00:00.062] ******************** +4>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 resetkey D:\OpenXP\Tools\coffbase.txt +5>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 validate D:\OpenXP\Tools\coffbase.txt +Compiling d:\openxp\inetsrv\uddi\source\tools\replicationadmin directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +8>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\replicationadmin +6>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 Bootstrap D:\OpenXP\Tools\coffbase.txt +7>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 migrate D:\OpenXP\Tools\coffbase.txt +Elapsed time [0:00:00.093] ******************** +Compiling d:\openxp\inetsrv\uddi\source\tools\recalcstats directory ******************** +8>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicationadmin D:\OpenXP\Tools\coffbase.txt +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +2>genbasemac: module monitor not found in D:\OpenXP\Tools\coffbase.txt +3>genbasemac: module send not found in D:\OpenXP\Tools\coffbase.txt +4>genbasemac: module resetkey not found in D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module rcf not found in D:\OpenXP\Tools\coffbase.txt +5>genbasemac: module validate not found in D:\OpenXP\Tools\coffbase.txt +6>genbasemac: module Bootstrap not found in D:\OpenXP\Tools\coffbase.txt +7>genbasemac: module migrate not found in D:\OpenXP\Tools\coffbase.txt +8>genbasemac: module replicationadmin not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +4> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +2> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +5> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +6> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +7> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +8> resgen.exe .\adminframe.resx obj\i386\adminframe.resources +4> +1> +2> +3> +5> +6> +2>Stop. +5>Stop. +1>Stop. +3>Stop. +4>Stop. +7> +3>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\recalcstats +Elapsed time [0:00:00.422] ******************** +6>Stop. +7>Stop. +3>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 recalcstats D:\OpenXP\Tools\coffbase.txt +3>genbasemac: module recalcstats not found in D:\OpenXP\Tools\coffbase.txt +3> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +3> +3>Stop. +8> +8>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +8> at System.Resources.ResourceReader.StripVersionField(String typeName) +8> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +8> at System.Resources.ResourceReader.ReadResources() +8> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +8> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +8> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +8> at System.Environment.GetResourceString(String key) +8> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +8> at System.Globalization.CultureInfo..ctor(Int32 culture) +8> at System.Globalization.CultureInfo..cctor() +8> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +8> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +8> at System.Threading.Thread.get_CurrentUICulture()8> resgen.exe .\changelogcontrol.resx obj\i386\changelogcontrol.resources +8> +8>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +8> at System.Resources.ResourceReader.StripVersionField(String typeName) +8> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +8> at System.Resources.ResourceReader.ReadResources() +8> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +8> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +8> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +8> at System.Environment.GetResourceString(String key) +8> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +8> at System.Globalization.CultureInfo..ctor(Int32 culture) +8> at System.Globalization.CultureInfo..cctor() +8> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +8> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +8> at System.Threading.Thread.get_CurrentUICulture()8> resgen.exe .\correctionadmin.resx obj\i386\correctionadmin.resources +8> +8>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +8> at System.Resources.ResourceReader.StripVersionField(String typeName) +8> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +8> at System.Resources.ResourceReader.ReadResources() +8> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +8> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +8> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +8> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +8> at System.Environment.GetResourceString(String key) +8> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +8> at System.Globalization.CultureInfo..ctor(Int32 culture) +8> at System.Globalization.CultureInfo..cctor() +8> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +8> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +8> at System.Threading.Thread.get_CurrentUICulture()8> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +8> +8>Stop. +Linking d:\openxp\inetsrv\uddi\source\tools\rcf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 rcf D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module rcf not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\rcf.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.xml.dll,..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs rcf.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\rcf\obj\i386\rcf.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:04.218] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\monitor directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 monitor D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module monitor not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\monitor.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs monitor.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\monitor\obj\i386\monitor.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:04.750] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\send directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 send D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module send not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\send.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll,..\..\api\obj\I386\uddi.api.dll uddisend.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\send\obj\i386\send.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:05.297] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\resetkey directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 resetkey D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module resetkey not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\resetkey.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll resetkey.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\resetkey\obj\i386\resetkey.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:05.875] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\validate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 validate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module validate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\validate.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll assemblyinfo.cs assemblyversioninfo.cs validate.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\validate\obj\i386\validate.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:06.343] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\bootstrap directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 Bootstrap D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module Bootstrap not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\Bootstrap.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll,..\..\api\obj\I386\uddi.api.dll bootstrap.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\bootstrap\obj\i386\Bootstrap.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:06.875] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\migrate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 migrate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module migrate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\migrate.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /RES:uddi.v2.update_rc0_to_rc1.sql /RES:uddi.v2.update_rc1_to_rc2.sql /r:..\..\core\obj\I386\uddi.core.dll,..\..\api\obj\I386\uddi.api.dll migrate.cs assemblyinfo.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\migrate\obj\i386\migrate.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:07.781] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\replicationadmin directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 replicationadmin D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module replicationadmin not found in D:\OpenXP\Tools\coffbase.txt +1> resgen.exe .\adminframe.resx obj\i386\adminframe.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> resgen.exe .\changelogcontrol.resx obj\i386\changelogcontrol.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> resgen.exe .\correctionadmin.resx obj\i386\correctionadmin.resources +1> +1>Unhandled Exception: System.TypeInitializationException: [Resource lookup failed - infinite recursion detected. Resource name: TypeInitialization_Type] ---> System.NullReferenceException: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException] +1> at System.Resources.ResourceReader.StripVersionField(String typeName) +1> at System.Resources.ResourceReader.InitSafeToDeserializeArray() +1> at System.Resources.ResourceReader.ReadResources() +1> at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table) +1> at System.Resources.RuntimeResourceSet..ctor(Stream stream) +1> at System.Resources.ResourceManager.CreateResourceSet(Stream store) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +1> at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +1> at System.Environment.GetResourceString(String key) +1> at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) +1> at System.Globalization.CultureInfo..ctor(Int32 culture) +1> at System.Globalization.CultureInfo..cctor() +1> [Resource lookup failed - infinite recursion detected. Resource name: Exception_EndOfInnerExceptionStack] +1> at System.Globalization.CultureInfo.get_UserDefaultUICulture() +1> at System.Threading.Thread.get_CurrentUICulture()1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\replicationadmin.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /resource:obj\i386\adminframe.resources /resource:obj\i386\changelogcontrol.resources /resource:obj\i386\correctionadmin.resources /r:system.dll,system.data.dll,system.drawing.dll,system.windows.forms.dll,system.xml.dll,..\..\api\obj\I386\uddi.api.dll,..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs adminframe.cs changelogcontrol.cs correctionadmin.cs +1>error CS1566: Error reading resource file 'd:\OpenXP\inetsrv\uddi\source\tools\replicationadmin\obj\i386\changelogcontrol.resources' -- 'The system cannot find the file specified. ' +1>error CS1566: Error reading resource file 'd:\OpenXP\inetsrv\uddi\source\tools\replicationadmin\obj\i386\adminframe.resources' -- 'The system cannot find the file specified. ' +1>error CS1566: Error reading resource file 'd:\OpenXP\inetsrv\uddi\source\tools\replicationadmin\obj\i386\correctionadmin.resources' -- 'The system cannot find the file specified. ' +1>binplace d:\openxp\inetsrv\uddi\source\tools\replicationadmin\obj\i386\replicationadmin.exe +1>BINPLACE : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\replicationadmin\obj\i386\replicationadmin.exe,D:\binaries.x86chk\.\uddi\bin\replicationadmin.exe) failed 2 +1>BINPLACE : fatal error BNP0000: Unable to place file obj\i386\replicationadmin.exe - exiting. +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:10.843] ******************** +Linking d:\openxp\inetsrv\uddi\source\tools\recalcstats directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 recalcstats D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module recalcstats not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\recalcstats.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll recalcstats.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace d:\openxp\inetsrv\uddi\source\tools\recalcstats\obj\i386\recalcstats.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:11.312] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/tools/build.wrn b/inetsrv/uddi/source/tools/build.wrn new file mode 100644 index 0000000..62ccb9c --- /dev/null +++ b/inetsrv/uddi/source/tools/build.wrn @@ -0,0 +1 @@ +1>replicationadmin\binplace : warning BNP0000: CopyFile(d:\openxp\inetsrv\uddi\source\tools\replicationadmin\obj\i386\replicationadmin.exe,D:\binaries.x86chk\.\uddi\bin\replicationadmin.exe) failed 2 diff --git a/inetsrv/uddi/source/tools/dirs b/inetsrv/uddi/source/tools/dirs new file mode 100644 index 0000000..2ca56c7 --- /dev/null +++ b/inetsrv/uddi/source/tools/dirs @@ -0,0 +1 @@ +dirs = rcf monitor send resetkey validate bootstrap migrate replicationadmin recalcstats diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/assemblyinfo.cs b/inetsrv/uddi/source/tools/fixdefaulturl/assemblyinfo.cs new file mode 100644 index 0000000..fed9aa5 --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("fixdefaulturl.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/build.log b/inetsrv/uddi/source/tools/fixdefaulturl/build.log new file mode 100644 index 0000000..299817d --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/build.log @@ -0,0 +1,33 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\tools\fixdefaulturl directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\tools\fixdefaulturl directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\fixdefaulturl +Elapsed time [0:00:00.015] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 fixdefaulturl D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module fixdefaulturl not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe .\assemblyversioninfo.cs +1>Usage of version.exe: +1> +1>version.exe <-outFile > +1>version.exe <-help> +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\tools\fixdefaulturl directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 fixdefaulturl D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module fixdefaulturl not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe .\assemblyversioninfo.cs +1>Usage of version.exe: +1> +1>version.exe <-outFile > +1>version.exe <-help> +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\fixdefaulturl.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.windows.forms.dll,system.dll,system.data.dll,system.xml.dll,..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll,..\..\api\obj\I386\uddi.api.dll fixdefaulturl.cs assemblyinfo.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\tools\fixdefaulturl\obj\i386\fixdefaulturl.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:00.859] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.cs b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.cs new file mode 100644 index 0000000..042239f --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.cs @@ -0,0 +1,653 @@ +using System; +using System.Collections; +using System.IO; +using System.Data; +using System.Data.SqlClient; +using System.Xml; +using System.Xml.Serialization; +using System.Windows.Forms; +using System.Security.Principal; + +using Microsoft.Win32; + +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.Replication; + +namespace UDDI.Tools +{ + class FixDefaultURL + { + // + // Enumerated Types + // + enum LogType + { + ConsoleAndLog, + ConsoleOnly, + LogOnly + } + + // + // Constants + // + const string LogFileName = "fixdefaulturl.log.txt"; + const string ExceptionFileName = "fixdefaulturl.exceptions.txt"; + + // + // Globals + // + static StreamWriter logFile; + static StreamWriter exceptionsFile; + + static void FixDefaultURLs() + { + // + // Get a list of business keys that have non-default discovery URLs. + // + ArrayList businessEntities = GetBusinessEntities(); + int total = businessEntities.Count; + int current = 1; + int numberFixed = 0; + + foreach( BusinessEntity businessEntity in businessEntities ) + { + // + // Get values for this business. + // + businessEntity.Get(); + + // + // BusinessEntity.Get() may add the default one, we don't want it. + // + DiscoveryUrlCollection originalList = new DiscoveryUrlCollection(); + originalList.Get( businessEntity.BusinessKey ); + businessEntity.DiscoveryUrls = originalList; + + Log( "*** Processing " + current++ + "/" + total + " *** " ); + + LogStartBusinessEntity( businessEntity ); + + DiscoveryUrlCollection filteredList = GetFilterList( businessEntity ); + + if( filteredList.Count < businessEntity.DiscoveryUrls.Count ) + { + try + { + numberFixed++; + + LogFixStart( filteredList ); + + ConnectionManager.BeginTransaction(); + + // + // Remove duplicate discovery URLs + // + businessEntity.DiscoveryUrls = filteredList; + + // + // Fix change records + // + FixChangeRecords( businessEntity ); + + // + // Fix data. Saving the BusinessEntity will also create a ChangeRecordNew data in our replication stream. + // Other operators will consume this change record, which will update their databases. + // + + FixData( businessEntity ); +#if never + ChangeRecordNewData changeRecordNewData = new ChangeRecordNewData( businessEntity ); + ChangeRecord fixData = new ChangeRecord( changeRecordNewData ); + fixData.Process(); +#endif + ConnectionManager.Commit(); + + LogFixEnd( businessEntity ); + } + catch( Exception e) + { + WriteException( e ); + ConnectionManager.Abort(); + } + } + LogDoneBusinessEntity( businessEntity ); + } + Log( "BusinessEntities fixed: " + numberFixed ); + } + + static void FixData( BusinessEntity businessEntity ) + { + Log( "\t\tSTART Fixing Data" ); + + // + // Save the current user ID + // + string currentUserID = Context.User.ID; + + try + { + // + // Set the current user to this user to the PUID for this business entity. + // + Context.User.ID = GetPUIDForBusinessEntity( businessEntity.BusinessKey ); + + // + // Save our business + // + businessEntity.Save(); + + Log( "\t\tDONE Fixing Data" ); + } + finally + { + // + // Restore the ID + // + Context.User.ID = currentUserID; + } + } + + static string GetPUIDForBusinessEntity( string businessKey ) + { + SqlStoredProcedureAccessor puidSP = new SqlStoredProcedureAccessor(); + puidSP.ProcedureName = "net_getPUIDForBusinessEntity"; + + puidSP.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + puidSP.Parameters.SetGuidFromString( "@businessKey", businessKey ); + + SqlDataReaderAccessor reader = puidSP.ExecuteReader(); + string puid = ""; + + try + { + reader.Read(); + puid = reader.GetString( 0 ); + } + finally + { + reader.Close(); + } + + return puid; + } + + static void FixChangeRecords( BusinessEntity businessEntity ) + { + // + // Get all related change records + // + ArrayList newDataChangeRecords = GetChangeRecordsForEntity( businessEntity ); + + // + // Create and process a correction for each change record. + // + Log( "\t\tSTART Processing Corrections" ); + foreach( ChangeRecord changeRecord in newDataChangeRecords ) + { + ChangeRecord changeRecordCorrection = CreateCorrection( changeRecord, businessEntity ); + changeRecordCorrection.Process(); + + LogChangeRecordCorrection( changeRecord, changeRecordCorrection ); + } + Log( "\t\tDONE Processing Corrections" ); + } + + static ChangeRecord CreateCorrection( ChangeRecord originalChangeRecord, BusinessEntity businessEntity ) + { + ChangeRecordNewData changeRecordNewData = originalChangeRecord.Payload as ChangeRecordNewData; + changeRecordNewData.Entity = businessEntity; + + ChangeRecordCorrection changeRecordCorrection = new ChangeRecordCorrection(); + changeRecordCorrection.ChangeRecord = originalChangeRecord; + + return new ChangeRecord( changeRecordCorrection ); + } + + static ArrayList GetChangeRecordsForEntity( BusinessEntity businessEntity ) + { + string contextID = Guid.NewGuid().ToString(); + string operatorKey = Config.GetString( "OperatorKey" ); + ArrayList changeRecords = new ArrayList(); + SqlDataReaderAccessor resultsReader = null; + + try + { + // + // Get all the ChangeRecordNewData change records associated with this entity. + // + SqlStoredProcedureAccessor findSP = new SqlStoredProcedureAccessor(); + findSP.ProcedureName = "net_find_changeRecordsByChangeType"; + + findSP.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + findSP.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + findSP.Parameters.Add( "@entityKey", SqlDbType.UniqueIdentifier ); + findSP.Parameters.Add( "@changeTypeID", SqlDbType.TinyInt ); + findSP.Parameters.Add( "@rows", SqlDbType.Int, ParameterDirection.Output ); + + findSP.Parameters.SetGuidFromString( "@contextID", contextID ); + findSP.Parameters.SetGuidFromString( "@operatorKey", operatorKey ); + findSP.Parameters.SetGuidFromString( "@entityKey", businessEntity.BusinessKey ); + findSP.Parameters.SetShort( "@changeTypeID", ( short )ChangeRecordPayloadType.ChangeRecordNewData ); + + findSP.ExecuteNonQuery(); + + // + // Retrieve results + // + SqlStoredProcedureAccessor resultsSP = new SqlStoredProcedureAccessor(); + + resultsSP.ProcedureName = "net_find_changeRecords_commit"; + + resultsSP.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + resultsSP.Parameters.Add( "@responseLimitCount", SqlDbType.Int ); + + resultsSP.Parameters.SetGuidFromString( "@contextID", contextID ); + resultsSP.Parameters.SetInt( "@responseLimitCount", 0 ); + + // + // Read our results and create change records from them. + // + resultsReader = resultsSP.ExecuteReader(); + + while( resultsReader.Read() ) + { + ChangeRecord changeRecord = CreateChangeRecord( resultsReader ); + if( null != changeRecord ) + { + changeRecords.Add( changeRecord ); + } + else + { + throw new Exception( "Could not create change record!" ); + } + } + } + catch + { + // + // Cleanup on failure. + // + SqlStoredProcedureAccessor cleanupSP = new SqlStoredProcedureAccessor(); + + cleanupSP.ProcedureName = "net_find_changeRecords_cleanup"; + cleanupSP.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier ); + cleanupSP.Parameters.SetGuidFromString( "@contextID", contextID ); + + cleanupSP.ExecuteNonQuery(); + } + finally + { + if( null != resultsReader ) + { + resultsReader.Close(); + } + } + + return changeRecords; + } + + static ChangeRecord CreateChangeRecord( SqlDataReaderAccessor reader ) + { + ChangeRecord changeRecord = null; + + XmlSerializer serializer = null; + + switch( (ChangeRecordPayloadType)reader.GetShort( "changeTypeID" ) ) + { + case ChangeRecordPayloadType.ChangeRecordNull: + serializer = new XmlSerializer( typeof( ChangeRecordNull ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordNewData: + serializer = new XmlSerializer( typeof( ChangeRecordNewData ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordDelete: + serializer = new XmlSerializer( typeof( ChangeRecordDelete ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordPublisherAssertion: + serializer = new XmlSerializer( typeof( ChangeRecordPublisherAssertion ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordHide: + serializer = new XmlSerializer( typeof( ChangeRecordHide ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordDeleteAssertion: + serializer = new XmlSerializer( typeof( ChangeRecordDeleteAssertion ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordAcknowledgement: + serializer = new XmlSerializer( typeof( ChangeRecordAcknowledgement ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordCorrection: + serializer = new XmlSerializer( typeof( ChangeRecordCorrection ) ); + break; + } + + StringReader stringReader = new StringReader( reader.GetString( "changeData" ) ); + + try + { + changeRecord = new ChangeRecord(); + + changeRecord.AcknowledgementRequested = ( reader.GetInt( "flag" ) & (int)ChangeRecordFlags.AcknowledgementRequested ) > 0; + changeRecord.ChangeID.NodeID = reader.GetString( "OperatorKey" ); + changeRecord.ChangeID.OriginatingUSN = reader.GetLong( "USN" ); + + ChangeRecordBase changeRecordBase = ( ChangeRecordBase ) serializer.Deserialize( stringReader ); + if( changeRecordBase is ChangeRecordCorrection ) + { + // + // The query to find change records will do correction 'fixups'. That is, the changeData of this + // change record will be replaced with the changeData from the correction. The problem with this is + // that the original change data will now look like a correction. To distinguish these types of + // change records, we look to see if the OriginatingUSN's match. If the OriginatingUSN's match, + // we want they payload of the change record in this correction. This payload will contain the + // corrected data that we want. + // + ChangeRecordCorrection changeRecordCorrection = ( ChangeRecordCorrection ) changeRecordBase; + if( changeRecordCorrection.ChangeRecord.ChangeID.OriginatingUSN == changeRecord.ChangeID.OriginatingUSN ) + { + changeRecordBase = changeRecordCorrection.ChangeRecord.Payload; + } + } + + changeRecord.Payload = changeRecordBase; + } + finally + { + stringReader.Close(); + } + + return changeRecord; + } + + static DiscoveryUrlCollection GetFilterList( BusinessEntity businessEntity ) + { + DiscoveryUrlCollection filterList = new DiscoveryUrlCollection(); + + // + // Get the default URL + // + string defaultDiscoveryUrl= Config.GetString( "DefaultDiscoveryURL" ) + businessEntity.BusinessKey; + + foreach( DiscoveryUrl discoveryUrl in businessEntity.DiscoveryUrls ) + { + // + // Do a case in-sensitive search + // + if( string.Compare( discoveryUrl.Value, defaultDiscoveryUrl, true ) != 0 ) + { + filterList.Add( discoveryUrl ); + } + } + + return filterList; + } + + static ArrayList GetBusinessEntities() + { + ArrayList businessKeyList = new ArrayList(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + sp.ProcedureName = "net_find_businessKeysWithDiscoveryURLs"; + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + ArrayList businessEntities = new ArrayList(); + try + { + while( reader.Read() ) + { + BusinessEntity businessEntity = new BusinessEntity( reader.GetGuidString( 0 ) ); + businessEntities.Add( businessEntity ); + } + } + finally + { + reader.Close(); + } + + return businessEntities; + } + + [STAThread] + static void Main(string[] args) + { + Log( "Microsoft (R) FixDefaultURL Migrate Utility", FixDefaultURL.LogType.ConsoleOnly ); + Log( "Copyright (C) Microsoft Corp. 2002. All rights reserved.\n", FixDefaultURL.LogType.ConsoleOnly ); + + try + { + // + // Process command line arguments + // + ProcessCommandLineArgs( args ); + + // + // Init + // + Initialize(); + + // + // Fix our URLs + // + FixDefaultURLs(); + } + catch( Exception e ) + { + WriteException( "Uncaught exception: " + e.ToString() ); + } + finally + { + logFile.Close(); + + if( null != exceptionsFile ) + { + exceptionsFile.Close(); + } + } + } + + static void ProcessCommandLineArgs( string[] commandLineArgs ) + { + // + // No command line args. + // + } + + static bool ValidatePublisher() + { + bool validPublisher = Context.User.IsRegistered; + + // + // Make sure the user is a UDDI publisher. + // + if( false == validPublisher ) + { + DialogResult dialogResult = MessageBox.Show( "You are not registered as a publisher on this UDDI Site? You must register before performing this operation. Would you like to register now?", + "UDDI", + MessageBoxButtons.YesNo ); + + if( DialogResult.Yes == dialogResult ) + { + try + { + Context.User.Register(); + validPublisher = Context.User.IsRegistered; + } + catch( Exception registrationException ) + { + MessageBox.Show( "An exception occurred when trying to register:\r\n\r\n" + registrationException.ToString() ); + } + } + } + + return validPublisher; + } + + static void Initialize() + { + // + // Open a connection to our UDDI database. + // + ConnectionManager.Open( true, false ); + + // + // Create our log file. + // + logFile = new StreamWriter( File.Open( LogFileName, FileMode.Append, FileAccess.Write, FileShare.Read ) ); + logFile.WriteLine( "--------------------- STARTING NEW LOG (" + DateTime.Now.ToString() + ")--------------------- " ); + + // + // Get UDDI site configuration settings. + // + Config.Refresh(); + + // + // Make sure the user is allowed to run this program. + // + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal( identity ); + + Context.User.SetRole( principal ); + + if( !Context.User.IsAdministrator ) + { + MessageBox.Show( "Access denied.\r\n\r\nThis program must be executed by a member of the '" + + Config.GetString( "GroupName.Administrators" ) + "'\r\ngroup. The current user '" + + identity.Name + "' is not a member of this group." ); + return; + } + + // + // Make sure the user is a valid publisher. + // + if( false == ValidatePublisher() ) + { + Log( "You must be a UDDI publisher in order to run this program", LogType.ConsoleOnly ); + System.Environment.Exit( 1 ); + } + } + + static void WriteException( Exception e ) + { + WriteException( e.ToString() ); + } + + static void WriteException( string msg ) + { + if( null == exceptionsFile ) + { + // + // Create our exceptions file. + // + exceptionsFile = new StreamWriter( File.Open( ExceptionFileName, FileMode.Append, FileAccess.Write, FileShare.Read ) ); + exceptionsFile.WriteLine( "--------------------- STARTING NEW LOG (" + DateTime.Now.ToString() + ")--------------------- " ); + } + + Log( exceptionsFile, msg, LogType.ConsoleAndLog ); + } + + static void Log( string message ) + { + Log( message, LogType.ConsoleAndLog ); + } + + static void Log( string message, LogType logType ) + { + Log( logFile, message, logType ); + } + + static void Log( StreamWriter log, string message, LogType logType ) + { + switch ( logType ) + { + case LogType.ConsoleAndLog: + { + Console.WriteLine( message ); + log.WriteLine( "{0}: {1}", DateTime.Now.ToLongTimeString(), message ); + break; + } + case LogType.ConsoleOnly: + { + Console.WriteLine( message ); + break; + } + default: + { + log.WriteLine( "{0}: {1}", DateTime.Now.ToLongTimeString(), message ); + break; + } + } + } + + private static string Serialize( object obj ) + { + UTF8EncodedStringWriter stringWriter = new UTF8EncodedStringWriter(); + + try + { + XmlSerializer serializer = new XmlSerializer( obj.GetType() ); + XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(); + namespaces.Add( "", "urn:uddi-org:api_v2" ); + + serializer.Serialize( stringWriter, obj, namespaces ); + } + finally + { + stringWriter.Close(); + } + + return stringWriter.ToString(); + } + + static void LogStartBusinessEntity( BusinessEntity businessEntity ) + { + Log( "START Examining: " + businessEntity.BusinessKey ); + Log( "\tOriginal DiscoveryUrls:" ); + + foreach( DiscoveryUrl discoveryUrl in businessEntity.DiscoveryUrls ) + { + Log( "\t\t" + discoveryUrl.Value ); + } + } + + static void LogDoneBusinessEntity( BusinessEntity businessEntity ) + { + Log( "DONE Examining: " + businessEntity.BusinessKey ); + } + + static void LogFixStart( DiscoveryUrlCollection filteredList ) + { + Log( "\tSTART Fixing duplicates; new DiscoveryUrl list will be:" ); + + if( filteredList.Count == 0 ) + { + Log( "\t\tNo Discovery Urls besides default." ); + } + else + { + foreach( DiscoveryUrl discoveryUrl in filteredList ) + { + Log( "\t\t" + discoveryUrl.Value ); + } + } + } + + static void LogFixEnd( BusinessEntity businessEntity ) + { + Log( "\tDONE Fixing duplicates" ); + } + + static void LogChangeRecordCorrection( ChangeRecord changeRecord, ChangeRecord changeRecordCorrection ) + { + Log( "\t\t\tCorrecting USN: " + changeRecord.ChangeID.OriginatingUSN ); + } + } +} diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.csproj b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.csproj new file mode 100644 index 0000000..3884afb --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.csproj @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.snk b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.snk new file mode 100644 index 0000000..fd66941 Binary files /dev/null and b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.snk differ diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.sql b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.sql new file mode 100644 index 0000000..8cb8d69 --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/fixdefaulturl.sql @@ -0,0 +1,121 @@ +-- ============================================= +-- Name: net_getPUIDForBusinessEntity +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_getPUIDForBusinessEntity' AND type = 'P') + DROP PROCEDURE net_getPUIDForBusinessEntity +GO + +CREATE PROCEDURE net_getPUIDForBusinessEntity + @businessKey uniqueidentifier -- the guid of the businessEntity +WITH ENCRYPTION +AS +BEGIN + +SELECT [UP].[PUID] +FROM [UDC_businessEntities] BE JOIN [UDO_publishers] UP ON [BE].[publisherID] = [UP].[publisherID] +WHERE [BE].[businessKey] = @businessKey + +END -- net_getPUIDForBusinessEntity +GO + +-- ============================================= +-- Name: net_find_businessKeysWithDiscoveryURLs +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_businessKeysWithDiscoveryURLs' AND type = 'P') + DROP PROCEDURE net_find_businessKeysWithDiscoveryURLs +GO + +CREATE PROCEDURE net_find_businessKeysWithDiscoveryURLs +WITH ENCRYPTION +AS +BEGIN + SELECT DISTINCT [BE].[businessKey] + FROM [UDC_discoveryURLs] UD + JOIN [UDC_businessEntities] BE ON ([UD].[businessID]) = ([BE].[businessID]) + WHERE dbo.isReplPublisher( [BE].[publisherID] ) = 0 +END +GO +-- ============================================= +-- Name: net_find_changeRecordsByChangeType +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_find_changeRecordsByChangeType' AND type = 'P') + DROP PROCEDURE net_find_changeRecordsByChangeType +GO + +CREATE PROCEDURE net_find_changeRecordsByChangeType + @contextID uniqueidentifier, -- contextID of current find operation + @operatorKey uniqueidentifier, -- operatorKey for source operator node + @entityKey uniqueidentifier, -- the guid of the entity + @changeTypeID tinyint, -- the type of change record + @rows bigint OUTPUT -- rows added to UDS_findResults +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @operatorID bigint, + @publisherID bigint, + @i int + + SET @rows = 0 + + SET @operatorID = dbo.operatorID(@operatorKey) + + IF @operatorID IS NULL + BEGIN + SET @error = 60150 -- E_unknownUser + SET @context = 'operatorKey = ' + dbo.UUIDSTR(@operatorKey) + GOTO errorLabel + END + + SET @publisherID = dbo.getOperatorPublisherID(@operatorID) + + IF (@operatorID = dbo.currentOperatorID()) + BEGIN + -- Find changeRecords for the local operator + INSERT [UDS_replResults] ( + [contextID], + [seqNo]) + SELECT + @contextID, + [seqNo] + FROM + [UDO_changeLog] + WHERE + ([changeTypeID] = @changeTypeID) AND + ([entityKey] = @entityKey) AND + ([USN] IS NULL) + ORDER BY + [seqNo] ASC + END + ELSE + BEGIN + INSERT [UDS_replResults] ( + [contextID], + [seqNo]) + SELECT + @contextID, + [seqNo] + FROM + [UDO_changeLog] + WHERE + ([changeTypeID] = @changeTypeID) AND + ([entityKey] = @entityKey) AND + ([publisherID] = @publisherID) + ORDER BY + [seqNo] ASC + END + + SET @rows = @@ROWCOUNT + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_find_changeRecordsByEntity +GO \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/makefile b/inetsrv/uddi/source/tools/fixdefaulturl/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/makefile.inc b/inetsrv/uddi/source/tools/fixdefaulturl/makefile.inc new file mode 100644 index 0000000..6288ef4 --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/obj/_objects.mac b/inetsrv/uddi/source/tools/fixdefaulturl/obj/_objects.mac new file mode 100644 index 0000000..7caa77f --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/obj/_objects.mac @@ -0,0 +1,24 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\fixdefaulturl.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\fixdefaulturl.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\fixdefaulturl.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\fixdefaulturl.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/obj/i386/fixdefaulturl.exe b/inetsrv/uddi/source/tools/fixdefaulturl/obj/i386/fixdefaulturl.exe new file mode 100644 index 0000000..d9c500a Binary files /dev/null and b/inetsrv/uddi/source/tools/fixdefaulturl/obj/i386/fixdefaulturl.exe differ diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/obj/i386/fixdefaulturl.pdb b/inetsrv/uddi/source/tools/fixdefaulturl/obj/i386/fixdefaulturl.pdb new file mode 100644 index 0000000..a341085 Binary files /dev/null and b/inetsrv/uddi/source/tools/fixdefaulturl/obj/i386/fixdefaulturl.pdb differ diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/placefil.txt b/inetsrv/uddi/source/tools/fixdefaulturl/placefil.txt new file mode 100644 index 0000000..0a302d0 --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/placefil.txt @@ -0,0 +1 @@ +fixdefaulturl.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/fixdefaulturl/sources b/inetsrv/uddi/source/tools/fixdefaulturl/sources new file mode 100644 index 0000000..401204e --- /dev/null +++ b/inetsrv/uddi/source/tools/fixdefaulturl/sources @@ -0,0 +1,23 @@ +# +# Sources for bootstrap.exe +# + +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=fixdefaulturl +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES=system.windows.forms.dll, system.dll, system.data.dll, system.xml.dll, ..\..\core\obj\*\uddi.core.dll, ..\..\operator\obj\*\uddi.operator.dll, ..\..\api\obj\*\uddi.api.dll + +SOURCES= fixdefaulturl.cs \ +# assemblyversioninfo.cs \ + assemblyinfo.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/migrate/assemblyinfo.cs b/inetsrv/uddi/source/tools/migrate/assemblyinfo.cs new file mode 100644 index 0000000..45d38d8 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("migrate.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/migrate/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/migrate/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/migrate/makefile b/inetsrv/uddi/source/tools/migrate/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/migrate/makefile.inc b/inetsrv/uddi/source/tools/migrate/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/migrate/migrate.cs b/inetsrv/uddi/source/tools/migrate/migrate.cs new file mode 100644 index 0000000..d0f6cee --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/migrate.cs @@ -0,0 +1,2537 @@ +using System; +using System.Diagnostics; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Xml.Serialization; + +using Microsoft.Win32; + +using UDDI.API; +using UDDI.API.ServiceType; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.Binding; +using UDDI.API.Extensions; + +namespace UDDI.Tools +{ + class Migrate + { + enum MigrationStage + { + DisplayUsage, + SetReaderConnection, + ResetWriter, + MigratePublishers, + MigrateBareTModels, + BootstrapResources, + MigrateCategorizationSchemes, + MigrateFullTModels, + MigrateHiddenTModels, + MigrateBareBusinessEntities, + MigrateBusinessEntities, + MigratePublisherAssertions, + RestoreReaderConnection + } + + enum LogType + { + ConsoleAndLog, + ConsoleOnly, + LogOnly + } + + // + // Registry Constants + // + + private const string DatabaseRoot = @"SOFTWARE\Microsoft\UDDI\Database"; + private const string DatabaseSetupRoot = @"SOFTWARE\Microsoft\UDDI\Setup\DBServer"; + private const string ReaderValueName = "ReaderConnectionString"; + private const string WriterValueName = "WriterConnectionString"; + private const string OldReaderValueName = "OldNewReaderConnectionString"; + + // + // Version Constants + // + + private const string V2RC0SITESTR = "5.2.3626.0"; + private const string V2RC1SITESTR = "5.2.3663.0"; + private const string V2RC0STR = "2.0.1.0"; + private const string V2RC1STR = "2.0.1.1"; + private const string V2RC2STR = "2.0.1.2"; + private const string V2RTMSTR = "2.0.1.3"; + + // + // Upgrade contstants + // + + private const string UpgradeRc0ToRc1Script = "uddi.v2.update_rc0_to_rc1.sql"; + private const string UpgradeRc1ToRc2Script = "uddi.v2.update_rc1_to_rc2.sql"; + + // + // Other Constants + // + + private const string LogFileName = "migrate.log.txt"; + private const string ExceptionFileName = "migrate.exceptions.txt"; + private const string ExceptionDirName = "exceptions"; + private const string EmptyAccessPoint = "undefined"; // String to use when both accessPoint and hostingRedirector are null + private const string EmptyPersonName = "unspecified"; // String to use when personName does not meet minumum length requriements + + // + // Command Line Parameters + // + + static MigrationStage Stage = MigrationStage.DisplayUsage; + static string NewReaderConnectionString; + static bool Verbose = false; + + // + // Global Variables + // + + static FileStream LogFile = new FileStream( LogFileName, FileMode.Append ); + static StreamWriter Stream = new StreamWriter( LogFile ); + + static string ReaderConnectionString; + static string WriterConnectionString; + static string Separator="".PadLeft( 80, '-' ); + static int Exceptions = 0; + + static Version V2RC0SITE = new Version( V2RC0SITESTR ); + static Version V2RC1SITE = new Version( V2RC1SITESTR ); + static Version V2RC0 = new Version( V2RC0STR ); + static Version V2RC1 = new Version( V2RC1STR ); + static Version V2RC2 = new Version( V2RC2STR ); + static Version V2RTM = new Version( V2RTMSTR ); + + [ StructLayout( LayoutKind.Sequential ) ] + internal class SECURITY_ATTRIBUTES + { + public int nLength; + public object lpSecurityDescriptor; + public bool bInheritHandle; + + public SECURITY_ATTRIBUTES() + { + nLength = Marshal.SizeOf( typeof( SECURITY_ATTRIBUTES ) ); + lpSecurityDescriptor = null; + bInheritHandle = false; + } + } + + internal enum SystemErrorCodes + { + ERROR_SUCCESS = 0, + ERROR_ALREADY_EXISTS = 183 + } + + // + // TODO add more values as we need them + // + internal enum FileHandleValues + { + INVALID_HANDLE_VALUE = -1 + } + + // + // TODO add more values as we need them + // + internal enum SharedFileProtection : byte + { + PAGE_READONLY = 0x02 + } + + internal class SharedMemory + { + int hSharedMemory; + const int INVALID_HANDLE_VALUE = -1; + + public bool Create( string name ) + { + hSharedMemory = -1; + bool success = false; + + try + { + SECURITY_ATTRIBUTES securityAttributes = new SECURITY_ATTRIBUTES(); + + hSharedMemory = CreateFileMapping( ( int )FileHandleValues.INVALID_HANDLE_VALUE, + securityAttributes, + ( int )SharedFileProtection.PAGE_READONLY, + 0, + 1, + name ); + + if( ( int )SystemErrorCodes.ERROR_SUCCESS == GetLastError() ) + { + success = true; + } + } + catch + { + if( -1 != hSharedMemory ) + { + CloseHandle( hSharedMemory ); + } + } + + return success; + } + + public void Release() + { + if( -1 != hSharedMemory ) + { + CloseHandle( hSharedMemory ); + } + } + + [DllImport( "user32.dll", CharSet=CharSet.Auto )] + private static extern int MessageBox(int hWnd, String text, String caption, uint type); + + [DllImport( "kernel32.dll", SetLastError=true )] + private static extern int CreateFileMapping( int hFile, + SECURITY_ATTRIBUTES lpAttributes, + int flProtect, + int dwMaximumSizeHigh, + int dwMaximumSizeLow, + string lpName ); + + [DllImport( "kernel32.dll" )] + private static extern bool CloseHandle( int hObject ); + + [DllImport( "kernel32.dll" )] + private static extern int GetLastError(); + } + + static int Main( string[] args ) + { + int retcode = 0; + + // + // Use shared memory to make sure that only 1 instance of this process is running. sharedMemory.Release() MUST + // be called when this process exits in order to free up the shared memory. + // + SharedMemory sharedMemory = new SharedMemory(); + + try + { + + Log( "Microsoft (R) UDDI Migrate Utility", LogType.ConsoleOnly ); + Log( "Copyright (C) Microsoft Corp. 2002. All rights reserved.\n", LogType.ConsoleOnly ); + + if( false == sharedMemory.Create( "UDDI_migration_process" ) ) + { + Console.WriteLine( "Only 1 instance of this process can be running." ); + System.Environment.Exit( 1 ); + } + + // + // parse command line + // + retcode = ProcessCommandLine( args ); + + if( Stage == MigrationStage.DisplayUsage ) + { + DisplayUsage(); + } + else + { + + Log( "Starting execution of migrate.exe", LogType.ConsoleAndLog ); + + // + // Get connection strings from registry + // + GetSettings(); + + // + // Refresh the config settings + // + Config.Refresh(); + + switch( Stage ) + { + case MigrationStage.SetReaderConnection: + SetReaderConnection(); + break; + + case MigrationStage.ResetWriter: + CheckDatabaseVersions(); + ResetWriter(); + break; + + case MigrationStage.MigratePublishers: + CheckDatabaseVersions(); + MigratePublishers(); + break; + + case MigrationStage.MigrateBareTModels: + CheckDatabaseVersions(); + MigrateBareTModels(); + break; + + case MigrationStage.BootstrapResources: + CheckDatabaseVersions(); + BootstrapResources(); + break; + + case MigrationStage.MigrateCategorizationSchemes: + CheckDatabaseVersions(); + MigrateCategorizationSchemes(); + break; + + case MigrationStage.MigrateFullTModels: + CheckDatabaseVersions(); + MigrateFullTModels(); + break; + + case MigrationStage.MigrateHiddenTModels: + CheckDatabaseVersions(); + MigrateHiddenTModels(); + break; + + case MigrationStage.MigrateBareBusinessEntities: + CheckDatabaseVersions(); + MigrateBareBusinessEntities(); + break; + + case MigrationStage.MigrateBusinessEntities: + CheckDatabaseVersions(); + MigrateBusinessEntities(); + break; + + case MigrationStage.MigratePublisherAssertions: + CheckDatabaseVersions(); + MigratePublisherAssertions(); + break; + + case MigrationStage.RestoreReaderConnection: + RestoreReaderConnection(); + break; + } + } + } + catch ( Exception e ) + { + retcode = 1; + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + } + finally + { + sharedMemory.Release(); + } + + if( retcode == 0 ) + Log( "Migrate.exe terminating normally", LogType.ConsoleAndLog ); + else + Log( "Migrate.exe terminating abnormally", LogType.ConsoleAndLog ); + + Stream.Close(); + LogFile.Close(); + + return retcode; + } + + private static int ProcessCommandLine( string [] args ) + { + int retcode = 0; + + for( int i = 0; i < args.Length; i ++ ) + { + if( '-' == args[i][0] || '/' == args[i][0] ) + { + string option = args[i].Substring( 1 ); + + if( "help" == option.ToLower() || "?" == option ) + { + Stage = MigrationStage.DisplayUsage; + return 0; + } + else if( "s" == option.ToLower() ) + { + i++; // move to the next arg + + try + { + Stage = (MigrationStage)Enum.Parse( Stage.GetType(), args[i], true ); + } + catch( Exception e ) + { + Log ( "ERROR: Invalid migrationstage value: " + e.ToString(), LogType.ConsoleOnly ); + return 1; + } + + } + else if( "c" == option.ToLower() ) + { + i++; // move to the next arg + NewReaderConnectionString = args[i]; + } + else if( "v" == option.ToLower() ) + { + Verbose = true; + } + else if( "i" == option.ToLower() ) + { + Stream.Close(); + LogFile.Close(); + LogFile = new FileStream( LogFileName, FileMode.Create ); + Stream = new StreamWriter( LogFile ); + } + else + { + Stage = MigrationStage.DisplayUsage; + return 1; + } + } + } + + // + // Check argument dependencies + // + + switch( Stage ) + { + case MigrationStage.SetReaderConnection: + retcode = ( null == NewReaderConnectionString ? 1 : 0 ); + break; + + default: + retcode = 0; + break; + } + + return retcode; + } + + private static void CheckDatabaseVersions() + { + // + // Process Reader Version + // + + Version readerversion = GetDbVersion( ReaderConnectionString ); + Version writerversion = GetDbVersion( WriterConnectionString ); + + if( !writerversion.Equals( readerversion ) ) + { + Log( "Different database versions detected.", LogType.ConsoleAndLog ); + Log( "Writer Database Version: " + writerversion.ToString(), LogType.LogOnly ); + + switch( writerversion.ToString() ) + { + case V2RC1STR: + if( readerversion.Equals( V2RC0 ) ) + { + Log( "Upgrading reader to UDDI Database version " + V2RC1.ToString(), LogType.ConsoleAndLog ); + ExecuteScript( ReaderConnectionString, UpgradeRc0ToRc1Script ); + } + else + { + throw new ApplicationException( "Migrations from a UDDI database version " + readerversion.ToString() + " to a UDDI database version " + writerversion.ToString() + " are not supported by this tool." ); + } + + break; + + case V2RC2STR: + if( readerversion.Equals( V2RC1 ) ) + { + Log( "Upgrading reader to UDDI Database version " + V2RC2.ToString(), LogType.ConsoleAndLog ); + ExecuteScript( ReaderConnectionString, UpgradeRc1ToRc2Script ); + } + else + { + throw new ApplicationException( "Migrations from a UDDI database version " + readerversion.ToString() + " to a UDDI database version " + writerversion.ToString() + " are not supported by this tool." ); + } + + break; + + case V2RTMSTR: + throw new ApplicationException( "Migrations from a UDDI database version " + readerversion.ToString() + " to a UDDI database version " + writerversion.ToString() + " are not yet supported by this tool." ); + + default: + throw new ApplicationException( "Unknown UDDI Database version encountered: " + writerversion.ToString() ); + } + } + } + + private static void SetReaderConnection() + { + Log( Separator, LogType.LogOnly ); + Log( "Executing Stage: SetReaderConnection", LogType.ConsoleAndLog ); + + try + { + RegistryKey root = Registry.LocalMachine.OpenSubKey( DatabaseRoot, true ); + + string oldconnectionstring = root.GetValue( ReaderValueName ).ToString(); + root.SetValue( ReaderValueName, NewReaderConnectionString ); + Log( "Registry setting changed: " + DatabaseRoot + "\\" + ReaderValueName + " = \"" + NewReaderConnectionString + "\"", LogType.LogOnly ); + root.SetValue( OldReaderValueName, oldconnectionstring ); + Log( "Registry setting changed: " + DatabaseRoot + "\\" + OldReaderValueName + " = \"" + oldconnectionstring + "\"", LogType.LogOnly ); + + root.Close(); + } + catch ( Exception e ) + { + Log( "ERROR: unable to modify registry: " + e.ToString(), LogType.LogOnly ); + throw new ApplicationException( "SetReaderConnection failed." ); + } + } + + private static void ResetWriter() + { + Log( Separator, LogType.LogOnly ); + Log( "Executing Stage: ResetWriter", LogType.ConsoleAndLog ); + + // + // Setup connection to writer + // + SqlConnection connection = new SqlConnection( WriterConnectionString ); + connection.Open(); + SqlTransaction transaction; + transaction = connection.BeginTransaction(); + + try + { + // + // Setup command for delete operation + // + + string cmdbatch = ""; + cmdbatch += "DELETE [UDC_categoryBag_TM] \n"; + cmdbatch += "DELETE [UDC_identifierBag_TM] \n"; + cmdbatch += "DELETE [UDC_tModelDesc] \n"; + cmdbatch += "DELETE [UDC_tModels] \n"; + cmdbatch += "DELETE [UDC_instanceDesc] \n"; + cmdbatch += "DELETE [UDC_tModelInstances] \n"; + cmdbatch += "DELETE [UDC_bindingDesc] \n"; + cmdbatch += "DELETE [UDC_bindingTemplates] \n"; + cmdbatch += "DELETE [UDC_names_BS] \n"; + cmdbatch += "DELETE [UDC_categoryBag_BS] \n"; + cmdbatch += "DELETE [UDC_serviceDesc] \n"; + cmdbatch += "DELETE [UDC_businessServices] \n"; + cmdbatch += "DELETE [UDC_addressLines] \n"; + cmdbatch += "DELETE [UDC_addresses] \n"; + cmdbatch += "DELETE [UDC_phones] \n"; + cmdbatch += "DELETE [UDC_emails] \n"; + cmdbatch += "DELETE [UDC_contactDesc] \n"; + cmdbatch += "DELETE [UDC_contacts] \n"; + cmdbatch += "DELETE [UDC_businessDesc] \n"; + cmdbatch += "DELETE [UDC_categoryBag_BE] \n"; + cmdbatch += "DELETE [UDC_identifierBag_BE] \n"; + cmdbatch += "DELETE [UDC_discoveryURLs] \n"; + cmdbatch += "DELETE [UDC_names_BE] \n"; + cmdbatch += "DELETE [UDC_assertions_BE] \n"; + cmdbatch += "DELETE [UDC_serviceProjections] \n"; + cmdbatch += "DELETE [UDT_taxonomyValues] \n"; + cmdbatch += "DELETE [UDT_taxonomies] \n"; + cmdbatch += "DELETE [UDO_changeLog] \n"; + cmdbatch += "DELETE [UDO_queryLog] \n"; + cmdbatch += "DELETE [UDO_operatorLog] \n"; + cmdbatch += "DELETE \n"; + cmdbatch += " [UDO_publishers] \n"; + cmdbatch += "WHERE \n"; + cmdbatch += " ([PUID] <> '"+ UDDI.Utility.GetDefaultPublisher() + "') \n"; + Log( cmdbatch, LogType.LogOnly ); + + SqlCommand command = new SqlCommand( cmdbatch ); + command.Connection = connection; + command.Transaction = transaction; + + // + // Execute command + // + + command.ExecuteNonQuery(); + transaction.Commit(); + Log( "Write database has been reset.", LogType.ConsoleAndLog ); + } + catch( Exception e ) + { + transaction.Rollback(); + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "ResetWriter failed." ); + } + finally + { + connection.Close(); + } + } + + private static void MigratePublishers() + { + int count = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing Stage: MigratePublishers", LogType.ConsoleAndLog ); + + // + // Get a list of publishers + // + + SqlConnection readerconnection = new SqlConnection( ReaderConnectionString ); + readerconnection.Open(); + + SqlConnection writerconnection = new SqlConnection( WriterConnectionString ); + writerconnection.Open(); + + SqlTransaction transaction; + transaction = writerconnection.BeginTransaction(); + + try + { + // + // Setup writer publisher insert statement + // + + string writercommandbatch = ""; + writercommandbatch += "INSERT [UDO_publishers] ( \n"; + writercommandbatch += " [publisherStatusID], \n"; + writercommandbatch += " [PUID], \n"; + writercommandbatch += " [email], \n"; + writercommandbatch += " [name], \n"; + writercommandbatch += " [phone], \n"; + writercommandbatch += " [isoLangCode], \n"; + writercommandbatch += " [tModelLimit], \n"; + writercommandbatch += " [businessLimit], \n"; + writercommandbatch += " [serviceLimit], \n"; + writercommandbatch += " [bindingLimit], \n"; + writercommandbatch += " [assertionLimit], \n"; + writercommandbatch += " [companyName], \n"; + writercommandbatch += " [addressLine1], \n"; + writercommandbatch += " [addressLine2], \n"; + writercommandbatch += " [mailstop], \n"; + writercommandbatch += " [city], \n"; + writercommandbatch += " [stateProvince], \n"; + writercommandbatch += " [extraProvince], \n"; + writercommandbatch += " [country], \n"; + writercommandbatch += " [postalCode], \n"; + writercommandbatch += " [companyURL], \n"; + writercommandbatch += " [companyPhone], \n"; + writercommandbatch += " [altPhone], \n"; + writercommandbatch += " [backupContact], \n"; + writercommandbatch += " [backupEmail], \n"; + writercommandbatch += " [description], \n"; + writercommandbatch += " [securityToken], \n"; + writercommandbatch += " [flag] )\n"; + writercommandbatch += "VALUES ( \n"; + writercommandbatch += " @publisherStatusID, \n"; + writercommandbatch += " @PUID, \n"; + writercommandbatch += " @email, \n"; + writercommandbatch += " @name, \n"; + writercommandbatch += " @phone, \n"; + writercommandbatch += " @isoLangCode, \n"; + writercommandbatch += " @tModelLimit, \n"; + writercommandbatch += " @businessLimit, \n"; + writercommandbatch += " @serviceLimit, \n"; + writercommandbatch += " @bindingLimit, \n"; + writercommandbatch += " @assertionLimit, \n"; + writercommandbatch += " @companyName, \n"; + writercommandbatch += " @addressLine1, \n"; + writercommandbatch += " @addressLine2, \n"; + writercommandbatch += " @mailstop, \n"; + writercommandbatch += " @city, \n"; + writercommandbatch += " @stateProvince, \n"; + writercommandbatch += " @extraProvince, \n"; + writercommandbatch += " @country, \n"; + writercommandbatch += " @postalCode, \n"; + writercommandbatch += " @companyURL, \n"; + writercommandbatch += " @companyPhone, \n"; + writercommandbatch += " @altPhone, \n"; + writercommandbatch += " @backupContact, \n"; + writercommandbatch += " @backupEmail, \n"; + writercommandbatch += " @description, \n"; + writercommandbatch += " @securityToken, \n"; + writercommandbatch += " @flag )\n"; + + SqlCommand writercommand = new SqlCommand( writercommandbatch ); + writercommand.Parameters.Add( "@publisherStatusID", SqlDbType.TinyInt ); + writercommand.Parameters.Add( "@PUID", SqlDbType.NVarChar, 450 ); + writercommand.Parameters.Add( "@email", SqlDbType.NVarChar, 450 ); + writercommand.Parameters.Add( "@name", SqlDbType.NVarChar, 100 ); + writercommand.Parameters.Add( "@phone", SqlDbType.VarChar, 20 ); + writercommand.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, 17 ); + writercommand.Parameters.Add( "@tModelLimit", SqlDbType.Int ); + writercommand.Parameters.Add( "@businessLimit", SqlDbType.Int ); + writercommand.Parameters.Add( "@serviceLimit", SqlDbType.Int ); + writercommand.Parameters.Add( "@bindingLimit", SqlDbType.Int ); + writercommand.Parameters.Add( "@assertionLimit", SqlDbType.Int ); + writercommand.Parameters.Add( "@companyName", SqlDbType.NVarChar, 100 ); + writercommand.Parameters.Add( "@addressLine1", SqlDbType.NVarChar, 4000 ); + writercommand.Parameters.Add( "@addressLine2", SqlDbType.NVarChar, 4000 ); + writercommand.Parameters.Add( "@mailstop", SqlDbType.NVarChar, 20 ); + writercommand.Parameters.Add( "@city", SqlDbType.NVarChar, 100 ); + writercommand.Parameters.Add( "@stateProvince", SqlDbType.NVarChar, 100 ); + writercommand.Parameters.Add( "@extraProvince", SqlDbType.NVarChar, 100 ); + writercommand.Parameters.Add( "@country", SqlDbType.NVarChar, 100 ); + writercommand.Parameters.Add( "@postalCode", SqlDbType.VarChar, 100 ); + writercommand.Parameters.Add( "@companyURL", SqlDbType.NVarChar, 512 ); + writercommand.Parameters.Add( "@companyPhone", SqlDbType.VarChar, 20 ); + writercommand.Parameters.Add( "@altPhone", SqlDbType.VarChar, 20 ); + writercommand.Parameters.Add( "@backupContact", SqlDbType.NVarChar, 100 ); + writercommand.Parameters.Add( "@backupEmail", SqlDbType.NVarChar, 450 ); + writercommand.Parameters.Add( "@description", SqlDbType.NVarChar, 4000 ); + writercommand.Parameters.Add( "@securityToken", SqlDbType.UniqueIdentifier ); + writercommand.Parameters.Add( "@flag", SqlDbType.Int ); + + writercommand.Connection = writerconnection; + writercommand.Transaction = transaction; + + // + // Execute query against reader and process results + // + SqlDataReader reader; + reader = GetPublisherList( readerconnection ); + + while( reader.Read() ) + { + count++; + + // + // Set writer insert parameters using reader result values. + // Note: Assumes reader select and writer insert have identical column lists + // + + for( int i = 0; i < writercommand.Parameters.Count; i++ ) + { + writercommand.Parameters[ i ].Value = DBNull.Value; + + if( !reader.IsDBNull( i ) ) + writercommand.Parameters[ i ].Value = reader.GetSqlValue( i ); + } + + // + // Execute writer insert + // + + writercommand.ExecuteNonQuery(); + } + + reader.Close(); + transaction.Commit(); + } + catch ( Exception e ) + { + transaction.Rollback(); + count = 0; + Log( "ERROR: database error: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigratePublishers failed." ); + } + finally + { + readerconnection.Close(); + writerconnection.Close(); + Log( count.ToString() + " publishers migrated.", LogType.ConsoleAndLog ); + } + } + + private static void MigrateBareTModels() + { + int count = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing Stage: MigrateBareTModels", LogType.ConsoleAndLog ); + + // + // Open a separate connection to reader + // + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + try + { + // + // Get a list of tModels hosted by Microsoft on reader + // + + SqlDataReader reader = GetCompleteTModelList( connection ); + + // + // Loop through each tModel in the result set + // + + //string operatorkey = ""; + + while( reader.Read() ) + { + TModel tmodel = new TModel(); + + // + // Set identity + // + + Context.User.ID = reader.IsDBNull( 1 ) ? null : reader.GetString( 1 ); + Context.User.SetPublisherRole( Context.User.ID ); + + // + // Get tModel from reader + // + + tmodel.TModelKey = "uuid:" + ( reader.IsDBNull( 0 ) ? "" : reader.GetGuid( 0 ).ToString() ); + ConnectionManager.Open( false, false ); + tmodel.Get(); + ConnectionManager.Close(); + + // + // Remove identifier and categoryBags + // + + if( tmodel.IdentifierBag.Count > 0 ) + { + tmodel.IdentifierBag.Clear(); + Log( "Cleared identifierBag for tModelKey = " + tmodel.TModelKey, LogType.LogOnly ); + } + + if( tmodel.CategoryBag.Count > 0 ) + { + tmodel.CategoryBag.Clear(); + Log( "Cleared categoryBag for tModelKey = " + tmodel.TModelKey, LogType.LogOnly ); + } + + // + // Set authorizedName to null + // + + tmodel.AuthorizedName = null; + + // + // Open writer connection + // + + ConnectionManager.Open( true, true ); + + if( Context.User.ID != UDDI.Utility.GetDefaultPublisher() ) + Context.User.SetAllowPreassignedKeys( true ); + + // + // Save the bare tModel to the writer + // + + Log( "save_tModel: tModelKey = " + tmodel.TModelKey + "; name = " + tmodel.Name + "; puid = " + Context.User.ID, LogType.LogOnly ); + tmodel.Save(); + count++; + + // + // Note that transaction only spans single save_tModel and operator insert/delete due to connecton manager limitations + // + + ConnectionManager.Commit(); + ConnectionManager.Close(); + } + + reader.Close(); + } + catch ( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigrateBareTModels failed." ); + } + finally + { + connection.Close(); + ConnectionManager.Close(); + Log( count.ToString() + " bare tModels migrated.", LogType.ConsoleAndLog ); + } + } + + private static void BootstrapResources() + { + int count=0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing Stage: BootstrapResources", LogType.ConsoleAndLog ); + + try + { + // + // load all the bootstrap files found in the \uddi\bootstrap folder + // + string targetDir = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI" ).GetValue( "InstallRoot" ).ToString(); + string bootstrapdir = CheckForSlash(targetDir) + "bootstrap"; + string bootstrapexe = CheckForSlash(targetDir) + @"bin\bootstrap.exe"; + + Log( "Getting list of bootstrap files from directory '" + bootstrapdir + "'", LogType.LogOnly ); + + string[] filepaths = Directory.GetFiles( bootstrapdir, "*.xml" ); + Log( "Writing " + filepaths.Length + " baseline resources to database.", LogType.ConsoleAndLog ); + + foreach( string filepath in filepaths ) + { + Log( "Importing bootstrap data from: " + filepath, LogType.ConsoleAndLog ); + + ProcessStartInfo startInfo = new ProcessStartInfo( bootstrapexe, "/f \""+ filepath + "\""); + + startInfo.CreateNoWindow = true; + startInfo.UseShellExecute = false; + startInfo.RedirectStandardOutput = true; + + Process p = new Process(); + p = Process.Start( startInfo ); + + // + // grab the stdout string + // + string bootstrapOutput = p.StandardOutput.ReadToEnd(); + + // + // wait for bootstrap.exe to complete + // + p.WaitForExit(); + + // + // write the stdout string to the log + // + Log( bootstrapOutput, LogType.LogOnly ); + + if( p.ExitCode != 0 ) + { + throw new ApplicationException( "BootstrapResources failed." ); + } + + count++; + } + } + catch( Exception e ) + { + DispositionReport.Throw( e ); + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "BootstrapResources failed." ); + } + finally + { + Log( count.ToString() + " resource files bootstrapped.", LogType.ConsoleAndLog ); + } + } + + private static void MigrateCategorizationSchemes() + { + int count = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing Stage: MigrateCategorizationSchemes", LogType.ConsoleAndLog ); + + // + // Check database version compatibility + // + + Version writerversion = GetDbVersion( WriterConnectionString ); + + if ( writerversion.CompareTo( V2RC2 ) < 0 ) + { + throw new ApplicationException( "The MigrateCategorizationSchemes migration stage is only supported for UDDI Services database versions " + V2RC2.ToString() + " or later. Your current database version is: " + writerversion.ToString() ); + } + + // + // Open a separate connection to reader + // + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + try + { + // + // Get a list of taxonomies + // + + SqlDataReader reader = GetTaxonomyList( connection ); + + // + // Loop through each taxonomy in the result set + // + + while( reader.Read() ) + { + // + // Check to see if taxonomy is a user-defined taxonomy + // Note: a user-defined taxonomy is any taxonomy that does not exist in a newly bootstrapped uddi database + // + + if( !CategorizationSchemeExists( reader.IsDBNull( 0 ) ? null : reader.GetGuid( 0 ).ToString() ) ) + { + CategorizationScheme scheme = new CategorizationScheme(); + + // + // Set identity to system since categorization schemes are not publications + // + + Context.User.ID = UDDI.Utility.GetDefaultPublisher(); + Context.User.SetPublisherRole( Context.User.ID ); + + // + // Get categorization scheme from reader + // + + scheme.TModelKey = "uuid:" + ( reader.IsDBNull( 0 ) ? "" : reader.GetGuid( 0 ).ToString() ); + ConnectionManager.Open( false, false ); + scheme.Get(); + ConnectionManager.Close(); + + // + // Save the categorization scheme to writer + // + ConnectionManager.Open( true, true ); + Log( "CategorizationScheme.Save(): tModelKey = " + scheme.TModelKey + "; puid = " + Context.User.ID + "; value count = " + scheme.CategoryValues.Count.ToString(), LogType.LogOnly ); + scheme.Save(); + count++; + + // + // Note that transaction only spans single tmodel due to connecton manager limitations + // + + ConnectionManager.Commit(); + ConnectionManager.Close(); + + scheme = new CategorizationScheme(); + } + } + + reader.Close(); + } + catch ( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigrateCategorizationSchemes failed." ); + } + finally + { + connection.Close(); + ConnectionManager.Close(); + Log( count.ToString() + " categorization schemes migrated.", LogType.ConsoleAndLog ); + } + } + + private static void MigrateFullTModels() + { + int count = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing Stage: MigrateFullTModels", LogType.ConsoleAndLog ); + + // + // Open a separate connection to reader + // + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + try + { + // + // Get a list of tModels hosted by Micrsoft + // + + SqlDataReader reader = GetCompleteTModelList( connection ); + + // + // Loop through each tModel in the result set + // + + TModel tmodel = new TModel(); + + while( reader.Read() ) + { + count++; + + // + // Set identity + // + + Context.User.ID = reader.IsDBNull( 1 ) ? null : reader.GetString( 1 ); + Context.User.SetPublisherRole( Context.User.ID ); + string email = reader.IsDBNull( 2 ) ? null : reader.GetString( 2 ); + + // + // Get tModel from reader + // + + string tmodelkey = reader.IsDBNull( 0 ) ? null : reader.GetGuid( 0 ).ToString(); + tmodel.TModelKey = "uuid:" + tmodelkey; + ConnectionManager.Open( false, false ); + tmodel.Get(); + ConnectionManager.Close(); + + // + // Fix 1.0 bugs if any + // + + FixTModel( tmodel, email ); + + // + // Set authorizedName to null + // + + tmodel.AuthorizedName = null; + + // + // Save tModel on writer + // + + ConnectionManager.Open( true, true ); + Log( "save_tModel: tModelKey = " + tmodel.TModelKey + "; name = " + tmodel.Name + "; puid = " + Context.User.ID, LogType.LogOnly ); + tmodel.Save(); + + // + // Note that transaction only spans single tmodel due to connecton manager limitations + // + + ConnectionManager.Commit(); + ConnectionManager.Close(); + + tmodel = new TModel(); + } + reader.Close(); + } + catch ( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigrateFullTModels failed." ); + } + finally + { + connection.Close(); + ConnectionManager.Close(); + Log( count.ToString() + " full tModels migrated.", LogType.ConsoleAndLog ); + } + } + + private static void MigrateHiddenTModels() + { + int count = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing stage: MigrateHiddenTModels", LogType.ConsoleAndLog ); + + // + // Open a separate connection to reader + // + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + // + // Open writer connection + // + + ConnectionManager.Open( true, true ); + + try + { + // + // Get a list of hidden tModels hosted by Microsoft from reader + // + + SqlDataReader reader = GetHiddenTModelList( connection ); + + // + // Loop through each tModel in the result set + // + + while( reader.Read() ) + { + TModel tmodel = new TModel(); + count++; + + // + // Set identity + // + + Context.User.ID = reader.IsDBNull( 1 ) ? null : reader.GetString( 1 ); + Context.User.SetPublisherRole( Context.User.ID ); + + // + // Delete the tModel on the writer connection + // + tmodel.TModelKey = "uuid:" + ( reader.IsDBNull( 0 ) ? "" : reader.GetGuid( 0 ).ToString() ); + Log( "delete_tModel: tModelKey = " + tmodel.TModelKey + "; puid = " + Context.User.ID, LogType.LogOnly ); + tmodel.Delete(); + } + + reader.Close(); + ConnectionManager.Commit(); + } + catch ( Exception e ) + { + ConnectionManager.Abort(); + count = 0; + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigrateHiddenTModels failed." ); + } + finally + { + connection.Close(); + ConnectionManager.Close(); + Log( count.ToString() + " hidden tModels migrated.", LogType.ConsoleAndLog ); + } + } + + private static void MigrateBareBusinessEntities() + { + int count = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing stage: MigrateBareBusinessEntities", LogType.ConsoleAndLog ); + + // + // Open a separate connection to reader + // + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + try + { + // + // Get a list of businessEntities hosted by Microsoft on reader + // + + SqlDataReader reader = GetBusinessEntityList( connection ); + + // + // Loop through each businessEntity in the result set + // + + while( reader.Read() ) + { + BusinessEntity businessentity = new BusinessEntity(); + count++; + + // + // Set identity + // + + Context.User.ID = reader.IsDBNull( 1 ) ? null : reader.GetString( 1 ); + Context.User.SetPublisherRole( Context.User.ID ); + string email = reader.IsDBNull( 2 ) ? null : reader.GetString( 2 ); + + // + // Get businessEntity from reader + // + + businessentity.BusinessKey = reader.IsDBNull( 0 ) ? null : reader.GetGuid( 0 ).ToString(); + ConnectionManager.Open( false, false ); + businessentity.Get(); + ConnectionManager.Close(); + + // + // Remove all keyedReferences from businessEntity + // + + if( 0 < businessentity.CategoryBag.Count ) + { + businessentity.CategoryBag.Clear(); + Log( "Cleared categoryBag for businessEntity. businessKey = " + businessentity.BusinessKey, LogType.LogOnly ); + } + + if( 0 < businessentity.IdentifierBag.Count ) + { + businessentity.IdentifierBag.Clear(); + Log( "Cleared identifierBag for businessEntity. businessKey = " + businessentity.BusinessKey, LogType.LogOnly ); + } + + foreach( BusinessService bs in businessentity.BusinessServices ) + { + // + // Remove all keyedReferences from businessService + // + + if( 0 < bs.CategoryBag.Count ) + { + bs.CategoryBag.Clear(); + Log( "Cleared categoryBag for businessService. serviceKey = " + bs.ServiceKey, LogType.LogOnly ); + } + + foreach( BindingTemplate bt in bs.BindingTemplates ) + { + // + // Clear hostingRedirector from bindingTemplate. Save key in accessPoint + // + + if( null != bt.HostingRedirector.BindingKey ) + { + bt.AccessPoint.Value = bt.HostingRedirector.BindingKey; + bt.HostingRedirector.BindingKey = null; + Log( "Cleared hostingRedirector for bindingTemplate. bindingKey = " + bt.BindingKey, LogType.LogOnly ); + } + } + } + + // + // Correct v1.0 bugs if any + // + + FixBusiness( businessentity, email, false ); + + // + // Set authorizedName to null + // + + businessentity.AuthorizedName = null; + + // + // Open writer connection + // + + ConnectionManager.Open( true, true ); + + if( Context.User.ID != UDDI.Utility.GetDefaultPublisher() ) + Context.User.SetAllowPreassignedKeys( true ); + + // + // Save the businessEntity on the writer + // + + Log( "save_business: businessKey = " + businessentity.BusinessKey + "; name = " + businessentity.Names[ 0 ].Value + "; puid = " + Context.User.ID, LogType.LogOnly ); + businessentity.Save(); + + // + // Note that transaction only spans single save_tModel and operator insert/delete due to connecton manager limitations + // + + ConnectionManager.Commit(); + ConnectionManager.Close(); + } + reader.Close(); + } + catch ( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigrateBareBusinessEntities failed." ); + } + finally + { + connection.Close(); + ConnectionManager.Close(); + Log( count.ToString() + " bare businessEntities migrated.", LogType.ConsoleAndLog ); + } + + } + + private static void MigrateBusinessEntities() + { + int count = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing stage: MigrateBusinessEntities", LogType.ConsoleAndLog ); + + // + // Open a separate connection to reader + // + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + try + { + // + // Get a list of businessEntities hosted by Microsoft on reader + // + + SqlDataReader reader = GetBusinessEntityList( connection ); + + // + // Loop through each businessEntity in the result set + // + + while( reader.Read() ) + { + BusinessEntity businessentity = new BusinessEntity(); + count++; + + // + // Set identity + // + + Context.User.ID = reader.IsDBNull( 1 ) ? null : reader.GetString( 1 ); + Context.User.SetPublisherRole( Context.User.ID ); + string email = reader.IsDBNull( 2 ) ? null : reader.GetString( 2 ); + + // + // Get businessEntity from reader + // + + businessentity.BusinessKey = reader.IsDBNull( 0 ) ? null : reader.GetGuid( 0 ).ToString(); + ConnectionManager.Open( false, false ); + businessentity.Get(); + ConnectionManager.Close(); + + // + // Correct v1.0 bugs if any + // + + FixBusiness( businessentity, email, true ); + + // + // Set authorizedName to null + // + + businessentity.AuthorizedName = null; + + // + // Open writer connection + // + + ConnectionManager.Open( true, true ); + + if( Context.User.ID != UDDI.Utility.GetDefaultPublisher() ) + Context.User.SetAllowPreassignedKeys( true ); + + // + // Save the businessEntity on the writer + // + + Log( "save_business: businessKey = " + businessentity.BusinessKey + "; name = " + businessentity.Names[ 0 ].Value + "; puid = " + Context.User.ID, LogType.LogOnly ); + businessentity.Save(); + + // + // Note that transaction only spans single save_tModel and operator insert/delete due to connecton manager limitations + // + + ConnectionManager.Commit(); + ConnectionManager.Close(); + } + reader.Close(); + } + catch ( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigrateBusinessEntities failed." ); + } + finally + { + connection.Close(); + ConnectionManager.Close(); + Log( count.ToString() + " businessEntities migrated.", LogType.ConsoleAndLog ); + } + + } + + private static void MigratePublisherAssertions() + { + int publishercount = 0; + int assertioncount = 0; + + Log( Separator, LogType.LogOnly ); + Log( "Executing stage: MigratePublisherAssertions", LogType.ConsoleAndLog ); + + // + // Open a separate connection to reader + // + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + try + { + // + // Get a list of publishers on the reader + // + + SqlDataReader reader = GetPublisherList( connection ); + + // + // Loop through each publisher in the result set + // + + while( reader.Read() ) + { + PublisherAssertionCollection assertions = new PublisherAssertionCollection(); + + // + // Set identity + // + + Context.User.ID = reader.IsDBNull( 1 ) ? null : reader.GetString( 1 ); + Context.User.SetPublisherRole( Context.User.ID ); + + // + // Get assertions + // + + ConnectionManager.Open( false, false ); + assertions.Get(); + ConnectionManager.Close(); + + // + // Open writer connection + // + + if( 0 < assertions.Count ) + { + ConnectionManager.Open( true, true ); + + // + // Save the assertions on the writer + // + + Log( "set_publisherAssertions: puid = " + Context.User.ID + "; count = " + assertions.Count.ToString(), LogType.LogOnly ); + assertions.Save(); + + publishercount++; + assertioncount = assertioncount + assertions.Count; + + // + // Note that transaction only spans single set_publisherAssertions due to connecton manager limitations + // + + ConnectionManager.Commit(); + ConnectionManager.Close(); + } + } + + reader.Close(); + } + catch ( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "MigratePublisherAssertions failed." ); + } + finally + { + connection.Close(); + ConnectionManager.Close(); + Log( assertioncount.ToString() + " assertions migrated for " + publishercount.ToString() + " publishers.", LogType.ConsoleAndLog ); + } + } + + private static void RestoreReaderConnection() + { + Log( Separator, LogType.LogOnly ); + Log( "Executing stage: RestoreReaderConnection", LogType.ConsoleAndLog ); + + try + { + RegistryKey root = Registry.LocalMachine.OpenSubKey( DatabaseRoot, true ); + + if( null != root.GetValue( OldReaderValueName ) ) + { + string oldreaderconnectionstring = root.GetValue( OldReaderValueName ).ToString(); + root.SetValue( ReaderValueName, oldreaderconnectionstring ); + Log( "Registry Setting Changed: " + DatabaseRoot + "\\" + ReaderValueName + " = \"" + oldreaderconnectionstring + "\"", LogType.LogOnly ); + root.DeleteValue( OldReaderValueName, true ); + Log( "Deleted Registry Value: " + DatabaseRoot + "\\" + OldReaderValueName, LogType.LogOnly ); + + root.Close(); + } + } + catch ( Exception e ) + { + Log( "ERROR:" + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "RestoreReaderConnection failed." ); + } + } + + private static void GetSettings() + { + + try + { + RegistryKey dbsetuproot = Registry.LocalMachine.OpenSubKey( DatabaseSetupRoot ); + + if( null == dbsetuproot ) + { + throw new ApplicationException( "The UDDI Services Database Components are not installed on this machine." ); + } + + dbsetuproot.Close(); + + RegistryKey dbroot = Registry.LocalMachine.OpenSubKey( DatabaseRoot, true ); + + if( null == dbroot ) + { + throw new ApplicationException( "Unable to open registry key: " + DatabaseRoot ); + } + + ReaderConnectionString = dbroot.GetValue( ReaderValueName ).ToString(); + WriterConnectionString = dbroot.GetValue( WriterValueName ).ToString(); + dbroot.Close(); + } + catch ( Exception e ) + { + Log( "ERROR:" + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "GetSettings failed." ); + } + + } + + private static SqlDataReader GetPublisherList( SqlConnection connection ) + { + string cmdbatch = ""; + cmdbatch += "SELECT \n"; + cmdbatch += " [publisherStatusID], \n"; + cmdbatch += " [PUID], \n"; + cmdbatch += " [email], \n"; + cmdbatch += " [name], \n"; + cmdbatch += " [phone], \n"; + cmdbatch += " [isoLangCode], \n"; + cmdbatch += " [tModelLimit], \n"; + cmdbatch += " [businessLimit], \n"; + cmdbatch += " [serviceLimit], \n"; + cmdbatch += " [bindingLimit], \n"; + cmdbatch += " [assertionLimit], \n"; + cmdbatch += " [companyName], \n"; + cmdbatch += " [addressLine1], \n"; + cmdbatch += " [addressLine2], \n"; + cmdbatch += " [mailstop], \n"; + cmdbatch += " [city], \n"; + cmdbatch += " [stateProvince], \n"; + cmdbatch += " [extraProvince], \n"; + cmdbatch += " [country], \n"; + cmdbatch += " [postalCode], \n"; + cmdbatch += " [companyURL], \n"; + cmdbatch += " [companyPhone], \n"; + cmdbatch += " [altPhone], \n"; + cmdbatch += " [backupContact], \n"; + cmdbatch += " [backupEmail], \n"; + cmdbatch += " [description], \n"; + cmdbatch += " [securityToken], \n"; + cmdbatch += " [flag] \n"; + cmdbatch += "FROM \n"; + cmdbatch += " [UDO_publishers] \n"; + cmdbatch += "WHERE \n"; + cmdbatch += " ([publisherID] NOT IN (SELECT [publisherID] FROM [UDO_operators])) \n"; + cmdbatch += "ORDER BY \n"; + cmdbatch += " [publisherID] ASC \n"; + + SqlCommand command = new SqlCommand( cmdbatch ); + command.Connection = connection; + + SqlDataReader reader; + + try + { + reader = command.ExecuteReader(); + } + catch ( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "GetPublisherList failed." ); + } + + return reader; + } + + private static SqlDataReader GetCompleteTModelList( SqlConnection connection ) + { + string cmdbatch = ""; + cmdbatch += "SELECT \n"; + cmdbatch += " TM.[tModelKey], \n"; + cmdbatch += " PU.[PUID], \n"; + cmdbatch += " PU.[email] \n"; + cmdbatch += "FROM \n"; + cmdbatch += " [UDC_tModels] TM \n"; + cmdbatch += " JOIN [UDO_publishers] PU ON TM.[publisherID] = PU.[publisherID] \n"; + cmdbatch += "ORDER BY \n"; + cmdbatch += " [tModelID] ASC \n"; + + SqlCommand command = new SqlCommand( cmdbatch ); + command.Connection = connection; + + SqlDataReader reader; + try + { + reader = command.ExecuteReader(); + } + catch( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "GetCompleteTModelList failed." ); + } + + return reader; + } + + private static SqlDataReader GetHiddenTModelList( SqlConnection connection ) + { + string cmdbatch = ""; + cmdbatch += "SELECT \n"; + cmdbatch += " TM.[tModelKey], \n"; + cmdbatch += " PU.[PUID], \n"; + cmdbatch += " PU.[email] \n"; + cmdbatch += "FROM \n"; + cmdbatch += " [UDC_tModels] TM \n"; + cmdbatch += " JOIN [UDO_publishers] PU ON TM.[publisherID] = PU.[publisherID] \n"; + cmdbatch += "WHERE \n"; + cmdbatch += " ( TM.[flag] = 1 ) \n"; + cmdbatch += "ORDER BY \n"; + cmdbatch += " [tModelID] ASC \n"; + + SqlCommand command = new SqlCommand( cmdbatch ); + command.Connection = connection; + + SqlDataReader reader; + try + { + reader = command.ExecuteReader(); + } + catch( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "GetCompleteTModelList failed." ); + } + + return reader; + } + + private static SqlDataReader GetBusinessEntityList( SqlConnection connection ) + { + string cmdbatch = ""; + cmdbatch += "SELECT \n"; + cmdbatch += " BE.[businessKey], \n"; + cmdbatch += " PU.[PUID], \n"; + cmdbatch += " PU.[email] \n"; + cmdbatch += "FROM \n"; + cmdbatch += " [UDC_businessEntities] BE \n"; + cmdbatch += " JOIN [UDO_publishers] PU ON BE.[publisherID] = PU.[publisherID] \n"; + cmdbatch += "ORDER BY \n"; + cmdbatch += " [businessID] ASC \n"; + + SqlCommand command = new SqlCommand( cmdbatch ); + command.Connection = connection; + + SqlDataReader reader; + + try + { + reader = command.ExecuteReader(); + } + catch( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "GetBusinessEntityList failed." ); + } + + return reader; + } + + private static SqlDataReader GetTaxonomyList( SqlConnection connection ) + { + string cmdbatch = ""; + cmdbatch += "SELECT \n"; + cmdbatch += " [tModelKey], \n"; + cmdbatch += " [flag] \n"; + cmdbatch += "FROM \n"; + cmdbatch += " [UDT_taxonomies] \n"; + cmdbatch += "ORDER BY \n"; + cmdbatch += " [taxonomyID] ASC \n"; + + SqlCommand command = new SqlCommand( cmdbatch ); + command.Connection = connection; + + SqlDataReader reader; + try + { + reader = command.ExecuteReader(); + } + catch( Exception e ) + { + Log( "ERROR: " + e.ToString(), LogType.ConsoleAndLog ); + throw new ApplicationException( "GetCompleteTModelList failed." ); + } + + return reader; + } + + private static bool CategorizationSchemeExists( string tmodelkey ) + { + bool bExists = false; + + ConnectionManager.Open( true, false ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_taxonomy_get" ); + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@flag", SqlDbType.Int, ParameterDirection.InputOutput ); + + sp.Parameters.SetGuidFromString( "@tModelKey", tmodelkey ); + sp.Parameters.SetNull( "@flag" ); + + try + { + sp.ExecuteNonQuery(); + bExists = true; + } + catch( System.Data.SqlClient.SqlException se ) + { + switch ( se.Number - UDDI.Constants.ErrorTypeSQLOffset ) + { + case (int) ErrorType.E_invalidKeyPassed : + // E_invalidKey: taxonomy does not exist on writer + bExists = false; + break; + + default: + throw se; + } + + } + catch( Exception e ) + { + throw e; + } + finally + { + ConnectionManager.Close(); + } + + return bExists; + } + + + private static void FixTModel( TModel tmodel, string email ) + { + bool changed = false; + string change = ""; + + string oldtmodel = Deserialize( UDDI.EntityType.TModel, tmodel ); + + // + // Fix null tModelKey in identifierBags + // + + for( int i=0; i < tmodel.IdentifierBag.Count; i++ ) + if( null == tmodel.IdentifierBag[ i ].TModelKey ) + { + tmodel.IdentifierBag[ i ].TModelKey = Config.GetString( "TModelKey.GeneralKeywords" ); + changed = true; + change += "tModel/identifierBag/keyedReference/@tModelKey {" + (i + 1).ToString() + "};"; + } + + // + // Delete invalid references to checked taxonomies in identifierBags + // + + for( int i=0; i < tmodel.IdentifierBag.Count; i++ ) + { + ConnectionManager.Open( true, false ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_identifierBag_validate"; + + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetString( "@keyValue", tmodel.IdentifierBag[ i ].KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", tmodel.IdentifierBag[ i ].TModelKey ); + + try + { + sp.ExecuteNonQuery(); + } + catch( System.Data.SqlClient.SqlException se ) + { + switch ( se.Number ) + { + case 70200 : + // E_invalidValue: bad categorization detected, delete keyedReference + changed = true; + change += "tModel/identifierBag/keyedReference {" + (i + 1).ToString() + "}; "; + tmodel.IdentifierBag.Remove( tmodel.IdentifierBag[ i ] ); + + i--; + break; + + case 50009 : + // E_subProcFailure + break; + + default: + throw se; + } + + } + catch( Exception e ) + { + throw e; + } + finally + { + ConnectionManager.Close(); + } + } + + if( changed ) + WriteException( email, UDDI.EntityType.TModel, tmodel.TModelKey, oldtmodel, Deserialize( UDDI.EntityType.TModel, tmodel ), change ); + + return; + } + + private static void FixBusiness( BusinessEntity business, string email, bool logExceptions ) + { + bool changed = false; + string change = ""; + + string oldbusiness = Deserialize( UDDI.EntityType.BusinessEntity, business ); + + // + // Fix businessEntities with no names + // + + if( 0 == business.Names.Count ) + { + string name = "unspecified"; + business.Names.Add( "en", name ); + changed = true; + change += "businessEntity/name {1); "; + } + + // + // Fix null tModelKey and / or keyValue in identifierBags + // + + for( int i=0; i < business.IdentifierBag.Count; i++ ) + { + if( null == business.IdentifierBag[ i ].TModelKey ) + { + business.IdentifierBag[ i ].TModelKey = Config.GetString( "TModelKey.GeneralKeywords" ); + changed = true; + } + + if( null == business.IdentifierBag[ i ].KeyValue ) + { + business.IdentifierBag[ i ].KeyValue = ""; + changed = true; + } + + if( changed ) + { + change += "businessEntity/identifierBag/keyedReference/@tModelKey {" + (i + 1).ToString() + "}; "; + } + } + + // + // Fix personName elements that do not meet minumum length requirements + // + + for( int i=0; i < business.Contacts.Count; i++ ) + { + if( StringEmpty2( business.Contacts[ i ].PersonName ) ) + { + business.Contacts[ i ].PersonName = EmptyPersonName; + changed = true; + change += "businessEntity/contact/personName {" + (i + 1).ToString() + "};"; + } + } + + // + // Fix bindingTemplates with null accessPoint and hostingRedirector + // + + for( int i=0; i < business.BusinessServices.Count; i++ ) + { + for( int j=0; j < business.BusinessServices[ i ].BindingTemplates.Count; j++ ) + { + if( Utility.StringEmpty( business.BusinessServices[ i ].BindingTemplates[ j ].HostingRedirector.BindingKey ) && Utility.StringEmpty( business.BusinessServices[ i ].BindingTemplates[ j ].AccessPoint.Value ) ) + { + business.BusinessServices[ i ].BindingTemplates[ j ].AccessPoint.Value = EmptyAccessPoint; + changed = true; + change += "businessEntity/businessServices/businessService/bindingTemplates/bindingTemplate/accessPoint {" + (j + 1).ToString() + "};"; + } + } + } + + // + // Delete invalid references to checked taxonomies in categoryBags + // + + for( int i=0; i < business.CategoryBag.Count; i++ ) + { + ConnectionManager.Open( true, false ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_categoryBag_validate"; + + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetString( "@keyValue", business.CategoryBag[ i ].KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", business.CategoryBag[ i ].TModelKey ); + + try + { + sp.ExecuteNonQuery(); + } + catch( System.Data.SqlClient.SqlException se ) + { + switch ( se.Number ) + { + case 70200 : + // E_invalidValue: bad categorization detected, delete keyedReference + changed = true; + change += "businessEntity/categoryBag/keyedReference {" + (i + 1).ToString() + "}; "; + business.CategoryBag.Remove( business.CategoryBag[ i ] ); + + i--; + break; + + case 50009 : + // E_subProcFailure + break; + + default: + throw se; + } + + } + catch( Exception e ) + { + throw e; + } + finally + { + ConnectionManager.Close(); + } + } + + // + // Delete invalid references to checked taxonomies in identifierBags + // + + for( int i=0; i < business.IdentifierBag.Count; i++ ) + { + ConnectionManager.Open( true, false ); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_identifierBag_validate"; + + sp.Parameters.Add( "@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue ); + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + + sp.Parameters.SetString( "@keyValue", business.IdentifierBag[ i ].KeyValue ); + sp.Parameters.SetGuidFromKey( "@tModelKey", business.IdentifierBag[ i ].TModelKey ); + + try + { + sp.ExecuteNonQuery(); + } + catch( System.Data.SqlClient.SqlException se ) + { + switch ( se.Number ) + { + case 70200 : + // E_invalidValue: bad categorization detected, delete keyedReference + changed = true; + change += "businessEntity/identifierBag/keyedReference {" + (i + 1).ToString() + "}; "; + business.IdentifierBag.Remove( business.IdentifierBag[ i ] ); + + i--; + break; + + case 50009 : + // E_subProcFailure + break; + + default: + throw se; + } + + } + catch( Exception e ) + { + throw e; + } + finally + { + ConnectionManager.Close(); + } + } + + // + // Fix dangling @hostingRedirectors + // + + for( int i=0; i < business.BusinessServices.Count; i++ ) + { + for( int j=0; j < business.BusinessServices[ i ].BindingTemplates.Count; j++ ) + { + BindingTemplate binding = business.BusinessServices[ i ].BindingTemplates[ j ]; + + if( null != binding.HostingRedirector.BindingKey ) + { + ConnectionManager.Open( true, false ); + + SqlStoredProcedureAccessor sp2 = new SqlStoredProcedureAccessor(); + + sp2.ProcedureName = "net_key_validate"; + + sp2.Parameters.Add( "@entityTypeID", SqlDbType.TinyInt ); + sp2.Parameters.Add( "@entityKey", SqlDbType.UniqueIdentifier ); + + sp2.Parameters.SetShort( "@entityTypeID", (short)EntityType.BindingTemplate ); + sp2.Parameters.SetGuidFromString( "@entityKey", binding.HostingRedirector.BindingKey ); + + try + { + sp2.ExecuteNonQuery(); + } + catch( System.Data.SqlClient.SqlException se ) + { + switch( se.Number - UDDI.Constants.ErrorTypeSQLOffset ) + { + case (int) ErrorType.E_invalidKeyPassed: + // + // Bad hostingRedirector detected + // + changed = true; + change += "businessEntity/businessServices/bindingTemplates/bindingTemplate/hostingRedirector/@bindingKey {" + (i + 1).ToString() + "}; "; + binding.AccessPoint.Value = "unspecified (previously hostingRedirector/@bindingKey = " + binding.HostingRedirector.BindingKey.ToString() + ")"; + binding.HostingRedirector.BindingKey = null; + break; + + default: + throw se; + } + } + catch( Exception e ) + { + throw e; + } + finally + { + ConnectionManager.Close(); + } + } + } + } + + if( changed && logExceptions ) + WriteException( email, UDDI.EntityType.BusinessEntity, business.BusinessKey, oldbusiness, Deserialize( UDDI.EntityType.BusinessEntity, business ) , change ); + + return; + } + + private static Version GetDbVersion( string connectionstring ) + { + + Version siteversion; + Version dbversion; + + // + // Get Site.Version config item + // + + if( connectionstring == WriterConnectionString ) + { + // Use standard config against writer + UDDI.Diagnostics.Debug.VerifySetting( "Site.Version" ); + siteversion = new Version( Config.GetString( "Site.Version" ) ); + } + else // connectionstring == ReaderConnectionString + { + // Standard config routines only support writer + // We need to get the config setting from reader so use a different approach + siteversion = new Version( GetReaderConfigValue( "Site.Version" ) ); + } + + if( siteversion.CompareTo( V2RC0SITE ) < 0 ) + { + throw new ApplicationException( "Unsupported UDDI Services Site Version detected: " + siteversion.ToString() ); + } + + // + // Get Database.Version config item + // + + if( siteversion.CompareTo( V2RC0SITE ) == 0 ) + { + // + // Indicates an RC0 (Qwest) build of UDDI Services for Windows Server 2003 + // Note: The Database.Verison config item did not exist in RC0 so we use Site.Version instead + // Note: This is the earliest version of UDDI Services supported by the migration tool + // + + dbversion = V2RC0; + } + else if( siteversion.CompareTo( V2RC1SITE ) == 0 ) + { + // + // Indicates an RC1 build of UDDI Services for Windows Server 2003 + // Note: The Database.Verison config item did not exist in RC1 so we use Site.Version instead + // Note: This is the earliest version of UDDI Services supported by the migration tool + // + + dbversion = V2RC1; + } + else + { + // + // Indicates a post-RC1 build of UDDI Services for Windows Server 2003 + // + + if( connectionstring == WriterConnectionString ) + { + // Use standard config against writer + UDDI.Diagnostics.Debug.VerifySetting( "Database.Version" ); + dbversion = new Version( Config.GetString( "Database.Version" ) ); + } + else // connectionstring == ReaderConnectionString + { + // Standard config routines only support writer + // We need to get the config setting from reader so use a different approach + dbversion = new Version( GetReaderConfigValue( "Database.Version" ) ); + } + + } + + // + // Evalutate database version + // + + switch( dbversion.ToString() ) + { + case V2RC0STR: + case V2RC1STR: + case V2RC2STR: + break; + + case V2RTMSTR: + // + // TODO: this will change when we ship RTM + // + throw new ApplicationException( "UDDI Services Database Version " + dbversion.ToString() + " is not currently supported by this tool." ); + + default: + throw new ApplicationException( "Unsupported UDDI Services Database Version detected: " + dbversion.ToString() ); + } + + Log( "UDDI Services Database Version detected: " + dbversion.ToString() + "; connection: " + connectionstring, LogType.LogOnly ); + + return dbversion; + } + + private static string GetReaderConfigValue( string configname ) + { + string configvalue = null; + + SqlConnection connection = new SqlConnection( ReaderConnectionString ); + connection.Open(); + + try + { + + SqlCommand sp = new SqlCommand( "net_config_get", connection ); + sp.CommandType = CommandType.StoredProcedure; + + SqlDataReader reader = sp.ExecuteReader(); + + while( reader.Read() ) + { + if( configname.ToUpper() == ( reader.IsDBNull( 0 ) ? null : reader.GetString( 0 ).ToUpper() ) ) + { + configvalue = reader.IsDBNull( 1 ) ? null : reader.GetString( 1 ); + break; + } + } + + reader.Close(); + } + catch( Exception e ) + { + throw new ApplicationException( "Execute of net_config_get failed. Error: " + e.ToString() ); + } + finally + { + connection.Close(); + } + + if( null == configvalue ) + { + throw new ApplicationException( "Unknown configName requested: " + configname ); + } + + return configvalue; + } + + private static string GetResource( string name ) + { + try + { + Assembly assembly = Assembly.GetExecutingAssembly(); + + // + // Read the resource. + // + Log( "Reading resource: " + name, LogType.LogOnly ); + Stream stream = assembly.GetManifestResourceStream( name ); + StreamReader reader = new StreamReader( stream ); + + return reader.ReadToEnd(); + } + catch ( Exception e ) + { + throw new ApplicationException( "Unable to get resource for: " + name + "; error: " + e.ToString() ); + } + } + + private static void ExecuteScript( string connectionstring, string scriptname ) + { + string script = GetResource( scriptname ); + + Log( "Executing script " + scriptname + " on connection: " + connectionstring, LogType.LogOnly ); + + // + // Scripts are comprised of multiple batches separated by "GO". + // The SQL managed provider does not recognize this convention, + // so this code must handle batching manually + // + + string buffer = ""; + + for( int i=0; i <= ( script.Length - 1 ); i++ ) + { + buffer = buffer + script[ i ].ToString(); + + // + // Detect 'G' + 'O' + whitespace at beginning of script + // + if( ( 2 == i ) && ( 'G' == Char.ToUpper( script[ i - 2 ] ) ) && ( 'O' == Char.ToUpper( script[ i - 1 ] ) ) && ( Char.IsWhiteSpace( script[ i ] ) ) ) + { + // + // This case can be ignored since no commands exist in the batch + // + buffer = ""; + continue; + } + + // + // Detect whitespace + 'G' + 'O' + whitespace inside script + // Note: case whitespace + 'G' + 'O' at end of script is handled automatically + // + if( ( 2 < i ) && ( Char.IsWhiteSpace( script[ i - 3 ] ) ) && ( 'G' == Char.ToUpper( script[ i - 2 ] ) ) && ( 'O' == Char.ToUpper( script[ i - 1 ] ) ) && ( Char.IsWhiteSpace( script[ i ] ) ) ) + { + RunBatch( connectionstring, buffer ); + buffer = ""; + } + } + + if( buffer.Length > 0 ) + { + RunBatch( connectionstring, buffer ); + } + } + + private static void RunBatch( string connectionstring, string batch ) + { + batch = batch.Trim(); + + // + // Strip "GO" off end of batch if it exists + // + + if( ( 3 < batch.Length ) && Char.IsWhiteSpace( batch[ batch.Length - 3 ] ) && ( batch.EndsWith( "GO" ) ) ) + { + batch = batch.Substring( 0, batch.Length - 2 ); + } + + batch = batch.Trim(); + + if( batch.Length == 0 ) + return; + + SqlConnection connection = new SqlConnection( connectionstring ); + connection.Open(); + SqlCommand command = new SqlCommand( batch, connection ); + + try + { + command.ExecuteNonQuery(); + } + catch( Exception e ) + { + throw new ApplicationException( "Attempt to execute batch failed: " + e.ToString() ); + } + finally + { + connection.Close(); + } + } + + private static void WriteException( string email, EntityType entitytype, string entitykey, string oldxml, string newxml, string change ) + { + Exceptions++; + + Log( "Logging exception number " + Exceptions.ToString( "0000" ) + " to exceptions file.", LogType.LogOnly ); + + if( !Directory.Exists( ExceptionDirName ) ) + Directory.CreateDirectory( ExceptionDirName ); + + // + // Write a new record to exceptions file + // + + string oldfilename = ExceptionDirName + "\\" + Exceptions.ToString( "0000" ) + "_old_" + entitykey + ".xml"; + oldfilename = oldfilename.Replace( ':', '-' ); + + string newfilename = ExceptionDirName + "\\" + Exceptions.ToString( "0000" ) + "_new_" + entitykey + ".xml"; + newfilename = newfilename.Replace( ':', '-' ); + + string exceptionRecord=""; + exceptionRecord += Exceptions.ToString() + "\t"; + exceptionRecord += email + "\t"; + exceptionRecord += entitytype.ToString() + "\t"; + exceptionRecord += entitykey + "\t"; + exceptionRecord += oldfilename + "\t"; + exceptionRecord += newfilename + "\t"; + exceptionRecord += change; + + FileStream exceptionfile = new FileStream( ExceptionFileName, FileMode.Append ); + StreamWriter stream = new StreamWriter( exceptionfile ); + stream.WriteLine( exceptionRecord ); + stream.Close(); + exceptionfile.Close(); + + // + // Write old and new entities out to exception directory + // + + Log( "Creating exception file: " + oldfilename, LogType.LogOnly ); + + FileStream oldfile = new FileStream( oldfilename, FileMode.CreateNew ); + stream = new StreamWriter( oldfile ); + stream.Write( oldxml ); + stream.Close(); + oldfile.Close(); + + Log( "Creating exception file: " + newfilename, LogType.LogOnly ); + + FileStream newfile = new FileStream( newfilename, FileMode.CreateNew ); + stream = new StreamWriter( newfile ); + stream.Write( newxml ); + stream.Close(); + newfile.Close(); + + return; + } + + private static string CheckForSlash( string str ) + { + if( !str.EndsWith( @"\" ) ) + { + return ( str + @"\" ); + } + + return str; + } + + private static string Deserialize( EntityType entitytype, object entity ) + { + XmlSerializer serializer; + string payload; + + switch( entitytype ) + { + case EntityType.BusinessEntity: + serializer = new XmlSerializer( typeof( BusinessEntity ) ); + break; + case EntityType.TModel: + serializer = new XmlSerializer( typeof( TModel ) ); + break; + default: + throw new ApplicationException( "Invalid entitytype in WriteException()." ); + } + + XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(); + UTF8EncodedStringWriter stringWriter = new UTF8EncodedStringWriter(); + + try + { + namespaces.Add( "", "urn:uddi-org:api_v2" ); + + serializer.Serialize( stringWriter, entity, namespaces ); + payload = stringWriter.ToString(); + } + finally + { + stringWriter.Close(); + } + + + return payload; + } + + private static void Log( string message, LogType logType ) + { + switch ( logType ) + { + case LogType.ConsoleAndLog: + Console.WriteLine( message ); + Stream.WriteLine( "{0}: {1}", DateTime.Now.ToLongTimeString(), message ); + break; + case LogType.ConsoleOnly: + Console.WriteLine( message ); + break; + case LogType.LogOnly: + if( Verbose ) + Console.WriteLine( message ); + + Stream.WriteLine( "{0}: {1}", DateTime.Now.ToLongTimeString(), message ); + break; + } + } + + private static void DisplayUsage() + { + Log( "Migrates data from UDDI V1.5 to UDDI V2.0", LogType.ConsoleOnly ); + Log( "Output is logged to " + LogFileName + "\n", LogType.ConsoleOnly ); + Log( "migrate [-?] [-s migrationstage] [-c readerconnectstring] [-v] [-i] \n", LogType.ConsoleOnly ); + Log( " [?]: Display usage information ", LogType.ConsoleOnly ); + Log( " [-s migrationstage]: Use one of the following values for migrationstage: ", LogType.ConsoleOnly ); + Log( " SetReaderConnection: Sets ReaderConnectionString in registry", LogType.ConsoleOnly ); + Log( " Note: Reference a V2.0 db loaded with V1.5 data", LogType.ConsoleOnly ); + Log( " Note: Requires -c argument", LogType.ConsoleOnly ); + Log( " ResetWriter: Resets publishers, tModels and businessEntities on write db", LogType.ConsoleOnly ); + Log( " MigratePublishers: Migrates publisher accounts from read to write db", LogType.ConsoleOnly ); + Log( " MigrateBareTModels: Migrates bare TModels from read to write db", LogType.ConsoleOnly ); + Log( " BootstrapResources: Bootstraps all resources in \\uddi\\bootstrap", LogType.ConsoleOnly ); + Log( " MigrateCategorizationSchemes: Migrates categorization schemes from read to write db", LogType.ConsoleOnly ); + Log( " MigrateFullTModels: Migrates full TModels from read to write db", LogType.ConsoleOnly ); + Log( " MigrateHiddenTModels: Migrates hidden TModels from read to write db", LogType.ConsoleOnly ); + Log( " MigrateBusinessEntities: Migrates businessEntities from read to write db", LogType.ConsoleOnly ); + Log( " MigratePublisherAssertions: Migrates publisher assertions from read to write db", LogType.ConsoleOnly ); + Log( " RestoreReaderConnection: Restores original ReaderConnectionString", LogType.ConsoleOnly ); + Log( " [-c readerconnectstring]: Used to specify a ReaderConnectionString", LogType.ConsoleOnly ); + Log( " Note: use only with -s SetReaderConnection", LogType.ConsoleOnly ); + Log( " Note: must use double-quotes around connection string", LogType.ConsoleOnly ); + Log( " [-v]: Verbose output to console.", LogType.ConsoleOnly ); + Log( " [-i]: Initialize log file.\n", LogType.ConsoleOnly ); + Log( "Examples:", LogType.ConsoleOnly ); + Log( " migrate -?", LogType.ConsoleOnly ); + Log( " migrate -s SetReaderConnection ", LogType.ConsoleOnly ); + Log( " -c \"Data Source=SRV;Initial Catalog=DB;Integrated Security=SSPI\" -i", LogType.ConsoleOnly ); + Log( " migrate -s ResetWriter", LogType.ConsoleOnly ); + Log( " migrate -s MigratePublishers", LogType.ConsoleOnly ); + Log( " migrate -s MigrateBareTModels", LogType.ConsoleOnly ); + Log( " migrate -s BootstrapResources", LogType.ConsoleOnly ); + Log( " migrate -s MigrateCategorizationSchemes", LogType.ConsoleOnly ); + Log( " migrate -s MigrateFullTModels", LogType.ConsoleOnly ); + Log( " migrate -s MigrateHiddenTModels", LogType.ConsoleOnly ); + Log( " migrate -s MigrateBareBusinessEntities", LogType.ConsoleOnly ); + Log( " migrate -s MigrateBusinessEntities", LogType.ConsoleOnly ); + Log( " migrate -s MigratePublisherAssertions", LogType.ConsoleOnly ); + Log( " migrate -s RestoreReaderConnection", LogType.ConsoleOnly ); + } + + private static bool StringEmpty2( string str ) + { + if( null == str ) + return true; + #if never + if( 0 == str.Trim().Length ) + return true; + #endif + + return false; + } + } +} diff --git a/inetsrv/uddi/source/tools/migrate/migrate.csproj b/inetsrv/uddi/source/tools/migrate/migrate.csproj new file mode 100644 index 0000000..b3ca543 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/migrate.csproj @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/migrate/migrate.snk b/inetsrv/uddi/source/tools/migrate/migrate.snk new file mode 100644 index 0000000..62b79d0 Binary files /dev/null and b/inetsrv/uddi/source/tools/migrate/migrate.snk differ diff --git a/inetsrv/uddi/source/tools/migrate/migrate.sql b/inetsrv/uddi/source/tools/migrate/migrate.sql new file mode 100644 index 0000000..f6d4eec --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/migrate.sql @@ -0,0 +1,1363 @@ +-- Script: uddi.v2.migrate.v15.v2.sql +-- Author: lrdohert@microsoft.com +-- Date: 04-10-01 +-- Description: Migrates data from v16 to v2.0. + +-- Instructions: +-- 1. Restore a copy of the v15 database on the same machine as the target v2.0 database +-- 2. Edit the database names in line 12 (target), line 31 (source) and line 32 (target) to reflect current environment +-- 3. Execute this script +-- 4. Save the results for verification + +-- ============================================= +-- Name: ADM_migrate +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'ADM_migrate' AND type = 'P') + DROP PROCEDURE ADM_migrate +GO + +CREATE PROCEDURE ADM_migrate + @sourceDb sysname, + @destDb sysname, + @mode varchar(20) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @message varchar(8000), + @batchText varchar(8000), + @lf char(1), + @start datetime, + @stop datetime, + @duration datetime, + @rows int + + SET @lf = CHAR(10) + SET @start = getdate() + + -- + -- Delete build data + -- + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Deleting data in target database...' + + -- Delete all tModel data + TRUNCATE TABLE [UDC_categoryBag_TM] + TRUNCATE TABLE [UDC_identifierBag_TM] + TRUNCATE TABLE [UDC_tModelDesc] + DELETE [UDC_tModels] + + -- Delete all bindingTemplate data + TRUNCATE TABLE [UDC_instanceDesc] + DELETE [UDC_tModelInstances] + TRUNCATE TABLE [UDC_bindingDesc] + DELETE [UDC_bindingTemplates] + + -- Delete all businessService data + TRUNCATE TABLE [UDC_names_BS] + TRUNCATE TABLE [UDC_categoryBag_BS] + TRUNCATE TABLE [UDC_serviceDesc] + DELETE [UDC_businessServices] + + -- Delete all businessEntity data + TRUNCATE TABLE [UDC_addressLines] + DELETE [UDC_addresses] + TRUNCATE TABLE [UDC_phones] + TRUNCATE TABLE [UDC_emails] + TRUNCATE TABLE [UDC_contactDesc] + DELETE [UDC_contacts] + TRUNCATE TABLE [UDC_businessDesc] + TRUNCATE TABLE [UDC_categoryBag_BE] + TRUNCATE TABLE [UDC_identifierBag_BE] + TRUNCATE TABLE [UDC_discoveryURLs] + TRUNCATE TABLE [UDC_names_BE] + DELETE [UDC_businessEntities] + TRUNCATE TABLE [UDC_assertions_BE] + TRUNCATE TABLE [UDC_serviceProjections] + + -- Miscellaneous deletes + + TRUNCATE TABLE [UDO_changeLog] + + DELETE [UDO_operators] + DELETE [UDO_publishers] + + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDO_publishers + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDO_publishers] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDO_publishers].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDO_publishers] ON ' + @lf + SET @batchText = @batchText + 'INSERT [UDO_publishers] ( ' + @lf + SET @batchText = @batchText + ' [publisherID], [publisherStatusID], [PUID], [email], [name], [phone], [isoLangCode], [tModelLimit], [businessLimit], [serviceLimit], [bindingLimit], [companyName], [addressLine1], [addressLine2], [mailstop], [city], [stateProvince], [extraProvince], [country], [postalCode], [companyURL], [companyPhone], [altPhone], [backupContact], [backupEmail], [description], [securityToken], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [publisherID], [publisherStatusID] - 1, [PUID], [email], [name], [phone], [isoLangCode], [tModelLimit], [businessLimit], [serviceLimit], [bindingLimit], [companyName], [addressLine1], [addressLine2], [mailstop], [city], [stateProvince], [extraProvince], [country], [postalCode], [companyURL], [companyPhone], [altPhone], [backupContact], [backupEmail], [description], [securityToken], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDO_publishers] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [publisherID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDO_publishers.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDO_publishers] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDO_publishers] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDO_publishers.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDO_publishers to UDO_publishers: ' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDO_operators to UDO_operators + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDO_operators] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDO_operators].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDO_operators] ON ' + @lf + SET @batchText = @batchText + 'INSERT [UDO_operators] ( ' + @lf + SET @batchText = @batchText + ' [operatorID], [operatorKey], [publisherID], [operatorStatusID], [name], [soapReplicationURL], [certSerialNo], [certIssuer], [certSubject], [certificate], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [operatorID], NEWID(), [publisherID], 1, [name], ''not initialized'', NEWID(), ''not initialized'', ''not initialized'', NULL, 0 ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDO_operators] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [operatorID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDO_operators.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDO_publishers] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDO_operators] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDO_operators.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_operators to UDO_operators: ' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Fix up UDO_operators + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'UPDATE [UDO_operators] SET ' + @lf + SET @batchText = @batchText + ' [operatorKey] = ''A05CF23A-296F-4899-B204-7142F31A77F9'', ' + @lf + SET @batchText = @batchText + ' [operatorStatusID] = 3 ' + @lf + SET @batchText = @batchText + 'WHERE ' + @lf + SET @batchText = @batchText + ' ([operatorID] = 1) ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows updated in UDO_operators for Ariba.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'UPDATE [UDO_operators] SET ' + @lf + SET @batchText = @batchText + ' [operatorKey] = ''A34875A8-A8DB-4231-BD12-1D5F1DC70EBF'' ' + @lf + SET @batchText = @batchText + 'WHERE ' + @lf + SET @batchText = @batchText + ' ([operatorID] = 2) ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows updated in UDO_operators for IBM.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'UPDATE [UDO_operators] SET ' + @lf + SET @batchText = @batchText + ' [operatorKey] = ''C8DE6FD6-4068-4FE2-B1DA-3C7E66EA9568'' ' + @lf + SET @batchText = @batchText + 'WHERE ' + @lf + SET @batchText = @batchText + ' ([operatorID] = 3) ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows updated in UDO_operators for Microsoft.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Fix up UDO_operators: ' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_tModels to UDC_tModels + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_tModels] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_tModels].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_tModels] ON ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_tModels]( ' + @lf + SET @batchText = @batchText + ' [tModelID], [publisherID], [generic], [authorizedName], [tModelKey], [name], [overviewURL], [lastChange], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [tModelID], [publisherID], [generic], [authorizedName], [tModelKey], [name], [overviewURL], 0, [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_tModels] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [tModelID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_tModels.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_tModels] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_tModels] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_tModels.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_tModels to UDC_tModels' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_tModelDesc to UDC_tModelDesc + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_tModelDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_tModelDesc].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_tModelDesc] ON ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_tModelDesc]( ' + @lf + SET @batchText = @batchText + ' [tModelID], [seqNo], [elementID], [isoLangCode], [description], [flag])' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [tModelID], [seqNo], [elementID] - 1, [isoLangCode], [description], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_tModelDesc] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [tModelID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_tModelDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_tModelDesc] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_tModelDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_tModelDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_tModelDesc to UDC_tModelDesc' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_identifierBag_TM to UDC_identifierBag_TM + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_identifierBag_TM] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_identifierBag_TM].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_identifierBag_TM]( ' + @lf + SET @batchText = @batchText + ' [tModelID], [keyName], [keyValue], [tModelKey], [flag])' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [tModelID], [keyName], [keyValue], [tModelKey], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_identifierBag_TM] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_identifierBag_TM.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_identifierBag_TM] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_identifierBag_TM.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_identifierBag_TM to UDC_identifierBag_TM' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_categoryBag_TM TO UDC_categoryBag_TM + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_categoryBag_TM] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' tModel rows in [' + @sourceDb + ']..[UDC_categoryBag_TM].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_categoryBag_TM]( ' + @lf + SET @batchText = @batchText + ' [tModelID], [keyName], [keyValue], [tModelKey], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [tModelID], [keyName], [keyValue], [tModelKey], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_categoryBag_TM] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_categoryBag_TM.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_categoryBag_TM] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_categoryBag_TM.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_categoryBag_TM TO UDC_categoryBag_TM' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_businessEntities to UDC_businessEntities + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_businessEntities] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_businessEntities].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_businessEntities] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_businessEntities]( ' + @lf + SET @batchText = @batchText + ' [businessID], [publisherID], [generic], [authorizedName], [businessKey], [lastChange], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [businessID], [publisherID], [generic], [authorizedName], [businessKey], 0, [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_businessEntities] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [businessID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_businessEntities.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_businessEntities] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_businessEntities] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_businessEntities.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_businessEntities to UDC_businessEntities' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_businessEntities to UDC_names_BE + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_businessEntities] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_businessEntities].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_names_BE]( ' + @lf + SET @batchText = @batchText + ' [businessID], [isoLangCode], [name]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' BE.[businessID], PU.[isoLangCode], BE.[name] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_businessEntities] BE ' + @lf + SET @batchText = @batchText + ' JOIN [' + @sourceDb + ']..[UDO_publishers] PU ON BE.[publisherID] = PU.[publisherID] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' BE.[businessID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_names_BE.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_names_BE] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_names_BE.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_businessEntities to UDC_names_BE' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_businessDesc to UDC_businessDesc + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_businessDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_businessDesc].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_businessDesc] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_businessDesc]( ' + @lf + SET @batchText = @batchText + ' [businessID], [seqNo], [isoLangCode], [description], [flag])' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [businessID], [seqNo], [isoLangCode], [description], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_businessDesc] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [businessID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_businessDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_businessDesc] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_businessDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_businessDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_businessDesc to UDC_businessDesc' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_discoveryURLs to UDC_discoveryURLs + -- + + SET @batchText = '' + SET @batchText = @batchText + '' + @lf + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_discoveryURLs] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_discoveryURLs].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_discoveryURLs] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_discoveryURLs]( ' + @lf + SET @batchText = @batchText + ' [businessID], [seqNo], [useType], [discoveryURL], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [businessID], [seqNo], [useType], [discoveryURL], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_discoveryURLs] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [businessID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_discoveryURLs.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_discoveryURLs] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_discoveryURLs] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_discoveryURLs.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_discoveryURLs to UDC_discoveryURLs' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_identifierBag_BE to UDC_identifierBag_BE + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_identifierBag_BE] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' businessEntity rows in [' + @sourceDb + ']..[UDC_identifierBag_BE].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_identifierBag_BE]( ' + @lf + SET @batchText = @batchText + ' [businessID], [keyName], [keyValue], [tModelKey], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [businessID], [keyName], [keyValue], [tModelKey], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_identifierBag_BE] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_identifierBag_BE.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_identifierBag_BE] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_identifierBag_BE.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_identifierBag_BE to UDC_identifierBag_BE' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_categoryBag_BE TO UDC_categoryBag_BE + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_categoryBag_BE] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' businessEntity rows in [' + @sourceDb + ']..[UDC_categoryBag_BE].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_categoryBag_BE]( ' + @lf + SET @batchText = @batchText + ' [businessID], [keyName], [keyValue], [tModelKey], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [businessID], [keyName], [keyValue], [tModelKey], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_categoryBag_BE] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_categoryBag_BE.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_categoryBag_BE] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_categoryBag_BE.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_categoryBag_BE TO UDC_categoryBag_BE' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_contacts to UDC_contacts + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_contacts] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_contacts].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_contacts] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_contacts]( ' + @lf + SET @batchText = @batchText + ' [contactID], [businessID], [useType], [personName], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [contactID], [businessID], [useType], [personName], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_contacts] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [contactID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_contacts.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_contacts] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_contacts] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_contacts.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_contacts to UDC_contacts' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_contactDesc to UDC_contactDesc + -- + + SET @batchText = '' + SET @batchText = @batchText + '' + @lf + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_contactDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_contactDesc].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_contactDesc] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_contactDesc]( ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo], [isoLangCode], [description], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo], [isoLangCode], [description], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_contactDesc] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_contactDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_contactDesc] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_contactDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_contactDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_contactDesc to UDC_contactDesc' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_emails to UDC_emails + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_emails] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_emails].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_emails] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_emails]( ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo], [useType], [email], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo], [useType], [email], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_emails] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_emails.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_emails] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_emails] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_emails.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_emails to UDC_emails' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_phones to UDC_phones + -- + + SET @batchText = '' + SET @batchText = @batchText + '' + @lf + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_phones] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_phones].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_phones] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_phones]( ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo], [useType], [phone], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo], [useType], [phone], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_phones] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [contactID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_phones.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_phones] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_phones] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_phones.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_phones to UDC_phones' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_addresses to UDC_addresses + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_addresses] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_addresses].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_addresses] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_addresses]( ' + @lf + SET @batchText = @batchText + ' [addressID], [contactID], [sortCode], [useType], [tModelKey], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [addressID], [contactID], [sortCode], [useType], NULL, [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_addresses] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [addressID], [contactID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_addresses.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_addresses] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_addresses] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_addresses.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_addresses' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_addressLines to UDC_addressLines + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_addressLines] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_addressLines].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_addressLines] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_addressLines]( ' + @lf + SET @batchText = @batchText + ' [addressID], [seqNo], [addressLine], [keyName], [keyValue], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [addressID], [seqNo], [addressLine], NULL, NULL, [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_addressLines] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [addressID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_addressLines.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_addressLines] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_addressLines] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_addressLines.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_addressLines to UDC_addressLines' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_businessServices to UDC_businessServices + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_businessServices] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_businessServices].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_businessServices] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_businessServices]( ' + @lf + SET @batchText = @batchText + ' [serviceID], [businessID], [generic], [serviceKey], [lastChange], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [serviceID], [businessID], [generic], [serviceKey], 0, [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_businessServices] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [serviceID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_businessServices.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_businessServices] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_businessServices] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_businessServices''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_businessServices to UDC_businessServices' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_businessServices to UDC_names_BS + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_businessServices] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_businessServices].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_names_BS]( ' + @lf + SET @batchText = @batchText + ' [serviceID], [isoLangCode], [name]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' BS.[serviceID], PU.[isoLangCode], BS.[name] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_businessServices] BS ' + @lf + SET @batchText = @batchText + ' JOIN [' + @sourceDb + ']..[UDC_businessEntities] BE ON BS.[businessID] = BE.[businessID] ' + @lf + SET @batchText = @batchText + ' JOIN [' + @sourceDb + ']..[UDO_publishers] PU ON BE.[publisherID] = PU.[publisherID] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' BS.[serviceID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_names_BS.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_names_BS] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_names_BS.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_businessServices to UDC_names_BE' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_serviceDesc to UDC_serviceDesc + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_serviceDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_serviceDesc].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_serviceDesc] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_serviceDesc]( ' + @lf + SET @batchText = @batchText + ' [serviceID], [seqNo], [isoLangCode], [description], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [serviceID], [seqNo], [isoLangCode], [description], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_serviceDesc] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [serviceID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_serviceDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_serviceDesc] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_serviceDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_serviceDesc''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Migrate UDC_serviceDesc to UDC_serviceDesc' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_categoryBag_BS TO UDC_categoryBag_BS + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_categoryBag_BS] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' businessService rows in [' + @sourceDb + ']..[UDC_categoryBag_BS].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_categoryBag_BS]( ' + @lf + SET @batchText = @batchText + ' [serviceID], [keyName], [keyValue], [tModelKey], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [serviceID], [keyName], [keyValue], [tModelKey], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_categoryBag_BS] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_categoryBag_BS.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_categoryBag_BS] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_categoryBag_BS.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_categoryBag TO UDC_categoryBag_BS' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_bindingTemplates to UDC_bindingTemplates + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_bindingTemplates] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_bindingTemplates].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_bindingTemplates] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_bindingTemplates]( ' + @lf + SET @batchText = @batchText + ' [bindingID], [serviceID], [generic], [bindingKey], [URLTypeID], [accessPoint], [hostingRedirector], [lastChange], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [bindingID], [serviceID], [generic], [bindingKey], [URLTypeID] - 1, [accessPoint], [hostingRedirector], 0, [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_bindingTemplates] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [bindingID], [serviceID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_bindingTemplates.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_bindingTemplates] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_bindingTemplates] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_bindingTemplates''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_bindingTemplates to UDC_bindingTemplates' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_bindingDesc to UDC_bindingDesc + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_bindingDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_bindingDesc].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_bindingDesc] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_bindingDesc]( ' + @lf + SET @batchText = @batchText + ' [bindingID], [seqNo], [isoLangCode], [description], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [bindingID], [seqNo], [isoLangCode], [description], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_bindingDesc] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [bindingID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_bindingDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_bindingDesc] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_bindingDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_bindingDesc''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_bindingDesc to UDC_bindingDesc' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_tModelInstances to UDC_tModelInstances + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_tModelInstances] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_tModelInstances].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_tModelInstances] ON ' + @lf + SET @batchText = @batchText + 'INSERT INTO [UDC_tModelInstances]( ' + @lf + SET @batchText = @batchText + ' [instanceID], [bindingID], [tModelKey], [overviewURL], [instanceParms], [flag]) ' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [instanceID], [bindingID], [tModelKey], [overviewURL], [instanceParms], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_tModelInstances] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [instanceID], [bindingID] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_tModelInstances.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_tModelInstances] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_tModelInstances] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_tModelInstances''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_tModelInstances to UDC_tModelInstances' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Migrate UDC_instanceDesc to UDC_instanceDesc + -- + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_instanceDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_instanceDesc].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_instanceDesc] ON ' + @lf + SET @batchText = @batchText + 'INSERT [UDC_instanceDesc]( ' + @lf + SET @batchText = @batchText + ' [instanceID], [seqNo], [elementID], [isoLangCode], [description], [flag])' + @lf + SET @batchText = @batchText + 'SELECT ' + @lf + SET @batchText = @batchText + ' [instanceID], [seqNo], [elementID] - 1, [isoLangCode], [description], [flag] ' + @lf + SET @batchText = @batchText + 'FROM ' + @lf + SET @batchText = @batchText + ' [' + @sourceDb + ']..[UDC_instanceDesc] ' + @lf + SET @batchText = @batchText + 'ORDER BY ' + @lf + SET @batchText = @batchText + ' [instanceID], [seqNo] ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows migrated to UDC_instanceDesc.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SET IDENTITY_INSERT [UDC_instanceDesc] OFF ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_instanceDesc] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_instanceDesc''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'UDC_instanceDesc to UDC_instanceDesc' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + -- + -- Perform test mode database cleanup operations + -- + + IF @mode = '/t' + BEGIN + SET @message=REPLICATE('=',80) + PRINT @message + + PRINT 'Deleting all MS businesses with dependencies on IBM bindings and tModels that are not in bootstrap files' + + SET @message=REPLICATE('-',80) + PRINT @message + + DECLARE @tempKeys TABLE( + [businessKey] uniqueidentifier, + [description] varchar(20)) + + INSERT @tempKeys( + [businessKey], + [description]) + SELECT DISTINCT + BE.[businessKey], + 'hostingRedirector' + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_bindingTemplates] BT2 ON BT.[hostingRedirector] = BT2.[bindingKey] + WHERE + (BE.[publisherID] <> 2) AND + (BT.[hostingRedirector] IS NOT NULL) AND + (dbo.getBindingPublisherID(BT2.[bindingKey]) = 2) + + INSERT @tempKeys( + [businessKey], + [description]) + SELECT DISTINCT + BE.[businessKey], + 'tModelInstance' + FROM + [UDC_businessEntities] BE + JOIN [UDC_businessServices] BS ON BE.[businessID] = BS.[businessID] + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TI ON BT.[bindingID] = TI.[bindingID] + JOIN [UDC_tModels] TM ON TI.[tModelKey] = TM.[tModelKey] + WHERE + (BE.[publisherID] <> 2) AND + (TM.[publisherID] = 2) AND + (TM.[tModelKey] NOT IN ( + 'C1ACF26D-9672-4404-9D70-39B756E62AB4', + '4CD7E4BC-648B-426D-9936-443EAAC8AE23', + '64C756D1-3374-4E00-AE83-EE12E38FAE63', + '3FB66FB7-5FC3-462F-A351-C140D9BD8304', + 'AC104DCC-D623-452F-88A7-F8ACD94D9B2B', + 'A2F36B65-2D66-4088-ABC7-914D0E05EB9E', + '1E3E9CBC-F8CE-41AB-8F99-88326BAD324A', + 'A035A07C-F362-44dd-8F95-E2B134BF43B4', + '4064C064-6D14-4F35-8953-9652106476A9', + '807A2C6A-EE22-470D-ADC7-E0424A337C03', + '327A56F0-3299-4461-BC23-5CD513E95C55', + '93335D49-3EFB-48A0-ACEA-EA102B60DDC6', + '1A2B00BE-6E2C-42F5-875B-56F32686E0E7', + '5FCF5CD0-629A-4C50-8B16-F94E9CF2A674', + '38E12427-5536-4260-A6F9-B5B530E63A07', + '68DE9E80-AD09-469D-8A37-088422BFBC36', + '4CEC1CEF-1F68-4B23-8CB7-8BAA763AEB89', + 'DB77450D-9FA8-45D4-A7BC-04411D14E384', + 'CD153257-086A-4237-B336-6BDCBDCC6634', + '4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88', + '8609C81E-EE1F-4D5A-B202-3EB13AD01823', + 'B1B1BAF5-2329-43E6-AE13-BA8E97195039', + 'C0B9FE13-179F-413D-8A5B-5004DB8E5BB2')) + + SELECT * FROM @tempKeys + + DELETE + [UDC_businessEntities] + WHERE + ([businessKey] IN (SELECT DISTINCT [businessKey] FROM @tempKeys)) + + SET @rows=@@ROWCOUNT + SET @message=CAST(@rows AS varchar(8000)) + ' businessEntities deleted.' + PRINT @message + + SET @message=REPLICATE('=',80) + PRINT @message + END + + -- + -- Perform heartland tModel cleanup + -- + IF @mode = '/h' + BEGIN + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDC_tModels] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_tModels].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'DELETE ' + @lf + SET @batchText = @batchText + ' [UDC_tModels] ' + @lf + SET @batchText = @batchText + 'WHERE ' + @lf + SET @batchText = @batchText + ' ([tModelKey] IN (''C1ACF26D-9672-4404-9D70-39B756E62AB4'',''4CD7E4BC-648B-426D-9936-443EAAC8AE23'',''64C756D1-3374-4E00-AE83-EE12E38FAE63'',''3FB66FB7-5FC3-462F-A351-C140D9BD8304'',''AC104DCC-D623-452F-88A7-F8ACD94D9B2B'',''A2F36B65-2D66-4088-ABC7-914D0E05EB9E'',''1E3E9CBC-F8CE-41AB-8F99-88326BAD324A'',''A035A07C-F362-44dd-8F95-E2B134BF43B4'',''e4a56494-4946-4805-aca5-546b8d08eefd'',''f358808c-e939-4813-a407-8873bfdc3d57'',''0c61e2c3-73c5-4743-8163-6647af5b4b9e'',''ce653789-f6d4-41b7-b7f4-31501831897d'',''b3c0835e-7206-41e0-9311-c8ad8fb19f73'',''BE37F93E-87B4-4982-BF6D-992A8E44EDAB'',''4064C064-6D14-4F35-8953-9652106476A9'',''807A2C6A-EE22-470D-ADC7-E0424A337C03'',''327A56F0-3299-4461-BC23-5CD513E95C55'',''93335D49-3EFB-48A0-ACEA-EA102B60DDC6'',''1A2B00BE-6E2C-42F5-875B-56F32686E0E7'',''5FCF5CD0-629A-4C50-8B16-F94E9CF2A674'',''38E12427-5536-4260-A6F9-B5B530E63A07'',''68DE9E80-AD09-469D-8A37-088422BFBC36'',''4CEC1CEF-1F68-4B23-8CB7-8BAA763AEB89'',''4c1f2e1f-4b7c-44eb-9b87-6e7d80f82b3e'')) ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows deleted from UDC_tModels.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDC_tModels] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDC_tModels''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Deleting heartland tModels that are to be boostrapped' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + + SET @batchText = '' + SET @batchText = @batchText + 'DECLARE @rows int, @message varchar(8000) ' + @lf + SET @batchText = @batchText + 'SELECT @rows=COUNT(*) FROM [' + @sourceDb + ']..[UDO_publishers] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in [' + @sourceDb + ']..[UDC_tModels].''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'UPDATE ' + @lf + SET @batchText = @batchText + ' [UDO_publishers] ' + @lf + SET @batchText = @batchText + 'SET ' + @lf + SET @batchText = @batchText + ' [PUID] = ''System'' ' + @lf + SET @batchText = @batchText + 'WHERE ' + @lf + SET @batchText = @batchText + ' ([publisherID] = 4) ' + @lf + SET @batchText = @batchText + 'SET @rows = @@ROWCOUNT ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows updated in UDO_publishers.''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + SET @batchText = @batchText + 'SELECT @rows = COUNT(*) FROM [UDO_publishers] ' + @lf + SET @batchText = @batchText + 'SET @message = CAST(@rows AS varchar(8000)) + '' rows in UDO_publishers''' + @lf + SET @batchText = @batchText + 'PRINT @message ' + @lf + + SET @message=REPLICATE('=',80) + PRINT @message + PRINT 'Fixing PUID for Heartland System publisher.' + SET @message=REPLICATE('-',80) + PRINT @message + PRINT @batchText + SET @message=REPLICATE('-',80) + PRINT @message + PRINT 'Results: ' + SET @message=REPLICATE('-',80) + PRINT @message + EXEC (@batchText) + SET @message=REPLICATE('=',80) + PRINT @message + END + + -- + -- Execute batch + -- + + SET @stop = getdate() + SET @duration = @stop - @start + SET @message = 'Total Script Duration: ' + CONVERT(varchar(8000),@duration, 8) + PRINT @message + + RETURN 0 +END +GO diff --git a/inetsrv/uddi/source/tools/migrate/migrate.uddi.cmd b/inetsrv/uddi/source/tools/migrate/migrate.uddi.cmd new file mode 100644 index 0000000..f96c490 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/migrate.uddi.cmd @@ -0,0 +1,157 @@ +@ECHO OFF + +ECHO Microsoft (R) UDDI Services migrate.uddi.cmd Batch Utility +ECHO Copyright (c) Microsoft Corp. 2002. All rights reserved. + +IF '%1%' == '/?' GOTO USAGE + +SET BOOTPATH=%~f1 +SET DATAPATH=%~f2 +SET SQLINSTANCE=%3 + +:CHECKDIRS +IF NOT EXIST migrate.exe GOTO ERROR +IF NOT EXIST %BOOTPATH% GOTO ERROR +IF NOT EXIST %DATAPATH% GOTO ERROR +IF NOT EXIST %DATAPATH%\uddi.database.bak GOTO ERROR + +:STARTRUN +SET READERDB=uddi_reader +SET READER="Data Source=%SQLINSTANCE%;Initial Catalog=%READERDB%;Integrated Security=SSPI" +SET WRITERDB=uddi +SET EXCEPTIONPATH=exceptions +SET EXCEPTIONFILE=migrate.exceptions.txt + +:START +ECHO ---------------------------------------------------------- +ECHO BOOTPATH=%BOOTPATH% +ECHO DATAPATH=%DATAPATH% +ECHO SQLINSTANCE=%SQLINSTANCE% + +IF EXIST %EXCEPTIONPATH% DEL /Q %EXCEPTIONPATH%\*.* +IF EXIST %EXCPTIONFILE% DEL %EXCEPTIONFILE% + +:sETREADERCONNECTION +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage SetReaderconnection... +PAUSE +migrate -s SetReaderConnection -c %READER% -i +IF ERRORLEVEL 1 GOTO ERROR + +:PREPAREDATABASES +ECHO ---------------------------------------------------------- +ECHO Dropping %READERDB% +PAUSE +OSQL -b -E -d master -S %SQLINSTANCE% -e -Q "IF EXISTS(SELECT * FROM [sysdatabases] WHERE [name] = '%READERDB%') DROP DATABASE %READERDB%" +IF ERRORLEVEL 1 GOTO ERROR + +ECHO Restoring %READERDB% +PAUSE +OSQL -b -E -d master -S %SQLINSTANCE% -e -Q "RESTORE DATABASE %READERDB% FROM DISK='%DATAPATH%\uddi.database.bak' WITH MOVE 'UDDI_SYS' TO '%DATAPATH%\UDDI_SYS_READER.MDF', MOVE 'UDDI_CORE_1' TO '%DATAPATH%\UDDI_CORE_1_READER.NDF', MOVE 'UDDI_CORE_2' TO '%DATAPATH%\UDDI_CORE_2_READER.NDF', MOVE 'UDDI_JOURNAL_1' TO '%DATAPATH%\UDDI_JOURNAL_1_READER.NDF', MOVE 'UDDI_STAGING_1' TO '%DATAPATH%\UDDI_STAGING_1_READER.NDF', MOVE 'UDDI_LOG' TO '%DATAPATH%\UDDI_LOG_READER.LDF'" +IF ERRORLEVEL 1 GOTO ERROR + +:RESETWRITER +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage ResetWriter +PAUSE +migrate -s ResetWriter +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEPUBLISHERS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigratePublishers +PAUSE +migrate -s MigratePublishers +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEBARETMODELS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateBareTModels +PAUSE +migrate -s MigrateBareTModels +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEBAREBUSINESSENTITIES +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateBareBusinessEntities +PAUSE +migrate -s MigrateBareBusinessEntities +IF ERRORLEVEL 1 GOTO ERROR + +:BOOTSTRAPRESOURCES +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage BootstrapResources +PAUSE + +migrate -s BootstrapResources +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATECATEGORIZATIONSCHEMES +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateCategorizatonSchemes +PAUSE + +migrate -s MigrateCategorizationSchemes +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEFULLTMODELS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateFullTModels +PAUSE +migrate -s MigrateFullTModels +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEHIDDENTMODELS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateHiddenTModels +PAUSE +migrate -s MigrateHiddenTModels +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEBUSINESSENTITIES +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateBusinessEntities +PAUSE +migrate -s MigrateBusinessEntities +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEPUBLISHERASSERTIONS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigratePublisherAssertions +PAUSE +migrate -s MigratePublisherAssertions +IF ERRORLEVEL 1 GOTO ERROR + +:RESTOREREADERCONNECTION +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage RestoreReaderConnection +PAUSE +migrate -s RestoreReaderConnection +GOTO END + +:ERROR +ECHO ---------------------------------------------------------- +ECHO migrate.uddi.cmd terminating with an error +ECHO see migrate.log.txt for details +migrate -s RestoreReaderConnection +GOTO END + +:USAGE +ECHO runmigrate [bootpath] [datapath] [sqlinstance] +ECHO [bootpath]: path to bootstrap files, e.g. ..\bootstrap +ECHO [datapath]: path to data directory, e.g. ..\data +ECHO [sqlinstance]: instance name of sql server, e.g. (local) +GOTO END + +:END +SET BOOTPATH= +SET DATAPATH= +SET SQLINSTANCE= +SET READERDB= +SET READER= +SET WRITERDB= +SET EXCEPTIONPATH= +SET EXCEPTIONFILE= + +ECHO ---------------------------------------------------------- +ECHO migrate.uddi.cmd ending diff --git a/inetsrv/uddi/source/tools/migrate/obj/_objects.mac b/inetsrv/uddi/source/tools/migrate/obj/_objects.mac new file mode 100644 index 0000000..eba6cc0 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/obj/_objects.mac @@ -0,0 +1,24 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\migrate.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\migrate.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\migrate.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\migrate.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/migrate/obj/i386/migrate.exe b/inetsrv/uddi/source/tools/migrate/obj/i386/migrate.exe new file mode 100644 index 0000000..54bebb5 Binary files /dev/null and b/inetsrv/uddi/source/tools/migrate/obj/i386/migrate.exe differ diff --git a/inetsrv/uddi/source/tools/migrate/obj/i386/migrate.pdb b/inetsrv/uddi/source/tools/migrate/obj/i386/migrate.pdb new file mode 100644 index 0000000..baa9d0f Binary files /dev/null and b/inetsrv/uddi/source/tools/migrate/obj/i386/migrate.pdb differ diff --git a/inetsrv/uddi/source/tools/migrate/placefil.txt b/inetsrv/uddi/source/tools/migrate/placefil.txt new file mode 100644 index 0000000..859009d --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/placefil.txt @@ -0,0 +1 @@ +migrate.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/migrate/runmigrate.cmd b/inetsrv/uddi/source/tools/migrate/runmigrate.cmd new file mode 100644 index 0000000..5978e0f --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/runmigrate.cmd @@ -0,0 +1,306 @@ +@ECHO OFF + +IF '%1%' == '/?' GOTO USAGE + +SET BOOTPATH=%~f1 +SET DATAPATH=%~f2 +SET MODE=%3 + +IF '%MODE%' == '' SET MODE=/t + +:CHECKDIRS +IF NOT EXIST migrate.exe GOTO ERROR +IF NOT EXIST migrate.sql GOTO ERROR +IF NOT EXIST %BOOTPATH% GOTO ERROR +IF NOT EXIST %DATAPATH% GOTO ERROR + +:CHECKMODE +IF '%MODE%' == '' SET MODE=/t +IF /i '%MODE%' == '/h' GOTO STARTRUN +IF /i '%MODE%' == '/t' GOTO STARTRUN +IF /i '%MODE%' == '/p' GOTO STARTRUN ELSE GOTO ERROR + +:STARTRUN +SET V15DB=uddi_v15 +SET READERDB=uddi_reader +SET READER="Data Source=%COMPUTERNAME%\;Initial Catalog=%READERDB%;Integrated Security=SSPI" +SET WRITERDB=uddi +SET SYSPUID=System +SET IBMOPERATORKEY=C8DBBBED-EEFB-45F9-BB23-DD3CBCF1DB9E +SET EXCEPTIONPATH=exceptions +SET EXCEPTIONFILE=migrate.exceptions.txt +SET IBMPUBINSERT=EXEC UI_savePublisher @PUID='%IBMOPERATORKEY%', @isoLangCode='en', @name='IBM', @email='', @phone='', @tier=2 +SET IBMOPINSERT=EXEC net_operator_save @operatorKey='%IBMOPERATORKEY%', @PUID='%IBMOPERATORKEY%', @operatorStatusID=1, @name='IBM', @soapReplicationURL='', @certSerialNo='2D2D03BC-4782-4D97-B1CC-993D4352F09E', @certIssuer='', @certSubject='', @certificate=NULL +SET DELPUBINSERT=EXEC UI_savePublisher @PUID='%USERDOMAIN%\%USERNAME%', @isoLangCode='en', @name='Delegate', @email='', @phone='', @tier=2 + +:START +ECHO ---------------------------------------------------------- +ECHO runmigrate.cmd starting in %MODE% mode. +ECHO BOOTPATH=%BOOTPATH% +ECHO DATAPATH=%DATAPATH% + +IF EXIST %EXCEPTIONPATH% DEL /Q %EXCEPTIONPATH%\*.* +IF EXIST %EXCPTIONFILE% DEL %EXCEPTIONFILE% + +:sETREADERCONNECTION +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage SetReaderconnection... +PAUSE +migrate -s SetReaderConnection -c %READER% -i +IF ERRORLEVEL 1 GOTO ERROR + +:PREPAREDATABASES +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage PrepareDatabases... +PAUSE + +ECHO Restore a backup of the UDDI V1.5 Production Database +PAUSE + +ECHO Backing up %WRITERDB% +PAUSE +OSQL -b -E -d master -e -Q "BACKUP DATABASE %WRITERDB% TO DISK='%DATAPATH%\uddi_migrate.bak' WITH INIT" +IF ERRORLEVEL 1 GOTO ERROR + +ECHO Dropping %READERDB% +PAUSE +OSQL -b -E -d master -e -Q "IF EXISTS(SELECT * FROM [sysdatabases] WHERE [name] = '%READERDB%') DROP DATABASE %READERDB%" +IF ERRORLEVEL 1 GOTO ERROR + +ECHO Restoring %READERDB% +PAUSE +OSQL -b -E -d master -e -Q "RESTORE DATABASE %READERDB% FROM DISK='%DATAPATH%\uddi_migrate.bak' WITH MOVE 'UDDI_SYS' TO '%DATAPATH%\UDDI_SYS_READER.MDF', MOVE 'UDDI_CORE_1' TO '%DATAPATH%\UDDI_CORE_1_READER.NDF', MOVE 'UDDI_CORE_2' TO '%DATAPATH%\UDDI_CORE_2_READER.NDF', MOVE 'UDDI_JOURNAL_1' TO '%DATAPATH%\UDDI_JOURNAL_1_READER.NDF', MOVE 'UDDI_STAGING_1' TO '%DATAPATH%\UDDI_STAGING_1_READER.NDF', MOVE 'UDDI_LOG' TO '%DATAPATH%\UDDI_LOG_READER.LDF'" +IF ERRORLEVEL 1 GOTO ERROR + +ECHO Create ADM_migrate SP in %READERDB% +PAUSE +OSQL -b -E -d %READERDB% -i migrate.sql +IF ERRORLEVEL 1 GOTO ERROR + +ECHO - +ECHO Execute ADM_migrate SP +PAUSE +OSQL -b -E -d %READERDB% -e -Q "EXEC ADM_migrate @sourceDb='%V15DB%', @destDb='%READERDB%', @mode='%MODE%'" >> migrate.log.txt +IF ERRORLEVEL 1 GOTO ERROR + +:RESETWRITER +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage ResetWriter +PAUSE +migrate -s ResetWriter +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEPUBLISHERS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigratePublishers +PAUSE +migrate -s MigratePublishers +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEBARETMODELS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateBareTModels +PAUSE +migrate -s MigrateBareTModels +IF ERRORLEVEL 1 GOTO ERROR + +:REPLICATE1 +ECHO ---------------------------------------------------------- +IF '%MODE%' == '/t' GOTO REPLICATE1TEST +IF '%MODE%' == '/h' GOTO REPLICATE1HEARTLAND +ECHO Prapring to execute interim replication phase 1 in %MODE% mode. +PAUSE + +ECHO Install IBM operator / publisher now using rcf.exe +PAUSE +ECHO Retrieve from IBM +PAUSE +ECHO Ask IBM to retrieve from Microsoft +PAUSE +ECHO Preparing to bootstrap checked taxonomies... +PAUSE +bootstrap -f %BOOTPATH%\PRODUCTION\01.uddi-org-types.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\06.uddi-org-relationships.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\09.ntis-gov-sic-1987.microsoft.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\10.unspsc-org-unspsc-3-1.ibm.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\11.unspsc-org-unspsc-7-3.ibm.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\12.uddi-org-iso-ch-3166-1999.ibm.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\15.microsoft-com-geoweb-2000.microsoft.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\16.ntis-gov-naics-1997.ibm.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\PRODUCTION\17.ms-com-vstudio.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +GOTO MIGRATEFULLTMODELS + +:REPLICATE1TEST +ECHO Inserting a test IBM publisher. +PAUSE +OSQL -b -E -d %WRITERDB% -e -Q "%IBMPUBINSERT%" +PAUSE + +ECHO Inserting a test IBM operator +PAUSE +OSQL -b -E -d %WRITERDB% -e -Q "%IBMOPINSERT%" + +ECHO Inserting a delegate publisher +PAUSE +OSQL -b -E -d %WRITERDB% -e -Q "%DELPUBINSERT%" + +ECHO Bootstrapping test tmodels and checked taxonomies under IBM account +bootstrap -f %BOOTPATH%\TEST\01.uddi-org-types.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\02.v1-canonical.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\03.v2-canonical.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\04.uddi-org-general_keywords.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\05.uddi-org-owningBusiness.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\06.uddi-org-relationships.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\07.uddi-org-operators.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\08.uddi-core-other.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\09.ntis-gov-sic-1987.microsoft.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\10.unspsc-org-unspsc-3-1.ibm.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\11.unspsc-org-unspsc-7-3.ibm.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\12.uddi-org-iso-ch-3166-1999.ibm.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\13.dnb-com-D-U-N-S.ibm.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\14.thomasregister-com-supplierID.ibm.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\15.microsoft-com-geoweb-2000.microsoft.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\16.ntis-gov-naics-1997.ibm.bootstrap.xml -u %IBMOPERATORKEY% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\TEST\17.ms-com-vstudio.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +GOTO MIGRATEFULLTMODELS + +:REPLICATE1HEARTLAND +ECHO Inserting a delegate publisher +PAUSE +OSQL -b -E -d %WRITERDB% -e -Q "%DELPUBINSERT%" + +ECHO Preparing to Bootstrap tmodels and checked taxonomies under System account +PAUSE +bootstrap -f %BOOTPATH%\01.uddi-org-types.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\02.v1-canonical.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\03.v2-canonical.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\04.uddi-org-general_keywords.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\04a.ms-com-authmodels.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\04b.ms-com-extensions.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\04c.ms-com.catbrowse.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\05.uddi-org-owningBusiness.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\06.uddi-org-relationships.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\07.uddi-org-operators.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\08.uddi-core-other.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +bootstrap -f %BOOTPATH%\09.ms-com-vstudio.bootstrap.xml -u %SYSPUID% +IF ERRORLEVEL 1 GOTO ERROR +GOTO MIGRATEFULLTMODELS + +:MIGRATEFULLTMODELS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateFullTModels +PAUSE +migrate -s MigrateFullTModels +IF ERRORLEVEL 1 GOTO ERROR + +:MIGRATEHIDDENTMODELS +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateHiddenTModels +PAUSE +migrate -s MigrateHiddenTModels +IF ERRORLEVEL 1 GOTO ERROR + +:REPLICATE2 +IF '%MODE%' == '/t' GOTO MIGRATEBUSINESSENTITIES +IF '%MODE%' == '/h' GOTO MIGRATEBUSINESSENTITIES +ECHO ---------------------------------------------------------- +ECHO Prepring to execute interim replication phase 2 +ECHO Retrieve from IBM +PAUSE +ECHO Ask IBM to retrieve from Microsoft +PAUSE +PAUSE + +:MIGRATEBUSINESSENTITIES +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage MigrateBusinessEntities +PAUSE +migrate -s MigrateBusinessEntities +IF ERRORLEVEL 1 GOTO ERROR + +:REPLICATE3 +ECHO ---------------------------------------------------------- +ECHO Prepring to execute interim replication phase 3 +ECHO Retrieve from IBM +PAUSE +ECHO Ask IBM to retrieve from Microsoft +PAUSE + +:RESTOREREADERCONNECTION +ECHO ---------------------------------------------------------- +ECHO Preparing to execute stage RestoreReaderConnection +PAUSE +migrate -s RestoreReaderConnection +GOTO END + +:ERROR +ECHO ---------------------------------------------------------- +ECHO runmigrate.cmd terminating with an error +ECHO see migrate.log.txt for details +migrate -s RestoreReaderConnection +GOTO END + +:USAGE +ECHO runmigrate [bootpath] [datapath] [/t or /p] +ECHO [bootpath]: path to bootstrap files, e.g. ..\bootstrap +ECHO [datapath]: path to data directory, e.g. ..\data +ECHO [/t]: test mode (default) +ECHO [/h]: heartland mode +ECHO [/p]: production mode +GOTO END + +:END +SET MODE= +SET READER= +SET BINPATH= +SET BOOTPATH= +SET V15DB= +SET READERDB= +SET WRITERDB= +SET SYSPUID= +SET IBMOPERATORKEY= +SET EXCEPTIONPATH= +SET EXCEPTIONFILE= +SET IBMPUBINSERT= +SET DELPUBINSERT= +SET IBMOPINSERT= + +ECHO ---------------------------------------------------------- +ECHO runmigrate.cmd ending diff --git a/inetsrv/uddi/source/tools/migrate/sources b/inetsrv/uddi/source/tools/migrate/sources new file mode 100644 index 0000000..6cfe513 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/sources @@ -0,0 +1,37 @@ +# +# Sources for bootstrap.exe +# +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=migrate +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console + +SYNCHRONIZE_PASS2_BLOCK=1 + + +NTTARGETFILE1=foo.cs + + +# +# this get passed to the csc.exe command line, so specify the resources +# and a response file here +# +USER_CS_FLAGS= /RES:uddi.v2.update_rc0_to_rc1.sql \ + /RES:uddi.v2.update_rc1_to_rc2.sql + + +# +# add all the other assembly references here +# +REFERENCES= ..\..\core\obj\*\uddi.core.dll, ..\..\api\obj\*\uddi.api.dll + +# +# csharp source code +# +SOURCES= migrate.cs \ + assemblyinfo.cs \ + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/migrate/uddi.v2.update_rc0_to_rc1.sql b/inetsrv/uddi/source/tools/migrate/uddi.v2.update_rc0_to_rc1.sql new file mode 100644 index 0000000..f0f9521 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/uddi.v2.update_rc0_to_rc1.sql @@ -0,0 +1,11 @@ +-- Script: uddi.v2.update_rc0_to_rc1.sql +-- Author: LRDohert@Microsoft.com +-- Description: Updates a UDDI Services RC1 database to RC2 +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Update Version(s) +-- ============================================= + +EXEC net_config_save 'Site.Version', '5.2.3663.0' +GO \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/migrate/uddi.v2.update_rc1_to_rc2.sql b/inetsrv/uddi/source/tools/migrate/uddi.v2.update_rc1_to_rc2.sql new file mode 100644 index 0000000..80cdd61 --- /dev/null +++ b/inetsrv/uddi/source/tools/migrate/uddi.v2.update_rc1_to_rc2.sql @@ -0,0 +1,587 @@ +-- Script: uddi.v2.update_rc1_to_rc2.sql +-- Description: Updates a UDDI Services RC1 database to RC2 +-- Note: This file is best viewed and edited with a tab width of 2. + +-- ============================================= +-- Section: Stored Procedure fixes +-- ============================================= + +-- ============================================= +-- Name: net_serviceProjection_repl_save +-- Fix: uddi bug 2454 +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_serviceProjection_repl_save' and type = 'P') + DROP PROCEDURE net_serviceProjection_repl_save +GO + +CREATE PROCEDURE net_serviceProjection_repl_save + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier, + @businessKey2 uniqueidentifier, + @lastChange bigint +WITH ENCRYPTION +AS +BEGIN + DECLARE + @RC int, + @error int, + @context nvarchar(4000) + + SET @RC = 0 + + -- IMPORTANT: This sproc should only ever be called for replication. As per IN 60, we have to process service projection + -- change records even if they refer to business services that no longer exist. Both businesses referenced + -- by the service projection must exist. + + -- businessKey validation must occur during save since its not always known at validate time + IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey) + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + -- + -- Commenting out the following check to comply with IN60 as per UDDI bug 2454 + -- Which states that service projections that refer to a deleted service must be successfully saved + -- From this we can imply that service projections that refer to a deleted business must also be successfully saved + -- + + --IF NOT EXISTS(SELECT * FROM [UDC_businessEntities] WHERE [businessKey] = @businessKey2) + --BEGIN + --SET @error = 60210 -- E_invalidKey + --SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey2) + --GOTO errorLabel + --END + + -- Add service projection if it doesn't already exist + IF NOT EXISTS(SELECT * FROM [UDC_serviceProjections] WHERE ([businessKey] = @businessKey) AND ([serviceKey] = @serviceKey)) + BEGIN + INSERT [UDC_serviceProjections]( + [businessKey], + [serviceKey], + [businessKey2], + [lastChange]) + VALUES( + @businessKey, + @serviceKey, + @businessKey2, + @lastChange) + END + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_serviceProjection_repl_save +GO + +-- ============================================= +-- Name: VS_AWR_businesses_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = 'VS_AWR_businesses_get' AND type = 'P') + DROP PROCEDURE VS_AWR_businesses_get +GO + +CREATE PROCEDURE VS_AWR_businesses_get + @businessName nvarchar(450) +WITH ENCRYPTION +AS +BEGIN + DECLARE + @typesTModelKey uniqueidentifier, + @wsdlKeyValue nvarchar(255), + @services cursor, + @serviceID bigint, + @serviceKey uniqueidentifier, + @businessID bigint, + @businessName2 nvarchar(450), + @businessKey uniqueidentifier, + @serviceName nvarchar(450) + + -- + -- Get a list of tModel keys for tModels categorized as a wsdlSpec + -- + + SET @typesTModelKey = 'C1ACF26D-9672-4404-9D70-39B756E62AB4' + SET @wsdlKeyValue = 'wsdlSpec' + + DECLARE @wsdlTModelKeys TABLE ( + [tModelKey] uniqueidentifier) + + INSERT @wsdlTModelKeys + SELECT DISTINCT + TM.[tModelKey] + FROM + [UDC_tModels] TM + JOIN [UDC_categoryBag_TM] CB ON TM.[tModelID] = CB.[tModelID] + WHERE + (CB.[tModelKey] = @typesTModelKey) AND + (CB.[keyValue] = @wsdlKeyValue) + + -- + -- Setup temporary table for staging results + -- + + DECLARE @results TABLE( + [businessName] nvarchar(450), + [businessKey] uniqueidentifier, + [serviceName] nvarchar(450), + [serviceKey] uniqueidentifier) + + -- + -- Cursor through every service that: + -- 1. Has a tModelInstance that references a wsdlTModelKey + -- 2. Is owned by a business that meets the name search criteria + -- Build results from this list of services + -- + + SET @services = CURSOR LOCAL READ_ONLY FORWARD_ONLY FOR + SELECT + BS.[serviceID], + BS.[serviceKey], + BS.[businessID] + FROM + [UDC_businessServices] BS + JOIN [UDC_bindingTemplates] BT ON BS.[serviceID] = BT.[serviceID] + JOIN [UDC_tModelInstances] TMI ON BT.[bindingID] = TMI.[bindingID] + WHERE + (TMI.[tModelKey] IN (SELECT [tModelKey] FROM @wsdlTModelKeys)) AND + (BS.[businessID] IN (SELECT DISTINCT BN.[businessID] FROM [UDC_names_BE] BN WHERE (BN.[name] LIKE @businessName + '%'))) + + OPEN @services + + FETCH NEXT FROM @services INTO + @serviceID, + @serviceKey, + @businessID + + WHILE @@FETCH_STATUS = 0 + BEGIN + -- + -- Retrieve the name of the business that owns the service + -- + + SET @businessName2 = (SELECT TOP 1 BN.[name] FROM [UDC_names_BE] BN WHERE (BN.[businessID] = @businessID)) + + -- + -- Retrieve the key of the business that owns the service + -- + + SET @businessKey = dbo.businessKey(@businessID) + + -- + -- Retrieve the name of the service + -- + + SET @serviceName = (SELECT TOP 1 SN.[name] FROM [UDC_names_BS] SN WHERE (SN.[serviceID] = @serviceID)) + + -- + -- Add results to results table + -- + + INSERT @results VALUES( + @businessName2, + @businessKey, + @serviceName, + @serviceKey) + + FETCH NEXT FROM @services INTO + @serviceID, + @serviceKey, + @businessID + END + + CLOSE @services + + -- + -- Return results + -- + + SELECT * FROM @results + +END +GO + +-- ============================================= +-- Section: New Stored Procedures +-- ============================================= + +-- ============================================= +-- Name: net_taxonomyValues_get +-- ============================================= + +IF EXISTS (SELECT name FROM sysobjects WHERE name = N'net_taxonomyValues_get' AND type = 'P') + DROP PROCEDURE net_taxonomyValues_get +GO + +CREATE PROCEDURE net_taxonomyValues_get + @tModelKey uniqueidentifier +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000), + @taxonomyID bigint + + SET @taxonomyID = dbo.taxonomyID(@tModelKey) + + IF @taxonomyID IS NULL + BEGIN + SET @error = 60210 + SET @context = 'uuid:' + dbo.UUIDSTR(@tModelKey) + GOTO errorLabel + END + + SELECT + [keyValue], + [parentKeyValue], + [keyName], + [valid] + FROM + [UDT_taxonomyValues] + WHERE + ([taxonomyID] = @taxonomyID) + ORDER BY + [parentKeyValue], + [keyValue] + + RETURN 0 +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END +GO + +-- ============================================= +-- Name: net_bindingTemplate_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_get_batch' and type = 'P') + DROP PROCEDURE net_bindingTemplate_get_batch +GO + +CREATE PROCEDURE net_bindingTemplate_get_batch + @bindingKey uniqueidentifier, + @serviceKey uniqueidentifier OUTPUT, + @URLTypeID tinyint OUTPUT, + @accessPoint nvarchar(4000) OUTPUT, + @hostingRedirector uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @serviceKey = dbo.serviceKey([serviceID]), + @URLTypeID = [URLTypeID], + @accessPoint = [accessPoint], + @hostingRedirector = [hostingRedirector] + FROM + [UDC_bindingTemplates] + WHERE + ([bindingID] = dbo.bindingID(@bindingKey)) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'bindingKey = ' + dbo.UUIDSTR(@bindingKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_bindingTemplate_descriptions_get @bindingKey + EXEC net_bindingTemplate_tModelInstanceInfos_get @bindingKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_bindingTemplate_get_batch +GO + +-- ============================================= +-- Name: net_bindingTemplate_tModelInstanceInfo_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_bindingTemplate_tModelInstanceInfo_get_batch' and type = 'P') + DROP PROCEDURE net_bindingTemplate_tModelInstanceInfo_get_batch +GO + +CREATE PROCEDURE net_bindingTemplate_tModelInstanceInfo_get_batch + @instanceID bigint +WITH ENCRYPTION +AS +BEGIN + EXEC net_bindingTemplate_tModelInstanceInfo_descriptions_get @instanceID + EXEC net_bindingTemplate_instanceDetails_descriptions_get @instanceID + EXEC net_bindingTemplate_instanceDetails_overviewDoc_descriptions_get @instanceID + + RETURN 0 +END -- net_bindingTemplate_tModelInstanceInfo_get_batch +GO + +-- ============================================= +-- Name: net_businessEntity_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_get_batch' and type = 'P') + DROP PROCEDURE net_businessEntity_get_batch +GO + +CREATE PROCEDURE net_businessEntity_get_batch + @businessKey uniqueidentifier, + @operatorName nvarchar(450) OUTPUT, + @authorizedName nvarchar(4000) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @operatorName = dbo.publisherOperatorName([publisherID]), + @authorizedName = ISNULL([authorizedName],dbo.publisherName([publisherID])) + FROM + [UDC_businessEntities] + WHERE + [businessKey] = @businessKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 + SET @context = 'businessKey = ' + dbo.UUIDSTR(@businessKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_businessEntity_descriptions_get @businessKey + EXEC net_businessEntity_names_get @businessKey + EXEC net_businessEntity_discoveryURLs_get @businessKey + EXEC net_businessEntity_contacts_get @businessKey + EXEC net_businessEntity_IdentifierBag_get @businessKey + EXEC net_businessEntity_CategoryBag_get @businessKey + EXEC net_businessEntity_BusinessServices_get @businessKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessEntity_get_batch +GO + +-- ============================================= +-- Name: net_businessInfo_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessInfo_get_batch' and type = 'P') + DROP PROCEDURE net_businessInfo_get_batch +GO + +CREATE PROCEDURE net_businessInfo_get_batch + @businessKey uniqueidentifier, + @getServiceInfos bit + +WITH ENCRYPTION +AS +BEGIN + -- Retrieve the contained objects needed for a BusinessInfo + EXEC net_businessEntity_descriptions_get @businessKey + EXEC net_businessEntity_names_get @businessKey + + IF @getServiceInfos = 1 + BEGIN + EXEC net_businessEntity_BusinessServices_get @businessKey + END + + RETURN 0 + +END -- net_businessEntity_get_batch +GO + +-- ============================================= +-- Name: net_businessEntity_contact_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessEntity_contact_get_batch' and type = 'P') + DROP PROCEDURE net_businessEntity_contact_get_batch +GO + +CREATE PROCEDURE net_businessEntity_contact_get_batch + @contactID bigint +WITH ENCRYPTION +AS +BEGIN + -- Get all contained objects in a contact + EXEC net_contact_descriptions_get @contactID + EXEC net_contact_phones_get @contactID + EXEC net_contact_emails_get @contactID + EXEC net_contact_addresses_get @contactID + +END -- net_businessEntity_contact_get_batch +GO + +-- ============================================= +-- Name: net_businessService_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_businessService_get_batch' and type = 'P') + DROP PROCEDURE net_businessService_get_batch +GO + +CREATE PROCEDURE net_businessService_get_batch + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @businessKey = dbo.businessKey([businessID]) + FROM + [UDC_businessServices] + WHERE + [serviceKey] = @serviceKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_businessService_descriptions_get @serviceKey + EXEC net_businessService_names_get @serviceKey + EXEC net_businessService_bindingTemplates_get @serviceKey + EXEC net_businessService_categoryBag_get @serviceKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_get_batch +GO + +-- ============================================= +-- Name: net_serviceInfo_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_serviceInfo_get_batch' and type = 'P') + DROP PROCEDURE net_serviceInfo_get_batch +GO + +CREATE PROCEDURE net_serviceInfo_get_batch + @serviceKey uniqueidentifier, + @businessKey uniqueidentifier OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @businessKey = dbo.businessKey([businessID]) + FROM + [UDC_businessServices] + WHERE + [serviceKey] = @serviceKey + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'serviceKey = ' + dbo.UUIDSTR(@serviceKey) + GOTO errorLabel + END + + -- Retrieve the contained objects + EXEC net_businessService_names_get @serviceKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_businessService_get_batch +GO + +-- ============================================= +-- Name: net_tModel_get_batch +-- ============================================= +IF EXISTS (SELECT * FROM sysobjects WHERE name = 'net_tModel_get_batch' and type = 'P') + DROP PROCEDURE net_tModel_get_batch +GO + +CREATE PROCEDURE net_tModel_get_batch + @tModelKey uniqueidentifier, + @operatorName nvarchar(450) OUTPUT, + @authorizedName nvarchar(4000) OUTPUT, + @name nvarchar(450) OUTPUT, + @overviewURL nvarchar(4000) OUTPUT +WITH ENCRYPTION +AS +BEGIN + DECLARE + @error int, + @context nvarchar(4000) + + SELECT + @operatorName = dbo.publisherOperatorName([publisherID]), + @authorizedName = ISNULL([authorizedName],dbo.publisherName([publisherID])), + @name = [name], + @overviewURL = [overviewURL] + FROM + [UDC_tModels] + WHERE + ([tModelKey] = @tModelKey) + + IF @@ROWCOUNT = 0 + BEGIN + SET @error = 60210 -- E_invalidKey + SET @context = 'tModelKey = ' + dbo.addURN(@tModelKey) + GOTO errorLabel + END + + -- Get contained objects + EXEC net_tModel_descriptions_get @tModelKey + EXEC net_tModel_overviewDoc_descriptions_get @tModelKey + EXEC net_tModel_identifierBag_get @tModelKey + EXEC net_tModel_categoryBag_get @tModelKey + + RETURN 0 + +errorLabel: + RAISERROR (@error, 16, 1, @context) + RETURN 1 +END -- net_tModel_get_batch +GO + +-- ============================================= +-- Section: Security +-- ============================================= + +GRANT EXEC ON net_taxonomyValues_get to UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_bindingTemplate_tModelInstanceInfo_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessInfo_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessEntity_contact_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_businessService_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_serviceInfo_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON net_serviceProjection_repl_save TO UDDIAdmin, UDDIService +GRANT EXEC ON net_tModel_get_batch TO UDDIAdmin, UDDIService +GRANT EXEC ON VS_AWR_businesses_get TO UDDIAdmin, UDDIService +GO + +-- ============================================= +-- Section: Update Version(s) +-- ============================================= + +EXEC net_config_save 'Site.Version', '5.2.3664.0' -- TODO: Update this to proper RC2 site.version +EXEC net_config_save 'Database.Version', '2.0.0001.2' +GO diff --git a/inetsrv/uddi/source/tools/monitor/app.ico b/inetsrv/uddi/source/tools/monitor/app.ico new file mode 100644 index 0000000..3a5525f Binary files /dev/null and b/inetsrv/uddi/source/tools/monitor/app.ico differ diff --git a/inetsrv/uddi/source/tools/monitor/assemblyinfo.cs b/inetsrv/uddi/source/tools/monitor/assemblyinfo.cs new file mode 100644 index 0000000..691c71c --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("monitor.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/monitor/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/monitor/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/monitor/makefile b/inetsrv/uddi/source/tools/monitor/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/monitor/makefile.inc b/inetsrv/uddi/source/tools/monitor/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/monitor/monitor.cs b/inetsrv/uddi/source/tools/monitor/monitor.cs new file mode 100644 index 0000000..f0824dc --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/monitor.cs @@ -0,0 +1,230 @@ +using System; +using System.Collections; +using System.Diagnostics; +using UDDI; +using UDDI.Replication; + +namespace UDDI.Tools +{ + public class Monitor + { + public static int PollInterval = 5000; + public static string Program = null; + + [STAThread] + static void Main( string[] args ) + { + Console.WriteLine( "Microsoft (R) UDDI Monitor Utility" ); + Console.WriteLine( "Copyright (C) Microsoft Corp. 2002. All rights reserved.\r\n" ); + + try + { + ProcessCommandLine( args ); + + ArrayList results = new ArrayList(); + + ConnectionManager.Open( false, false ); + + // + // Get the list of known operatorNodes. + // + OperatorNodeCollection operatorNodes = new OperatorNodeCollection(); + operatorNodes.Get(); + + // + // Get the last notification message status for each operator. + // + foreach( OperatorNode operatorNode in operatorNodes ) + { + ReplicationResult result = new ReplicationResult(); + + result.GetLast( operatorNode.OperatorNodeID, true ); + + results.Add( result ); + } + + // + // Monitor changes to operator status every 5 seconds. + // + while( true ) + { + Console.WriteLine( "Polling for new notifications: {0}. Press Ctrl+C to stop.", DateTime.Now ); + + for( int i = 0; i < operatorNodes.Count; i ++ ) + { + ReplicationResult lastResult = (ReplicationResult)results[ i ]; + ReplicationResult result = new ReplicationResult(); + + result.GetLast( operatorNodes[ i ].OperatorNodeID, true ); + + // + // Check to see if a notification message has been received + // + if( result.LastChange > lastResult.LastChange ) + { + DateTime time = new DateTime( result.LastChange ); + + Console.WriteLine( + "\r\n\tnotify_changeRecordsAvailable detected\r\n\t\tNode: {0}\r\n\t\tTime: {1}", + result.OperatorNodeID, + time ); + + // + // Execute the specified file. + // + Console.WriteLine( + "\t\tStarting: {0} -o {1}", + Program, + result.OperatorNodeID ); + + Process process = Process.Start( Program, "-o " + result.OperatorNodeID ); + + process.WaitForExit(); + + Console.WriteLine( + "\t\tReturn code: {0}\r\n", + process.ExitCode ); + + // + // Save the current notify result so that we don't + // reprocess. + // + results[ i ] = result; + } + } + + System.Threading.Thread.Sleep( PollInterval ); + } + } + catch( CommandLineException e ) + { + if( null != e.Message && e.Message.Length > 0 ) + { + Console.WriteLine( e.Message ); + Console.WriteLine(); + } + else + { + DisplayUsage(); + } + } + catch( Exception e ) + { + Console.WriteLine( "Exception: {0}", e.ToString() ); + } + finally + { + ConnectionManager.Close(); + } + + return; + } + + public static void DisplayUsage() + { + Console.WriteLine( "Starts the specified program whenever a notify_changeRecordsAvailable\r\nmessage is received." ); + Console.WriteLine( "\r\nUsage:" ); + Console.WriteLine( "\tmonitor.exe [switches] " ); + Console.WriteLine( "\r\nSwitches:" ); + Console.WriteLine( "\t-i Sets the poll interval (in milliseconds). The" ); + Console.WriteLine( "\t default is 5000." ); + Console.WriteLine( "\r\nExamples:" ); + Console.WriteLine( "\tmonitor.exe c:\\bin\\retrieve.exe" ); + Console.WriteLine( "\tmonitor.exe -t 10000 c:\\bin\\retrieve.exe" ); + } + + internal static void ProcessCommandLine( string[] args ) + { + int i = 0; + + if( 0 == args.Length ) + throw new CommandLineException(); + + while( i < args.Length ) + { + if( "-" == args[ i ].Substring( 0, 1 ) || "/" == args[ i ].Substring( 0, 1 ) ) + { + switch( args[ i ].Substring( 1 ).ToLower() ) + { + case "i": + if( i + 1 >= args.Length ) + throw new CommandLineException( "Missing required parameter 'interval'." ); + + i ++; + + try + { + PollInterval = Convert.ToInt32( args[ i ] ); + } + catch + { + throw new CommandLineException( "Parameter 'interval' must be numeric." ); + } + + break; + + case "?": + throw new CommandLineException(); + + default: + throw new CommandLineException( "Invalid switch." ); + } + } + else + { + if( null == Program ) + Program = args[ i ]; + else + throw new CommandLineException( "Too many command line parameters." ); + } + + i ++; + } + + if( null == Program ) + throw new CommandLineException( "Missing required parameter 'Program'." ); + } + } + + /// **************************************************************** + /// public class CommandLineException + /// ---------------------------------------------------------------- + /// + /// Exception class for errors encountered while parsing the + /// command-line. + /// + /// **************************************************************** + /// + public class CommandLineException : ApplicationException + { + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ************************************************************ + /// + public CommandLineException() + : base( "" ) + { + } + + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ------------------------------------------------------------ + /// + /// Exception message. + /// + /// ************************************************************ + /// + public CommandLineException( string message ) + : base( message ) + { + } + } +} diff --git a/inetsrv/uddi/source/tools/monitor/monitor.csproj b/inetsrv/uddi/source/tools/monitor/monitor.csproj new file mode 100644 index 0000000..b1c97d8 --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/monitor.csproj @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/monitor/monitor.snk b/inetsrv/uddi/source/tools/monitor/monitor.snk new file mode 100644 index 0000000..842d9db Binary files /dev/null and b/inetsrv/uddi/source/tools/monitor/monitor.snk differ diff --git a/inetsrv/uddi/source/tools/monitor/obj/_objects.mac b/inetsrv/uddi/source/tools/monitor/obj/_objects.mac new file mode 100644 index 0000000..8be4db2 --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\monitor.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\monitor.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\monitor.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\monitor.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/monitor/obj/i386/monitor.exe b/inetsrv/uddi/source/tools/monitor/obj/i386/monitor.exe new file mode 100644 index 0000000..444bc68 Binary files /dev/null and b/inetsrv/uddi/source/tools/monitor/obj/i386/monitor.exe differ diff --git a/inetsrv/uddi/source/tools/monitor/obj/i386/monitor.pdb b/inetsrv/uddi/source/tools/monitor/obj/i386/monitor.pdb new file mode 100644 index 0000000..b071633 Binary files /dev/null and b/inetsrv/uddi/source/tools/monitor/obj/i386/monitor.pdb differ diff --git a/inetsrv/uddi/source/tools/monitor/placefil.txt b/inetsrv/uddi/source/tools/monitor/placefil.txt new file mode 100644 index 0000000..666d1ca --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/placefil.txt @@ -0,0 +1 @@ +monitor.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/monitor/sources b/inetsrv/uddi/source/tools/monitor/sources new file mode 100644 index 0000000..b1f6c92 --- /dev/null +++ b/inetsrv/uddi/source/tools/monitor/sources @@ -0,0 +1,20 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=monitor +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES= ..\..\core\obj\*\uddi.core.dll, ..\..\operator\obj\*\uddi.operator.dll + +SOURCES=\ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + monitor.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/rcf/app.ico b/inetsrv/uddi/source/tools/rcf/app.ico new file mode 100644 index 0000000..3a5525f Binary files /dev/null and b/inetsrv/uddi/source/tools/rcf/app.ico differ diff --git a/inetsrv/uddi/source/tools/rcf/assemblyinfo.cs b/inetsrv/uddi/source/tools/rcf/assemblyinfo.cs new file mode 100644 index 0000000..d2b8b4c --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("rcf.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/rcf/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/rcf/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/rcf/build.log b/inetsrv/uddi/source/tools/rcf/build.log new file mode 100644 index 0000000..909d20e --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/build.log @@ -0,0 +1,25 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\tools\rcf directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\tools\rcf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\rcf +Elapsed time [0:00:00.016] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 rcf D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module rcf not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\tools\rcf directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 rcf D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module rcf not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\rcf.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.xml.dll,..\..\core\obj\I386\uddi.core.dll,..\..\operator\obj\I386\uddi.operator.dll assemblyinfo.cs assemblyversioninfo.cs rcf.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\tools\rcf\obj\i386\rcf.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:00.985] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/tools/rcf/makefile b/inetsrv/uddi/source/tools/rcf/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/rcf/makefile.inc b/inetsrv/uddi/source/tools/rcf/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/rcf/obj/_objects.mac b/inetsrv/uddi/source/tools/rcf/obj/_objects.mac new file mode 100644 index 0000000..0454617 --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\rcf.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\rcf.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\rcf.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\rcf.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/rcf/obj/i386/rcf.exe b/inetsrv/uddi/source/tools/rcf/obj/i386/rcf.exe new file mode 100644 index 0000000..6fe676a Binary files /dev/null and b/inetsrv/uddi/source/tools/rcf/obj/i386/rcf.exe differ diff --git a/inetsrv/uddi/source/tools/rcf/obj/i386/rcf.pdb b/inetsrv/uddi/source/tools/rcf/obj/i386/rcf.pdb new file mode 100644 index 0000000..0d368b2 Binary files /dev/null and b/inetsrv/uddi/source/tools/rcf/obj/i386/rcf.pdb differ diff --git a/inetsrv/uddi/source/tools/rcf/placefil.txt b/inetsrv/uddi/source/tools/rcf/placefil.txt new file mode 100644 index 0000000..f479469 --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/placefil.txt @@ -0,0 +1 @@ +rcf.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/rcf/rcf.cs b/inetsrv/uddi/source/tools/rcf/rcf.cs new file mode 100644 index 0000000..7f26e22 --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/rcf.cs @@ -0,0 +1,647 @@ +using System; +using System.Net; +using System.Collections; +using System.Data; +using System.IO; +using System.Security.Principal; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; +using System.Web.Services; +using System.Web.Services.Description; +using System.Web.Services.Protocols; + +using UDDI; +using UDDI.Replication; +using UDDI.Diagnostics; + +namespace UDDI.Tools +{ + public class ReplicationConfigurationUtility + { + private static string executable = System.AppDomain.CurrentDomain.FriendlyName; + private static string filename = null; + private static string operatorKey = null; + private static string rcfFile = null; + + private static bool overwrite = false; + + private enum ModeType + { + None = 0, + ImportOperatorCertificate = 1, + ExportOperatorCertificate = 2, + ImportRCF = 3 + } + + private static ModeType mode = ModeType.None; + + /// **************************************************************** + /// internal ProcessCommandLine [static] + /// ---------------------------------------------------------------- + /// + /// Parse the command-line. + /// + /// ---------------------------------------------------------------- + /// + /// Command-line arguments. + /// + /// **************************************************************** + internal static void ProcessCommandLine( string[] args ) + { + int i = 0; + + while( i < args.Length ) + { + if( '-' == args[i][0] || '/' == args[i][0] ) + { + // + // Process the switch. + // + switch( args[i].Substring( 1 ).ToLower() ) + { + case "i": + if( i == args.Length - 1 ) + throw new CommandLineException( "Missing required argument 'certfile'." ); + + mode = ModeType.ImportOperatorCertificate; + + i ++; + filename = args[i]; + + if( !File.Exists( filename ) ) + throw new CommandLineException( "Certificate file '" + filename + "' does not exist." ); + + break; + + case "e": + if( i == args.Length - 1 ) + throw new CommandLineException( "Missing required argument 'certfile'." ); + + mode = ModeType.ExportOperatorCertificate; + + i ++; + filename = args[i]; + + break; + + case "o": + if( i == args.Length - 1 ) + throw new CommandLineException( "Missing required argument 'operatorkey'." ); + + i ++; + operatorKey = args[i]; + + // + // strip {'s and }'s + // + operatorKey = operatorKey.Replace("{", string.Empty); + operatorKey = operatorKey.Replace("}", string.Empty); + + break; + case "r": + if( i == args.Length - 1 ) + { + throw new CommandLineException( "Missing required argument 'path to RCF file'." ); + } + i ++; + rcfFile = args[i]; + mode = ModeType.ImportRCF; + + if( !File.Exists( rcfFile ) ) + throw new CommandLineException( "RCF file '" + rcfFile + "' does not exist." ); + + break; + case "y": + overwrite = true; + break; + + case "?": + goto case "help"; + + case "help": + throw new CommandLineException( "" ); + + default: + throw new CommandLineException( "Unknown command-line parameter '" + args[i] + "'." ); + } + } + + i ++; + } + + // + // Make sure the appropriate options were set. + // + //if() + // throw new CommandLineException( "Missing required command-line parameters." ); + } + + public static void ImportOperatorCertificate() + { + X509Certificate certificate = X509Certificate.CreateFromCertFile( filename ); + SaveOperatorInfo( operatorKey, certificate ); + } + + public static void ImportRCF() + { + FileStream rcfStream = File.Open( rcfFile, FileMode.Open, FileAccess.Read, FileShare.Read ); + + try + { + // + // Validate the RCF file. + // + SchemaCollection.Validate( rcfStream ); + + // + // + // Open our RCF file, it has already been checked to make sure it exists. + // + XmlTextReader rcfReader = new XmlTextReader( rcfStream ); + + while( true == rcfReader.Read() && false == rcfReader.EOF ) + { + if( rcfReader.Name.Equals( "operator" ) && rcfReader.NamespaceURI.Equals( UDDI.Replication.Constants.Namespace ) ) + { + // + // For each operator node, we want the following information. These are all + // mandatory elements, so if any were missing we should not have passed schema + // validation. + // + // operatorNodeID (this is the operatorKey) + // operatorStatus + // soapReplicationUrl + // certificate + // operatorCustodyName (operatorName) + // + + // + // Note that contacts are currently being ignored. This is because we are not sending + // the businessKey for the operator. Since we store contacts based on businessKey (actually businessID) + // we do not have a way of storing contacts. IN 70 says that the operatorNodeID should actually be this + // businessKey, so once we decide to implement this, we'll process contacts. + // + + X509Certificate certificate = null; + string operatorKey = null; + string operatorName = null; + string soapReplicationUrl = null; + int operatorStatus = 0; + string localOperatorKey = Config.GetString( "OperatorKey" ).ToLower(); + + do + { + switch( rcfReader.Name ) + { + case "operatorNodeID": + { + operatorKey = rcfReader.ReadElementString(); + break; + } + case "operatorCustodyName": + { + operatorName = rcfReader.ReadElementString(); + break; + } + case "operatorStatus": + { + + operatorStatus = OperatorStatus2ID( rcfReader.ReadElementString() ); + break; + } + case "soapReplicationURL": + { + soapReplicationUrl = rcfReader.ReadElementString(); + break; + } + case "certificate": + { + // + // Read our data in 1024 byte chunks. Keep an array list of these + // chunks. + // + int bytesRead = 0; + int chunkSize = 1024; + ArrayList chunks = new ArrayList(); + + do + { + byte[] data = new byte[ chunkSize ]; + bytesRead = rcfReader.ReadBase64( data, 0, chunkSize ); + + if( bytesRead > 0 ) + { + chunks.Add( data ); + } + }while( bytesRead != 0 ); + + // + // Allocate a buffer to hold all of our chunks. + // + byte[] certificateData = new byte[ chunks.Count * chunkSize ]; + + // + // Copy each chunk into our buffer. This buffer is our certificate. + // + int index = 0; + foreach( byte[] chunkData in chunks ) + { + Array.Copy( chunkData, 0, certificateData, index, chunkData.Length ); + index += chunkData.Length; + } + + // + // Create a certificate from our byte data. + // + certificate = new X509Certificate( certificateData ); + break; + } + } + }while( true == rcfReader.Read() && false == rcfReader.EOF && false == rcfReader.Name.Equals( "operator" ) ); + + // + // Make sure we identify the local operator. + // + if( false == operatorKey.ToLower().Equals( localOperatorKey ) ) + { + // + // Import this operator + // + SaveOperatorInfo( operatorKey, operatorName, soapReplicationUrl, operatorStatus, certificate ); + Console.WriteLine( "Successfully imported {0}.", operatorName ); + } + else + { + SaveOperatorInfo( null, operatorName, soapReplicationUrl, operatorStatus, certificate ); + Console.WriteLine( "Successfully update the local operator." ); + } + + } + } + } + catch( XmlException xmlException ) + { + Console.WriteLine( "Exception processing the RCF: " ); + Console.WriteLine( "\t" ); + Console.WriteLine( xmlException.ToString() ); + } + catch( XmlSchemaException schemaException ) + { + Console.WriteLine( "The RCF did not pass schema validation: " ); + Console.WriteLine( "\t" ); + Console.WriteLine( schemaException.ToString() ); + } + finally + { + rcfStream.Close(); + } + } + + public static void ExportOperatorCertificate() + { + if( null == operatorKey ) + { + operatorKey = Config.GetString( "OperatorKey" ); + } + + if( File.Exists( filename ) && !overwrite ) + { + Console.Write( "Overwrite '{0}' [y/n]? ", filename ); + int choice = Console.Read(); + + if( 'y' != (char)choice && 'Y' != (char)choice ) + { + Console.WriteLine(); + Console.WriteLine( "Operation aborted." ); + + return; + } + } + + byte[] data = null; + + // + // Retrieve the certificate. + // + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_operator_get"; + + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@operatorKey", operatorKey ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + if( reader.Read() ) + data = reader.GetBinary( "certificate" ); + } + finally + { + reader.Close(); + } + + FileStream file = File.Open( filename, FileMode.Create, FileAccess.Write, FileShare.None ); + + try + { + int filesize = (int)data.Length; + + file.Write( data, 0, filesize ); + + Console.WriteLine( "Wrote {0} byte(s) to certificate file '{1}'.\r\nSource: {{{2}}}", + filesize, + filename, + operatorKey ); + } + finally + { + file.Close(); + } + } + + private static int OperatorStatus2ID( string status ) + { + // + // These values must match the values in UDO_operatorStatus + // + int id = 2; + switch( status ) + { + case "disable": + { + id = 0; + break; + } + case "new": + { + id = 1; + break; + } + case "normal": + { + id = 2; + break; + } + case "resigned": + { + id = 3; + break; + } + } + + return id; + } + + private static void SaveOperatorInfo( string operatorKey, X509Certificate certificate) + { + // + // Default operator status to 2 (normal) + // + SaveOperatorInfo( operatorKey, operatorKey, null, 2, certificate ); + } + + private static void SaveOperatorInfo( string operatorKey, + string operatorName, + string soapReplicationUrl, + int operatorStatus, + X509Certificate certificate) + { + byte[] data = certificate.GetRawCertData(); + + ConnectionManager.BeginTransaction(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + sp.ProcedureName = "net_operator_save"; + + if( null == operatorKey ) + { + // + // Import a certificate for the local operator + // + + operatorKey = Config.GetString( "OperatorKey" ); + + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@certSerialNo", SqlDbType.NVarChar, UDDI.Constants.Lengths.CertSerialNo ); + sp.Parameters.Add( "@certIssuer", SqlDbType.NVarChar, UDDI.Constants.Lengths.CertIssuer ); + sp.Parameters.Add( "@certSubject", SqlDbType.NVarChar, UDDI.Constants.Lengths.CertSubject ); + sp.Parameters.Add( "@certificate", SqlDbType.Image ); + + sp.Parameters.SetGuidFromString( "@operatorKey", operatorKey ); + sp.Parameters.SetString( "@certSerialNo", certificate.GetSerialNumberString() ); + sp.Parameters.SetString( "@certIssuer", certificate.GetIssuerName() ); + sp.Parameters.SetString( "@certSubject", certificate.GetName() ); + sp.Parameters.SetBinary( "@certificate", data ); + + sp.ExecuteNonQuery(); + } + else + { + // + // Create a new operator / publisher and import certificate + // + + // + // First add a publisher for the new operator + // + + SqlStoredProcedureAccessor sp2 = new SqlStoredProcedureAccessor(); + + sp2.ProcedureName = "UI_savePublisher"; + + sp2.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp2.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp2.Parameters.Add( "@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email ); + // + // TODO: use UDDI.Constants.Lengths.Phone when the UI_savePublisher is fixed + // + sp2.Parameters.Add( "@phone", SqlDbType.VarChar, 20 ); + + sp2.Parameters.SetString( "@PUID", operatorKey ); + sp2.Parameters.SetString( "@name", operatorKey ); + sp2.Parameters.SetString( "@email", "" ); + sp2.Parameters.SetString( "@phone", "" ); + + sp2.ExecuteNonQuery(); + + // + // Add the new operator and link it to the new publisher + // + sp.Parameters.Add( "@operatorKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@operatorStatusID", SqlDbType.Int ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp.Parameters.Add( "@soapReplicationURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.SoapReplicationURL ); + sp.Parameters.Add( "@certSerialNo", SqlDbType.NVarChar, UDDI.Constants.Lengths.CertSerialNo ); + sp.Parameters.Add( "@certIssuer", SqlDbType.NVarChar, UDDI.Constants.Lengths.CertIssuer ); + sp.Parameters.Add( "@certSubject", SqlDbType.NVarChar, UDDI.Constants.Lengths.CertSubject ); + sp.Parameters.Add( "@certificate", SqlDbType.Image ); + + sp.Parameters.SetGuidFromString( "@operatorKey", operatorKey ); + sp.Parameters.SetInt( "@operatorStatusID", operatorStatus ); + sp.Parameters.SetString( "@PUID", operatorKey ); + sp.Parameters.SetString( "@name", operatorName ); + sp.Parameters.SetString( "@soapReplicationURL", soapReplicationUrl ); + sp.Parameters.SetString( "@certSerialNo", certificate.GetSerialNumberString() ); + sp.Parameters.SetString( "@certIssuer", certificate.GetIssuerName() ); + sp.Parameters.SetString( "@certSubject", certificate.GetName() ); + sp.Parameters.SetBinary( "@certificate", data ); + + sp.ExecuteNonQuery(); + } + + ConnectionManager.Commit(); + + Console.WriteLine( "Wrote {0} byte(s) to operator key {{{1}}}.\r\nSource: '{2}'.", + data.Length, + operatorKey, + filename ); + } + + /// **************************************************************** + /// public Main [static] + /// ---------------------------------------------------------------- + /// + /// Program entry point. + /// + /// ---------------------------------------------------------------- + /// + /// Command-line arguments. + /// + /// **************************************************************** + /// + public static void Main( string[] args ) + { + try + { + ConnectionManager.Open( true, false ); + + Debug.VerifySetting( "OperatorKey" ); + + Console.WriteLine( "Microsoft (R) UDDI Replication Configuration Utility." ); + Console.WriteLine( "Copyright (C) Microsoft Corp. 2002. All rights reserved." ); + Console.WriteLine(); + + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal( identity ); + + Context.User.SetRole( principal ); + + if( !Context.User.IsAdministrator ) + { + Console.WriteLine( "Access denied.\r\n\r\nThis program must be executed by a member of the '" + + Config.GetString( "GroupName.Administrators" ) + "'\r\ngroup. The current user '" + + identity.Name + "' is not a member of this group." ); + + return; + } + + ProcessCommandLine( args ); + + switch( mode ) + { + case ModeType.ImportOperatorCertificate: + ImportOperatorCertificate(); + break; + + case ModeType.ExportOperatorCertificate: + ExportOperatorCertificate(); + break; + case ModeType.ImportRCF: + ImportRCF(); + break; + default: + throw new CommandLineException( "" ); + } + } + catch( CommandLineException e ) + { + // + // Display command-line help. + // + Console.WriteLine( "Syntax:" ); + Console.WriteLine( " " + executable + " [parameters]" ); + Console.WriteLine(); + Console.WriteLine( "Options:" ); + Console.WriteLine( " -help Displays this help message." ); + Console.WriteLine( " -i Import a certificate. If the -o option is not" ); + Console.WriteLine( " used, the certificate is imported for the" ); + Console.WriteLine( " local operator." ); + Console.WriteLine( " -e Export a certificate. If the -o option is not" ); + Console.WriteLine( " used, the certificate is exported from the" ); + Console.WriteLine( " local operator." ); + Console.WriteLine( " -o The operator key to import/export a certificate" ); + Console.WriteLine( " Omit this parameter to import a certificate for the" ); + Console.WriteLine( " local operator." ); + Console.WriteLine( " -y Supress file overwrite prompt." ); + Console.WriteLine( " -r Path to replication configuration file (RCF)." ); + Console.WriteLine(); + Console.WriteLine( "Examples:" ); + Console.WriteLine( " " + executable + " -help" ); + Console.WriteLine( " " + executable + " -o FF735874-28BD-41A0-96F3-02113FFD9D6C -i uddi.cer" ); + Console.WriteLine( " " + executable + " -i uddi.cer" ); + Console.WriteLine( " " + executable + " -r operators.xml" ); + Console.WriteLine(); + + if( 0 != e.Message.Length ) + Console.WriteLine( e.Message ); + + return; + } + catch( Exception e ) + { + Console.WriteLine( e.ToString() ); + + return; + } + } + } + + /// **************************************************************** + /// public class CommandLineException + /// ---------------------------------------------------------------- + /// + /// Exception class for errors encountered while parsing the + /// command-line. + /// + /// **************************************************************** + /// + public class CommandLineException : ApplicationException + { + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ************************************************************ + /// + public CommandLineException() + : base() + { + } + + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ------------------------------------------------------------ + /// + /// Exception message. + /// + /// ************************************************************ + /// + public CommandLineException( string message ) + : base( message ) + { + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/rcf/rcf.csproj b/inetsrv/uddi/source/tools/rcf/rcf.csproj new file mode 100644 index 0000000..00fbcc6 --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/rcf.csproj @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/rcf/rcf.snk b/inetsrv/uddi/source/tools/rcf/rcf.snk new file mode 100644 index 0000000..909838f Binary files /dev/null and b/inetsrv/uddi/source/tools/rcf/rcf.snk differ diff --git a/inetsrv/uddi/source/tools/rcf/sources b/inetsrv/uddi/source/tools/rcf/sources new file mode 100644 index 0000000..49d01d6 --- /dev/null +++ b/inetsrv/uddi/source/tools/rcf/sources @@ -0,0 +1,24 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=rcf +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console + +# +# this ensures that the references are built before this is built +# +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES=system.dll, system.data.dll, system.xml.dll, ..\..\core\obj\*\uddi.core.dll, ..\..\operator\obj\*\uddi.operator.dll + +SOURCES=\ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + rcf.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/recalcstats/assemblyinfo.cs b/inetsrv/uddi/source/tools/recalcstats/assemblyinfo.cs new file mode 100644 index 0000000..e96824e --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/assemblyinfo.cs @@ -0,0 +1,40 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("recalcstats.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/recalcstats/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/recalcstats/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/recalcstats/build.log b/inetsrv/uddi/source/tools/recalcstats/build.log new file mode 100644 index 0000000..77713ca --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/build.log @@ -0,0 +1,25 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\tools\recalcstats directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\tools\recalcstats directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\recalcstats +Elapsed time [0:00:00.032] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 recalcstats D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module recalcstats not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\tools\recalcstats directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 recalcstats D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module recalcstats not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\recalcstats.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll recalcstats.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\tools\recalcstats\obj\i386\recalcstats.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:02.735] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/tools/recalcstats/makefile b/inetsrv/uddi/source/tools/recalcstats/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/recalcstats/makefile.inc b/inetsrv/uddi/source/tools/recalcstats/makefile.inc new file mode 100644 index 0000000..26ceee5 --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/makefile.inc @@ -0,0 +1,2 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/recalcstats/obj/_objects.mac b/inetsrv/uddi/source/tools/recalcstats/obj/_objects.mac new file mode 100644 index 0000000..9a2f6a2 --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\recalcstats.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\recalcstats.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\recalcstats.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\recalcstats.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/recalcstats/obj/i386/recalcstats.exe b/inetsrv/uddi/source/tools/recalcstats/obj/i386/recalcstats.exe new file mode 100644 index 0000000..a714001 Binary files /dev/null and b/inetsrv/uddi/source/tools/recalcstats/obj/i386/recalcstats.exe differ diff --git a/inetsrv/uddi/source/tools/recalcstats/obj/i386/recalcstats.pdb b/inetsrv/uddi/source/tools/recalcstats/obj/i386/recalcstats.pdb new file mode 100644 index 0000000..b01aa74 Binary files /dev/null and b/inetsrv/uddi/source/tools/recalcstats/obj/i386/recalcstats.pdb differ diff --git a/inetsrv/uddi/source/tools/recalcstats/placefil.txt b/inetsrv/uddi/source/tools/recalcstats/placefil.txt new file mode 100644 index 0000000..ca09b32 --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/placefil.txt @@ -0,0 +1 @@ +recalcstats.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/recalcstats/recalcstats.cs b/inetsrv/uddi/source/tools/recalcstats/recalcstats.cs new file mode 100644 index 0000000..270573d --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/recalcstats.cs @@ -0,0 +1,198 @@ +using System; +using System.Globalization; +using System.Data; +using System.Data.SqlClient; +using Microsoft.Win32; +using System.Resources; + +namespace UDDI.Tools +{ + class Recalcstats + { + static SqlConnection connection; + static SqlTransaction transaction; + + static int Main( string[] args ) + { + int rc = 0; // assume success + + try + { + // + // Check if CurrentUICulture needs to be overridden + // + UDDI.Localization.SetConsoleUICulture(); + + DisplayBanner(); + + // + // Parse the command line + // + if( !ProcessCommandLine( args ) ) + { + return 1; + } + + // + // Recalculate statistics + // + RecalcStats(); + } + catch( Exception e ) + { + Console.WriteLine( FormatFromResource( "RECALCSTATS_FAILED" , e.Message ) ); + rc = 1; + } + + + return rc; + } + + private static bool ProcessCommandLine( string [] args ) + { + bool bOK = false; + + if ( args.Length > 0 ) + { + for( int i = 0; i < args.Length; i ++ ) + { + if( '-' == args[i][0] || '/' == args[i][0] ) + { + string option = args[i].Substring( 1 ); + + if( "help" == option.ToLower() || "?" == option ) + { + DisplayUsage(); + return false; + } + } + } + } + else + bOK = true; + + if( !bOK ) + { + DisplayUsage(); + return false; + } + + return true; + } + + static void DisplayBanner() + { + Console.WriteLine( FormatFromResource( "RECALCSTATS_COPYRIGHT_1" ) ); + Console.WriteLine( FormatFromResource( "RECALCSTATS_COPYRIGHT_2" ) ); + Console.WriteLine(); + } + + static void DisplayUsage() + { + Console.WriteLine( FormatFromResource( "RECALCSTATS_USAGE_1" ) ); + Console.WriteLine( FormatFromResource( "RECALCSTATS_USAGE_2" ) ); + Console.WriteLine(); + } + + static void RecalcStats() + { + OpenConnection(); + + try + { + // + // Get entity counts + // + Console.Write( FormatFromResource( "RECALCSTATS_GETTINGENTITYCOUNTS" ) ); + + SqlCommand cmd = new SqlCommand( "UI_getEntityCounts", connection, transaction ); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.ExecuteNonQuery(); + + Console.WriteLine( FormatFromResource( "RECALCSTATS_DONE" ) ); + + // + // Get publisher stats + // + Console.Write( FormatFromResource( "RECALCSTATS_GETTINGPUBLISHERSTATS" ) ); + + cmd.CommandText = "UI_getPublisherStats"; + cmd.ExecuteNonQuery(); + + Console.WriteLine( FormatFromResource( "RECALCSTATS_DONE" ) ); + + // + // Get top publishers + // + Console.Write( FormatFromResource( "RECALCSTATS_GETTINGTOPPUBLISHERS" ) ); + + cmd.CommandText = "UI_getTopPublishers"; + cmd.ExecuteNonQuery(); + + Console.WriteLine( FormatFromResource( "RECALCSTATS_DONE" ) ); + + // + // Get taxonomy stats + // + Console.Write( FormatFromResource( "RECALCSTATS_GETTINGTAXONOMYSTATS" ) ); + + cmd.CommandText = "UI_getTaxonomyStats"; + cmd.ExecuteNonQuery(); + + Console.WriteLine( FormatFromResource( "RECALCSTATS_DONE" ) ); + + // + // All sprocs succeeded + // + Console.WriteLine( FormatFromResource( "RECALCSTATS_SUCCEEDED" ) ); + } + finally + { + CloseConnection(); + } + + return; + } + + static void OpenConnection() + { + try + { + string connectionString = (string) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI\Database" ).GetValue( "WriterConnectionString" ); + connection = new SqlConnection( connectionString ); + connection.Open(); + transaction = connection.BeginTransaction( IsolationLevel.ReadCommitted, "recalcstats" ); + } + catch + { + throw new Exception( "Unable to connect to the database" ); + } + } + + static void CloseConnection() + { + transaction.Commit(); + connection.Close(); + } + + static string FormatFromResource( string resID, params object[] inserts ) + { + try + { + string resourceStr = UDDI.Localization.GetString( resID ); + if( null != resourceStr ) + { + string resultStr = string.Format( resourceStr, inserts ); + return resultStr; + } + + return "String not specified in the resources: " + resID; + } + catch( Exception e ) + { + return "FormatFromResource failed to load the resource string for ID: " + resID + " Reason: " + e.Message; + } + } + } +} diff --git a/inetsrv/uddi/source/tools/recalcstats/recalcstats.csproj b/inetsrv/uddi/source/tools/recalcstats/recalcstats.csproj new file mode 100644 index 0000000..f2f1474 --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/recalcstats.csproj @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/recalcstats/recalcstats.snk b/inetsrv/uddi/source/tools/recalcstats/recalcstats.snk new file mode 100644 index 0000000..1e457a1 Binary files /dev/null and b/inetsrv/uddi/source/tools/recalcstats/recalcstats.snk differ diff --git a/inetsrv/uddi/source/tools/recalcstats/sources b/inetsrv/uddi/source/tools/recalcstats/sources new file mode 100644 index 0000000..52aa0ea --- /dev/null +++ b/inetsrv/uddi/source/tools/recalcstats/sources @@ -0,0 +1,19 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=recalcstats +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + +REFERENCES= ..\..\core\obj\*\uddi.core.dll + +SOURCES=\ + recalcstats.cs \ + assemblyversioninfo.cs \ + assemblyinfo.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/replicationadmin/adminframe.cs b/inetsrv/uddi/source/tools/replicationadmin/adminframe.cs new file mode 100644 index 0000000..f648191 --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/adminframe.cs @@ -0,0 +1,219 @@ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.Security.Principal; + +namespace UDDI.Tools +{ + public interface IAdminObject + { + void Initialize( IAdminFrame parent ); + string GetNodeText(); + void Show( Control parentDisplay ); + } + + public interface IAdminFrame + { + void UpdateAllViews(); + } + + public class AdminFrame : Form, IAdminFrame + { + private TreeView nodesTreeView; + private Splitter splitter; + private Panel viewPanel; + private MainMenu mainMenu; + private MenuItem fileMenuItem; + private MenuItem viewMenuItem; + private MenuItem exitMenuItem; + private MenuItem refreshMenuItem; + + public AdminFrame( ArrayList adminObjects ) + { + InitializeComponent(); + + foreach( IAdminObject adminObject in adminObjects ) + { + TreeNode adminNode = new TreeNode( adminObject.GetNodeText() ); + adminNode.Tag = adminObject; + + try + { + adminObject.Initialize( this ); + nodesTreeView.Nodes.Add( adminNode ); + } + catch( Exception e ) + { + MessageBox.Show( string.Format( "There was an exception initializing: {0}\n\n{1}", adminObject.GetNodeText(), e.ToString() ) ); + } + } + } + + public void UpdateAllViews() + { + foreach( TreeNode treeNode in nodesTreeView.Nodes ) + { + IAdminObject adminObject = ( IAdminObject )treeNode.Tag; + + try + { + adminObject.Show( viewPanel ); + } + catch( Exception e ) + { + MessageBox.Show( string.Format( "There was an exception updating: {0}\n\n{1}", adminObject.GetNodeText(), e.ToString() ) ); + } + } + } + + private void InitializeComponent() + { + nodesTreeView = new TreeView(); + splitter = new Splitter(); + viewPanel = new Panel(); + mainMenu = new MainMenu(); + fileMenuItem = new MenuItem(); + viewMenuItem = new MenuItem(); + exitMenuItem = new MenuItem(); + refreshMenuItem = new MenuItem(); + + SuspendLayout(); + + // + // nodesTreeView + // + nodesTreeView.BorderStyle = BorderStyle.None; + nodesTreeView.Dock = DockStyle.Left; + nodesTreeView.ImageIndex = -1; + nodesTreeView.Name = "nodesTreeView"; + nodesTreeView.SelectedImageIndex = -1; + nodesTreeView.ShowLines = false; + nodesTreeView.Size = new System.Drawing.Size(121, 549); + nodesTreeView.TabIndex = 0; + nodesTreeView.HotTracking = true; + nodesTreeView.AfterSelect += new TreeViewEventHandler(NodesTreeView_AfterSelect); + + // + // splitter + // + splitter.Location = new System.Drawing.Point(121, 0); + splitter.Name = "splitter"; + splitter.Size = new System.Drawing.Size(3, 549); + splitter.TabIndex = 1; + splitter.TabStop = false; + + // + // viewPanel + // + viewPanel.Dock = DockStyle.Fill; + viewPanel.Location = new System.Drawing.Point(124, 0); + viewPanel.Name = "viewPanel"; + viewPanel.Size = new System.Drawing.Size(676, 549); + viewPanel.TabIndex = 2; + + // + // mainMenu + // + mainMenu.MenuItems.AddRange( new MenuItem[] { fileMenuItem, viewMenuItem } ); + + // + // fileMenuItem + // + fileMenuItem.Index = 0; + fileMenuItem.MenuItems.AddRange(new MenuItem[] { exitMenuItem } ); + fileMenuItem.Text = "File"; + + // viewMenuItem + viewMenuItem.Index = 1; + viewMenuItem.MenuItems.AddRange(new MenuItem[] { refreshMenuItem } ); + viewMenuItem.Text = "View"; + + // + // exitMenuItem + // + exitMenuItem.Index = 0; + exitMenuItem.Text = "E&xit"; + exitMenuItem.Click += new System.EventHandler( ExitMenuItem_Click ); + + // + // refreshMenuItem + // + refreshMenuItem.Index = 0; + refreshMenuItem.Text = "Refresh"; + refreshMenuItem.Click += new EventHandler( RefreshMenuItem_Click ); + + // + // AdminFrame + // + AutoScaleBaseSize = new System.Drawing.Size(5, 13); + ClientSize = new System.Drawing.Size(705, 680); + Controls.AddRange(new Control[] { viewPanel, splitter, nodesTreeView}); + + Menu = mainMenu; + Name = "AdminFrame"; + Text = "Replication Admin Tool"; + + ResumeLayout(false); + + Resize += new EventHandler( AdminFrame_Resize ); + } + + private void AdminFrame_Resize( object sender, EventArgs eventArgs ) + { + UpdateAllViews(); + } + + private void NodesTreeView_AfterSelect( object sender, TreeViewEventArgs treeViewArgs ) + { + IAdminObject adminObject = treeViewArgs.Node.Tag as IAdminObject; + + if( null == adminObject ) + { + MessageBox.Show( "Admin node was incorrectly initialized" ); + } + else + { + viewPanel.Controls.Clear(); + adminObject.Show( viewPanel ); + } + } + + private void RefreshMenuItem_Click( object sender, EventArgs eventArgs ) + { + this.UpdateAllViews(); + } + + private void ExitMenuItem_Click( object sender, EventArgs eventArgs ) + { + System.Windows.Forms.Application.Exit(); + } + + [STAThread] + static void Main() + { + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal( identity ); + + Context.User.SetRole( principal ); + + if( !Context.User.IsAdministrator ) + { + MessageBox.Show( "Access denied.\r\n\r\nThis program must be executed by a member of the '" + + Config.GetString( "GroupName.Administrators" ) + "'\r\ngroup. The current user '" + + identity.Name + "' is not a member of this group." ); + return; + } + + UDDI.ConnectionManager.Open( true, false ); + + ArrayList adminObjects = new ArrayList(); + + adminObjects.Add( new CorrectionAdmin() ); + AdminFrame adminFrame = new AdminFrame( adminObjects ); + + System.Windows.Forms.Application.Run( adminFrame ); + } + } +} diff --git a/inetsrv/uddi/source/tools/replicationadmin/adminframe.resx b/inetsrv/uddi/source/tools/replicationadmin/adminframe.resx new file mode 100644 index 0000000..f612ec2 --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/adminframe.resx @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ChangeLogControl + + \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/replicationadmin/correctionadmin.cs b/inetsrv/uddi/source/tools/replicationadmin/correctionadmin.cs new file mode 100644 index 0000000..7330932 --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/correctionadmin.cs @@ -0,0 +1,451 @@ +using System; +using System.Data.SqlClient; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.Xml; +using System.Xml.Serialization; +using System.IO; + +using UDDI; +using UDDI.API; +using UDDI.Replication; +using UDDI.API.Binding; +using UDDI.API.ServiceType; + +namespace UDDI.Tools +{ + public class CorrectionAdmin : UserControl, IAdminObject + { + private XmlSerializer changeRecordSerializer; + + private System.Windows.Forms.Label usnLabel; + private System.Windows.Forms.TextBox usnTextBox; + private System.Windows.Forms.Button usnButton; + private System.Windows.Forms.GroupBox findGroupBox; + private System.Windows.Forms.GroupBox changeRecordGroupBox; + private System.Windows.Forms.TextBox changeRecordTextBox; + private System.Windows.Forms.GroupBox correctionGroupBox; + private System.Windows.Forms.TextBox correctionTextBox; + private System.Windows.Forms.Button correctionButton; + private XmlSerializer correctionSerializer; + + public CorrectionAdmin() + { + changeRecordSerializer = new XmlSerializer( typeof( ChangeRecord ) ); + correctionSerializer = new XmlSerializer( typeof( ChangeRecordCorrection ) ); + } + + public void Initialize( IAdminFrame parent ) + { + InitializeComponent(); + } + + public string GetNodeText() + { + return "Corrections"; + } + + public void Show( Control parentDisplay ) + { + Parent = parentDisplay; + Size = parentDisplay.Size; + } + + private void InitializeComponent() + { + this.usnLabel = new System.Windows.Forms.Label(); + this.usnTextBox = new System.Windows.Forms.TextBox(); + this.usnButton = new System.Windows.Forms.Button(); + this.findGroupBox = new System.Windows.Forms.GroupBox(); + this.changeRecordGroupBox = new System.Windows.Forms.GroupBox(); + this.changeRecordTextBox = new System.Windows.Forms.TextBox(); + this.correctionGroupBox = new System.Windows.Forms.GroupBox(); + this.correctionButton = new System.Windows.Forms.Button(); + this.correctionTextBox = new System.Windows.Forms.TextBox(); + this.findGroupBox.SuspendLayout(); + this.changeRecordGroupBox.SuspendLayout(); + this.correctionGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // usnLabel + // + this.usnLabel.Location = new System.Drawing.Point(8, 24); + this.usnLabel.Name = "usnLabel"; + this.usnLabel.Size = new System.Drawing.Size(48, 16); + this.usnLabel.TabIndex = 0; + this.usnLabel.Text = "USN:"; + // + // usnTextBox + // + this.usnTextBox.Location = new System.Drawing.Point(56, 22); + this.usnTextBox.Name = "usnTextBox"; + this.usnTextBox.Size = new System.Drawing.Size(112, 20); + this.usnTextBox.TabIndex = 1; + this.usnTextBox.Text = ""; + // + // usnButton + // + this.usnButton.Location = new System.Drawing.Point(176, 21); + this.usnButton.Name = "usnButton"; + this.usnButton.Size = new System.Drawing.Size(120, 23); + this.usnButton.TabIndex = 2; + this.usnButton.Text = "Get ChangeRecord"; + this.usnButton.Click += new System.EventHandler(this.usnButton_Click); + // + // findGroupBox + // + this.findGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); + this.findGroupBox.Controls.AddRange(new System.Windows.Forms.Control[] { + this.usnLabel, + this.usnButton, + this.usnTextBox}); + this.findGroupBox.Location = new System.Drawing.Point(8, 8); + this.findGroupBox.Name = "findGroupBox"; + this.findGroupBox.Size = new System.Drawing.Size(568, 56); + this.findGroupBox.TabIndex = 3; + this.findGroupBox.TabStop = false; + this.findGroupBox.Text = "Find Change Record"; + // + // changeRecordGroupBox + // + this.changeRecordGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); + this.changeRecordGroupBox.Controls.AddRange(new System.Windows.Forms.Control[] { + this.changeRecordTextBox}); + this.changeRecordGroupBox.Location = new System.Drawing.Point(8, 72); + this.changeRecordGroupBox.Name = "changeRecordGroupBox"; + this.changeRecordGroupBox.Size = new System.Drawing.Size(568, 280); + this.changeRecordGroupBox.TabIndex = 4; + this.changeRecordGroupBox.TabStop = false; + this.changeRecordGroupBox.Text = "Change Record"; + // + // changeRecordTextBox + // + this.changeRecordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); + this.changeRecordTextBox.Location = new System.Drawing.Point(8, 24); + this.changeRecordTextBox.Multiline = true; + this.changeRecordTextBox.Name = "changeRecordTextBox"; + this.changeRecordTextBox.ReadOnly = true; + this.changeRecordTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.changeRecordTextBox.Size = new System.Drawing.Size(552, 240); + this.changeRecordTextBox.TabIndex = 0; + this.changeRecordTextBox.Text = ""; + // + // correctionGroupBox + // + this.correctionGroupBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); + this.correctionGroupBox.Controls.AddRange(new System.Windows.Forms.Control[] { + this.correctionButton, + this.correctionTextBox}); + this.correctionGroupBox.Location = new System.Drawing.Point(8, 360); + this.correctionGroupBox.Name = "correctionGroupBox"; + this.correctionGroupBox.Size = new System.Drawing.Size(568, 304); + this.correctionGroupBox.TabIndex = 5; + this.correctionGroupBox.TabStop = false; + this.correctionGroupBox.Text = "Proposed Correction"; + // + // correctionButton + // + this.correctionButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.correctionButton.Enabled = false; + this.correctionButton.Location = new System.Drawing.Point(8, 272); + this.correctionButton.Name = "correctionButton"; + this.correctionButton.Size = new System.Drawing.Size(112, 23); + this.correctionButton.TabIndex = 1; + this.correctionButton.Text = "Issue Correction"; + this.correctionButton.Click += new System.EventHandler(this.correctionButton_Click); + // + // correctionTextBox + // + this.correctionTextBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); + this.correctionTextBox.Location = new System.Drawing.Point(8, 24); + this.correctionTextBox.Multiline = true; + this.correctionTextBox.Name = "correctionTextBox"; + this.correctionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.correctionTextBox.Size = new System.Drawing.Size(552, 240); + this.correctionTextBox.TabIndex = 0; + this.correctionTextBox.Text = ""; + // + // CorrectionAdmin + // + this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.correctionGroupBox, + this.changeRecordGroupBox, + this.findGroupBox}); + this.Name = "CorrectionAdmin"; + this.Size = new System.Drawing.Size(592, 680); + this.findGroupBox.ResumeLayout(false); + this.changeRecordGroupBox.ResumeLayout(false); + this.correctionGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + + } + + void usnButton_Click(object sender, System.EventArgs e) + { + ShowChangeRecord(); + } + + private bool ValidatePublisher() + { + bool validPublisher = Context.User.IsRegistered; + + // + // Make sure the user is a UDDI publisher. + // + if( false == validPublisher ) + { + DialogResult dialogResult = MessageBox.Show( "You are not registered as a publisher on this UDDI Site? You must register before performing this operation. Would you like to register now?", + "UDDI", + MessageBoxButtons.YesNo ); + + if( DialogResult.Yes == dialogResult ) + { + try + { + Context.User.Register(); + validPublisher = Context.User.IsRegistered; + } + catch( Exception registrationException ) + { + MessageBox.Show( "An exception occurred when trying to register:\r\n\r\n" + registrationException.ToString() ); + } + } + } + + return validPublisher; + } + + private void correctionButton_Click(object sender, System.EventArgs e) + { + if( false == ValidatePublisher() ) + { + return; + } + + try + { + ConnectionManager.BeginTransaction(); + + // + // Deserialize into a change record object + // + StringReader reader = new StringReader( correctionTextBox.Text ); + + ChangeRecordCorrection changeRecordCorrection = ( ChangeRecordCorrection ) correctionSerializer.Deserialize( reader ); + + // + // Validate what we created. + // + SchemaCollection.Validate( changeRecordCorrection ); + + // + // Create a new change record to hold the correction. + // + ChangeRecord changeRecord = new ChangeRecord( changeRecordCorrection ); + changeRecord.Process(); + ConnectionManager.Commit(); + + // + // If we made it this far, we were able to process the correction + // + MessageBox.Show( "Correction processed!" ); + + // + // Refresh our display. + // + ShowChangeRecord(); + } + catch( Exception exception ) + { + ConnectionManager.Abort(); + + MessageBox.Show( "An exception occurred when trying to process the correction:\r\n\r\n" + exception.ToString() ); + } + } + + void ShowChangeRecord() + { + try + { + // + // Get the USN the user entered. + // + int usn = Convert.ToInt32( usnTextBox.Text ); + SqlDataReaderAccessor reader = null; + + try + { + // + // Try to find the ChangeRecord by USN. We can only correct local change records, so always + // use the local operator key. + // + FindChangeRecords.SetRange( Config.GetString( "OperatorKey" ), usn, usn ); + + // + // Get the results; we should only have 1 result. + // + reader = FindChangeRecords.RetrieveResults( 1 ); + + // + // Construct a ChangeRecord from the results. + // + ChangeRecord changeRecord = CreateChangeRecord( reader ); + + if( null != changeRecord ) + { + // + // If we found a change record, show its XML and show the XML for a + // proposed correction. The user will be allowed to edit the XML for the + // proposed correction. + // + DisplayChangeRecord( changeRecord ); + DisplayCorrection( changeRecord ); + + correctionButton.Enabled = true; + } + else + { + MessageBox.Show( "No ChangeRecord matching that USN was found." ); + } + } + catch( Exception innerException ) + { + FindChangeRecords.CleanUp(); + + throw innerException; + + } + finally + { + if( null != reader ) + { + reader.Close(); + } + } + } + catch( Exception exception ) + { + correctionButton.Enabled = false; + MessageBox.Show( "Change Record for that USN could not be obtained\r\n\r\n:" + exception.ToString() ); + } + } + + ChangeRecord CreateChangeRecord( SqlDataReaderAccessor reader ) + { + ChangeRecord changeRecord = null; + try + { + while( reader.Read() ) + { + XmlSerializer serializer = null; + + switch( (ChangeRecordPayloadType)reader.GetShort( "changeTypeID" ) ) + { + case ChangeRecordPayloadType.ChangeRecordNull: + serializer = new XmlSerializer( typeof( ChangeRecordNull ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordNewData: + serializer = new XmlSerializer( typeof( ChangeRecordNewData ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordDelete: + serializer = new XmlSerializer( typeof( ChangeRecordDelete ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordPublisherAssertion: + serializer = new XmlSerializer( typeof( ChangeRecordPublisherAssertion ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordHide: + serializer = new XmlSerializer( typeof( ChangeRecordHide ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordDeleteAssertion: + serializer = new XmlSerializer( typeof( ChangeRecordDeleteAssertion ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordAcknowledgement: + serializer = new XmlSerializer( typeof( ChangeRecordAcknowledgement ) ); + break; + + case ChangeRecordPayloadType.ChangeRecordCorrection: + serializer = new XmlSerializer( typeof( ChangeRecordCorrection ) ); + break; + } + + StringReader stringReader = new StringReader( reader.GetString( "changeData" ) ); + + try + { + changeRecord = new ChangeRecord(); + + changeRecord.AcknowledgementRequested = ( reader.GetInt( "flag" ) & (int)ChangeRecordFlags.AcknowledgementRequested ) > 0; + changeRecord.ChangeID.NodeID = reader.GetString( "OperatorKey" ); + changeRecord.ChangeID.OriginatingUSN = reader.GetLong( "USN" ); + + ChangeRecordBase changeRecordBase = ( ChangeRecordBase ) serializer.Deserialize( stringReader ); + if( changeRecordBase is ChangeRecordCorrection ) + { + // + // The query to find change records will do correction 'fixups'. That is, the changeData of this + // change record will be replaced with the changeData from the correction. The problem with this is + // that the original change data will now look like a correction. To distinguish these types of + // change records, we look to see if the OriginatingUSN's match. If the OriginatingUSN's match, + // we want they payload of the change record in this correction. This payload will contain the + // corrected data that we want. + // + ChangeRecordCorrection changeRecordCorrection = ( ChangeRecordCorrection ) changeRecordBase; + if( changeRecordCorrection.ChangeRecord.ChangeID.OriginatingUSN == changeRecord.ChangeID.OriginatingUSN ) + { + changeRecordBase = changeRecordCorrection.ChangeRecord.Payload; + } + } + + changeRecord.Payload = changeRecordBase; + } + finally + { + stringReader.Close(); + } + } + } + finally + { + reader.Close(); + } + + return changeRecord; + } + + void DisplayChangeRecord( ChangeRecord changeRecord ) + { + UTF8EncodedStringWriter writer = new UTF8EncodedStringWriter(); + changeRecordSerializer.Serialize( writer, changeRecord ); + writer.Close(); + + changeRecordTextBox.Text = writer.ToString(); + } + + void DisplayCorrection( ChangeRecord changeRecord ) + { + ChangeRecordCorrection changeRecordCorrection = new ChangeRecordCorrection(); + changeRecordCorrection.ChangeRecord = changeRecord; + + UTF8EncodedStringWriter writer = new UTF8EncodedStringWriter(); + correctionSerializer.Serialize( writer, changeRecordCorrection ); + writer.Close(); + + correctionTextBox.Text = writer.ToString(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/replicationadmin/correctionadmin.resx b/inetsrv/uddi/source/tools/replicationadmin/correctionadmin.resx new file mode 100644 index 0000000..87a37eb --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/correctionadmin.resx @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CorrectionAdmin + + \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/replicationadmin/makefile b/inetsrv/uddi/source/tools/replicationadmin/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/replicationadmin/makefile.inc b/inetsrv/uddi/source/tools/replicationadmin/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/replicationadmin/obj/_objects.mac b/inetsrv/uddi/source/tools/replicationadmin/obj/_objects.mac new file mode 100644 index 0000000..8abacfd --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/obj/_objects.mac @@ -0,0 +1,36 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\adminframe.obj \ + $(_OBJ_DIR)\i386\changelogcontrol.obj \ + $(_OBJ_DIR)\i386\correctionadmin.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\adminframe.obj \ + $(_OBJ_DIR)\ia64\changelogcontrol.obj \ + $(_OBJ_DIR)\ia64\correctionadmin.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\adminframe.obj \ + $(_OBJ_DIR)\amd64\changelogcontrol.obj \ + $(_OBJ_DIR)\amd64\correctionadmin.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\adminframe.obj \ + $(_OBJ_DIR)\arm\changelogcontrol.obj \ + $(_OBJ_DIR)\arm\correctionadmin.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/replicationadmin/obj/i386/replicationadmin.exe b/inetsrv/uddi/source/tools/replicationadmin/obj/i386/replicationadmin.exe new file mode 100644 index 0000000..02b2df7 Binary files /dev/null and b/inetsrv/uddi/source/tools/replicationadmin/obj/i386/replicationadmin.exe differ diff --git a/inetsrv/uddi/source/tools/replicationadmin/obj/i386/replicationadmin.pdb b/inetsrv/uddi/source/tools/replicationadmin/obj/i386/replicationadmin.pdb new file mode 100644 index 0000000..560b6af Binary files /dev/null and b/inetsrv/uddi/source/tools/replicationadmin/obj/i386/replicationadmin.pdb differ diff --git a/inetsrv/uddi/source/tools/replicationadmin/placefil.txt b/inetsrv/uddi/source/tools/replicationadmin/placefil.txt new file mode 100644 index 0000000..b20101d --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/placefil.txt @@ -0,0 +1 @@ +replicationadmin.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/replicationadmin/replicationadmin.csproj b/inetsrv/uddi/source/tools/replicationadmin/replicationadmin.csproj new file mode 100644 index 0000000..b5924da --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/replicationadmin.csproj @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/replicationadmin/replicationadmin.snk b/inetsrv/uddi/source/tools/replicationadmin/replicationadmin.snk new file mode 100644 index 0000000..e636d08 Binary files /dev/null and b/inetsrv/uddi/source/tools/replicationadmin/replicationadmin.snk differ diff --git a/inetsrv/uddi/source/tools/replicationadmin/sources b/inetsrv/uddi/source/tools/replicationadmin/sources new file mode 100644 index 0000000..638c3f9 --- /dev/null +++ b/inetsrv/uddi/source/tools/replicationadmin/sources @@ -0,0 +1,52 @@ +# +# sources file for a managed code DLL +# +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=replicationadmin +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console + +SYNCHRONIZE_PASS2_BLOCK=1 + +# +# tell the system to build each resources file +# +NTTARGETFILE1 = \ + foo.cs + +# +# user supplied csc.exe cmd line params, so specify the resgen compiled +# resources files here. +# +#USER_CS_FLAGS = \ +# /resource:$(O)\adminframe.resources \ +# /resource:$(O)\changelogcontrol.resources \ +# /resource:$(O)\correctionadmin.resources + +# +# add all the other assembly references here +# +REFERENCES = \ + system.dll, \ + system.data.dll, \ + system.drawing.dll, \ + system.windows.forms.dll, \ + system.xml.dll , \ + ..\..\api\obj\*\uddi.api.dll, \ + ..\..\core\obj\*\uddi.core.dll, \ + ..\..\operator\obj\*\uddi.operator.dll + +# +# csharp source code +# +SOURCES = \ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + adminframe.cs \ + changelogcontrol.cs \ + correctionadmin.cs \ + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/tools/resetkey/assemblyinfo.cs b/inetsrv/uddi/source/tools/resetkey/assemblyinfo.cs new file mode 100644 index 0000000..621a0dd --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("resetkey.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/resetkey/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/resetkey/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/resetkey/build.log b/inetsrv/uddi/source/tools/resetkey/build.log new file mode 100644 index 0000000..20b9fda --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/build.log @@ -0,0 +1,25 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\tools\resetkey directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\tools\resetkey directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\resetkey +Elapsed time [0:00:00.016] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 resetkey D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module resetkey not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\tools\resetkey directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 resetkey D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module resetkey not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\resetkey.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll resetkey.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\tools\resetkey\obj\i386\resetkey.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:00.750] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/tools/resetkey/makefile b/inetsrv/uddi/source/tools/resetkey/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/resetkey/makefile.inc b/inetsrv/uddi/source/tools/resetkey/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/resetkey/obj/_objects.mac b/inetsrv/uddi/source/tools/resetkey/obj/_objects.mac new file mode 100644 index 0000000..b66d257 --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\resetkey.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\resetkey.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\resetkey.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\resetkey.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/resetkey/obj/i386/resetkey.exe b/inetsrv/uddi/source/tools/resetkey/obj/i386/resetkey.exe new file mode 100644 index 0000000..23f1aa8 Binary files /dev/null and b/inetsrv/uddi/source/tools/resetkey/obj/i386/resetkey.exe differ diff --git a/inetsrv/uddi/source/tools/resetkey/obj/i386/resetkey.pdb b/inetsrv/uddi/source/tools/resetkey/obj/i386/resetkey.pdb new file mode 100644 index 0000000..6f5ef9a Binary files /dev/null and b/inetsrv/uddi/source/tools/resetkey/obj/i386/resetkey.pdb differ diff --git a/inetsrv/uddi/source/tools/resetkey/placefil.txt b/inetsrv/uddi/source/tools/resetkey/placefil.txt new file mode 100644 index 0000000..b9d410c --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/placefil.txt @@ -0,0 +1 @@ +resetkey.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/resetkey/resetkey.cs b/inetsrv/uddi/source/tools/resetkey/resetkey.cs new file mode 100644 index 0000000..c9ffb61 --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/resetkey.cs @@ -0,0 +1,320 @@ +using System; +using System.Globalization; +using System.Security.Cryptography; +using System.Data; +using System.Data.SqlClient; +using Microsoft.Win32; +using System.Resources; + +namespace UDDI.Tools +{ + class Resetkey + { + static bool resetnow = false; + static string key; + static string iv; + static DateTime dt = DateTime.Now; + static SqlConnection connection; + static SqlTransaction transaction; + + static int Main( string[] args ) + { + int rc = 0; // assume success + + try + { + // + // Check if CurrentUICulture needs to be overridden + // + UDDI.Localization.SetConsoleUICulture(); + + DisplayBanner(); + + // + // Parse the command line + // + if( !ProcessCommandLine( args ) ) + { + return 1; + } + + // + // Generate key and initialization vector + // + SymmetricAlgorithm sa = SymmetricAlgorithm.Create(); + + sa.GenerateKey(); + key = Convert.ToBase64String( sa.Key ); + + sa.GenerateIV(); + iv = Convert.ToBase64String( sa.IV ); + + // + // Save config information + // + if( resetnow ) + { + ResetKeysNow(); + } + else + { + ResetKeysScheduled(); + } + } + catch( Exception e ) + { + Console.WriteLine( FormatFromResource( "RESETKEY_FAILED" , e.Message ) ); + rc = 1; + } + + + return rc; + } + + private static bool ProcessCommandLine( string [] args ) + { + bool bOK = false; + + if ( args.Length > 0 ) + { + for( int i = 0; i < args.Length; i ++ ) + { + if( '-' == args[i][0] || '/' == args[i][0] ) + { + string option = args[i].Substring( 1 ); + + if( "help" == option.ToLower() || "?" == option ) + { + DisplayUsage(); + return false; + } + if( "now" == option.ToLower() ) + { + i++; // move to the next arg + resetnow = true; + bOK = true; + } + } + } + } + else + bOK = true; + + if( !bOK ) + { + DisplayUsage(); + return false; + } + + return true; + } + + static void DisplayBanner() + { + Console.WriteLine( FormatFromResource( "RESETKEY_COPYRIGHT_1" ) ); + Console.WriteLine( FormatFromResource( "RESETKEY_COPYRIGHT_2" ) ); + Console.WriteLine(); + } + + static void DisplayUsage() + { + Console.WriteLine( FormatFromResource( "RESETKEY_USAGE_1" ) ); + Console.WriteLine( FormatFromResource( "RESETKEY_USAGE_2" ) ); + Console.WriteLine( FormatFromResource( "RESETKEY_USAGE_3" ) ); + Console.WriteLine(); + } + + static void OpenConnection() + { + try + { + string connectionectionString = (string) Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\UDDI\Database" ).GetValue( "WriterConnectionString" ); + connection = new SqlConnection( connectionectionString ); + connection.Open(); + transaction = connection.BeginTransaction( IsolationLevel.ReadCommitted, "resetkey" ); + } + catch + { + throw new Exception( "Unable to connect to the database" ); + } + } + + static void CloseConnection() + { + transaction.Commit(); + connection.Close(); + } + + static void SaveConfig(string configname, string configvalue) + { + // + // Save configuration info + // + + SqlCommand cmd = new SqlCommand( "net_config_save", connection, transaction ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.Add( new SqlParameter( "@configName", SqlDbType.NVarChar, UDDI.Constants.Lengths.ConfigName ) ).Direction = ParameterDirection.Input; + cmd.Parameters[ "@configName" ].Value = configname; + cmd.Parameters.Add( new SqlParameter( "@configValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.ConfigValue ) ).Direction = ParameterDirection.Input; + cmd.Parameters[ "@configValue" ].Value = configvalue; + + cmd.ExecuteNonQuery(); + } + + static void ResetKeysNow() + { + OpenConnection(); + + try + { + // + // 739955 - Make sure date is parsed in the same format it was written. + // + UDDILastResetDate.Set( dt ); + + SaveConfig( "Security.Key", key ); + SaveConfig( "Security.IV", iv ); + + Console.WriteLine( FormatFromResource( "RESETKEY_SUCCEEDED" ) ); + } + finally + { + CloseConnection(); + } + + return; + } + + static void ResetKeysScheduled() + { + OpenConnection(); + + try + { + // + // Get config values + // + SqlCommand cmd = new SqlCommand( "net_config_get", connection, transaction ); + SqlDataReader rdr = cmd.ExecuteReader( CommandBehavior.SingleResult ); + + // + // Iterate through results and populate variables + // + string configname; + string configvalue; + int timeoutdays = 0; + DateTime olddt = DateTime.Now; + int autoreset = 1; + + while( rdr.Read() ) + { + configname = ""; + configvalue = ""; + + if( !rdr.IsDBNull( 0 ) ) + configname = rdr.GetString(0); + if (!rdr.IsDBNull( 1 )) + configvalue = rdr.GetString(1); + + // + // TODO: Use ToInt32 here please + // + switch( configname ) + { + case "Security.KeyTimeout": + timeoutdays = Convert.ToInt16( configvalue ); + break; + case "Security.KeyLastResetDate": + { + // + // 739955 - Make sure date is parsed in the same format it was written. + // + olddt = UDDILastResetDate.Get(); + + break; + } + case "Security.KeyAutoReset": + autoreset = Convert.ToInt16 ( configvalue ); + break; + } + } + + rdr.Close(); + + Console.WriteLine( FormatFromResource( "RESETKEY_EXISTING_SETTINGS" ) ); + Console.WriteLine( "Security.KeyAutoReset = " + autoreset.ToString() ); + Console.WriteLine( "Security.KeyTimeout = " + timeoutdays.ToString() ); + + // + // 661537 - Output the date in the correct format for the user. + // + Console.WriteLine( "Security.KeyLastResetDate = " + olddt.ToShortDateString() + " " + olddt.ToShortTimeString() + "\n" ); + + // + // Check Security.KeyAutoReset + // + if( 1 != autoreset ) + { + Console.WriteLine( FormatFromResource( "RESETKEY_AUTO_RESET_1" ) ); + Console.WriteLine( FormatFromResource( "RESETKEY_AUTO_RESET_2" ) ); + return; + } + + // + // Check dates to determine if key has expired + // + DateTime expiration = olddt.AddDays( timeoutdays ); + + if( dt <= expiration ) + { + // + // 661537 - Output the date in the correct format for the user. + // + Console.WriteLine( FormatFromResource( "RESETKEY_KEY_EXPIRE_NOTE_1", expiration.ToShortDateString() + " " + expiration.ToShortTimeString() ) ); + Console.WriteLine( FormatFromResource( "RESETKEY_KEY_EXPIRE_NOTE_2" ) ); + return; + } + + // + // Write config values + // + + // + // 739955 - Make sure date is parsed in the same format it was written. + // + UDDILastResetDate.Set( dt ); + + SaveConfig( "Security.Key", key ); + SaveConfig( "Security.IV", iv ); + + Console.WriteLine( FormatFromResource( "RESETKEY_SUCCEEDED" ) ); + } + finally + { + CloseConnection(); + } + + return; + } + + static string FormatFromResource( string resID, params object[] inserts ) + { + try + { + string resourceStr = UDDI.Localization.GetString( resID ); + if( null != resourceStr ) + { + string resultStr = string.Format( resourceStr, inserts ); + return resultStr; + } + + return "String not specified in the resources: " + resID; + } + catch( Exception e ) + { + return "FormatFromResource failed to load the resource string for ID: " + resID + " Reason: " + e.Message; + } + } + } +} diff --git a/inetsrv/uddi/source/tools/resetkey/resetkey.csproj b/inetsrv/uddi/source/tools/resetkey/resetkey.csproj new file mode 100644 index 0000000..81a454b --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/resetkey.csproj @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/resetkey/resetkey.snk b/inetsrv/uddi/source/tools/resetkey/resetkey.snk new file mode 100644 index 0000000..1cd02b6 Binary files /dev/null and b/inetsrv/uddi/source/tools/resetkey/resetkey.snk differ diff --git a/inetsrv/uddi/source/tools/resetkey/sources b/inetsrv/uddi/source/tools/resetkey/sources new file mode 100644 index 0000000..c0d7742 --- /dev/null +++ b/inetsrv/uddi/source/tools/resetkey/sources @@ -0,0 +1,20 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=resetkey +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES= ..\..\core\obj\*\uddi.core.dll + +SOURCES=\ + resetkey.cs \ + assemblyversioninfo.cs \ + assemblyinfo.cs + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/send/assemblyinfo.cs b/inetsrv/uddi/source/tools/send/assemblyinfo.cs new file mode 100644 index 0000000..458b989 --- /dev/null +++ b/inetsrv/uddi/source/tools/send/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("send.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/send/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/send/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/send/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/send/build.log b/inetsrv/uddi/source/tools/send/build.log new file mode 100644 index 0000000..fa0565b --- /dev/null +++ b/inetsrv/uddi/source/tools/send/build.log @@ -0,0 +1,25 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\tools\send directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\tools\send directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\send +Elapsed time [0:00:00.000] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 send D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module send not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\tools\send directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 send D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module send not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\send.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll,..\..\api\obj\I386\uddi.api.dll uddisend.cs assemblyversioninfo.cs assemblyinfo.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\tools\send\obj\i386\send.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:00.703] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/tools/send/makefile b/inetsrv/uddi/source/tools/send/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/send/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/send/makefile.inc b/inetsrv/uddi/source/tools/send/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/send/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/send/obj/_objects.mac b/inetsrv/uddi/source/tools/send/obj/_objects.mac new file mode 100644 index 0000000..2abb0b4 --- /dev/null +++ b/inetsrv/uddi/source/tools/send/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\uddisend.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\uddisend.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\uddisend.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\uddisend.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/send/obj/i386/send.exe b/inetsrv/uddi/source/tools/send/obj/i386/send.exe new file mode 100644 index 0000000..69a6e96 Binary files /dev/null and b/inetsrv/uddi/source/tools/send/obj/i386/send.exe differ diff --git a/inetsrv/uddi/source/tools/send/obj/i386/send.pdb b/inetsrv/uddi/source/tools/send/obj/i386/send.pdb new file mode 100644 index 0000000..096030e Binary files /dev/null and b/inetsrv/uddi/source/tools/send/obj/i386/send.pdb differ diff --git a/inetsrv/uddi/source/tools/send/placefil.txt b/inetsrv/uddi/source/tools/send/placefil.txt new file mode 100644 index 0000000..5326e37 --- /dev/null +++ b/inetsrv/uddi/source/tools/send/placefil.txt @@ -0,0 +1 @@ +send.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/send/send.csproj b/inetsrv/uddi/source/tools/send/send.csproj new file mode 100644 index 0000000..660ca55 --- /dev/null +++ b/inetsrv/uddi/source/tools/send/send.csproj @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/send/send.snk b/inetsrv/uddi/source/tools/send/send.snk new file mode 100644 index 0000000..68cbdcb Binary files /dev/null and b/inetsrv/uddi/source/tools/send/send.snk differ diff --git a/inetsrv/uddi/source/tools/send/sources b/inetsrv/uddi/source/tools/send/sources new file mode 100644 index 0000000..9ddf34a --- /dev/null +++ b/inetsrv/uddi/source/tools/send/sources @@ -0,0 +1,20 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=send +TARGETPATH=obj +TARGETTYPE=PROGRAM +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + + +REFERENCES= ..\..\core\obj\*\uddi.core.dll, ..\..\api\obj\*\uddi.api.dll + +SOURCES=\ + uddisend.cs \ + assemblyversioninfo.cs \ + assemblyinfo.cs + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/tools/send/uddisend.cs b/inetsrv/uddi/source/tools/send/uddisend.cs new file mode 100644 index 0000000..e4d107b --- /dev/null +++ b/inetsrv/uddi/source/tools/send/uddisend.cs @@ -0,0 +1,277 @@ +using System; +using System.Net; +using System.IO; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Xml; + +namespace UDDI.Tools +{ + class UDDISend + { + public enum AuthenticationType + { + Uninitialized = 0, + WindowsAuthentication = 1, + UDDIAuthentication = 2, + ClientCertificateAuthentication = 3 + } + + public const int BlockSize = 4096; + + public static AuthenticationType AuthType = AuthenticationType.Uninitialized; + + public static string Url = null; + public static string MessageFilename = null; + public static string CertificateFilename = null; + + public static void Main( string[] args ) + { + Console.WriteLine( "Microsoft (R) UDDI Send Utility" ); + Console.WriteLine( "Copyright (C) Microsoft Corp. 2002. All rights reserved.\r\n" ); + + try + { + ProcessCommandLine( args ); + + // + // Retrieve the input data from the specified file + // + Console.Write( "Loading '" + MessageFilename + "'... "); + + FileStream f = new FileStream( MessageFilename, FileMode.Open, FileAccess.Read ); + + System.IO.BinaryReader br = new BinaryReader( f ); + byte[] cbInput = new byte[ BlockSize ]; + int n = 0; + int nTotal = 0; + HttpWebRequest req = (HttpWebRequest) HttpWebRequest.Create( Url ); + req.Timeout = -1; + + if( AuthenticationType.WindowsAuthentication == AuthType ) + { + req.Credentials = CredentialCache.DefaultCredentials; + req.PreAuthenticate = true; + } + else if( AuthenticationType.ClientCertificateAuthentication == AuthType ) + { + req.ClientCertificates.Add( X509Certificate.CreateFromCertFile( CertificateFilename ) ); + } + + // + // Populate the request data from the input file + // + req.Method = "POST"; + req.ContentType = "text/xml; charset=\"utf-8\""; + req.ContentLength = f.Length; + req.Headers.Add( "SOAPAction", "\"\"" ); + + n = br.Read( cbInput, 0, BlockSize ); + + while( n > 0 ) + { + nTotal += n; + req.GetRequestStream().Write( cbInput, 0, n ); + n = br.Read( cbInput, 0, BlockSize ); + } + + Console.WriteLine( "done." ); + Console.Write( "Transmitting... " ); + + Stream strmResponse; + HttpWebResponse result; + + try + { + result = (HttpWebResponse) req.GetResponse(); + Console.WriteLine( "done." ); + } + catch( WebException we ) + { + Console.WriteLine( "error." ); + + result = (HttpWebResponse) we.Response; + Console.WriteLine( "\r\nException: {0}", we.ToString() ); + } + + // + // Write the results to the standard output + // + Console.Write( "\r\nResponse stream received\r\nStatus code: " + result.StatusCode ); + Console.Write( "\r\nStatus Description: " + result.StatusDescription ); + + strmResponse = result.GetResponseStream(); + + Byte[] cbRead = new Byte[ 512 ]; + BinaryReader br1 = new BinaryReader( strmResponse ); + int nBytesRead = br1.Read( cbRead, 0, 512 ); + + Console.WriteLine("\r\n\r\nXML:\r\n"); + + FileStream file = new FileStream( "output.xml", System.IO.FileMode.Create ); + BinaryWriter strm = new BinaryWriter( file, System.Text.Encoding.UTF8 ); + + while( nBytesRead > 0 ) + { + Console.Write( System.Text.Encoding.UTF8.GetString( cbRead, 0, nBytesRead ) ); + strm.Write( cbRead, 0, nBytesRead ); + + nBytesRead = br1.Read( cbRead, 0, 512 ); + } + + strm.Close(); + + Console.WriteLine(""); + } + catch( CommandLineException e ) + { + if( null != e.Message && e.Message.Length > 0 ) + { + Console.WriteLine( e.Message ); + Console.WriteLine(); + } + else + { + DisplayUsage(); + } + } + catch( Exception e ) + { + Console.WriteLine ("Exception: {0}", e.ToString()); + } + + return; + } + + internal static void ProcessCommandLine( string[] args ) + { + int i = 0; + + if( 0 == args.Length ) + throw new CommandLineException(); + + while( i < args.Length ) + { + if( "-" == args[ i ].Substring( 0, 1 ) || "/" == args[ i ].Substring( 0, 1 ) ) + { + switch( args[ i ].Substring( 1 ).ToLower() ) + { + case "w": + AuthType = AuthenticationType.WindowsAuthentication; + Console.WriteLine( "Including Windows Authentication credentials\r\n" ); + + break; + + case "u": + AuthType = AuthenticationType.UDDIAuthentication; + Console.WriteLine( "Using UDDI Authentication -- no credentials included\r\n" ); + + break; + + case "c": + if( i + 1 >= args.Length ) + throw new CommandLineException( "Missing required parameter 'CertificateFilename'." ); + + i ++; + + if( !File.Exists( args[ i ] ) ) + throw new CommandLineException( "Certificate file '" + args[ i ] + "' does not exist." ); + + AuthType = AuthenticationType.ClientCertificateAuthentication; + CertificateFilename = args[ i ]; + + Console.WriteLine( "Using client certificate '" + CertificateFilename + "' for authentication.\r\n" ); + + break; + + case "?": + throw new CommandLineException(); + + default: + throw new CommandLineException( "Invalid switch." ); + } + } + else + { + if( null == Url ) + Url = args[ i ]; + else if( null == MessageFilename ) + MessageFilename = args[ i ]; + else + throw new CommandLineException( "Too many command line parameters." ); + } + + i ++; + } + + if( null == Url ) + throw new CommandLineException( "Missing required parameter 'URL'." ); + + if( null == MessageFilename ) + throw new CommandLineException( "Missing required parameter 'InputFile'." ); + + if( AuthenticationType.Uninitialized == AuthType ) + { + AuthType = AuthenticationType.UDDIAuthentication; + Console.WriteLine( "Using UDDI Authentication -- no credentials included\r\n" ); + } + } + + public static void DisplayUsage() + { + Console.WriteLine( "Sends a UDDI message to a specific URL." ); + Console.WriteLine( "\r\nUsage:" ); + Console.WriteLine( "\tsend [switches] URL InputFile" ); + Console.WriteLine( "\r\nSwitches:" ); + Console.WriteLine( "\t-w Windows authentication" ); + Console.WriteLine( "\t-u UDDI authentication (default)" ); + Console.WriteLine( "\t-c Client certificate authentication" ); + Console.WriteLine( "\r\nExamples:" ); + Console.WriteLine( "\tsend -w http://uddi.microsoft.com/inquire c:\\somefile.xml" ); + Console.WriteLine( "\tsend -u https://test.uddi.microsoft.com/publish c:\\somefile.xml" ); + Console.WriteLine( "\tsend -c uddi.cer https://uddi.microsoft.com/operator c:\\somefile.xml" ); + } + + /// **************************************************************** + /// public class CommandLineException + /// ---------------------------------------------------------------- + /// + /// Exception class for errors encountered while parsing the + /// command-line. + /// + /// **************************************************************** + /// + public class CommandLineException : ApplicationException + { + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ************************************************************ + /// + public CommandLineException() + : base( "" ) + { + } + + /// ************************************************************ + /// public CommandLineException [constructor] + /// ------------------------------------------------------------ + /// + /// CommandLineException constructor. + /// + /// ------------------------------------------------------------ + /// + /// Exception message. + /// + /// ************************************************************ + /// + public CommandLineException( string message ) + : base( message ) + { + } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/tools.sln b/inetsrv/uddi/source/tools/tools.sln new file mode 100644 index 0000000..f634752 --- /dev/null +++ b/inetsrv/uddi/source/tools/tools.sln @@ -0,0 +1,257 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "..\api\api.csproj", "{11742B5A-F929-4DA7-8378-F82AB3B69491}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "core", "..\core\core.csproj", "{C792705F-C4F9-41F7-AE03-B9C87FAD9151}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "operator", "..\operator\operator.csproj", "{D6075C1E-793D-4AAC-8E9F-D6765A013C9E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bootstrap", "bootstrap\bootstrap.csproj", "{241E0512-30BD-44B6-8313-CAEC59AC57A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "send", "send\send.csproj", "{F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resetkey", "resetkey\resetkey.csproj", "{02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rcf", "rcf\rcf.csproj", "{FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "validate", "validate\validate.csproj", "{3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "monitor", "monitor\monitor.csproj", "{C79124C5-432B-4CAD-A3D2-A88127E56519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "migrate", "migrate\migrate.csproj", "{1BEC123B-825B-4B54-9106-6071504AA5DD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "replicationadmin", "replicationadmin\replicationadmin.csproj", "{775BEDF2-393D-4173-83B8-17DCCC1F94A7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fixdefaulturl", "fixdefaulturl\fixdefaulturl.csproj", "{3978BC73-2761-4FEF-9ADD-61CA876E69AC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "recalcstats", "recalcstats\recalcstats.csproj", "{F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Debug (with Setup) + ConfigName.2 = Release + ConfigName.3 = Release (with Setup) + ConfigName.4 = Unicode Debug + ConfigName.5 = Unicode Release + ConfigName.6 = Unicode Release MinSize + ConfigName.7 = web + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.0 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + {11742B5A-F929-4DA7-8378-F82AB3B69491}.1 = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.ActiveCfg = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug.Build.0 = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug (with Setup).ActiveCfg = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug (with Setup).Build.0 = Debug|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release.Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release (with Setup).ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release (with Setup).Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Debug.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Debug.Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release.Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release MinSize.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release MinSize.Build.0 = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.web.ActiveCfg = Release|.NET + {11742B5A-F929-4DA7-8378-F82AB3B69491}.web.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.ActiveCfg = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug.Build.0 = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug (with Setup).ActiveCfg = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug (with Setup).Build.0 = Debug|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release (with Setup).ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release (with Setup).Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Debug.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Debug.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release MinSize.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release MinSize.Build.0 = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.web.ActiveCfg = Release|.NET + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.web.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug.ActiveCfg = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug.Build.0 = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug (with Setup).ActiveCfg = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug (with Setup).Build.0 = Debug|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release (with Setup).ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release (with Setup).Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Debug.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Debug.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release MinSize.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release MinSize.Build.0 = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.web.ActiveCfg = Release|.NET + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.web.Build.0 = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Debug.ActiveCfg = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Debug.Build.0 = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Debug (with Setup).ActiveCfg = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Debug (with Setup).Build.0 = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Release.ActiveCfg = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Release.Build.0 = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Release (with Setup).ActiveCfg = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Release (with Setup).Build.0 = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Unicode Debug.ActiveCfg = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Unicode Debug.Build.0 = Debug|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Unicode Release.ActiveCfg = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Unicode Release.Build.0 = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Unicode Release MinSize.ActiveCfg = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.Unicode Release MinSize.Build.0 = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.web.ActiveCfg = Release|.NET + {241E0512-30BD-44B6-8313-CAEC59AC57A9}.web.Build.0 = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Debug.ActiveCfg = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Debug.Build.0 = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Debug (with Setup).ActiveCfg = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Debug (with Setup).Build.0 = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Release.ActiveCfg = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Release.Build.0 = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Release (with Setup).ActiveCfg = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Release (with Setup).Build.0 = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Unicode Debug.ActiveCfg = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Unicode Debug.Build.0 = Debug|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Unicode Release.ActiveCfg = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Unicode Release.Build.0 = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Unicode Release MinSize.ActiveCfg = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.Unicode Release MinSize.Build.0 = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.web.ActiveCfg = Release|.NET + {F9CEC503-F822-43A6-817A-F2BBB3EEB9B2}.web.Build.0 = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Debug.ActiveCfg = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Debug.Build.0 = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Debug (with Setup).ActiveCfg = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Debug (with Setup).Build.0 = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Release.ActiveCfg = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Release.Build.0 = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Release (with Setup).ActiveCfg = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Release (with Setup).Build.0 = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Unicode Debug.ActiveCfg = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Unicode Debug.Build.0 = Debug|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Unicode Release.ActiveCfg = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Unicode Release.Build.0 = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Unicode Release MinSize.ActiveCfg = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.Unicode Release MinSize.Build.0 = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.web.ActiveCfg = Release|.NET + {02B859D7-2ABB-4528-8CC0-8AAE6630ABD1}.web.Build.0 = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Debug.ActiveCfg = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Debug.Build.0 = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Debug (with Setup).ActiveCfg = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Debug (with Setup).Build.0 = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Release.ActiveCfg = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Release.Build.0 = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Release (with Setup).ActiveCfg = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Release (with Setup).Build.0 = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Unicode Debug.ActiveCfg = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Unicode Debug.Build.0 = Debug|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Unicode Release.ActiveCfg = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Unicode Release.Build.0 = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Unicode Release MinSize.ActiveCfg = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.Unicode Release MinSize.Build.0 = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.web.ActiveCfg = Release|.NET + {FC0CC85C-BBE6-4788-8DCF-3F7329C5B38A}.web.Build.0 = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Debug.ActiveCfg = Debug|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Debug.Build.0 = Debug|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Debug (with Setup).ActiveCfg = Debug|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Debug (with Setup).Build.0 = Debug|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Release.ActiveCfg = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Release.Build.0 = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Release (with Setup).ActiveCfg = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Release (with Setup).Build.0 = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Unicode Debug.ActiveCfg = Debug|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Unicode Debug.Build.0 = Debug|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Unicode Release.ActiveCfg = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Unicode Release.Build.0 = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Unicode Release MinSize.ActiveCfg = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.Unicode Release MinSize.Build.0 = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.web.ActiveCfg = Release|.NET + {3D2D4BFD-1FAA-4E40-AF87-2A21882019E9}.web.Build.0 = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Debug.ActiveCfg = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Debug.Build.0 = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Debug (with Setup).ActiveCfg = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Debug (with Setup).Build.0 = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Release.ActiveCfg = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Release.Build.0 = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Release (with Setup).ActiveCfg = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Release (with Setup).Build.0 = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Unicode Debug.ActiveCfg = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Unicode Debug.Build.0 = Debug|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Unicode Release.ActiveCfg = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Unicode Release.Build.0 = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Unicode Release MinSize.ActiveCfg = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.Unicode Release MinSize.Build.0 = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.web.ActiveCfg = Release|.NET + {C79124C5-432B-4CAD-A3D2-A88127E56519}.web.Build.0 = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Debug.ActiveCfg = Debug|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Debug.Build.0 = Debug|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Debug (with Setup).ActiveCfg = Debug|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Debug (with Setup).Build.0 = Debug|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Release.ActiveCfg = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Release.Build.0 = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Release (with Setup).ActiveCfg = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Release (with Setup).Build.0 = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Unicode Debug.ActiveCfg = Debug|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Unicode Debug.Build.0 = Debug|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Unicode Release.ActiveCfg = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Unicode Release.Build.0 = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Unicode Release MinSize.ActiveCfg = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.Unicode Release MinSize.Build.0 = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.web.ActiveCfg = Release|.NET + {1BEC123B-825B-4B54-9106-6071504AA5DD}.web.Build.0 = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Debug.ActiveCfg = Debug|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Debug.Build.0 = Debug|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Debug (with Setup).ActiveCfg = Debug|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Debug (with Setup).Build.0 = Debug|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Release.ActiveCfg = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Release.Build.0 = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Release (with Setup).ActiveCfg = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Release (with Setup).Build.0 = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Unicode Debug.ActiveCfg = Debug|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Unicode Debug.Build.0 = Debug|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Unicode Release.ActiveCfg = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Unicode Release.Build.0 = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Unicode Release MinSize.ActiveCfg = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.Unicode Release MinSize.Build.0 = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.web.ActiveCfg = Release|.NET + {775BEDF2-393D-4173-83B8-17DCCC1F94A7}.web.Build.0 = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Debug.ActiveCfg = Debug|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Debug.Build.0 = Debug|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Debug (with Setup).ActiveCfg = Debug|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Debug (with Setup).Build.0 = Debug|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Release.ActiveCfg = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Release.Build.0 = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Release (with Setup).ActiveCfg = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Release (with Setup).Build.0 = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Unicode Debug.ActiveCfg = Debug|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Unicode Debug.Build.0 = Debug|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Unicode Release.ActiveCfg = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Unicode Release.Build.0 = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Unicode Release MinSize.ActiveCfg = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.Unicode Release MinSize.Build.0 = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.web.ActiveCfg = Release|.NET + {3978BC73-2761-4FEF-9ADD-61CA876E69AC}.web.Build.0 = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Debug.ActiveCfg = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Debug.Build.0 = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Debug (with Setup).ActiveCfg = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Debug (with Setup).Build.0 = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Release.ActiveCfg = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Release.Build.0 = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Release (with Setup).ActiveCfg = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Release (with Setup).Build.0 = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Unicode Debug.ActiveCfg = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Unicode Debug.Build.0 = Debug|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Unicode Release.ActiveCfg = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Unicode Release.Build.0 = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Unicode Release MinSize.ActiveCfg = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.Unicode Release MinSize.Build.0 = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.web.ActiveCfg = Release|.NET + {F9621465-FDB6-4BE2-A34D-4F2907B3CFC2}.web.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/inetsrv/uddi/source/tools/validate/assemblyinfo.cs b/inetsrv/uddi/source/tools/validate/assemblyinfo.cs new file mode 100644 index 0000000..e9c867e --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("validate.exe")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/validate/assemblyversioninfo.cs b/inetsrv/uddi/source/tools/validate/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/tools/validate/build.log b/inetsrv/uddi/source/tools/validate/build.log new file mode 100644 index 0000000..3aa676e --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/build.log @@ -0,0 +1,25 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\tools\validate directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\tools\validate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\tools\validate +Elapsed time [0:00:00.000] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 validate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module validate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\tools\validate directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 validate D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module validate not found in D:\OpenXP\Tools\coffbase.txt +1> ..\..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1>csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:exe /out:obj\i386\validate.exe /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:..\..\core\obj\I386\uddi.core.dll assemblyinfo.cs assemblyversioninfo.cs validate.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\tools\validate\obj\i386\validate.exe +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:01.578] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/tools/validate/makefile b/inetsrv/uddi/source/tools/validate/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/tools/validate/makefile.inc b/inetsrv/uddi/source/tools/validate/makefile.inc new file mode 100644 index 0000000..0d1f2ec --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/tools/validate/obj/_objects.mac b/inetsrv/uddi/source/tools/validate/obj/_objects.mac new file mode 100644 index 0000000..054f75b --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\validate.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\validate.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\validate.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\validate.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/tools/validate/obj/i386/validate.exe b/inetsrv/uddi/source/tools/validate/obj/i386/validate.exe new file mode 100644 index 0000000..8ce0f1e Binary files /dev/null and b/inetsrv/uddi/source/tools/validate/obj/i386/validate.exe differ diff --git a/inetsrv/uddi/source/tools/validate/obj/i386/validate.pdb b/inetsrv/uddi/source/tools/validate/obj/i386/validate.pdb new file mode 100644 index 0000000..6364615 Binary files /dev/null and b/inetsrv/uddi/source/tools/validate/obj/i386/validate.pdb differ diff --git a/inetsrv/uddi/source/tools/validate/placefil.txt b/inetsrv/uddi/source/tools/validate/placefil.txt new file mode 100644 index 0000000..0a303d0 --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/placefil.txt @@ -0,0 +1 @@ +validate.exe uddi\bin diff --git a/inetsrv/uddi/source/tools/validate/sources b/inetsrv/uddi/source/tools/validate/sources new file mode 100644 index 0000000..d97f1b0 --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/sources @@ -0,0 +1,19 @@ +MANAGED_CODE=1 +URT_VER=1.1 +TARGETNAME=validate +TARGETTYPE=PROGRAM +TARGETPATH=obj +UMTYPE=console +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + +REFERENCES=..\..\core\obj\*\uddi.core.dll + +SOURCES=\ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + validate.cs + + +BINPLACE_PLACEFILE=placefil.txt \ No newline at end of file diff --git a/inetsrv/uddi/source/tools/validate/validate.cs b/inetsrv/uddi/source/tools/validate/validate.cs new file mode 100644 index 0000000..64f1428 --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/validate.cs @@ -0,0 +1,43 @@ +using System; +using System.IO; +using UDDI.Diagnostics; + +class UDDIValidate +{ + static void Main(string[] args) + { + if( args.Length < 1 ) + { + usage(); + return; + } + + try + { + Debug.Verify( + File.Exists( args[ 0 ] ), + "UDDI_ERROR_FATALERROR_TOOLS_VALIDATE_MISSIGFILE", + UDDI.ErrorType.E_fatalError, + args[ 0 ] + ); + Console.WriteLine( "Validating {0}...", args[0] ); + UDDI.SchemaCollection.ValidateFile( args[0] ); + Console.WriteLine( "{0} successfully validated", args[ 0 ] ); + } + catch( Exception e ) + { + Console.WriteLine( "Exception: {0}", e.ToString() ); + } + + return; + } + + public static void usage() + { + Console.WriteLine("Attempts to validate an XML file against the UDDI schema"); + Console.WriteLine("\r\nUsage:"); + Console.WriteLine("\r\nvalidate InputFile"); + Console.WriteLine("\r\nExamples:"); + Console.WriteLine("\r\nvalidate c:\\somefile.xml"); + } +} diff --git a/inetsrv/uddi/source/tools/validate/validate.csproj b/inetsrv/uddi/source/tools/validate/validate.csproj new file mode 100644 index 0000000..1bde01d --- /dev/null +++ b/inetsrv/uddi/source/tools/validate/validate.csproj @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/tools/validate/validate.snk b/inetsrv/uddi/source/tools/validate/validate.snk new file mode 100644 index 0000000..fb4cff5 Binary files /dev/null and b/inetsrv/uddi/source/tools/validate/validate.snk differ diff --git a/inetsrv/uddi/source/uddi.sln b/inetsrv/uddi/source/uddi.sln new file mode 100644 index 0000000..ff7da3f --- /dev/null +++ b/inetsrv/uddi/source/uddi.sln @@ -0,0 +1,102 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.1.11304.174 d18.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "api\api.csproj", "{11742B5A-F929-4DA7-8378-F82AB3B69491}" + ProjectSection(ProjectDependencies) = postProject + {C792705F-C4F9-41F7-AE03-B9C87FAD9151} = {C792705F-C4F9-41F7-AE03-B9C87FAD9151} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "core", "core\core.csproj", "{C792705F-C4F9-41F7-AE03-B9C87FAD9151}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "filter", "filter\filter.vcxproj", "{70731D7E-08C5-4555-9707-71665BFC642A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "web", "web\web.csproj", "{BF191EA0-B0CF-4502-A290-A183AC71998F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "operator", "operator\operator.csproj", "{D6075C1E-793D-4AAC-8E9F-D6765A013C9E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmc", "mmc\mmc.vcxproj", "{C3B4C74C-83D0-42C9-9706-B15F03BA9593}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "replicate", "replicate\replicate.csproj", "{864978F9-A5AA-4F39-BA06-CC2A66949D33}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "addwebreference", "addwebreference\addwebreference.csproj", "{D8191F63-66E7-4D6D-A718-815A76F8D799}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xp", "xp\xp.vcxproj", "{35D639CF-608C-4810-95A3-4895185E6A54}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + Unicode Debug|x86 = Unicode Debug|x86 + Unicode Release MinSize|x86 = Unicode Release MinSize|x86 + Unicode Release|x86 = Unicode Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Debug|x86.ActiveCfg = Debug|Any CPU + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Release|x86.ActiveCfg = Release|Any CPU + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Debug|x86.ActiveCfg = Release|Any CPU + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release MinSize|x86.ActiveCfg = Release|Any CPU + {11742B5A-F929-4DA7-8378-F82AB3B69491}.Unicode Release|x86.ActiveCfg = Release|Any CPU + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Debug|x86.ActiveCfg = Debug|Any CPU + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Release|x86.ActiveCfg = Release|Any CPU + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Debug|x86.ActiveCfg = Release|Any CPU + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release MinSize|x86.ActiveCfg = Release|Any CPU + {C792705F-C4F9-41F7-AE03-B9C87FAD9151}.Unicode Release|x86.ActiveCfg = Release|Any CPU + {70731D7E-08C5-4555-9707-71665BFC642A}.Debug|x86.ActiveCfg = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Debug|x86.Build.0 = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Release|x86.ActiveCfg = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Release|x86.Build.0 = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Debug|x86.ActiveCfg = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Debug|x86.Build.0 = Unicode Debug|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release MinSize|x86.ActiveCfg = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release MinSize|x86.Build.0 = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release|x86.ActiveCfg = Unicode Release|Win32 + {70731D7E-08C5-4555-9707-71665BFC642A}.Unicode Release|x86.Build.0 = Unicode Release|Win32 + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Debug|x86.ActiveCfg = Debug|Any CPU + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Release|x86.ActiveCfg = Release|Any CPU + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Debug|x86.ActiveCfg = Release|Any CPU + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Release MinSize|x86.ActiveCfg = Release|Any CPU + {BF191EA0-B0CF-4502-A290-A183AC71998F}.Unicode Release|x86.ActiveCfg = Release|Any CPU + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Debug|x86.ActiveCfg = Debug|Any CPU + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Release|x86.ActiveCfg = Release|Any CPU + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Debug|x86.ActiveCfg = Release|Any CPU + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release MinSize|x86.ActiveCfg = Release|Any CPU + {D6075C1E-793D-4AAC-8E9F-D6765A013C9E}.Unicode Release|x86.ActiveCfg = Release|Any CPU + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Debug|x86.ActiveCfg = Debug|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Debug|x86.Build.0 = Debug|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Release|x86.ActiveCfg = Release|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Release|x86.Build.0 = Release|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Unicode Debug|x86.ActiveCfg = Release|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Unicode Debug|x86.Build.0 = Release|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Unicode Release MinSize|x86.ActiveCfg = Release|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Unicode Release MinSize|x86.Build.0 = Release|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Unicode Release|x86.ActiveCfg = Release|Win32 + {C3B4C74C-83D0-42C9-9706-B15F03BA9593}.Unicode Release|x86.Build.0 = Release|Win32 + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Debug|x86.ActiveCfg = Debug|Any CPU + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Release|x86.ActiveCfg = Release|Any CPU + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Debug|x86.ActiveCfg = Release|Any CPU + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Release MinSize|x86.ActiveCfg = Release|Any CPU + {864978F9-A5AA-4F39-BA06-CC2A66949D33}.Unicode Release|x86.ActiveCfg = Release|Any CPU + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Debug|x86.ActiveCfg = Debug|Any CPU + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Release|x86.ActiveCfg = Release|Any CPU + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Debug|x86.ActiveCfg = Release|Any CPU + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Release MinSize|x86.ActiveCfg = Release|Any CPU + {D8191F63-66E7-4D6D-A718-815A76F8D799}.Unicode Release|x86.ActiveCfg = Release|Any CPU + {35D639CF-608C-4810-95A3-4895185E6A54}.Debug|x86.ActiveCfg = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Debug|x86.Build.0 = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Release|x86.ActiveCfg = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Release|x86.Build.0 = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Debug|x86.ActiveCfg = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Debug|x86.Build.0 = Debug|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release MinSize|x86.ActiveCfg = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release MinSize|x86.Build.0 = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release|x86.ActiveCfg = Release|Win32 + {35D639CF-608C-4810-95A3-4895185E6A54}.Unicode Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DAEB4CB9-9961-4827-9552-8AABAE2B7D65} + EndGlobalSection +EndGlobal diff --git a/inetsrv/uddi/source/version/assemblyversioninfo.cs b/inetsrv/uddi/source/version/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/version/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/version/build.log b/inetsrv/uddi/source/version/build.log new file mode 100644 index 0000000..bc7c611 --- /dev/null +++ b/inetsrv/uddi/source/version/build.log @@ -0,0 +1,83 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\version directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\version directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\version +Elapsed time [0:00:00.000] ******************** +1>cl -nologo -Ii386\ -I. -I\OpenXP\nt\public\sdk\inc\mfc42 -I\OpenXP\public\sdk\inc\atl30 -Iobj\i386 -ID:\OpenXP\InetSrv\inc -ID:\OpenXP\InetSrv\inc\obj\i386 -ID:\OpenXP\public\internal\InetSrv\inc -ID:\OpenXP\public\oak\inc -ID:\OpenXP\public\sdk\inc -ID:\OpenXP\public\sdk\inc\crt -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DDBG=1 -D__BUILDDATE__=260111-1250 -D__BUILDMACHINE__=mxb1_tech_demo("ntvbl06") -DFPO=0 -DNDEBUG /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP /c /Zel /Zp8 /Gy /Gi- /Gm- /W3 /WX /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /Oxs /Oy- -Z7 -FID:\OpenXP\public\sdk\inc\warning.h .\version.cpp +1>version.cpp +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\version directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' +1> link -out:obj\i386\version.exe -machine:ix86 @C:\Users\ntvbl06\AppData\Local\Temp\nm164C.tmp +1>Microsoft (R) Incremental Linker Version 7.10.2179 +1>Copyright (C) Microsoft Corporation. All rights reserved. +1> +1>-MERGE:_PAGE=PAGE +1>-MERGE:_TEXT=.text +1>-SECTION:INIT,d +1>-OPT:REF +1>-OPT:ICF +1>-IGNORE:4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 +1>-INCREMENTAL:NO +1>-FULLBUILD +1>/release +1>-NODEFAULTLIB +1>/WX +1>-debug:FULL +1>-debugtype:cv +1>-version:5.2 +1>-osversion:5.2 +1>-debug:full +1>-debugtype:cv,fixup +1>/opt:nowin98 +1>-PDBPATH:NONE +1>-merge:.rdata=.text +1>-STACK:0x40000,0x2000 +1>/tsaware +1>-subsystem:console,4.00 +1>-base:@D:\OpenXP\Tools\coffbase.txt,usermode +1>-entry:mainCRTStartup +1>obj\i386\version.obj +1>D:\OpenXP\public\sdk\lib\i386\BufferOverflowU.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\libc.lib +1>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\advapi32.lib +1>D:\OpenXP\public\sdk\lib\i386\comctl32.lib +1>D:\OpenXP\public\sdk\lib\i386\comdlg32.lib +1>D:\OpenXP\public\sdk\lib\i386\comsvcs.lib +1>D:\OpenXP\public\sdk\lib\i386\kernel32.lib +1>D:\OpenXP\public\sdk\lib\i386\shell32.lib +1>D:\OpenXP\public\sdk\lib\i386\shlwapi.lib +1>D:\OpenXP\public\sdk\lib\i386\Secur32.lib +1>D:\OpenXP\public\sdk\lib\i386\user32.lib +1> compact /c /q obj\i386\version.pdb +1> +1> Compressing files in D:\OpenXP\inetsrv\uddi\source\version\obj\i386\ +1> +1> +1>1 files within 1 directories were compressed. +1>199,680 total bytes of data are stored in 94,208 bytes. +1>The compression ratio is 2.1 to 1. +1> echo. +1> +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:02.953] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' +1>Source Depot client error: +1> See http://sourcedepot for documentation on Source Depot. +1> No server or port specified; check $SDPORT. +1> 1 file(s) moved. +1>BUILDMSG: Error attempting to publish files +1>BUILDMSG: Source Depot client error: +1>Source Depot client error: +1> See http://sourcedepot for documentation on Source Depot. +1> No server or port specified; check $SDPORT. +1>exit: 1 diff --git a/inetsrv/uddi/source/version/makefile b/inetsrv/uddi/source/version/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/version/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/version/obj/_objects.mac b/inetsrv/uddi/source/version/obj/_objects.mac new file mode 100644 index 0000000..7d25ec7 --- /dev/null +++ b/inetsrv/uddi/source/version/obj/_objects.mac @@ -0,0 +1,20 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\version.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\version.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\version.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\version.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/version/obj/i386/version.exe b/inetsrv/uddi/source/version/obj/i386/version.exe new file mode 100644 index 0000000..363de1c Binary files /dev/null and b/inetsrv/uddi/source/version/obj/i386/version.exe differ diff --git a/inetsrv/uddi/source/version/obj/i386/version.obj b/inetsrv/uddi/source/version/obj/i386/version.obj new file mode 100644 index 0000000..06bb819 Binary files /dev/null and b/inetsrv/uddi/source/version/obj/i386/version.obj differ diff --git a/inetsrv/uddi/source/version/obj/i386/version.pdb b/inetsrv/uddi/source/version/obj/i386/version.pdb new file mode 100644 index 0000000..fb2b7ef Binary files /dev/null and b/inetsrv/uddi/source/version/obj/i386/version.pdb differ diff --git a/inetsrv/uddi/source/version/sources b/inetsrv/uddi/source/version/sources new file mode 100644 index 0000000..69a8c53 --- /dev/null +++ b/inetsrv/uddi/source/version/sources @@ -0,0 +1,25 @@ +TARGETNAME=version +TARGETPATH=obj +TARGETTYPE=PROGRAM + +UMTYPE=console +#UMENTRY=main + +SYNCHRONIZE_PASS2_BLOCK=1 + +INCLUDES=$(INCLUDES);$(_NTROOT)\nt\public\sdk\inc\mfc42;$(_NTROOT)\public\sdk\inc\atl30; + +TARGETLIBS=\ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\comdlg32.lib \ + $(SDK_LIB_PATH)\comsvcs.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\shlwapi.lib \ + $(SDK_LIB_PATH)\Secur32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + +SOURCES = version.cpp + +C_DEFINES = $(C_DEFINES) /DWIN32 /D_WINDOWS /D_USRDLL /D_UNICODE /DUNICODE /DUSE_NTVERP diff --git a/inetsrv/uddi/source/version/version.cpp b/inetsrv/uddi/source/version/version.cpp new file mode 100644 index 0000000..850c28f --- /dev/null +++ b/inetsrv/uddi/source/version/version.cpp @@ -0,0 +1,132 @@ +// version.cpp : Defines the entry point for the console application. +// +#include +#include +#include +#include +#include + +static BOOL WriteToFile( HANDLE hFile, const char *psz ); +static void PrintUsage(); + +int __cdecl +main( int argc, char **argv ) +{ + const char *pszOutFile = NULL; + + if( 1 == argc ) + { + PrintUsage(); + return 1; + } + + for( int i = 1; i < argc; i++ ) + { + if( 0 == _stricmp( argv[ i ], "-outFile" ) && ( i + 1 < argc ) ) + { + pszOutFile = argv[ i + 1 ]; + break; + } + else + { + PrintUsage(); + return 1; + } + } + + const char *pszUsings = "using System.Reflection;\r\nusing System.Security.Permissions;\r\nusing System.Runtime.CompilerServices;\r\n\r\n"; + const char *pszVersionTemplate = "[assembly: AssemblyVersion(\"%s\")]\r\n"; + + char szVersion[ 256 ]; + char szBuf[ 32 ]; + + memset( szBuf, 0, 32 * sizeof( char ) ); + memset( szVersion, 0, 256 * sizeof( char ) ); + + // + // VER_PRODUCTVERSION_STR is a preprocessor symbol, defined in ntverp.h. + // It contains the string-ized Windows version number. + // + char *psz = strncpy( szBuf, VER_PRODUCTVERSION_STR, 32 ); + szBuf[ 31 ] = 0x00; + + if( NULL == psz ) + { + printf( "Preprocessor symbol VER_PRODUCTVERSION_STR is not defined. Giving up.\n" ); + return -1; + } + + sprintf( szVersion, pszVersionTemplate, szBuf ); + + HANDLE hFile = CreateFileA( pszOutFile, + GENERIC_WRITE, + 0, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL ); + if( NULL == hFile ) + { + printf( "Could not create the following file: %s. Giving up.\n", pszOutFile ); + return -1; + } + + BOOL fSuccess = FALSE; + + fSuccess = WriteToFile( hFile, pszUsings ); + if( !fSuccess ) + { + printf( "Error writing to file: %s. Giving up.\n", pszOutFile ); + CloseHandle( hFile ); + return -1; + } + + fSuccess = WriteToFile( hFile, szVersion ); + if( !fSuccess ) + { + printf( "Error writing to file: %s. Giving up.\n", argv[ 1 ] ); + CloseHandle( hFile ); + return -1; + } + + CloseHandle( hFile ); + + return 0; +} + + +BOOL +WriteToFile( HANDLE hFile, const char *psz ) +{ + if( ( NULL == hFile ) || ( NULL == psz ) ) + { + return FALSE; + } + + DWORD dwBytesToWrite = strlen( psz ); + DWORD dwBytesWritten = 0; + BOOL fSuccess = FALSE; + + fSuccess = WriteFile( hFile, + reinterpret_cast( psz ), + dwBytesToWrite, + &dwBytesWritten, + NULL ); + + if( !fSuccess || ( dwBytesToWrite != dwBytesWritten ) ) + { + return FALSE; + } + else + { + return TRUE; + } +} + +void +PrintUsage() +{ + printf( "Usage of version.exe:\r\n\r\n" ); + printf( "version.exe <-outFile >\r\n" ); + printf( "version.exe <-help>\r\n" ); +} \ No newline at end of file diff --git a/inetsrv/uddi/source/version/version.ncb b/inetsrv/uddi/source/version/version.ncb new file mode 100644 index 0000000..4b209b5 Binary files /dev/null and b/inetsrv/uddi/source/version/version.ncb differ diff --git a/inetsrv/uddi/source/version/version.vcproj b/inetsrv/uddi/source/version/version.vcproj new file mode 100644 index 0000000..a3cd0f0 --- /dev/null +++ b/inetsrv/uddi/source/version/version.vcproj @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/web/address.cs b/inetsrv/uddi/source/web/address.cs new file mode 100644 index 0000000..b3f4348 --- /dev/null +++ b/inetsrv/uddi/source/web/address.cs @@ -0,0 +1,149 @@ +using System; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; + +namespace UDDI.Web +{ + public class AddressControl : UddiControl + { + protected AddressCollection addresses; + protected BusinessEntity business; + protected UddiLabel count; + + protected DataGrid grid; + + public void Initialize( AddressCollection addresses ) + { + this.addresses = addresses; + + grid.Columns[ 1 ].Visible = false; + } + + public void Initialize( AddressCollection addresses, BusinessEntity business ) + { + this.addresses = addresses; + this.business = business; + + grid.Columns[ 1 ].Visible = true; + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid(); + + if( grid.EditItemIndex >= 0 ) + SetEditMode(); + } + + void PopulateDataGrid() + { + grid.DataSource = addresses; + grid.DataBind(); + } + + protected void DataGrid_Edit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + grid.EditItemIndex = index; + SetEditMode(); + + PopulateDataGrid(); + } + + protected void OnEnterKeyPressed( object sender, EventArgs e ) + { + DataGrid_Update( sender, null ); + } + + protected void DataGrid_Update( object sender, DataGridCommandEventArgs e ) + { + int index = grid.EditItemIndex; + + if( index >= addresses.Count ) + addresses.Add( "", "" ); + + Address address = addresses[ index ]; + address.AddressLines.Clear(); + + DataGridItem item = grid.Items[ index ]; + + string[] addressLine = new string[ 5 ] + { + ((TextBox)item.FindControl( "address0" )).Text, + ((TextBox)item.FindControl( "address1" )).Text, + ((TextBox)item.FindControl( "address2" )).Text, + ((TextBox)item.FindControl( "address3" )).Text, + ((TextBox)item.FindControl( "address4" )).Text + }; + + for( int i = 0; i < 5; i ++ ) + { + if( !Utility.StringEmpty( addressLine[ i ] ) ) + address.AddressLines.Add( addressLine[ i ] ); + } + + address.UseType = ((TextBox)item.FindControl( "useType" )).Text; + business.Save(); + + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void DataGrid_Cancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void DataGrid_Delete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + addresses.RemoveAt( index ); + business.Save(); + + PopulateDataGrid(); + } + + protected void DataGrid_Add( object sender, EventArgs e ) + { + grid.EditItemIndex = addresses.Count; + SetEditMode(); + + addresses.Add( "", "" ); + + PopulateDataGrid(); + } + + protected void Selector_OnSelect( object sender, string key, string name ) + { + /* + UddiLabel otherBusiness = (UddiLabel)GetControl( "otherBusiness", 6 ); + UddiLabel otherBusinessKey = (UddiLabel)GetControl( "otherBusinessKey", 6 ); + UddiLabel leftOtherBusiness = (UddiLabel)GetControl( "leftOtherBusiness", 6 ); + UddiLabel rightOtherBusiness = (UddiLabel)GetControl( "rightOtherBusiness", 6 ); + + otherBusinessKey.Text = key; + otherBusiness.Text = name; + leftOtherBusiness.Text = name; + rightOtherBusiness.Text = name; + + Panel selectPanel = (Panel)GetControl( "selectPanel", 6 ); + Panel directionPanel = (Panel)GetControl( "directionPanel", 6 ); + + UddiButton add = (UddiButton)GetControl( "add", 7 ); + + add.Enabled = true; + + selectPanel.Visible = false; + directionPanel.Visible = true; */ + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/assemblyinfo.cs b/inetsrv/uddi/source/web/assemblyinfo.cs new file mode 100644 index 0000000..616751e --- /dev/null +++ b/inetsrv/uddi/source/web/assemblyinfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("uddi.web.dll")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("UDDI Services")] +[assembly: AssemblyCopyright("Copyright(c) 2002 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified - the assembly cannot be signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. +// (*) If the key file and a key name attributes are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP - that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the file is installed into the CSP and used. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile( "")] +[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/inetsrv/uddi/source/web/assemblyversioninfo.cs b/inetsrv/uddi/source/web/assemblyversioninfo.cs new file mode 100644 index 0000000..e50d1e8 --- /dev/null +++ b/inetsrv/uddi/source/web/assemblyversioninfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Security.Permissions; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("5.2.4000.10000")] diff --git a/inetsrv/uddi/source/web/base.cs b/inetsrv/uddi/source/web/base.cs new file mode 100644 index 0000000..d5ba861 --- /dev/null +++ b/inetsrv/uddi/source/web/base.cs @@ -0,0 +1,1443 @@ +using System; +using System.Web; +using System.Web.UI; + +namespace UDDI.Web +{ + public class UddiBrowser + { + public static bool IsNetscape6 + { + get + { + return + HttpContext.Current.Request.Browser.Type.StartsWith( "Netscape" ) && + HttpContext.Current.Request.Browser.MajorVersion >= 5; + } + } + + public static bool IsIE4 + { + get + { + return + HttpContext.Current.Request.Browser.Type.StartsWith( "IE" ) && + HttpContext.Current.Request.Browser.MajorVersion >= 4 && + HttpContext.Current.Request.Browser.MajorVersion < 5; + } + } + + public static bool IsIE5 + { + get + { + return + HttpContext.Current.Request.Browser.Type.StartsWith( "IE" ) && + HttpContext.Current.Request.Browser.MajorVersion >= 5; + } + } + + public static bool IsDownlevel + { + get { return !IsIE5; } + } + + public static bool IsFrames + { + get{ return ( "true"==HttpContext.Current.Request[ "frames" ] );} + } + public static bool ShouldBeFrames + { + get{ return !IsDownlevel; } + } + } + + public class UddiPage : System.Web.UI.Page + { + + private System.Web.UI.WebControls.PlaceHolder headerbag; + public System.Web.UI.WebControls.PlaceHolder HeaderBag + { + get{ return headerbag; } + set{ headerbag=(System.Web.UI.WebControls.PlaceHolder) value; } + } + + private System.Web.UI.WebControls.PlaceHolder footerbag; + public System.Web.UI.WebControls.PlaceHolder FooterBag + { + get{ return footerbag; } + set{ footerbag=(System.Web.UI.WebControls.PlaceHolder) value; } + } + + public bool IsDownlevel + { + get { return UddiBrowser.IsDownlevel; } + } + + public bool EditMode + { + get + { + if( null == ViewState[ "EditMode" ] ) + return false; + + return (bool)ViewState[ "EditMode" ]; + } + } + + public bool IsNetscape6 + { + get { return UddiBrowser.IsNetscape6; } + } + + public bool IsIE4 + { + get { return UddiBrowser.IsIE4; } + } + + public bool IsIE5 + { + get { return UddiBrowser.IsIE5; } + } + + private SytleSheetControlCollection stylesheets; + public SytleSheetControlCollection StyleSheets + { + get + { + if( null==stylesheets ) + stylesheets = new SytleSheetControlCollection(); + + return stylesheets; + } + set { stylesheets = (SytleSheetControlCollection)value; } + } + private PageStyleControl pagestyle = null; + public PageStyleControl PageStyle + { + get + { + if( null==pagestyle ) + { + pagestyle = PageStyleControl.GetDefault(); + } + return pagestyle; + } + set { pagestyle = (PageStyleControl)value; } + } + private ClientScriptRegisterCollection clientscripts; + public ClientScriptRegisterCollection ClientScript + { + get + { + if( null==clientscripts ) + clientscripts = new ClientScriptRegisterCollection(); + + return clientscripts; + } + set{ clientscripts = (ClientScriptRegisterCollection)value; } + } + + public string Root + { + get + { + if( "/" == Request.ApplicationPath ) + return ""; + + return Request.ApplicationPath; + } + } + + public void CancelEditMode() + { + ViewState[ "EditMode" ] = false; + } + + public void SetEditMode() + { + ViewState[ "EditMode" ] = true; + } + + protected override void OnLoad( EventArgs e ) + { + base.OnLoad( e ); + + if( null!=HeaderBag ) + HeaderBag.Visible = PageStyle.ShowHeader; + + if( null!=FooterBag ) + FooterBag.Visible = PageStyle.ShowFooter; + } + + protected override void Render( HtmlTextWriter output ) + { + + // + // Render Open HTML + // + output.RenderBeginTag( HtmlTextWriterTag.Html ); + + // + // Render Open Head + // + output.Write( "\r\n" ); + + // + // Render StyleSheet Links + // + foreach( StyleSheetControl stylesheet in this.StyleSheets ) + stylesheet.RenderControl( output ); + + // + // Render Client Scripts + // + foreach( ClientScriptRegister script in this.ClientScript ) + script.RenderControl( output ); + + + if( null != PageStyle ) + { + + output.RenderBeginTag( HtmlTextWriterTag.Title );// + if( 0 == Config.GetInt( "Web.ServiceMode", 0 ) ) + { + output.Write( UDDI.Localization.GetString( PageStyle.Title ) ); + } + else + { + output.Write( UDDI.Localization.GetString( PageStyle.AltTitle ) ); + } + output.RenderEndTag();// + } + + + // + // Render Close Head + // + output.Write( "\r\n" ); + + // + // Register the attributes for the body + // + if( null!=PageStyle ) + PageStyle.RenderControl( output ); + + // + // Render Open Body + // + output.RenderBeginTag( HtmlTextWriterTag.Body ); + + + // + // Render Open Table. + // This prevents scrolling problems. + // + if( null != PageStyle ) + output.AddAttribute( "border",PageStyle.BorderWidth ); + else + output.AddAttribute( "border","0" ); + output.AddAttribute( "width","100%" ); + output.AddAttribute( "height","100%" ); + output.AddAttribute( "cellpadding","0" ); + output.AddAttribute( "cellspacing","0" ); + output.RenderBeginTag( HtmlTextWriterTag.Table ); + + // + // Render Open TR + // + if( UddiBrowser.IsDownlevel || UddiBrowser.IsNetscape6 ) + output.AddAttribute( "height","100%" ); + output.RenderBeginTag( HtmlTextWriterTag.Tr ); + + // + // Render Open TD + // + if( UddiBrowser.IsDownlevel || UddiBrowser.IsNetscape6 ) + output.AddAttribute( "height","100%" ); + + output.AddAttribute( "valign","top" ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + + // + // Render Content of ASPX Page + // + base.Render( output );//do the base render + + // + // Close All Open Tags + // + output.RenderEndTag();//td + output.RenderEndTag();//tr + output.RenderEndTag();//table + + + output.RenderEndTag();//body + output.RenderEndTag();//html + + } + + protected override void AddParsedSubObject( object obj ) + { + if( obj is StyleSheetControl ) + { + this.StyleSheets.Add( (StyleSheetControl)obj ); + return; + } + else if( obj is PageStyleControl ) + { + this.PageStyle = (PageStyleControl)obj; + return; + } + else if( obj is ClientScriptRegister ) + { + this.ClientScript.Add( (ClientScriptRegister)obj ); + return; + } + + base.AddParsedSubObject( obj ); + } + + + } + public class SytleSheetControlCollection : System.Collections.CollectionBase + { + public StyleSheetControl this[ int index ] + { + get{ return (StyleSheetControl)this.List[ index ]; } + set{ this.List[ index ] = value; } + } + public int Add( StyleSheetControl control ) + { + return this.List.Add( control ); + } + public void Remove( int index ) + { + this.RemoveAt( index ); + } + public void Remove( StyleSheetControl control ) + { + this.Remove( control ); + } + public void Insert( int index, StyleSheetControl control ) + { + this.List.Insert( index, control ); + } + + } + public class StyleSheetControl : UddiControl, INamingContainer + { + public StyleSheetControl() + { + } + private string defaultsheet; + public string Default + { + get{ return defaultsheet; } + set{ defaultsheet = value; } + } + private string downlevelsheet; + public string DownLevel + { + get{ return downlevelsheet; } + set{ downlevelsheet = value; } + } + protected override void Render( HtmlTextWriter output ) + { + if( ( UddiBrowser.IsDownlevel && !UddiBrowser.IsNetscape6 ) && null!=DownLevel ) + { + output.AddAttribute( HtmlTextWriterAttribute.Href, DownLevel ); + } + else if( ( !UddiBrowser.IsDownlevel || UddiBrowser.IsNetscape6 ) && null!=Default ) + { + output.AddAttribute( HtmlTextWriterAttribute.Href, Default ); + } + else + { + return; + } + + output.AddAttribute( "rel","stylesheet"); + output.AddAttribute( "type", "text/css" ); + output.RenderBeginTag( HtmlTextWriterTag.Link ); + output.RenderEndTag(); + } + } + public class PageStyleControl : UddiControl, INamingContainer + { + public PageStyleControl() + { + // + // Show footer if Config value is set. + // + this.ShowFooter = ( Config.GetInt( "Web.ShowFooter",0 ) > 0 ); + + // + // Show header only if DownLevel + // + this.ShowHeader = !UddiBrowser.ShouldBeFrames; + + + // + // Set Page margin data + // + this.MarginHeight = "0"; + this.MarginWidth = "0"; + this.LeftMargin = "0"; + this.RightMargin = "0"; + this.TopMargin = "0"; + this.BottomMargin = "0"; + + } + + + private string title; + public string Title + { + get{ return title; } + set{ title=value; } + } + private string alttitle; + public string AltTitle + { + get{ return alttitle; } + set{ alttitle=value; } + } + + private string oncontextmenu; + public string OnClientContextMenu + { + get{ return oncontextmenu; } + set{ oncontextmenu=value; } + } + private string leftmargin; + public string LeftMargin + { + get{ return leftmargin; } + set{ leftmargin=value; } + } + private string topmargin; + public string TopMargin + { + get{ return topmargin; } + set{ topmargin=value; } + } + private string bottommargin; + public string BottomMargin + { + get{ return bottommargin; } + set{ bottommargin=value; } + } + private string rightmargin; + public string RightMargin + { + get{ return rightmargin; } + set{ rightmargin=value;} + } + private string marginheight; + public string MarginHeight + { + get{ return marginheight; } + set{ marginheight=value; } + } + private string marginwidth; + public string MarginWidth + { + get{ return marginwidth; } + set{ marginwidth=value; } + } + private string onload; + public string OnClientLoad + { + get{ return onload; } + set{ onload=value; } + } + private string bgcolor; + public string BackgroundColor + { + get{ return bgcolor; } + set{ bgcolor=value; } + } + private string linkcolor; + public string LinkColor + { + get{ return linkcolor; } + set{ linkcolor=value; } + } + private string alinkcolor; + public string ALinkColor + { + get{ return alinkcolor; } + set{ alinkcolor=value; } + } + private string vlinkcolor; + public string VLinkColor + { + get{ return vlinkcolor; } + set{ vlinkcolor=value; } + } + private string textcolor; + public string TextColor + { + get{ return textcolor; } + set{ textcolor=value; } + } + + private bool showfooter; + public bool ShowFooter + { + get{ return showfooter; } + set{ showfooter=value; } + } + + private bool showheader; + public bool ShowHeader + { + get{ return showheader; } + set{ showheader=value; } + } + + private string borderwidth = "0"; + public string BorderWidth + { + get{ return borderwidth; } + set{ borderwidth = value; } + } + + private string cssclass; + public string CssClass + { + get{ return cssclass; } + set{ cssclass=value; } + } + + private string onclientactivate; + public string OnClientActivate + { + get{ return onclientactivate; } + set{ onclientactivate = value; } + } + + + private string onclientafterprint; + public string OnClientAfterPrint + { + get{ return onclientafterprint; } + set{ onclientafterprint = value; } + } + + + private string onclientbeforeactivate ; + public string OnClientBeforeActivate + { + get{ return onclientbeforeactivate; } + set{ onclientbeforeactivate = value; } + } + + private string onclientbeforecut; + public string OnClientBeforeCut + { + get{ return onclientbeforecut; } + set{ onclientbeforecut = value; } + } + + private string onclientbeforedeactivate; + public string OnClientBeforeDeactivate + { + get{ return onclientbeforedeactivate; } + set{ onclientbeforedeactivate = value; } + } + + private string onclientbeforeeditfocus; + public string OnClientBeforeEditFocus + { + get{ return onclientbeforeeditfocus; } + set{ onclientbeforeeditfocus = value; } + } + + private string onclientbeforepaste; + public string OnClientBeforePaste + { + get{ return onclientbeforepaste; } + set{ onclientbeforepaste = value; } + } + + private string onclientbeforeprint; + public string OnClientBeforePrint + { + get{ return onclientbeforeprint; } + set{ onclientbeforeprint = value; } + } + + private string onclientbeforeunload; + public string OnClientBeforeUnload + { + get{ return onclientbeforeunload; } + set{ onclientbeforeunload = value; } + } + + private string onclientcontrolselect; + public string OnClientControlSelect + { + get{ return onclientcontrolselect; } + set{ onclientcontrolselect = value; } + } + + private string onclientcut; + public string OnClientCut + { + get{ return onclientcut; } + set{ onclientcut = value; } + } + + private string onclientdblclick; + public string OnClientDblClick + { + get{ return onclientdblclick; } + set{ onclientdblclick = value; } + } + + private string onclientdeactivate; + public string OnClientDeactivate + { + get{ return onclientdeactivate; } + set{ onclientdeactivate = value; } + } + + private string onclientdrag; + public string OnClientDrag + { + get{ return onclientdrag; } + set{ onclientdrag = value; } + } + + private string onclientdragend; + public string OnClientDragEnd + { + get{ return onclientdragend; } + set{ onclientdragend = value; } + } + + + private string onclientdragenter; + public string OnClientDragEnter + { + get{ return onclientdragenter; } + set{ onclientdragenter = value; } + } + + private string onclientdragleave; + public string OnClientDragLeave + { + get{ return onclientdragleave; } + set{ onclientdragleave = value; } + } + + private string onclientdragover; + public string OnClientDragOver + { + get{ return onclientdragover; } + set{ onclientdragover = value; } + } + + private string onclientdragstart; + public string OnClientDragStart + { + get{ return onclientdragstart; } + set{ onclientdragstart = value; } + } + + private string onclientdrop; + public string OnClientDrop + { + get{ return onclientdrop; } + set{ onclientdrop = value; } + } + + private string onclientfilterchange; + public string OnClientFilterChange + { + get{ return onclientfilterchange; } + set{ onclientfilterchange = value; } + } + + private string onclientfocusin; + public string OnClientFocusIn + { + get{ return onclientfocusin; } + set{ onclientfocusin = value; } + } + + private string onclientfocusout; + public string OnClientFocusOut + { + get{ return onclientfocusout; } + set{ onclientfocusout = value; } + } + + private string onclientkeydown; + public string OnClientKeyDown + { + get{ return onclientkeydown; } + set{ onclientkeydown = value; } + } + + private string onclientkeypress; + public string OnClientKeyPress + { + get{ return onclientkeypress; } + set{ onclientkeypress = value; } + } + + private string onclientkeyup; + public string OnClientKeyUp + { + get{ return onclientkeyup; } + set{ onclientkeyup = value; } + } + + private string onclientlosecapture; + public string OnClientLoseCapture + { + get{ return onclientlosecapture; } + set{ onclientlosecapture = value; } + } + + private string onclientmousedown; + public string OnClientMouseDown + { + get{ return onclientmousedown; } + set{ onclientmousedown = value; } + } + + private string onclientmouseenter; + public string OnClientMouseEnter + { + get{ return onclientmouseenter; } + set{ onclientmouseenter = value; } + } + + private string onclientmouseleave; + public string OnClientMouseLeave + { + get{ return onclientmouseleave; } + set{ onclientmouseleave = value; } + } + + private string onclientmousemove; + public string OnClientMouseMove + { + get{ return onclientmousemove; } + set{ onclientmousemove = value; } + } + + private string onclientmouseout; + public string OnClientMouseOut + { + get{ return onclientmouseout; } + set{ onclientmouseout = value; } + } + private string onclientmouseover; + public string OnClientMouseOver + { + get{ return onclientmouseover; } + set{ onclientmouseover = value; } + } + + private string onclientmouseup; + public string OnClientMouseUp + { + get{ return onclientmouseup; } + set{ onclientmouseup = value; } + } + + private string onclientmousewheel; + public string OnClientMouseWheel + { + get{ return onclientmousewheel; } + set{ onclientmousewheel = value; } + } + + private string onclientmove; + public string OnClientMove + { + get{ return onclientmove; } + set{ onclientmove = value; } + } + + private string onclientmoveend; + public string OnClientMoveEnd + { + get{ return onclientmoveend; } + set{ onclientmoveend = value; } + } + + private string onclientmovestart; + public string OnClientMoveStart + { + get{ return onclientmovestart; } + set{ onclientmovestart = value; } + } + + private string onclientpaste; + public string OnClientPaste + { + get{ return onclientpaste; } + set{ onclientpaste = value; } + } + + private string onclientpropertychange; + public string OnClientPropertyChange + { + get{ return onclientpropertychange; } + set{ onclientpropertychange = value; } + } + + private string onclientreadystatechange; + public string OnClientReadyStateChange + { + get{ return onclientreadystatechange; } + set{ onclientreadystatechange = value; } + } + + private string onclientresizeend; + public string OnClientResizeEnd + { + get{ return onclientresizeend; } + set{ onclientresizeend = value; } + } + + private string onclientresizestart; + public string OnClientResizeStart + { + get{ return onclientresizestart; } + set{ onclientresizestart = value; } + } + + + private string onclientscroll; + public string OnClientScroll + { + get{ return onclientscroll; } + set{ onclientscroll = value; } + } + + private string onclientselect; + public string OnClientSelect + { + get{ return onclientselect; } + set{ onclientselect = value; } + } + + private string onclientselectstart; + public string OnClientSelectStart + { + get{ return onclientselectstart; } + set{ onclientselectstart = value; } + } + + private string onclientunload; + public string OnClientUnload + { + get{ return onclientunload; } + set{ onclientunload = value; } + } + + protected override void Render( HtmlTextWriter output ) + { + if( null!=ALinkColor ) + output.AddAttribute( "alink",ALinkColor ); + if( null!=LinkColor ) + output.AddAttribute( "link",LinkColor ); + if( null!=VLinkColor ) + output.AddAttribute( "vlink",VLinkColor ); + if( null!=TextColor ) + output.AddAttribute( "text",TextColor ); + + if( null!=BackgroundColor ) + output.AddAttribute( "bgcolor",BackgroundColor ); + + if( null!=TopMargin ) + output.AddAttribute( "topmargin",TopMargin ); + if( null!=BottomMargin ) + output.AddAttribute( "bottommargin",BottomMargin ); + if( null!=LeftMargin ) + output.AddAttribute( "leftmargin",LeftMargin ); + if( null!=RightMargin ) + output.AddAttribute( "rightmargin",RightMargin ); + + if( null!=MarginHeight ) + output.AddAttribute( "marginheight",MarginHeight ); + if( null!=MarginWidth ) + output.AddAttribute( "marginwidth",MarginWidth ); + + if( null!=OnClientContextMenu ) + output.AddAttribute( "oncontextmenu",OnClientContextMenu ); + if( null!=OnClientLoad ) + output.AddAttribute( "onload",OnClientLoad ); + if( null!=OnClientActivate ) + output.AddAttribute( "onactive", OnClientActivate ); + if( null!=OnClientAfterPrint ) + output.AddAttribute( "onafterprint" ,OnClientAfterPrint ); + if( null!=OnClientBeforeActivate ) + output.AddAttribute( "onbeforeupdate",OnClientBeforeActivate ); + if( null!=OnClientBeforeCut ) + output.AddAttribute( "onbeforecut",OnClientBeforeCut ); + if( null!=OnClientBeforeDeactivate ) + output.AddAttribute( "onbeforedeactivate", OnClientBeforeDeactivate ); + if( null!=OnClientBeforeEditFocus ) + output.AddAttribute( "onbeforeeditfocus",OnClientBeforeEditFocus ); + if( null!=OnClientBeforePaste ) + output.AddAttribute( "onbeforepaste", OnClientBeforePaste ); + if( null!=OnClientBeforePrint ) + output.AddAttribute( "onbeforeprint", OnClientBeforePrint ); + if( null!=OnClientBeforeUnload ) + output.AddAttribute( "onbeforeunload", OnClientBeforeUnload ); + if( null!=OnClientControlSelect ) + output.AddAttribute( "oncontrolselect", OnClientControlSelect ); + if( null!=OnClientCut ) + output.AddAttribute( "oncut", OnClientCut ); + if( null!=OnClientDblClick ) + output.AddAttribute( "ondblclick", OnClientDblClick ); + if( null!=OnClientDeactivate ) + output.AddAttribute( "ondeactivate", OnClientDeactivate ); + if( null!=OnClientDrag ) + output.AddAttribute( "ondrag", OnClientDrag ); + if( null!=OnClientDragEnd ) + output.AddAttribute( "ondragend", OnClientDragEnd ); + if( null!=OnClientDragEnter ) + output.AddAttribute( "ondragenter", OnClientDragEnter ); + if( null!=OnClientDragLeave ) + output.AddAttribute( "ondragleave", OnClientDragLeave ); + if( null!=OnClientDragOver ) + output.AddAttribute( "ondragover", OnClientDragOver ); + if( null!=OnClientDragStart ) + output.AddAttribute( "ondragstart", OnClientDragStart ); + if( null!=OnClientDrop ) + output.AddAttribute( "ondrop", OnClientDrop ); + if( null!=OnClientFilterChange ) + output.AddAttribute( "onfilterchange", OnClientFilterChange ); + if( null!=OnClientFocusIn ) + output.AddAttribute( "onfocusin", OnClientFocusIn ); + if( null!=OnClientFocusOut ) + output.AddAttribute( "onfocusout", OnClientFocusOut ); + if( null!=OnClientKeyDown ) + output.AddAttribute( "onkeydown", OnClientKeyDown ); + if( null!=OnClientKeyPress ) + output.AddAttribute( "onkeypress", OnClientKeyPress ); + if( null!=OnClientKeyUp ) + output.AddAttribute( "onkeyup", OnClientKeyUp ); + if( null!=OnClientLoseCapture ) + output.AddAttribute( "onlosecapture", OnClientMouseDown ); + if( null!=OnClientMouseDown ) + output.AddAttribute( "onmousedown", OnClientMouseDown ); + if( null!=OnClientMouseEnter ) + output.AddAttribute( "onmouseenter", OnClientMouseEnter ); + if( null!=OnClientMouseLeave ) + output.AddAttribute( "onmouseleave", OnClientMouseLeave ); + if( null!=OnClientMouseMove ) + output.AddAttribute( "onmousemove", OnClientMouseMove ); + if( null!=OnClientMouseOut ) + output.AddAttribute( "onmouseout", OnClientMouseOut ); + if( null!=OnClientMouseOver ) + output.AddAttribute( "onmouseover", OnClientMouseOver ); + if( null!=OnClientMouseUp ) + output.AddAttribute( "onmouseup", OnClientMouseUp ); + if( null!=OnClientMouseWheel ) + output.AddAttribute( "onmousewheel", OnClientMouseWheel ); + if( null!=OnClientMove ) + output.AddAttribute( "onmove", OnClientMove ); + if( null!=OnClientMoveEnd ) + output.AddAttribute( "onmoveend", OnClientMoveEnd ); + if( null!=OnClientMoveStart ) + output.AddAttribute( "onmovestart", OnClientMoveStart ); + if( null!=OnClientPaste ) + output.AddAttribute( "onpaste", OnClientPaste ); + if( null!=OnClientPropertyChange ) + output.AddAttribute( "onpropertychange", OnClientPropertyChange ); + if( null!=OnClientReadyStateChange ) + output.AddAttribute( "onreadystatechange", OnClientReadyStateChange ); + if( null!=OnClientResizeEnd ) + output.AddAttribute( "onresizeend", OnClientResizeEnd ); + if( null!=OnClientResizeStart ) + output.AddAttribute( "onresizestart", OnClientResizeStart ); + if( null!=OnClientScroll ) + output.AddAttribute( "onscroll", OnClientScroll ); + if( null!=OnClientSelect ) + output.AddAttribute( "onselect", OnClientSelect ); + if( null!=OnClientSelectStart ) + output.AddAttribute( "onselectstart", OnClientSelectStart ); + if( null!=OnClientUnload ) + output.AddAttribute( "onunload", OnClientUnload ); + } + + public static PageStyleControl GetDefault() + { + PageStyleControl control = new PageStyleControl(); + + + + + //TODO: Build other defaults in. + + return control; + } + + } + + public class UddiControl : System.Web.UI.UserControl + { + public bool IsDownlevel + { + get { return UddiBrowser.IsDownlevel; } + } + + public virtual bool EditMode + { + get { return ((UddiPage)Page).EditMode; } + } + + public string Root + { + get { return ((UddiPage)Page).Root; } + } + + public virtual void CancelEditMode() + { + ((UddiPage)Page).CancelEditMode(); + } + + public virtual void SetEditMode() + { + ((UddiPage)Page).SetEditMode(); + } + } + + public class UddiButton : System.Web.UI.WebControls.Button + { + protected bool editModeDisable = false; + protected bool focus = false; + + public bool EditModeDisable + { + get { return editModeDisable; } + set { editModeDisable = value; } + } + + public bool Focus + { + get { return focus; } + set { focus = value; } + } + + public new string Text + { + get { return base.Text; } + set + { + // + // Check to see if the button text needs to be localized. We + // use strings of the form [[ID]] to indicate localization is + // needed. + // + if( null != value && value.StartsWith( "[[" ) && value.EndsWith( "]]" ) ) + base.Text = Localization.GetString( value.Substring( 2, value.Length - 4 ) ); + else + base.Text = value; + } + } + + protected override void Render( HtmlTextWriter output ) + { + bool enabled = Enabled; + + // + // Check to see if we need to disable this control. We do + // this if we are in edit mode and the control is set to + // autodisable. + // + if( EditModeDisable && ((UddiPage)Page).EditMode ) + Enabled = false; + + // + // Only render the control if it is enabled, or we're on an IE + // browser. Netscape and other browsers do not support the + // enabled attribute, so we have to prevent the control from + // rendering on these browsers. + // + if( Enabled || UddiBrowser.IsIE5 ) + { + if( Focus ) + { + Page.RegisterStartupScript( + "SetFocus", + "" ); + } + + base.Render( output ); + } + + Enabled = enabled; + } + } + + public class UddiCheckBox : System.Web.UI.WebControls.CheckBox + { + protected bool editModeDisable = false; + protected bool focus = false; + + public bool EditModeDisable + { + get { return editModeDisable; } + set { editModeDisable = value; } + } + + public bool Focus + { + get { return focus; } + set { focus = value; } + } + + public override string Text + { + get { return base.Text; } + set + { + // + // Check to see if the button text needs to be localized. We + // use strings of the form [[ID]] to indicate localization is + // needed. + // + if( null != value && value.StartsWith( "[[" ) && value.EndsWith( "]]" ) ) + base.Text = Localization.GetString( value.Substring( 2, value.Length - 4 ) ); + else + base.Text = value; + } + } + + protected override void Render( HtmlTextWriter output ) + { + bool enabled = Enabled; + + // + // Check to see if we need to disable this control. We do + // this if we are in edit mode and the control is set to + // autodisable. + // + if( EditModeDisable && ((UddiPage)Page).EditMode ) + Enabled = false; + + // + // Only render the control if it is enabled, or we're on an IE + // browser. Netscape and other browsers do not support the + // enabled attribute, so we have to prevent the control from + // rendering on these browsers. + // + if( Enabled || UddiBrowser.IsIE5 ) + { + if( Focus ) + { + Page.RegisterStartupScript( + "SetFocus", + "" ); + } + + base.Render( output ); + } + + Enabled = enabled; + } + } + + public class UddiLabel : System.Web.UI.WebControls.Label + { + protected override void Render( HtmlTextWriter output ) + { + // + // Check to see if the label text needs to be localized. We + // use strings of the form [[ID]] to indicate localization is + // needed. + // + string text = base.Text; + + if( null != text && text.StartsWith( "[[" ) && text.EndsWith( "]]" ) ) + { + text = Localization.GetString( text.Substring( 2, text.Length - 4 ) ); + } + else + { + text = HttpUtility.HtmlEncode( text ); + + if( null != text ) + text = text.Replace( "\n", "
" ).Replace( " ", "  " ); + } + + base.AddAttributesToRender( output ); + + output.RenderBeginTag( HtmlTextWriterTag.Span ); + output.Write( text ); + output.RenderEndTag(); + } + } + + public class UddiTextBox : System.Web.UI.WebControls.TextBox, IPostBackEventHandler + { + protected bool editModeDisable = false; + protected bool selected = false; + protected bool focus = false; + + public bool Selected + { + get { return selected; } + set { selected = value; } + } + + public override string Text + { + get + { + // + // BUG: 759949. We must strip invalid characters from the strings. + // + if( null != base.Text ) + return Utility.XmlEncode( base.Text ); + else + return base.Text; + + } + set + { + base.Text = value; + } + } + + public bool Focus + { + get { return focus; } + set { focus = value; } + } + + public bool EditModeDisable + { + get { return editModeDisable; } + set { editModeDisable = value; } + } + + public event EventHandler EnterKeyPressed; + + void IPostBackEventHandler.RaisePostBackEvent( string eventArgument ) + { + switch( eventArgument ) + { + case "enterkey": + if( null != EnterKeyPressed ) + EnterKeyPressed( this, new EventArgs() ); + + break; + } + } + + protected override void Render( HtmlTextWriter output ) + { + if( EditModeDisable && ((UddiPage)Page).EditMode ) + { + output.AddAttribute(HtmlTextWriterAttribute.Disabled, null ); + } + else + { + if( Selected ) + { + Page.RegisterStartupScript( + "Select", + "" ); + } + else if( Focus ) + { + Page.RegisterStartupScript( + "SetFocus", + "" ); + } + + if( null != EnterKeyPressed ) + output.AddAttribute( "onkeypress", "if( 13 == event.keyCode ) " + Page.GetPostBackEventReference( this, "enterkey" ) ); + } + + base.Render( output ); + } + } + + public class UddiDataGrid : System.Web.UI.WebControls.DataGrid, IPostBackEventHandler + { + void IPostBackEventHandler.RaisePostBackEvent( string eventArgument ) + { + int page = Convert.ToInt32( eventArgument ); + + OnPageIndexChanged( + new System.Web.UI.WebControls.DataGridPageChangedEventArgs( this, page ) ); + } + + protected override void Render( HtmlTextWriter output ) + { + bool paging = AllowPaging; + + AllowPaging = false; + base.Render( output ); + + if( paging ) + { + // TODO: Localize!!! + output.AddAttribute( HtmlTextWriterAttribute.Class, "pagingFooter" ); + output.RenderBeginTag( HtmlTextWriterTag.Span ); + output.Write( String.Format( "Page {0} of {1}: ", CurrentPageIndex + 1, PageCount ) ); + + int startPage = ( CurrentPageIndex / PagerStyle.PageButtonCount ) * PagerStyle.PageButtonCount; + int stopPage = Math.Min( startPage + PagerStyle.PageButtonCount - 1, PageCount - 1 ); + + for( int page = startPage; page <= stopPage; page ++ ) + { + if( page == CurrentPageIndex ) + { + output.AddAttribute( HtmlTextWriterAttribute.Class, "pageSelected" ); + output.RenderBeginTag( HtmlTextWriterTag.Span ); + output.Write( " " + ( page + 1 ) + " " ); + output.RenderEndTag(); + } + else + { + output.AddAttribute( HtmlTextWriterAttribute.Class, "page" ); + output.AddAttribute( HtmlTextWriterAttribute.Href, "javascript:" + Page.GetPostBackEventReference( this, page.ToString() ) ); + output.RenderBeginTag( HtmlTextWriterTag.A ); + output.Write( " " + ( page + 1 ) + " " ); + output.RenderEndTag(); + } + } + + output.RenderEndTag(); + } + } + } + public class HyperLinkManager + { + + public static string GetSecureHyperLink( string pagename ) + { + + string url = ""; + bool isAbsolute = false; + + int port = Config.GetInt( "Web.HttpsPort",UDDI.Constants.Web.HttpsPort ); + + // + // if + // the current context is not secure, and we require HTTPS, + // - OR - + // The Web.HttpsPort is something other than the Default and the current port is not what is configured + // + // we will need to generate an absolute path. + // + isAbsolute = ( ( !HttpContext.Current.Request.IsSecureConnection && + 1==Config.GetInt( "Security.HTTPS", UDDI.Constants.Security.HTTPS ) ) || + ( UDDI.Constants.Web.HttpsPort!=port && HttpContext.Current.Request.Url.Port!=port ) ); + + + if( isAbsolute ) + { + url = GetUrlStart( true ); + } + + url+=GetFullFilePath( pagename ); + + return url; + } + public static string GetHyperLink( string pagename ) + { + return GetHyperLink( pagename, false ); + } + public static string GetHyperLink( string pagename, bool absolute ) + { + string url = ""; + if( absolute ) + { + url = GetUrlStart( HttpContext.Current.Request.IsSecureConnection ); + } + url += GetFullFilePath( pagename ); + return url; + } + public static string GetNonSecureHyperLink( string pagename ) + { + string url = ""; + + int port = Config.GetInt( "Web.HttpPort",UDDI.Constants.Web.HttpPort ); + bool isAbsolute = false; + + // + // if the current context is secure, + // - or - + // the Web.HttpPort is something other than default, and current port is not what is configured + // we will need to generate an absolute path. + // + isAbsolute = HttpContext.Current.Request.IsSecureConnection || + ( UDDI.Constants.Web.HttpPort!=port && HttpContext.Current.Request.Url.Port!=port ); + + if( isAbsolute ) + { + url = GetUrlStart( false ); + } + + url += GetFullFilePath( pagename ); + + return url; + } + private static string GetUrlStart( bool secure ) + { + string url = ""; + int port = 0; + if( secure )//build a secure url + { + url = "https://" + HttpContext.Current.Request.Url.Host; + + port = Config.GetInt( "Web.HttpsPort",UDDI.Constants.Web.HttpsPort ); + + if( port!=UDDI.Constants.Web.HttpsPort ) + url += ":" + port.ToString(); + } + else//build no secure url + { + url = "http://" + HttpContext.Current.Request.Url.Host; + port = Config.GetInt( "Web.HttpPort",UDDI.Constants.Web.HttpPort ); + if( port!=UDDI.Constants.Web.HttpPort ) + url += ":" + port.ToString(); + } + + return url; + } + private static string GetFullFilePath( string file ) + { + string url = ( ( "/"==HttpContext.Current.Request.ApplicationPath) ? "" : HttpContext.Current.Request.ApplicationPath ); + url += file ; + return url; + } + + } + public enum UrlFlags + { + Https = 0x0001, + Require = 0x0002, + Absolute = 0x0004, + External = 0x0008 + + } + public enum UrlOptions + { + PreferHttp = 0x0000, + PreferHttps = 0x0001, + RequireHttp = 0x0002, + RequireHttps = 0x0003, + PreferHttpAbsolute = 0x0004, + PreferHttpsAbsolute = 0x0005, + RequireHttpAbsolute = 0x0006, + RequireHttpsAbsolute = 0x0007, + External = 0x0008 + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/bindings.cs b/inetsrv/uddi/source/web/bindings.cs new file mode 100644 index 0000000..735e6a2 --- /dev/null +++ b/inetsrv/uddi/source/web/bindings.cs @@ -0,0 +1,106 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI.API.Binding; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class BindingControl : UddiControl + { + protected BindingTemplateCollection bindings; + protected BusinessService parent; + protected bool frames; + + protected DataGrid grid; + + public void Initialize( BindingTemplateCollection bindings ) + { + this.bindings = bindings; + this.parent = null; + + grid.Columns[ 0 ].Visible = false; + grid.Columns[ 1 ].Visible = false; + grid.Columns[ 2 ].Visible = true; + } + + public void Initialize( BindingTemplateCollection bindings, BusinessService parent ) + { + this.bindings = bindings; + this.parent = parent; + + grid.Columns[ 0 ].Visible = true; + grid.Columns[ 1 ].Visible = true; + grid.Columns[ 2 ].Visible = false; + } + + protected void Page_Load( object sender, EventArgs e ) + { + frames = ( "true" == Request[ "frames" ] ); + + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + grid.DataSource = bindings; + grid.DataBind(); + } + + protected void Binding_Edit( object sender, DataGridCommandEventArgs e ) + { + string key = bindings[ e.Item.ItemIndex ].BindingKey; + + if( frames ) + { + Response.Write( + ClientScripts.ReloadExplorerAndViewPanes( "editbinding.aspx?frames=true&key=" + key, key ) ); + + Response.End(); + } + else + { + Response.Redirect( "editbinding.aspx?frames=false&key=" + key ); + Response.End(); + } + } + + protected void Binding_Delete( object sender, DataGridCommandEventArgs e ) + { + BindingTemplate binding = bindings[ e.Item.ItemIndex ]; + string name; + + if( null != binding.AccessPoint ) + name = binding.AccessPoint.Value; + else + name = Localization.GetString( "HEADING_BINDING" ); + + string key = binding.BindingKey; + + // + // The user has not yet confirmed the delete operation, so display + // a confirmation dialog. + // + string message = String.Format( + Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), + name ); + + Page.RegisterStartupScript( + "Confirm", + ClientScripts.Confirm( + message, + "editbinding.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + key + "&mode=delete&confirm=true&tab=1" ) ); + } + + protected void Binding_Add( object sender, EventArgs e ) + { + Response.Redirect( "editbinding.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + parent.ServiceKey + "&mode=add" ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/box.cs b/inetsrv/uddi/source/web/box.cs new file mode 100644 index 0000000..d9ba9a5 --- /dev/null +++ b/inetsrv/uddi/source/web/box.cs @@ -0,0 +1,62 @@ +using System; +using System.Web; +using System.Web.UI; + +namespace UDDI.Web +{ + public class Box : Control, INamingContainer + { + protected bool downlevel = false; + + public bool Downlevel + { + get { return downlevel; } + set { downlevel = value; } + } + + public Box() + { + } + + protected override void OnInit( EventArgs e ) + { + Downlevel = + 0 != Page.Request.Browser.Type.IndexOf( "IE" ) || + Page.Request.Browser.MajorVersion < 5; + } + + protected override void Render( HtmlTextWriter output ) + { + if( !Downlevel ) + { + output.AddAttribute( HtmlTextWriterAttribute.Class, "boxed" ); + output.RenderBeginTag( HtmlTextWriterTag.Div ); + + this.RenderChildren( output ); + + output.RenderEndTag(); + } + else + { + output.AddAttribute( HtmlTextWriterAttribute.Cellpadding, "10" ); + output.AddAttribute( HtmlTextWriterAttribute.Cellspacing, "0" ); + output.AddAttribute( HtmlTextWriterAttribute.Border, "1" ); + output.AddAttribute( HtmlTextWriterAttribute.Bgcolor, "#f0f8ff" ); + output.AddAttribute( HtmlTextWriterAttribute.Bordercolor, "#639ace" ); + output.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + output.RenderBeginTag( HtmlTextWriterTag.Table ); + + output.RenderBeginTag( HtmlTextWriterTag.Tr ); + + output.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + this.RenderChildren( output ); + + output.RenderEndTag(); + output.RenderEndTag(); + output.RenderEndTag(); + } + } + } +} diff --git a/inetsrv/uddi/source/web/breadcrumb.cs b/inetsrv/uddi/source/web/breadcrumb.cs new file mode 100644 index 0000000..3dece4a --- /dev/null +++ b/inetsrv/uddi/source/web/breadcrumb.cs @@ -0,0 +1,347 @@ +using System; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI.API.Binding; + +namespace UDDI.Web +{ + public enum BreadCrumbType + { + Edit = 0, + Details = 1, + Search = 1, + Administer = 2 + } + + public class BreadCrumbControl : UserControl + { + protected string root = ""; + protected bool frames; + + protected PlaceHolder section; + protected PlaceHolder navigate; + + protected BreadCrumbType type; + + protected override void OnInit( EventArgs e ) + { + if( "/" != Request.ApplicationPath ) + root = Request.ApplicationPath; + + frames = ( 0 == String.Compare( "true", Request[ "frames" ], true ) ); + } + + public void Initialize( BreadCrumbType type, EntityType entityType, string key ) + { + Initialize( type,entityType,key,null ); + } + public void Initialize( BreadCrumbType type, EntityType entityType, string key, string projectionkey ) + { + this.type = type; + + switch( entityType ) + { + case EntityType.BusinessEntity: + AddBusinessBlurb( key, false ); + break; + + case EntityType.BusinessService: + if( null!=projectionkey ) + { + AddServiceProjectionBlurb( key,projectionkey, false ); + } + else + { + AddServiceBlurb( key, false ); + } + break; + + case EntityType.BindingTemplate: + AddBindingBlurb( key, false ); + break; + + case EntityType.TModel: + AddTModelBlurb( key, false ); + break; + + default: + break; + } + } + + public void Initialize( BreadCrumbType type, EntityType entityType, string key, int index ) + { + this.type = type; + + switch( entityType ) + { + case EntityType.Contact: + AddContactBlurb( key, index, false ); + break; + + case EntityType.TModelInstanceInfo: + AddInstanceInfoBlurb( key, index, false ); + break; + + default: + break; + } + } + + public void AddBlurb( string text, string url, string imageFilename, string tooltip, bool crumb ) + { + if( crumb ) + { + if( navigate.Controls.Count > 0 ) + navigate.Controls.Add( new LiteralControl( " | " ) ); + + HyperLink link = new HyperLink(); + + link.NavigateUrl = url; + link.Text = HttpUtility.HtmlEncode( text ); + link.CssClass = "breadcrumb"; + link.ToolTip = tooltip; + + navigate.Controls.Add( link ); + } + else + { + if( null != imageFilename ) + { + Image image = new Image(); + image.ImageUrl = root + "/images/" + imageFilename; + + if( frames ) + image.ImageAlign = ImageAlign.AbsMiddle; + else + image.ImageAlign = ImageAlign.Bottom; + + section.Controls.Add( image ); + section.Controls.Add( new LiteralControl( " " ) ); + } + + Label label = new Label(); + + label.Text = HttpUtility.HtmlEncode( text ); + label.CssClass = "section"; + label.ToolTip = tooltip; + + section.Controls.Add( label ); + } + } + + public void AddContainerBlurb( bool chained ) + { + string text; + string tooltip; + string url = root; + + if( BreadCrumbType.Edit == type ) + { + text = Localization.GetString( "HEADING_MY_ENTRIES" ); + tooltip = text; + url = root + "/edit/edit.aspx?refreshExplorer=&frames=" + frames.ToString().ToLower(); + } + else + { + if( frames ) + return; + + if( chained ) + { + text = Localization.GetString( "HEADING_SEARCH_RESULTS" ); + url += "/search/results.aspx"; + } + else + { + text = Localization.GetString( "HEADING_SEARCH_CRITERIA" ); + url += "/search/search.aspx"; + } + + tooltip = text; + url += "?search=" + Request[ "search" ] + "&frames=" + frames.ToString().ToLower(); + } + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, null, tooltip, false ); + } + + public void AddBusinessBlurb( string businessKey, bool chained ) + { + BusinessInfo businessInfo = new BusinessInfo( businessKey ); + businessInfo.Get( false ); + + string text = businessInfo.Names[ 0 ].Value; + string tooltip = Localization.GetString( "HEADING_BUSINESS" ); + string url = root; + + if( BreadCrumbType.Edit == type ) + url += "/edit/editbusiness.aspx?refreshExplorer=&key="; + else + url += "/details/businessdetail.aspx?search=" + Request[ "search" ] + "&key="; + + url += businessKey + "&frames=" + frames.ToString().ToLower(); + + AddContainerBlurb( true ); + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, "business.gif", tooltip, false ); + } + + public void AddServiceBlurb( string serviceKey, bool chained ) + { + ServiceInfo serviceInfo = new ServiceInfo(); + + serviceInfo.ServiceKey = serviceKey; + serviceInfo.Get(); + + string text = serviceInfo.Names[ 0 ].Value; + string tooltip = Localization.GetString( "HEADING_SERVICE" ); + string url = root; + + if( BreadCrumbType.Edit == type ) + url += "/edit/editservice.aspx?refreshExplorer=&key="; + else + url += "/details/servicedetail.aspx?search=" + Request[ "search" ] + "&key="; + + url += serviceKey + "&frames=" + frames.ToString().ToLower(); + + AddBusinessBlurb( serviceInfo.BusinessKey, true ); + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, "service.gif", tooltip, false ); + } + public void AddServiceProjectionBlurb( string serviceKey, string parentKey, bool chained ) + { + ServiceInfo serviceInfo = new ServiceInfo(); + + serviceInfo.ServiceKey = serviceKey; + serviceInfo.Get(); + + string text = serviceInfo.Names[ 0 ].Value; + string tooltip = Localization.GetString( "HEADING_SERVICE" ); + string url = root; + + if( BreadCrumbType.Edit == type ) + url += "/edit/editservice.aspx?refreshExplorer=&key="; + else + url += "/details/servicedetail.aspx?search=" + Request[ "search" ] + "&key="; + + url += serviceKey + "&frames=" + frames.ToString().ToLower(); + + AddBusinessBlurb( parentKey, true ); + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, "service_projection.gif", tooltip, false ); + } + public void AddBindingBlurb( string bindingKey, bool chained ) + { + BindingTemplate binding = new BindingTemplate( bindingKey ); + binding.Get(); + + string text = ( null != binding.AccessPoint ? binding.AccessPoint.Value : Localization.GetString( "HEADING_BINDING" ) ); + string tooltip = Localization.GetString( "HEADING_BINDING" ); + string url = root; + + if( BreadCrumbType.Edit == type ) + url += "/edit/editbinding.aspx?refreshExplorer=&key="; + else + url += "/details/bindingdetail.aspx?search=" + Request[ "search" ] + "&key="; + + url += bindingKey + "&frames=" + frames.ToString().ToLower(); + + AddServiceBlurb( binding.ServiceKey, true ); + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, "binding.gif", tooltip, false ); + } + + public void AddInstanceInfoBlurb( string bindingKey, int index, bool chained ) + { + TModelInstanceInfoCollection infos = new TModelInstanceInfoCollection(); + infos.Get( bindingKey ); + + string text = Lookup.TModelName( infos[ index ].TModelKey ); + string tooltip = Localization.GetString( "HEADING_INSTANCE_INFO" ); + string url = root; + + if( BreadCrumbType.Edit == type ) + url += "/edit/editinstanceinfo.aspx?key="; + else + url += "/details/instanceinfodetail.aspx?search=" + Request[ "search" ] + "&key="; + + url += bindingKey + "&index=" + index + "&frames=" + frames.ToString().ToLower(); + + AddBindingBlurb( bindingKey, true ); + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, "instance.gif", tooltip, false ); + } + + public void AddContactBlurb( string businessKey, int index, bool chained ) + { + ContactCollection contacts = new ContactCollection(); + contacts.Get( businessKey ); + + string text = contacts[ index ].PersonName; + string tooltip = Localization.GetString( "HEADING_CONTACT" ); + string url = root; + + if( BreadCrumbType.Edit == type ) + url += "/edit/editcontact.aspx?key="; + else + url += "/details/contactdetail.aspx?search=" + Request[ "search" ] + "&key="; + + url += businessKey + "&index=" + index + "&frames=" + frames.ToString().ToLower(); + + AddBusinessBlurb( businessKey, true ); + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, "contact.gif", tooltip, false ); + } + + public void AddTModelBlurb( string tModelKey, bool chained ) + { + TModelInfo tModelInfo = new TModelInfo( tModelKey ); + tModelInfo.Get(); + + string text = tModelInfo.Name; + string tooltip = Localization.GetString( "HEADING_TMODEL" ); + string url = root; + + if( BreadCrumbType.Edit == type ) + url += "/edit/editmodel.aspx?key="; + else + url += "/details/modeldetail.aspx?search=" + Request[ "search" ] + "&key="; + + url += tModelKey + "&frames=" + frames.ToString().ToLower(); + + AddContainerBlurb( true ); + + if( chained ) + AddBlurb( text, url, null, tooltip, true ); + else + AddBlurb( text, null, "tmodel.gif", tooltip, false ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/build.log b/inetsrv/uddi/source/web/build.log new file mode 100644 index 0000000..e478998 --- /dev/null +++ b/inetsrv/uddi/source/web/build.log @@ -0,0 +1,26 @@ +BUILD: Examining d:\openxp\inetsrv\uddi\source\web directory for files to compile. +Compiling d:\openxp\inetsrv\uddi\source\web directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1' +1>BUILDMSG: Processing d:\openxp\inetsrv\uddi\source\web +Elapsed time [0:00:00.015] ******************** +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.web D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.web not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> +1>Stop. +Linking d:\openxp\inetsrv\uddi\source\web directory ******************** +'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= MAKEDLL=1 386=1' +1>BUILD: D:\OpenXP\tools\genbasemac.pl obj\i386 uddi.web D:\OpenXP\Tools\coffbase.txt +1>genbasemac: module uddi.web not found in D:\OpenXP\Tools\coffbase.txt +1> ..\version\obj\i386\version.exe -outfile .\assemblyversioninfo.cs +1> csc.exe -nologo /r:Accessibility.dll /r:Microsoft.Vsa.dll /r:System.Configuration.Install.dll /r:System.Data.dll /r:System.Design.dll /r:System.DirectoryServices.dll /r:System.dll /r:System.Drawing.Design.dll /r:System.Drawing.dll /r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll /r:System.Runtime.Serialization.Formatters.Soap.dll /r:System.Security.dll /r:System.ServiceProcess.dll /r:System.Web.dll /r:System.Web.RegularExpressions.dll /r:System.Web.Services.dll /r:System.Windows.Forms.Dll /r:System.XML.dll /target:library /out:obj\i386\uddi.web.dll /baseaddress:0x400000 /debug:full /define:DEBUG /warnaserror+ /unsafe- /r:system.dll,system.data.dll,system.web.dll,system.web.services.dll,system.xml.dll,..\core\obj\I386\uddi.core.dll,..\api\obj\I386\uddi.api.dll address.cs assemblyinfo.cs assemblyversioninfo.cs base.cs bindings.cs box.cs breadcrumb.cs businesses.cs cache.cs categorybag.cs clientscripts.cs contacts.cs contextmenu.cs description.cs discoveryurl.cs editcontrol.cs email.cs explorer.cs format.cs header.cs helpcontrol.cs identifierbag.cs instanceinfos.cs localization.cs lookup.cs name.cs owner.cs phone.cs publisher.cs security.cs selection.cs services.cs sidenav.cs statistics.cs tab.cs taxonomy.cs tmodelbag.cs tmodels.cs tree.cs categorybrowser.cs taxonomytree.cs menu.cs validators.cs +1>binplace D:\OpenXP\inetsrv\uddi\source\web\obj\i386\uddi.web.dll +1>binplace D:\OpenXP\inetsrv\uddi\source\web\obj\i386\uddi.web.dll +1> ( echo. ) +1> +1> +1>Stop. +Elapsed time [0:00:01.390] ******************** +Executing post build scripts ******************** +Checkout Public Changes +'D:\OpenXP\tools\edit_public.cmd ' diff --git a/inetsrv/uddi/source/web/businesses.cs b/inetsrv/uddi/source/web/businesses.cs new file mode 100644 index 0000000..8aeeeeb --- /dev/null +++ b/inetsrv/uddi/source/web/businesses.cs @@ -0,0 +1,87 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class BusinessControl : UddiControl + { + protected BusinessInfoCollection businessInfos; + protected bool frames; + + protected DataGrid grid; + + public void Initialize( BusinessInfoCollection businessInfos, bool allowEdit ) + { + this.businessInfos = businessInfos; + + grid.Columns[ 0 ].Visible = allowEdit; + grid.Columns[ 1 ].Visible = allowEdit; + grid.Columns[ 2 ].Visible = !allowEdit; + } + + protected void Page_Load( object sender, EventArgs e ) + { + frames = ( "true" == Request[ "frames" ] ); + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + grid.DataSource = businessInfos; + grid.DataBind(); + } + + protected void Business_Edit( object sender, DataGridCommandEventArgs e ) + { + string key = businessInfos[ e.Item.ItemIndex ].BusinessKey; + + if( frames ) + { + // + // Reload explorer and view panes. + // + Response.Write( + ClientScripts.ReloadExplorerAndViewPanes( "editbusiness.aspx?frames=true&key=" + key, key ) ); + + Response.End(); + } + else + { + Response.Redirect( "editbusiness.aspx?frames=false&key=" + key ); + Response.End(); + } + } + + protected void Business_Delete( object sender, DataGridCommandEventArgs e ) + { + string name = businessInfos[ e.Item.ItemIndex ].Names[ 0 ].Value; + string key = businessInfos[ e.Item.ItemIndex ].BusinessKey; + + // + // The user has not yet confirmed the delete operation, so display + // a confirmation dialog. + // + string message = String.Format( + Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), + name ); + + Page.RegisterStartupScript( + "Confirm", + ClientScripts.Confirm( + message, + "editbusiness.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + key + "&mode=delete&confirm=true&tab=1" ) ); + } + + protected void Business_Add( object sender, EventArgs e ) + { + Response.Redirect( "editbusiness.aspx?frames=" + ( frames ? "true" : "false" ) + "&mode=add" ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/cache.cs b/inetsrv/uddi/source/web/cache.cs new file mode 100644 index 0000000..fbe12cc --- /dev/null +++ b/inetsrv/uddi/source/web/cache.cs @@ -0,0 +1,193 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.Serialization; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + /// ******************************************************************** + /// public class CacheObject + /// -------------------------------------------------------------------- + /// + /// Encapsulates a session cache object. + /// + /// ******************************************************************** + /// + [ XmlRoot( "cacheObject" ) ] + public class CacheObject + { + [XmlElement( "find_business", typeof( FindBusiness ) )] + public UDDI.API.Business.FindBusiness FindBusiness; + + [XmlElement( "find_service", typeof( FindService ) )] + public UDDI.API.Service.FindService FindService; + + [XmlElement( "find_tModel", typeof( FindTModel ) )] + public UDDI.API.ServiceType.FindTModel FindTModel; + + [XmlAttribute( "findType" )] + public string FindType; + + [ XmlIgnore ] + public string UserID; + + public CacheObject() + { + } + + public void Save() + { + SessionCache.Save( UserID, this ); + } + } + + public class SessionCache + { + /// **************************************************************** + /// public Get + /// ---------------------------------------------------------------- + /// + /// Retrieves a cache object from the session cache. + /// + /// ---------------------------------------------------------------- + /// + /// The user id. + /// + /// ---------------------------------------------------------------- + /// + /// The cache object. + /// + /// **************************************************************** + /// + public static CacheObject Get( string userID ) + { + Debug.Enter(); + + // + // Retrieve the cache object from the database. + // + string data = ""; + + SqlCommand cmd = new SqlCommand( "UI_getSessionCache", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@context", SqlDbType.NVarChar, UDDI.Constants.Lengths.Context ) ).Direction = ParameterDirection.Input; + + cmd.Parameters[ "@PUID" ].Value = userID; + cmd.Parameters[ "@context" ].Value = "WebServer"; + + data = (string)cmd.ExecuteScalar(); + + // + // Deserialize into a cache object. + // + CacheObject cache = null; + + if( !Utility.StringEmpty( data ) ) + { + XmlSerializer serializer = new XmlSerializer( typeof( CacheObject ) ); + StringReader reader = new StringReader( data ); + + cache = (CacheObject)serializer.Deserialize( reader ); + cache.UserID = userID; + } + + Debug.Leave(); + + return cache; + } + + /// **************************************************************** + /// public Save + /// ---------------------------------------------------------------- + /// + /// Stores the cache object in the session cache. + /// + /// ---------------------------------------------------------------- + /// + /// The user id. + /// + /// + /// + /// The cache object. + /// + /// **************************************************************** + /// + public static void Save( string userID, CacheObject cache ) + { + Debug.Enter(); + + // + // Serialize the data into a stream. + // + XmlSerializer serializer = new XmlSerializer( typeof( CacheObject ) ); + UTF8EncodedStringWriter writer = new UTF8EncodedStringWriter(); + + serializer.Serialize( writer, cache ); + + // + // Write the cache object to the database. + // + SqlCommand cmd = new SqlCommand( "UI_setSessionCache", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@cacheValue", SqlDbType.NText ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@context", SqlDbType.NVarChar, UDDI.Constants.Lengths.Context ) ).Direction = ParameterDirection.Input; + + cmd.Parameters[ "@PUID" ].Value = userID; + cmd.Parameters[ "@cacheValue" ].Value = writer.ToString(); + cmd.Parameters[ "@context" ].Value = "WebServer"; + + cmd.ExecuteNonQuery(); + + Debug.Leave(); + } + + /// **************************************************************** + /// public Discard + /// ---------------------------------------------------------------- + /// + /// Removes a cache object from the session cache. + /// + /// ---------------------------------------------------------------- + /// + /// The user id. + /// + /// **************************************************************** + /// + public static void Discard( string userID ) + { + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "UI_removeSessionCache", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@context", SqlDbType.NVarChar, UDDI.Constants.Lengths.Context ) ).Direction = ParameterDirection.Input; + + cmd.Parameters[ "@PUID" ].Value = userID; + cmd.Parameters[ "@context" ].Value = "WebServer"; + + cmd.ExecuteNonQuery(); + + Debug.Leave(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/categorybag.cs b/inetsrv/uddi/source/web/categorybag.cs new file mode 100644 index 0000000..d89a11f --- /dev/null +++ b/inetsrv/uddi/source/web/categorybag.cs @@ -0,0 +1,196 @@ +using System; +using System.Data; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class CategoryBagControl : UddiControl + { + protected KeyedReferenceCollection categoryBag = null; + protected CacheObject cache = null; + protected EntityBase entity = null; + protected bool FindMode; + protected DataGrid grid; + protected Label taxonomyID; + protected Label taxonomyName; + protected Label tModelKey; + protected Label keyName; + protected Label keyValue; + protected Label path; + + public void Initialize( KeyedReferenceCollection categoryBag ) + { + this.categoryBag = categoryBag; + + grid.Columns[ 2 ].Visible = false; + } + + public void Initialize( KeyedReferenceCollection categoryBag, EntityBase entity ) + { + this.categoryBag = categoryBag; + this.entity = entity; + + grid.Columns[ 2 ].Visible = true; + } + + public void Initialize( KeyedReferenceCollection categoryBag, CacheObject cache ) + { + this.categoryBag = categoryBag; + this.cache = cache; + + grid.Columns[ 2 ].Visible = true; + } + + public void Initialize( KeyedReferenceCollection categoryBag, CacheObject cache, bool rebind ) + { + this.categoryBag = categoryBag; + this.cache = cache; + + grid.Columns[ 2 ].Visible = true; + + if( rebind ) + CategoryBag_DataBind( false ); + + } + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + CategoryBag_DataBind( false ); + } + + protected Control GetControl( string id, int cell ) + { + return grid.Items[ grid.EditItemIndex ].Cells[ cell ].FindControl( id ); + } + + protected void CategoryBag_DataBind( bool insertRow ) + { + DataTable table = new DataTable(); + DataRow row; + + int index = 0; + + table.Columns.Add( new DataColumn( "Index", typeof( int ) ) ); + table.Columns.Add( new DataColumn( "TModelName", typeof( string ) ) ); + table.Columns.Add( new DataColumn( "KeyName", typeof( string ) ) ); + table.Columns.Add( new DataColumn( "KeyValue", typeof( string ) ) ); + table.Columns.Add( new DataColumn( "TModelKey", typeof( string ) ) ); + + foreach( KeyedReference keyedReference in categoryBag ) + { + row = table.NewRow(); + + row[0] = index; + row[1] = HttpUtility.HtmlEncode( Lookup.TModelName( keyedReference.TModelKey ) ); + row[2] = HttpUtility.HtmlEncode( keyedReference.KeyName ); + row[3] = HttpUtility.HtmlEncode( keyedReference.KeyValue ); + row[4] = keyedReference.KeyValue; + + table.Rows.Add( row ); + + index ++; + } + + if( insertRow ) + { + row = table.NewRow(); + + row[0] = index; + row[1] = ""; + row[2] = ""; + row[3] = ""; + row[4] = ""; + table.Rows.Add( row ); + + index ++; + } + + grid.DataSource = table.DefaultView; + grid.ShowFooter = !FindMode; + grid.DataBind(); + } + + protected void CategoryBag_OnCommand( object sender, DataGridCommandEventArgs e ) + { + switch( e.CommandName.ToLower() ) + { + case "add": + CategoryBag_OnAdd(sender, e ); + break; + + case "select": + CategoryChooser_OnSelect( sender, e ); + break; + + case "cancel": + CategoryChooser_OnCancel( sender, e ); + break; + } + } + + protected void CategoryBag_OnAdd( object sender, DataGridCommandEventArgs e ) + { + + + grid.EditItemIndex = categoryBag.Count; + SetEditMode(); + + CategoryBag_DataBind( true ); + + } + + protected void CategoryBag_OnDelete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + categoryBag.RemoveAt( index ); + + if( null != entity ) + entity.Save(); + + if( null != cache ) + cache.Save(); + + CategoryBag_DataBind( false ); + } + + + protected void CategoryChooser_OnSelect( object sender, DataGridCommandEventArgs e ) + { + KeyedReference keyedReference = categoryBag[ categoryBag.Add() ]; + + + CategoryBrowserControl b = (CategoryBrowserControl)GetControl( "browser", 1 ); + + + keyedReference.TModelKey = "uuid:" + b.TModelKey; + keyedReference.KeyName = HttpUtility.HtmlDecode( b.KeyName ); + keyedReference.KeyValue = b.KeyValue; + + if( null != entity ) + entity.Save(); + + if( null != cache ) + cache.Save(); + + grid.EditItemIndex = -1; + CancelEditMode(); + + CategoryBag_DataBind( false ); + } + + protected void CategoryChooser_OnCancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + CategoryBag_DataBind( false ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/categorybrowser.cs b/inetsrv/uddi/source/web/categorybrowser.cs new file mode 100644 index 0000000..28078c6 --- /dev/null +++ b/inetsrv/uddi/source/web/categorybrowser.cs @@ -0,0 +1,392 @@ +using System; +using System.Collections; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + /// + /// Summary description for categorybrowser. + /// + public class CategoryBrowserControl : UddiControl + { + + protected LinkButton rootLink; + protected Panel panelTaxonomyList; + protected Panel panelCategoryChooser; + protected DataGrid taxonomyList; + protected DataGrid categoryChooser; + protected Label labelCategoryChooser; + protected Label categoryTree; + protected TaxonomyTreeControl taxonomyTree; + + private DataView taxonomies; + + protected int SelectedTaxonomyItemIndex; + + + public CategoryBrowserControl() + { + + } + + + protected KeyedReferenceCollection categoryBag; + protected CacheObject cache = null; + + public string ParentKeyValue + { + get{ return parentKeyValue; } + } + protected string parentKeyValue=""; + + public string TaxonomyID + { + get{ return taxonomyID; } + } + protected string taxonomyID; + + + public string TaxonomyName + { + get{ return taxonomyName; } + } + protected string taxonomyName; + + + public string Path + { + get{ return path; } + } + protected string path=""; + + + public string TModelKey + { + get{ return tModelKey; } + } + protected string tModelKey; + + + public string KeyName + { + get{ return keyName; } + } + protected string keyName; + + public string KeyValue + { + get{ return keyValue; } + } + protected string keyValue; + + + + + public bool ShowNoCategoriesMessage + { + get { return showNoCategoriesMessage; } + set { showNoCategoriesMessage = value; } + } + protected bool showNoCategoriesMessage; + + public int TaxonomyCount + { + get{ return taxonomies != null ? taxonomies.Count : 0; } + } + + protected bool showallcategories = false; + public bool ShowAllCategories + { + get{ return showallcategories; } + set{ showallcategories=value; } + } + + public void Initialize( KeyedReferenceCollection catbag, CacheObject co ) + { + showNoCategoriesMessage = true; + categoryBag = catbag; + cache = co; + } + + protected void Page_Init( object sender, EventArgs e ) + { + + } + protected void Page_Load( object sender, EventArgs e ) + { + + + + taxonomyID = Request[ "taxonomyID" ]; + taxonomyName = Request[ "taxonomyName" ]; + tModelKey = Request[ "tModelKey" ]; + keyName = Request[ "keyName" ]; + keyValue = Request[ "keyValue" ]; + + taxonomyTree.Click += new TaxonomyTreeControlEventHandler( TaxonomyTreeControl_Click ); + if( null!=rootLink ) + { + rootLink.Text = Localization.GetString( "TAG_AVAILABLE_TAXONOMIES" ); + rootLink.Enabled = (null!=taxonomyID); + rootLink.Click += new EventHandler( TaxonomyRootLink_Click ); + } + Populate(); + + + } + public void Populate() + { + if( null!=taxonomyID && ""!=taxonomyID ) + { + if( null!=keyValue && ""!=keyValue ) + { + PopulateTaxonomyTree(); + PopulateCategoryChooser(); + } + } + else + { + PopulateTaxonomyList( false ); + } + } + protected void PopulateTaxonomyList( bool single ) + { + panelTaxonomyList.Visible = true; + panelCategoryChooser.Visible = false; + //DataView taxonomies = null; + if( !single ) + { + if( ShowAllCategories ) + { + //get all taxonomies + taxonomies = Taxonomy.GetTaxonomies(); + } + else + { + taxonomies = Taxonomy.GetTaxonomiesForBrowsing(); + } + } + else + { + //get a single taxonomy for the list + taxonomies = Taxonomy.GetTaxonomiesForBrowsing( "tModelKey = '"+tModelKey+"'","tModelKey" ); + } + + //make sure the visible text is html encoded + foreach( DataRowView row in taxonomies ) + row[ "description" ] = HttpUtility.HtmlEncode( (string)row[ "description" ] ); + + taxonomyList.DataSource = taxonomies; + taxonomyList.DataBind(); + } + protected void PopulateTaxonomyTree( ) + { + panelTaxonomyList.Visible = false; + panelCategoryChooser.Visible =true ; + + int id=Convert.ToInt32( taxonomyID ); + + taxonomyTree.TaxonomyID = id; + taxonomyTree.KeyName = taxonomyName; + taxonomyTree.KeyValue = "__r00t__"; + + TaxonomyTreeItemControl item=null; + + + + if( "__r00t__"!=keyValue && ""!=keyValue ) + { + string parent = keyValue; + + while( null!=parent && ""!=parent ) + { + if( null==item) item=new TaxonomyTreeItemControl(); + item.KeyValue = parent; + //replace this with a way to get the keyName with the taxonomyID and the taxonomyValue + item.KeyName = Taxonomy.GetTaxonomyKeyName( id, parent ); + item.TaxonomyID = id; + item.Click += new TaxonomyTreeControlEventHandler( TaxonomyTreeControl_Click ); + parent = Taxonomy.GetTaxonomyParent( id, parent ); + if( ""==parent )break; + TaxonomyTreeItemControl parentitem = new TaxonomyTreeItemControl();; + parentitem.SetChild( item ); + item = parentitem; + + } + } + if( null!=item ) + { + taxonomyTree.SetChild( item ); + taxonomyTree.SelectItem( item.Count ); + } + else + taxonomyTree.SelectItem( 0 ); + + + taxonomyTree.TaxonomyID = id; + taxonomyTree.KeyName = taxonomyName; + taxonomyTree.KeyValue = "__r00t__"; + + } + protected void PopulateCategoryChooser( ) + { + panelTaxonomyList.Visible = false; + panelCategoryChooser.Visible =true ; + + string root = ( "/" == Page.Request.ApplicationPath ) ? "" : Page.Request.ApplicationPath; + + + int id = Convert.ToInt32( taxonomyID ); + + if( Utility.StringEmpty( keyValue ) ) + { + taxonomies = Taxonomy.GetTaxonomyChildrenRoot( id ); + } + else + { + taxonomies = Taxonomy.GetTaxonomyChildrenNode( id, keyValue ); + } + + if( 0 == taxonomies.Count ) + { + categoryChooser.Visible = false; + + if( true == showNoCategoriesMessage ) + { + labelCategoryChooser.Text = Localization.GetString( "HEADING_NO_CATEGORIES" ); + } + } + else + { + foreach( DataRowView row in taxonomies ) + row[ "keyName" ] = HttpUtility.HtmlEncode( (string)row[ "keyName" ] ); + + categoryChooser.Visible = true; + + labelCategoryChooser.Text = Localization.GetString( "TAG_SUBCATEGORIES" ); + + categoryChooser.DataSource = taxonomies; + categoryChooser.DataBind(); + } + + + } + public void Reset() + { + taxonomyID = null; + taxonomyName = null; + tModelKey = null; + keyName = null; + keyValue = null; + PopulateTaxonomyList(false); + } + protected void CategoryChooser_OnPageChange( object sender, DataGridPageChangedEventArgs e ) + { + categoryChooser.CurrentPageIndex = e.NewPageIndex; + PopulateTaxonomyTree(); + PopulateCategoryChooser(); + } + protected void CategoryChooser_Command( object sender, DataGridCommandEventArgs e ) + { + switch( e.CommandName ) + { + case "select": + + categoryChooser.CurrentPageIndex = 0; + taxonomyID = e.Item.Cells[ 0 ].Text; + parentKeyValue = e.Item.Cells[ 1 ].Text; + keyName = e.Item.Cells[ 2 ].Text; + keyValue = e.Item.Cells[ 4 ].Text; + + //path = path + "/:/" + keyName ;//+ "|" + keyValue + "|" + taxonomyID; + PopulateTaxonomyTree(); + PopulateCategoryChooser(); + + if( null!=cache ) + { + cache.FindBusiness.CategoryBag.Clear(); + cache.FindBusiness.CategoryBag.Add( keyName, keyValue, "uuid:"+tModelKey ); + + cache.FindService.CategoryBag.Clear(); + cache.FindService.CategoryBag.Add( keyName, keyValue, "uuid:"+tModelKey ); + + cache.FindTModel.CategoryBag.Clear(); + cache.FindTModel.CategoryBag.Add( keyName, keyValue, "uuid:"+tModelKey ); + + cache.Save(); + } + + if( null!=this.categoryBag ) + { + + } + + break; + + default: + break; + } + } + protected void TaxonomyList_OnCommand( object sender, DataGridCommandEventArgs e ) + { + switch( e.CommandName ) + { + case "browse": + categoryChooser.CurrentPageIndex = 0; + panelTaxonomyList.Visible = false; + panelCategoryChooser.Visible = true; + categoryChooser.CurrentPageIndex = 0; + taxonomyID = e.Item.Cells[ 0 ].Text; + taxonomyName = e.Item.Cells[ 1 ].Text; + tModelKey = e.Item.Cells[ 3 ].Text; + + keyName = ""; + keyValue = ""; + path = ""; + + PopulateTaxonomyTree(); + PopulateCategoryChooser(); + + break; + default: + break; + } + + + } + + + + + private void TaxonomyRootLink_Click( object sender, EventArgs e ) + { + this.Reset(); + } + private void TaxonomyTreeControl_Click( object sender, TaxonomyTreeControlEventArgs e ) + { + + //reset the page index on the categoryChooser + this.categoryChooser.CurrentPageIndex = 0; + + //set the relevent info from the selected taxonomy item + this.taxonomyID = e.Item.TaxonomyID.ToString(); + this.keyName = e.Item.KeyName; + this.keyValue = ( ( "__r00t__"==e.Item.KeyValue)?"":e.Item.KeyValue); + + //populate the data + this.PopulateTaxonomyTree(); + this.PopulateCategoryChooser(); + + } + + } + +} diff --git a/inetsrv/uddi/source/web/clientscripts.cs b/inetsrv/uddi/source/web/clientscripts.cs new file mode 100644 index 0000000..100d3cb --- /dev/null +++ b/inetsrv/uddi/source/web/clientscripts.cs @@ -0,0 +1,427 @@ +using System; + +namespace UDDI.Web +{ + public class ClientScripts + { + + + /// **************************************************************** + /// public ShowHelp [static] + /// ---------------------------------------------------------------- + /// + /// Shows the given help url. + /// + /// ---------------------------------------------------------------- + /// + /// The URL to load. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to show the help. + /// + /// **************************************************************** + /// + public static string ShowHelp( string url ) + { + string script = @" + "; + + script = script.Replace( "{url}", url.Replace( "\"", "\\\"" ) ); + + return script; + } + + /// **************************************************************** + /// public ReloadTop [static] + /// ---------------------------------------------------------------- + /// + /// Reloads the top window with the given url. + /// + /// ---------------------------------------------------------------- + /// + /// The URL to load in the top window. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to reload the top window. + /// + /// **************************************************************** + /// + public static string ReloadTop( string url ) + { + string script = @" + "; + + script = script.Replace( "{url}", url.Replace( "\"", "\\\"" ) ); + + return script; + } + + /// **************************************************************** + /// public ReloadViewPane [static] + /// ---------------------------------------------------------------- + /// + /// Reloads the view pane with the given url. + /// + /// ---------------------------------------------------------------- + /// + /// The URL to load in the view pane. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to reload the view pane. + /// + /// **************************************************************** + /// + public static string ReloadViewPane( string url ) + { + string script = @" + "; + + script = script.Replace( "{url}", url.Replace( "\"", "\\\"" ) ); + + return script; + } + + /// **************************************************************** + /// public ReloadExplorerPane [static] + /// ---------------------------------------------------------------- + /// + /// Reloads the explorer pane. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to reload the explorer pane. + /// + /// **************************************************************** + /// + public static string ReloadExplorerPane() + { + string script = @" + "; + + return script; + } + + /// **************************************************************** + /// public ReloadExplorerPane [static] + /// ---------------------------------------------------------------- + /// + /// Reloads the explorer pane. + /// + /// ---------------------------------------------------------------- + /// + /// The node key to select. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to reload the explorer pane. + /// + /// **************************************************************** + /// + public static string ReloadExplorerPane( string key ) + { + string script = @" + "; + + script = script.Replace( "{key}", key.Replace( "\"", "\\\"" ) ); + + return script; + } + + /// **************************************************************** + /// public ReloadExplorerAndViewPanes [static] + /// ---------------------------------------------------------------- + /// + /// Reloads the explorer and view panes. + /// + /// ---------------------------------------------------------------- + /// + /// The URL to load in the view pane. + /// + /// + /// + /// The node key to select in the explorer pane. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to reload the explorer and view panes. + /// + /// **************************************************************** + /// + public static string ReloadExplorerAndViewPanes( string url, string key ) + { + string script = @" + "; + + script = script.Replace( "{url}", url.Replace( "\"", "\\\"" ) ); + script = script.Replace( "{key}", key.Replace( "\"", "\\\"" ) ); + + return script; + } + + /// **************************************************************** + /// public Confirm [static] + /// ---------------------------------------------------------------- + /// + /// Displays a confirmation dialog and then proceeds to one + /// of two URL's depending on the user's choice. + /// + /// ---------------------------------------------------------------- + /// + /// The message to display. + /// + /// + /// + /// The URL to go to if the user selects OK. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to display the confirm dialog. + /// + /// **************************************************************** + /// + public static string Confirm( string message, string urlOk ) + { + string script = @" + "; + + script = script.Replace( "{message}", message.Replace( "\"", "\\\"" ).Replace( "\n", " " ) ); + script = script.Replace( "{urlOk}", urlOk.Replace( "\"", "\\\"" ) ); + + return script; + } + + /// **************************************************************** + /// public Confirm [static] + /// ---------------------------------------------------------------- + /// + /// Displays a confirmation dialog and then proceeds to one + /// of two URL's depending on the user's choice. + /// + /// ---------------------------------------------------------------- + /// + /// The message to display. + /// + /// + /// + /// The URL to go to if the user selects OK. + /// + /// + /// + /// The URL to go to if the user selects Cancel. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to display the confirm dialog. + /// + /// **************************************************************** + /// + public static string Confirm( string message, string urlOk, string urlCancel ) + { + string script = @" + "; + + script = script.Replace( "{message}", message.Replace( "\"", "\\\"" ).Replace( "\n", " " ) ); + script = script.Replace( "{urlOk}", urlOk.Replace( "\"", "\\\"" ) ); + script = script.Replace( "{urlCancel}", urlCancel.Replace( "\"", "\\\"" ) ); + + return script; + } + + + /// **************************************************************** + /// public ShowModalDialog [static] + /// ---------------------------------------------------------------- + /// + /// Displays a modal dialog. + /// + /// ---------------------------------------------------------------- + /// + /// The URL of the dialog to display. + /// + /// + /// + /// The width of the dialog. + /// + /// + /// + /// The height of the dialog. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to display the dialog. + /// + /// **************************************************************** + /// + public static string ShowModalDialog( string url, string width, string height, bool resizable, bool scrollbars, bool status ) + { + string script = @" + "; + + script = script.Replace( "{url}", url.Replace( "\"", "\\\"" ) ); + script = script.Replace( "{width}", width ); + script = script.Replace( "{height}", height ); + script = script.Replace( "{resizable}", resizable ? "yes" : "no" ); + script = script.Replace( "{scrollbars}", scrollbars ? "yes" : "no" ); + script = script.Replace( "{status}", status ? "yes" : "no" ); + + return script; + } + + /// **************************************************************** + /// public CloseWindow [static] + /// ---------------------------------------------------------------- + /// + /// Closes the window. + /// + /// ---------------------------------------------------------------- + /// + /// The client script to close the window. + /// + /// **************************************************************** + /// + public static string CloseWindow() + { + string script = @" + "; + + return script; + } + + + + + } + public class ClientScriptRegisterCollection : System.Collections.CollectionBase + { + public ClientScriptRegister this[ int index ] + { + get{ return (ClientScriptRegister)this.List[ index ] ; } + set{ this.List[ index ]=value; } + } + public int Add( ClientScriptRegister script ) + { + return this.List.Add( script ); + } + public void Remove( ClientScriptRegister script ) + { + this.List.Remove( script ); + } + public void Remove( int index ) + { + this.List.RemoveAt( index ); + } + + } + + public class ClientScriptRegister : System.Web.UI.WebControls.PlaceHolder + { + private string source; + public string Source + { + get{ return source; } + set{ source=value; } + } + + private string language; + public string Language + { + get{ return language; } + set{ language=value; } + } + protected override void Render( System.Web.UI.HtmlTextWriter output ) + { + //if source is provided, then render a link + if( null!=source ) + { + + output.Write( + "" + ); + } + else//else render the control + { + //render script tag + if( null!=Language ) + output.AddAttribute( "language", Language ); + + output.RenderBeginTag( System.Web.UI.HtmlTextWriterTag.Script ); + + base.Render( output ); + + //close script tag + output.RenderEndTag(); + } + } + } +} diff --git a/inetsrv/uddi/source/web/contacts.cs b/inetsrv/uddi/source/web/contacts.cs new file mode 100644 index 0000000..863a6d6 --- /dev/null +++ b/inetsrv/uddi/source/web/contacts.cs @@ -0,0 +1,89 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class ContactControl : UddiControl + { + protected ContactCollection contacts; + protected BusinessEntity parent; + protected bool frames; + + protected DataGrid grid; + + public void Initialize( ContactCollection contacts, BusinessEntity parent, bool allowEdit ) + { + this.contacts = contacts; + this.parent = parent; + + grid.Columns[ 0 ].Visible = allowEdit; + grid.Columns[ 1 ].Visible = allowEdit; + grid.Columns[ 2 ].Visible = !allowEdit; + } + + protected void Page_Load( object sender, EventArgs e ) + { + frames = ( "true" == Request[ "frames" ] ); + + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + grid.DataSource = contacts; + grid.DataBind(); + } + + protected void Contact_Edit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + if( frames ) + { + Response.Write( + ClientScripts.ReloadExplorerAndViewPanes( "editcontact.aspx?frames=true&key=" + parent.BusinessKey + "&index=" + index, parent.BusinessKey + ":" + index ) ); + + Response.End(); + } + else + { + Response.Redirect( "editcontact.aspx?frames=false&key=" + parent.BusinessKey + "&index=" + index ); + Response.End(); + } + } + + protected void Contact_Delete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + string name = contacts[ index ].PersonName; + string key = parent.BusinessKey; + + // + // The user has not yet confirmed the delete operation, so display + // a confirmation dialog. + // + string message = String.Format( + Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), + name ); + + Page.RegisterStartupScript( + "Confirm", + ClientScripts.Confirm( + message, + "editcontact.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + key + "&index=" + index + "&mode=delete&confirm=true&tab=2" ) ); + } + + protected void Contact_Add( object sender, EventArgs e ) + { + Response.Redirect( "editcontact.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + parent.BusinessKey + "&mode=add" ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/contextmenu.cs b/inetsrv/uddi/source/web/contextmenu.cs new file mode 100644 index 0000000..5f8261c --- /dev/null +++ b/inetsrv/uddi/source/web/contextmenu.cs @@ -0,0 +1,258 @@ +using System; +using System.Collections; +using System.Web.UI; + +using UDDI; + +namespace UDDI.Web +{ + public class ContextMenu : Control + { + protected ArrayList menuItems = new ArrayList(); + + protected static string popupScript = @" + "; + + protected static string contextMenuScript = @" + "; + + public ContextMenu() + { + } + + protected override void OnInit( EventArgs e ) + { + if( !Page.IsClientScriptBlockRegistered( "UDDI.Web.Popup" ) ) + Page.RegisterClientScriptBlock( "UDDI.Web.Popup", popupScript ); + + if( !Page.IsClientScriptBlockRegistered( "UDDI.Web.ContextMenu" ) ) + Page.RegisterClientScriptBlock( "UDDI.Web.ContextMenu", contextMenuScript ); + } + + protected override void AddParsedSubObject( object obj ) + { + if( obj is MenuItem || obj is MenuSeparator ) + menuItems.Add( obj ); + } + + protected override void Render( HtmlTextWriter output ) + { + output.Write( "" ); + } + } + + public class MenuItem : Control + { + protected bool bold = false; + protected string imageUrl = null; + protected string onClick = null; + protected string statusText = null; + protected string text = null; + protected RoleType requiredRole = RoleType.Anonymous; + + public bool Bold + { + get { return bold; } + set { bold = value; } + } + + public string ImageUrl + { + get { return imageUrl; } + set { imageUrl = value; } + } + + public string OnClick + { + get { return onClick; } + set { onClick = value; } + } + + public string StatusText + { + get { return statusText; } + set { statusText = value; } + } + + public string Text + { + get { return text; } + set { text = value; } + } + + public RoleType RequiredRole + { + get { return requiredRole; } + set { requiredRole = value; } + } + + public bool AccessAllowed + { + get + { + return + ( RoleType.Anonymous == requiredRole ) || + ( RoleType.User == requiredRole && UDDI.Context.User.IsUser ) || + ( RoleType.Publisher == requiredRole && UDDI.Context.User.IsPublisher ) || + ( RoleType.Coordinator == requiredRole && UDDI.Context.User.IsCoordinator ) || + ( RoleType.Administrator == requiredRole && UDDI.Context.User.IsAdministrator ); + } + } + + public MenuItem() + { + } + } + + public class MenuSeparator : Control + { + protected RoleType requiredRole = RoleType.Anonymous; + + public MenuSeparator() + { + } + + public RoleType RequiredRole + { + get { return requiredRole; } + set { requiredRole = value; } + } + + public bool AccessAllowed + { + get + { + return + ( RoleType.Anonymous == requiredRole ) || + ( RoleType.User == requiredRole && UDDI.Context.User.IsUser ) || + ( RoleType.Publisher == requiredRole && UDDI.Context.User.IsPublisher ) || + ( RoleType.Coordinator == requiredRole && UDDI.Context.User.IsCoordinator ) || + ( RoleType.Administrator == requiredRole && UDDI.Context.User.IsAdministrator ); + } + } + } +} diff --git a/inetsrv/uddi/source/web/description.cs b/inetsrv/uddi/source/web/description.cs new file mode 100644 index 0000000..c1d3ecd --- /dev/null +++ b/inetsrv/uddi/source/web/description.cs @@ -0,0 +1,163 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class DescriptionControl : UddiControl + { + protected DescriptionCollection descriptions; + protected EntityBase entity; + + protected DataGrid grid; + + public void Initialize( DescriptionCollection descriptions ) + { + this.descriptions = descriptions; + + grid.Columns[ 1 ].Visible = false; + } + + public void Initialize( DescriptionCollection descriptions, EntityBase entity ) + { + this.descriptions = descriptions; + this.entity = entity; + + grid.Columns[ 1 ].Visible = true; + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + grid.DataSource = descriptions; + grid.DataBind(); + } + + protected DataView GetLanguages() + { + DataView view = Lookup.GetLanguages(); + + int index = 0; + foreach( Description description in descriptions ) + { + if( index != grid.EditItemIndex ) + { + foreach( DataRowView row in view ) + { + if( row[ "isoLangCode" ].ToString() == description.IsoLangCode ) + { + row.Delete(); + break; + } + } + } + + index ++; + } + + return view; + } + + protected void Description_OnEdit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + grid.EditItemIndex = index; + SetEditMode(); + + PopulateDataGrid(); + + Description description = descriptions[ index ]; + + DropDownList list = (DropDownList)grid.Items[ index ].Cells[ 1 ].FindControl( "language" ); + + if( null != list ) + { + ListItem item = list.Items.FindByValue( description.IsoLangCode ); + + if( null != item ) + item.Selected = true; + else + { + item = new ListItem( description.IsoLangCode, description.IsoLangCode ); + list.Items.Add( item ); + item.Selected = true; + } + } + } + + protected void Description_OnUpdate( object sender, DataGridCommandEventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + string text = ""; + + int index = grid.EditItemIndex; + + if( index >= descriptions.Count ) + descriptions.Add( "" ); + + Description description = descriptions[ index ]; + + description.IsoLangCode = ((DropDownList)e.Item.FindControl( "language" )).SelectedItem.Value; + text = ((TextBox)e.Item.FindControl( "description" )).Text.Trim(); + + description.Value = text; + entity.Save(); + + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + } + + protected void Description_OnCancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void Description_OnDelete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + descriptions.RemoveAt( index ); + entity.Save(); + + PopulateDataGrid(); + } + + protected void Description_OnAdd( object sender, EventArgs e ) + { + int index = descriptions.Count; + + grid.EditItemIndex = index; + SetEditMode(); + + descriptions.Add( "" ); + PopulateDataGrid(); + + DropDownList list = (DropDownList)grid.Items[ index ].Cells[ 1 ].FindControl( "language" ); + ListItem item = list.Items.FindByValue( Localization.GetCulture().TwoLetterISOLanguageName ); + + if( null != item ) + item.Selected = true; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/discoveryurl.cs b/inetsrv/uddi/source/web/discoveryurl.cs new file mode 100644 index 0000000..730b8f6 --- /dev/null +++ b/inetsrv/uddi/source/web/discoveryurl.cs @@ -0,0 +1,176 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class DiscoveryUrlControl : UddiControl + { + protected DiscoveryUrlCollection discoveryUrls; + + protected BusinessEntity parentEntity = null; + protected string BusinessKey = ""; + + protected DataGrid grid; + + public override void DataBind() + { + base.DataBind(); + grid.DataBind(); + } + + public void Initialize( DiscoveryUrlCollection discUrls) + { + this.discoveryUrls = ShuffleData( discUrls ); + grid.Columns[ 1 ].Visible = false; + } + + public void Initialize( DiscoveryUrlCollection discUrls, BusinessEntity parentEntity ) + { + //set the parenet entity + this.parentEntity = parentEntity; + + //capture the be key + this.BusinessKey = this.parentEntity.BusinessKey; + + //reorganize the discoveryUrls to mantian order. + //we need the default to be the first in the collection. + this.discoveryUrls = ShuffleData( discUrls ); + + + grid.Columns[ 1 ].Visible = true; + } + + protected void Page_Init( object sender, EventArgs e ) + { + grid.Columns[ 0 ].HeaderText = Localization.GetString( "HEADING_DISCOVERYURL" ); + grid.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_ACTIONS" ); + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid(); + } + DiscoveryUrlCollection ShuffleData( DiscoveryUrlCollection discurls ) + { + foreach( DiscoveryUrl d in discurls ) + { + // move the default one to the begining of the list to + // fix bug: 1229 + if( d.IsDefault( BusinessKey ) ) + { + discurls.Remove( d ); + discurls.Insert( 0, d ); + break; + } + } + return discurls; + + } + void PopulateDataGrid() + { + + grid.DataSource = discoveryUrls; + grid.DataBind(); + } + + protected void DiscoveryUrl_Edit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + grid.EditItemIndex = index; + SetEditMode(); + + grid.ShowFooter = false; + + PopulateDataGrid(); + } + + protected void OnEnterKeyPressed( object sender, EventArgs e ) + { + DiscoveryUrl_Update( sender, null ); + } + public string TruncateUrl( string input ) + { + if( null!=input && input.Length>80 ) + return input.Substring( 0, 77 ) + "..."; + else + return input; + } + protected void DiscoveryUrl_Update( object sender, DataGridCommandEventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + int index = grid.EditItemIndex; + + if( index == discoveryUrls.Count ) + discoveryUrls.Add(); + + DiscoveryUrl discoveryUrl = discoveryUrls[ index ]; + + DataGridItem item = grid.Items[ index ]; + + discoveryUrl.Value = ((TextBox)item.FindControl( "discoveryUrl" )).Text; + discoveryUrl.UseType = ((TextBox)item.FindControl( "useType" )).Text; + + + parentEntity.Save(); + + grid.EditItemIndex = -1; + grid.ShowFooter = true; + + CancelEditMode(); + + this.discoveryUrls = ShuffleData( parentEntity.DiscoveryUrls ); + + PopulateDataGrid(); + } + } + + protected void DiscoveryUrl_Cancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + grid.ShowFooter = true; + + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void DiscoveryUrl_Delete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + discoveryUrls.RemoveAt( index ); + + parentEntity.Save(); + + grid.EditItemIndex = -1; + + this.discoveryUrls = ShuffleData( parentEntity.DiscoveryUrls ); + + PopulateDataGrid(); + } + + protected void DiscoveryUrl_Add( object sender, EventArgs e ) + { + grid.EditItemIndex = discoveryUrls.Count; + grid.ShowFooter = false; + + SetEditMode(); + + discoveryUrls.Add(); + + PopulateDataGrid(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/editcontrol.cs b/inetsrv/uddi/source/web/editcontrol.cs new file mode 100644 index 0000000..5d112ad --- /dev/null +++ b/inetsrv/uddi/source/web/editcontrol.cs @@ -0,0 +1,150 @@ +using System; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Collections; +using System.Collections.Specialized; + +namespace UDDI.Web +{ + public class EditControl : WebControl, INamingContainer + { + protected ITemplate itemTemplate = null; + protected ITemplate editItemTemplate = null; + protected Control activeControl = null; + + public event CommandEventHandler EditCommand; + public event CommandEventHandler CancelCommand; + public event CommandEventHandler UpdateCommand; + + public Control ActiveControl + { + get + { + EnsureChildControls(); + + if( EditMode ) + return Controls[ 1 ]; + else + return Controls[ 0 ]; + } + } + + public bool EditMode + { + get + { + if( null == ViewState[ "EditMode" ] ) + return false; + + return (bool)ViewState[ "EditMode" ]; + } + } + + public void CancelEditMode() + { + ViewState[ "EditMode" ] = false; + + Controls[ 0 ].Visible = true; + Controls[ 1 ].Visible = false; + + ((UddiPage)Page).CancelEditMode(); + } + + public void SetEditMode() + { + ViewState[ "EditMode" ] = true; + + Controls[ 0 ].Visible = false; + Controls[ 1 ].Visible = true; + + ((UddiPage)Page).SetEditMode(); + } + + protected override bool OnBubbleEvent( object source, EventArgs e ) + { + if( e is CommandEventArgs ) + { + switch( ((CommandEventArgs)e).CommandName.ToLower() ) + { + case "edit": + if( null != EditCommand ) + { + EditCommand( this, new CommandEventArgs( "Edit", ActiveControl ) ); + return true; + } + + break; + + case "update": + if( null != UpdateCommand ) + { + UpdateCommand( this, new CommandEventArgs( "Update", ActiveControl ) ); + return true; + } + + break; + + case "cancel": + if( null != CancelCommand ) + { + CancelCommand( this, new CommandEventArgs( "Cancel", ActiveControl ) ); + return true; + } + break; + } + } + + return false; + } + + [ TemplateContainer( typeof( EditControlItem ) ) ] + public ITemplate EditItemTemplate + { + get { return editItemTemplate; } + set { editItemTemplate = value; } + } + + [ TemplateContainer( typeof( EditControlItem ) ) ] + public ITemplate ItemTemplate + { + get { return itemTemplate; } + set { itemTemplate = value; } + } + + protected override void CreateChildControls() + { + Controls.Clear(); + + EditControlItem item = new EditControlItem(); + + item.ID = "item"; + ItemTemplate.InstantiateIn( item ); + Controls.Add( item ); + + item.DataBind(); + + EditControlItem editItem = new EditControlItem(); + + EditItemTemplate.InstantiateIn( editItem ); + editItem.ID = "editItem"; + Controls.Add( editItem ); + + editItem.DataBind(); + + Controls[ 0 ].Visible = !EditMode; + Controls[ 1 ].Visible = EditMode; + } + } + + // + // TODO: Remove unused method and class + // + + public class EditControlItem : Control, INamingContainer + { + public EditControlItem() + { + } + } +} diff --git a/inetsrv/uddi/source/web/email.cs b/inetsrv/uddi/source/web/email.cs new file mode 100644 index 0000000..8af994e --- /dev/null +++ b/inetsrv/uddi/source/web/email.cs @@ -0,0 +1,126 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class EmailControl : UddiControl + { + protected EmailCollection emails; + protected EntityBase entity; + + protected DataGrid grid; + + public void Initialize( EmailCollection emails ) + { + this.emails = emails; + + grid.Columns[ 1 ].Visible = false; + } + + public void Initialize( EmailCollection emails, EntityBase entity ) + { + this.emails = emails; + this.entity = entity; + + grid.Columns[ 1 ].Visible = true; + } + + protected void Page_Init( object sender, EventArgs e ) + { + grid.Columns[ 0 ].HeaderText = Localization.GetString( "HEADING_EMAIL" ); + grid.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_ACTIONS" ); + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid(); + + if( grid.EditItemIndex >= 0 ) + SetEditMode(); + } + + void PopulateDataGrid() + { + grid.DataSource = emails; + grid.DataBind(); + } + + protected void DataGrid_Edit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + grid.EditItemIndex = index; + SetEditMode(); + + PopulateDataGrid(); + } + + protected void OnEnterKeyPressed( object sender, EventArgs e ) + { + DataGrid_Update( sender, null ); + } + + protected void DataGrid_Update( object sender, DataGridCommandEventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + int index = grid.EditItemIndex; + + if( index >= emails.Count ) + emails.Add(); + + Email email = emails[ index ]; + + DataGridItem item = grid.Items[ index ]; + + email.Value = ((TextBox)item.FindControl( "email" )).Text; + email.UseType = ((TextBox)item.FindControl( "useType" )).Text; + + entity.Save(); + + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + } + + protected void DataGrid_Cancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void DataGrid_Delete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + emails.RemoveAt( index ); + entity.Save(); + + PopulateDataGrid(); + } + + protected void DataGrid_Add( object sender, EventArgs e ) + { + grid.EditItemIndex = emails.Count; + SetEditMode(); + + emails.Add(); + + PopulateDataGrid(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/explorer.cs b/inetsrv/uddi/source/web/explorer.cs new file mode 100644 index 0000000..f4efba0 --- /dev/null +++ b/inetsrv/uddi/source/web/explorer.cs @@ -0,0 +1,274 @@ +using System; +using System.Web.UI; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.Binding; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class ExplorerControl : UserControl + { + protected EntityBase entity; + protected int elementIndex = -1; + protected string key = ""; + protected bool frames = false; + + protected TreeView tree; + + public void Initialize( EntityBase entity ) + { + this.entity = entity; + } + + public void Initialize( EntityBase entity, int elementIndex ) + { + this.entity = entity; + this.elementIndex = elementIndex; + } + + protected override void OnInit( EventArgs e ) + { + key = Request[ "key" ]; + frames = ( "true" == Request[ "frames" ] ); + } + + protected override void OnPreRender( EventArgs e ) + { + if( null == entity ) + return; + + string root = ( "/" == Request.ApplicationPath ) ? "" : Request.ApplicationPath; + + int contactIndex = 0; + int instanceIndex = 0; + + EntityBase rootEntity = null; + + if( entity is BusinessEntity ) + { + rootEntity = entity; + + if( -1 != elementIndex ) + key = ((BusinessEntity)entity).BusinessKey + ":" + elementIndex; + else + key = ((BusinessEntity)entity).BusinessKey; + } + else if( entity is TModel ) + { + rootEntity = entity; + key = ((TModel)entity).TModelKey; + } + else if( entity is BusinessService ) + { + BusinessEntity business = new BusinessEntity(); + BusinessService service = (BusinessService)entity; + + key = service.ServiceKey; + + business.BusinessKey = service.BusinessKey; + business.Get(); + + rootEntity = business; + } + else if( entity is BindingTemplate ) + { + BusinessEntity business = new BusinessEntity(); + BusinessService service = new BusinessService(); + BindingTemplate binding = (BindingTemplate)entity; + + if( -1 != elementIndex ) + key = binding.BindingKey + ":" + elementIndex; + else + key = binding.BindingKey; + + service.ServiceKey = binding.ServiceKey; + service.Get(); + + business.BusinessKey = service.BusinessKey; + business.Get(); + + rootEntity = business; + } + + // + // Setup explorer information section. + // + if( rootEntity is BusinessEntity ) + { + BusinessEntity business = rootEntity as BusinessEntity; + + // + // Build explorer tree. + // + TreeNode businessNode = tree.Nodes.Add( + business.Names[ 0 ].Value, + business.BusinessKey, + "../images/business.gif" ); + + businessNode.OnClick = "Entity_OnSelect( [[node]], '../details/businessdetail.aspx?key=" + business.BusinessKey + Iff( frames, "&frames=true", "" ) + "' )"; + businessNode.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_PROVIDER" ); + + if( key == business.BusinessKey ) + businessNode.Select(); + + + contactIndex = 0; + + foreach( Contact contact in business.Contacts ) + { + TreeNode contactNode = businessNode.Nodes.Add( + contact.PersonName, + business.BusinessKey + ":" + contactIndex, + "../images/contact.gif" ); + + contactNode.OnClick = "Entity_OnSelect( [[node]], '../details/contactdetail.aspx?key=" + business.BusinessKey + "&index=" + contactIndex + Iff( frames, "&frames=true", "" ) + "' )"; + contactNode.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_CONTACT" ); + + if( key == business.BusinessKey + ":" + contactIndex ) + contactNode.Select(); + + contactIndex ++; + } + + //sort the services + business.BusinessServices.Sort(); + + foreach( BusinessService service in business.BusinessServices ) + { + if( service.BusinessKey.ToLower() != business.BusinessKey.ToLower() ) + { + // + // Added logic to catch errors on this. + // if the refrenced service doesn't exist, + // then we can't get the name, thus we get + // an error. + // + + TreeNode nodeService; + + // + // if there are names, then the service projections still exists, + // use the first name in teh collection. + // otherwise leave name as the broken projection string. + // + if( service.Names.Count>0 ) + { + nodeService = businessNode.Nodes.Add( + service.Names[ 0 ].Value, + service.ServiceKey, + "../images/service_projection.gif" ); + + nodeService.OnClick = "Entity_OnSelect( [[node]], '../details/servicedetail.aspx?key=" + service.ServiceKey + Iff( frames, "&frames=true", "" ) + "&projectionKey="+business.BusinessKey+"' )"; + nodeService.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_SERVICEPROJECTION" ); + } + else + { + nodeService = businessNode.Nodes.Add( + Localization.GetString( "BUTTON_PROJECTIONBROKEN" ), + service.ServiceKey, + "../images/x.gif" ); + + nodeService.OnClick = "javascript:alert('"+Localization.GetString( "TOOLTIP_PROJECTIONBROKEN" )+"');"; + nodeService.Tooltip = Localization.GetString( "TOOLTIP_PROJECTIONBROKEN" ); + } + + } + else + { + + TreeNode serviceNode = businessNode.Nodes.Add( + service.Names[ 0 ].Value, + service.ServiceKey, + "../images/service.gif" ); + + serviceNode.OnClick = "Entity_OnSelect( [[node]], '../details/servicedetail.aspx?key=" + service.ServiceKey + Iff( frames, "&frames=true", "" ) + "' )"; + serviceNode.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_SERVICE" ); + + if( key == service.ServiceKey ) + serviceNode.Select(); + + int bindingCount = 0; + foreach( BindingTemplate binding in service.BindingTemplates ) + { + bindingCount ++; + + TreeNode bindingNode = serviceNode.Nodes.Add( + UDDI.Utility.StringEmpty( binding.AccessPoint.Value ) + ? Localization.GetString( "HEADING_NONE" ) + : binding.AccessPoint.Value, + binding.BindingKey, + "../images/binding.gif" ); + + bindingNode.OnClick = "Entity_OnSelect( [[node]], '../details/bindingdetail.aspx?key=" + binding.BindingKey + Iff( frames, "&frames=true", "" ) + "' )"; + bindingNode.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_BINDING" ); + + if( key == binding.BindingKey ) + bindingNode.Select(); + + instanceIndex = 0; + foreach( TModelInstanceInfo instance in binding.TModelInstanceInfos ) + { + TreeNode instanceNode = bindingNode.Nodes.Add( + UDDI.Utility.StringEmpty( instance.TModelKey ) + ? Localization.GetString( "HEADING_NONE" ) + : Lookup.TModelName( instance.TModelKey ), + binding.BindingKey + ":" + instanceIndex, + "../images/instance.gif" ); + + instanceNode.OnClick = "Entity_OnSelect( [[node]], '../details/instanceinfodetail.aspx?key=" + binding.BindingKey + "&index=" + instanceIndex + Iff( frames, "&frames=true", "" ) + "' )"; + instanceNode.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_INSTANCE_INFO" ); + + if( key == binding.BindingKey + ":" + instanceIndex ) + instanceNode.Select(); + + instanceIndex ++; + } + } + } + } + } + else if( rootEntity is TModel ) + { + TModel tModel = rootEntity as TModel; + + // + // Build explorer tree. + // + TreeNode nodeTModel = tree.Nodes.Add( + tModel.Name, + tModel.TModelKey, + "../images/tmodel.gif" ); + + nodeTModel.OnClick = "Entity_OnSelect( [[node]], '../details/modeldetail.aspx?key=" + Conversions.GuidStringFromKey( tModel.TModelKey ) + Iff( frames, "&frames=true", "" ) + "' )"; + nodeTModel.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_TMODEL" ); + nodeTModel.Select(); + } + else + { + Debug.Assert( false, "Unknown root entity '" + rootEntity.ToString() + "'." ); + } + + if( null != tree.SelectedNode ) + { + tree.SelectedNode.EnsureVisible(); + tree.SelectedNode.Expand(); + } + } + + // + // TODO: IIF function may not be required, consider using C# tenery operator + // + + protected string Iff( bool expr, string trueResult, string falseResult ) + { + if( expr ) + return trueResult; + else + return falseResult; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/format.cs b/inetsrv/uddi/source/web/format.cs new file mode 100644 index 0000000..f7d01b3 --- /dev/null +++ b/inetsrv/uddi/source/web/format.cs @@ -0,0 +1,52 @@ +using System; +using System.Data; +using System.Web; +using System.Web.UI.WebControls; +using UDDI; + +namespace UDDI.Web +{ + public class DataRowViewAccessor + { + public static int GetInt( DataGridItem item, string field ) + { + DataRowView row = (DataRowView)item.DataItem; + + object data = row[ field ]; + + if( null == data ) + return 0; + + return Convert.ToInt32( data ); + } + + public static string GetString( DataGridItem item, string field ) + { + return GetString( item, field, false ); + } + + public static string GetString( DataGridItem item, string field, bool encode ) + { + DataRowView row = (DataRowView)item.DataItem; + + object data = row[ field ]; + + if( null == data ) + return null; + else if( encode ) + return HttpUtility.HtmlEncode( data.ToString() ); + + return data.ToString(); + } + + public static string GetStringOrNone( DataGridItem item, string field, bool encode ) + { + string data = GetString( item, field, encode ); + + if( Utility.StringEmpty( data ) ) + return Localization.GetString( "HEADING_NONE" ); + + return data; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/header.cs b/inetsrv/uddi/source/web/header.cs new file mode 100644 index 0000000..1d2020b --- /dev/null +++ b/inetsrv/uddi/source/web/header.cs @@ -0,0 +1,159 @@ +using System; +using System.Globalization; +using System.IO; +using System.Security.Principal; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using UDDI; + +namespace UDDI.Web +{ + public class HeaderControl : UserControl + { + + protected PlaceHolder beta = null; + protected PlaceHolder test = null; + protected PlaceHolder edit = null; + protected PlaceHolder coordinate = null; + protected UddiLabel user = null; + protected UddiLabel role = null; + + //protected string rootpath; + protected string root; + protected string roots; + + protected string isoLangCode; + protected string[] links; + protected HtmlSelect quickHelp; + protected HtmlInputButton go; + + protected bool frames = false; + + public bool Frames + { + get { return frames; } + set { frames = value; } + } + + + protected override void OnInit( EventArgs e ) + { + + Response.Expires = -1; + Response.AddHeader( "Cache-Control", "no-cache" ); + Response.AddHeader( "Pragma", "no-cache" ); + + root = HyperLinkManager.GetHyperLink( "" ); + roots = HyperLinkManager.GetSecureHyperLink( "" ); + + if( null != beta && 1 == Config.GetInt( "Web.BetaSite", 0 ) ) + beta.Visible = true; + + if( null != test && 1 == Config.GetInt( "Web.TestSite", 0 ) ) + test.Visible = true; + } + + protected override void OnLoad( EventArgs e ) + { + if( !Page.IsPostBack && null != links ) + { + for( int i = 0; i < links.Length; i += 2 ) + { + string filename = links[ i + 1 ]; + + // + // 'cultureIDValue is expected to contain a neutral culture. ie, + // 'en', or 'ko', or 'de'. All but a few neutral cultures have + // a default specific culture. For example, the default specific + // culture of 'en' is 'en-US'. + // + // Traditional & simplified Chinese (zh-CHT and zh-CHS respectively) + // are examples of neutral cultures which have no default specific + // culture! + // + // So what happens below is this: First we try to lookup the default + // specific culture for the neutral culture that we were given. If that + // fails (ie, if CreateSpecificCulture throws), we just get the lcid + // of the neutral culture. + // + string defaultlang = Config.GetString( "Setup.WebServer.ProductLanguage","en" ); + int defaultlcid = 1033; + int userlcid = Localization.GetCulture().LCID; + + try + { + defaultlcid = CultureInfo.CreateSpecificCulture( defaultlang ).LCID; + } + catch + { + CultureInfo ci = new CultureInfo( defaultlang ); + defaultlcid = ci.LCID; + } + + string url = root + "/help/" + userlcid.ToString()+ "/" + filename; + + + + if( !File.Exists( Server.MapPath( url ) ) ) + { + // + // If the language the user wants isn't available user the defualt lang. + // + url = root +"/help/" + defaultlcid.ToString() + "/" + filename; + } + + + ListItem listItem = new ListItem( + Localization.GetString( links[ i ] ), + url ); + + quickHelp.Items.Add( listItem ); + } + + go.Value = Localization.GetString( "BUTTON_GO" ); + go.Attributes.Add( "onclick", "ShowQuickHelp( '" + quickHelp.UniqueID + "' )" ); + + quickHelp.Attributes.Add( "onchange", "ShowQuickHelp( '" + quickHelp.UniqueID + "' )" ); + } + } + + protected override void Render( HtmlTextWriter output ) + { + if( null != edit ) + edit.Visible = UDDI.Context.User.IsPublisher; + + if( null != coordinate ) + coordinate.Visible = UDDI.Context.User.IsCoordinator; + + if( null != user ) + { + if( UDDI.Context.User.IsImpersonated ) + user.Text = String.Format( Localization.GetString( "TAG_IMPERSONATING_USER" ), UDDI.Context.User.ID ); + else + user.Text = String.Format( Localization.GetString( "TAG_USER" ), UDDI.Context.User.ID ); + } + + if( null != role ) + { + string roleName; + + if( UDDI.Context.User.IsAdministrator ) + roleName = Localization.GetString( "ROLE_ADMINISTRATOR" ); + else if( UDDI.Context.User.IsCoordinator ) + roleName = Localization.GetString( "ROLE_COORDINATOR" ); + else if( UDDI.Context.User.IsPublisher ) + roleName = Localization.GetString( "ROLE_PUBLISHER" ); + else if( UDDI.Context.User.IsUser ) + roleName = Localization.GetString( "ROLE_USER" ); + else + roleName = Localization.GetString( "ROLE_ANONYMOUS" ); + + role.Text = String.Format( Localization.GetString( "TAG_ROLE" ), roleName ); + } + + base.Render( output ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/helpcontrol.cs b/inetsrv/uddi/source/web/helpcontrol.cs new file mode 100644 index 0000000..1df286e --- /dev/null +++ b/inetsrv/uddi/source/web/helpcontrol.cs @@ -0,0 +1,321 @@ +using System; +using System.Globalization; +using System.IO; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using UDDI; + +namespace UDDI.Web +{ + public class ContextualHelpControl : UserControl + { + + + private UddiLabel helptext; + protected UddiLabel HelpText + { + get{ return helptext;} + set{ helptext = (UddiLabel)value; } + } + + + private HelpControl helplink; + protected HelpControl HelpLink + { + get{ return helplink;} + set{ helplink = (HelpControl)value; } + } + + private string cssclass; + public string CssClass + { + get{ return cssclass; } + set{ cssclass=value; } + } + + private string borderwidth; + public string BorderWidth + { + get{ return borderwidth; } + set{ borderwidth=value; } + } + + private string horizontalalign; + public string HorizontalAlign + { + get{ return horizontalalign; } + set{ horizontalalign=value; } + } + private string verticalalign; + public string VertialAlign + { + get{ return verticalalign; } + set{ verticalalign=value; } + } + private string width="100%"; + public string Width + { + get{ return width; } + set{ width=value; } + } + + private string height; + public string Height + { + get{ return height; } + set{ height=value; } + } + + private string text; + public string Text + { + get{ return text; } + set{ text=value; } + } + + private string helpfile; + public string HelpFile + { + get{ return helpfile; } + set{ helpfile=value; } + } + + + protected override void OnLoad( EventArgs e ) + { + + if( null==HelpText ) + { + HelpText = new UddiLabel(); + Controls.Add( HelpText ); + } + if( null==HelpLink ) + { + HelpLink = new HelpControl(); + Controls.Add( HelpLink ); + } + + HelpText.Text = Text; + HelpLink.HelpFile = HelpFile; + base.OnLoad( e ); + } + + protected override void Render( HtmlTextWriter output ) + { + + output.Write( + "\r\n" + ); + + + output.Write( + "\r\n" + + "\r\n"+ + "\r\n"+ + "\r\n"+ + "
\r\n" + ); + + + + HelpText.RenderControl( output ); + + + output.Write( + "\r\n" + ); + + + HelpLink.RenderControl( output ); + + output.Write( + "
\r\n" + ); + /* + AddAttribute( output,HtmlTextWriterAttribute.Height, Height, null ); + AddAttribute( output,HtmlTextWriterAttribute.Border, BorderWidth, "0" ); + AddAttribute( output,HtmlTextWriterAttribute.Class, CssClass, null ); + AddAttribute( output,HtmlTextWriterAttribute.Id, ClientID, null ); + AddAttribute( output,HtmlTextWriterAttribute.Width, Width,null ); + output.RenderBeginTag( HtmlTextWriterTag.Table ); + + output.RenderBeginTag( HtmlTextWriterTag.Tr ); + + //Text Row + AddAttribute( output,HtmlTextWriterAttribute.Align, HorizontalAlign,null ); + AddAttribute( output,HtmlTextWriterAttribute.Valign, VertialAlign,null ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + if( null!=HelpText ) + HelpText.RenderControl( output ); + + output.RenderEndTag();//HtmlTextWriterTag.Td + + AddAttribute( output,HtmlTextWriterAttribute.Width, "25",null ); + AddAttribute( output,HtmlTextWriterAttribute.Align, HorizontalAlign,null ); + AddAttribute( output,HtmlTextWriterAttribute.Valign, VertialAlign,null ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + if( null!=HelpLink ) + HelpLink.RenderControl( output ); + + output.RenderEndTag();//HtmlTextWriterTag.Td + + output.RenderEndTag();//HtmlTextWriterTag.Tr + output.RenderEndTag();//HtmlTextWriterTag.Table + */ + + } + protected void AddAttribute( HtmlTextWriter output, HtmlTextWriterAttribute name, string val, string defaultvalue ) + { + if( null!=val ) + { + output.AddAttribute( name, val ); + } + else if( null!=defaultvalue ) + { + output.AddAttribute( name, val ); + } + } + + } + + public class HelpControl : UserControl + { + protected string helpFile; + protected string root; + + public string HelpFile + { + get { return helpFile; } + set { helpFile = value; } + } + + protected override void OnInit( EventArgs e ) + { + if( "/" == Request.ApplicationPath ) + root = ""; + else + root = Request.ApplicationPath; + } + + protected override void CreateChildControls() + { + CultureInfo culture = UDDI.Localization.GetCulture(); + + string isoLangCode = culture.LCID.ToString(); + + string file = "/help/" + isoLangCode + "/" + HelpFile + ".aspx"; + + string defaultlang = Config.GetString( "Setup.WebServer.ProductLanguage","en" ); + int lcid = 1033; + + // + // 'cultureIDValue is expected to contain a neutral culture. ie, + // 'en', or 'ko', or 'de'. All but a few neutral cultures have + // a default specific culture. For example, the default specific + // culture of 'en' is 'en-US'. + // + // Traditional & simplified Chinese (zh-CHT and zh-CHS respectively) + // are examples of neutral cultures which have no default specific + // culture! + // + // So what happens below is this: First we try to lookup the default + // specific culture for the neutral culture that we were given. If that + // fails (ie, if CreateSpecificCulture throws), we just get the lcid + // of the neutral culture. + // + try + { + lcid = CultureInfo.CreateSpecificCulture( defaultlang ).LCID; + } + catch + { + CultureInfo ci = new CultureInfo( defaultlang ); + lcid = ci.LCID; + } + + if( !File.Exists( Server.MapPath( root + file ) ) ) + file = "/help/" + lcid.ToString() + "/" + HelpFile + ".aspx"; + + + file = HyperLinkManager.GetNonSecureHyperLink( file ); + + HtmlAnchor anchor = new HtmlAnchor(); + + if( ((UddiPage)Page).IsIE4 || ((UddiPage)Page).IsIE5 || ((UddiPage)Page).IsNetscape6 ) + { + // + // Standards recommend pointer, but IE4 used hand. + // + if( ((UddiPage)Page).IsIE4 ) + anchor.Style.Add( "cursor", "hand" ); + else + anchor.Style.Add( "cursor", "pointer" ); + + anchor.Attributes.Add( "onclick", "ShowHelp( '" + file + "' )" ); + anchor.HRef = ""; + } + else + { + anchor.HRef = file; + } + + anchor.Target = "help"; + anchor.InnerHtml = ""; + + Controls.Add( anchor ); + } + } + public class ContentController : System.Web.UI.WebControls.PlaceHolder + { + private ServiceModeType mode; + public ServiceModeType Mode + { + get{ return mode; } + set{ mode=(ServiceModeType)value; } + } + + private RoleType requiredaccesslevel = RoleType.Anonymous; + public RoleType RequiredAccessLevel + { + get{ return requiredaccesslevel; } + set{ requiredaccesslevel=(RoleType)value; } + } + + protected internal ServiceModeType currentMode; + protected override void Render( HtmlTextWriter output ) + { + if( currentMode==Mode && (int)UDDI.Context.User.Role>=(int)RequiredAccessLevel ) + { + base.Render( output ); + } + } + protected override void OnLoad( EventArgs e ) + { + currentMode = (ServiceModeType)Config.GetInt( "Web.ServiceMode", (int)ServiceModeType.Private ); + base.OnLoad( e ); + } + } + public enum ServiceModeType + { + Private = 0x00, + Public = 0x01 + } + +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/identifierbag.cs b/inetsrv/uddi/source/web/identifierbag.cs new file mode 100644 index 0000000..a9e14eb --- /dev/null +++ b/inetsrv/uddi/source/web/identifierbag.cs @@ -0,0 +1,155 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; +using UDDI.Web; + +namespace UDDI.Web +{ + public class IdentifierBagControl : UddiControl + { + protected KeyedReferenceCollection identifierBag; + protected CacheObject cache = null; + protected EntityBase entity = null; + + protected DataGrid grid; + + public void Initialize( KeyedReferenceCollection identifierBag ) + { + this.identifierBag = identifierBag; + + grid.Columns[ 1 ].Visible = false; + } + + public void Initialize( KeyedReferenceCollection identifierBag, EntityBase entity ) + { + this.identifierBag = identifierBag; + this.entity = entity; + + grid.Columns[ 1 ].Visible = true; + } + + public void Initialize( KeyedReferenceCollection identifierBag, CacheObject cache ) + { + this.identifierBag = identifierBag; + this.cache = cache; + + grid.Columns[ 1 ].Visible = true; + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid(); + + if( grid.EditItemIndex >= 0 ) + SetEditMode(); + } + + void PopulateDataGrid() + { + grid.DataSource = identifierBag; + grid.DataBind(); + } + + protected void Identifier_Edit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + grid.EditItemIndex = index; + SetEditMode(); + + PopulateDataGrid(); + + if( index >= identifierBag.Count ) + identifierBag.Add(); + + KeyedReference keyedReference = identifierBag[ index ]; + + DropDownList list = (DropDownList)grid.Items[ index ].Cells[ 0 ].FindControl( "tModelKey" ); + if( null != list ) + { + ListItem item = list.Items.FindByValue( keyedReference.TModelKey.Substring( 5 ) ); + + if( null != item ) + item.Selected = true; + } + } + + protected void OnEnterKeyPressed( object sender, EventArgs e ) + { + Identifier_Update( sender, null ); + } + + protected void Identifier_Update( object sender, DataGridCommandEventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + int index = grid.EditItemIndex; + DataGridItem item = grid.Items[ index ]; + + if( index >= identifierBag.Count ) + identifierBag.Add(); + + KeyedReference keyedReference = identifierBag[ index ]; + + string tModelKey = ((DropDownList)item.FindControl( "tModelKey" )).SelectedItem.Value; + + keyedReference.TModelKey = "uuid:" + tModelKey; + keyedReference.KeyName = ((TextBox)item.FindControl( "keyName" )).Text; + keyedReference.KeyValue = ((TextBox)item.FindControl( "keyValue" )).Text; + + if( null != entity ) + entity.Save(); + + if( null != cache ) + cache.Save(); + + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + } + + protected void Identifier_Cancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void Identifier_Delete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + identifierBag.RemoveAt( index ); + + if( null != entity ) + entity.Save(); + + if( null != cache ) + cache.Save(); + + PopulateDataGrid(); + } + + protected void Identifier_Add( object sender, EventArgs e ) + { + grid.EditItemIndex = identifierBag.Count; + SetEditMode(); + + identifierBag.Add(); + + PopulateDataGrid(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/instanceinfos.cs b/inetsrv/uddi/source/web/instanceinfos.cs new file mode 100644 index 0000000..c4e8a05 --- /dev/null +++ b/inetsrv/uddi/source/web/instanceinfos.cs @@ -0,0 +1,91 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI.API.Binding; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class InstanceInfoControl : UddiControl + { + protected TModelInstanceInfoCollection instanceInfos; + protected BindingTemplate parent; + protected bool frames; + + protected DataGrid grid; + + public void Initialize( TModelInstanceInfoCollection instanceInfos, BindingTemplate parent, bool allowEdit ) + { + this.instanceInfos = instanceInfos; + this.parent = parent; + + grid.Columns[ 0 ].Visible = allowEdit; + grid.Columns[ 1 ].Visible = allowEdit; + grid.Columns[ 2 ].Visible = !allowEdit; + } + + protected void Page_Load( object sender, EventArgs e ) + { + frames = ( "true" == Request[ "frames" ] ); + + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + grid.DataSource = instanceInfos; + grid.DataBind(); + } + + protected void InstanceInfo_Edit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + if( frames ) + { + Response.Write( + ClientScripts.ReloadExplorerAndViewPanes( "editinstanceinfo.aspx?frames=true&key=" + parent.BindingKey + "&index=" + index, parent.BindingKey + ":" + index ) ); + + Response.End(); + } + else + { + Response.Redirect( "editinstanceinfo.aspx?frames=false&key=" + parent.BindingKey + "&index=" + index ); + Response.End(); + } + } + + protected void InstanceInfo_Delete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + string name = Lookup.TModelName( instanceInfos[ index ].TModelKey ); + string key = parent.BindingKey; + + // + // The user has not yet confirmed the delete operation, so display + // a confirmation dialog. + // + string message = String.Format( + Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), + name ); + + Page.RegisterStartupScript( + "Confirm", + ClientScripts.Confirm( + message, + "editinstanceinfo.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + key + "&index=" + index + "&mode=delete&confirm=true&tab=1" ) ); + } + + protected void InstanceInfo_Add( object sender, EventArgs e ) + { + Response.Redirect( "editinstanceinfo.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + parent.BindingKey + "&mode=add" ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/localization.cs b/inetsrv/uddi/source/web/localization.cs new file mode 100644 index 0000000..4d3b2b8 --- /dev/null +++ b/inetsrv/uddi/source/web/localization.cs @@ -0,0 +1,50 @@ +using System; +using System.Globalization; +using System.Resources; +using System.Threading; +using System.Web; +using System.Web.UI; +using UDDI.Diagnostics; +using UDDI; + +namespace UDDI.Web +{ + public class StringResource : UserControl + { + protected string name; + + public StringResource() + { + } + + public string Name + { + get { return name; } + set { name = value; } + } + + protected override void Render( HtmlTextWriter output ) + { + output.Write( Localization.GetString( name ) ); + } + } + + public class LocalizedLabel : System.Web.UI.WebControls.Label + { + protected string name; + + public LocalizedLabel() + { + } + + public string Name + { + get { return name; } + set + { + name = value; + base.Text = Localization.GetString( name ); + } + } + } +} diff --git a/inetsrv/uddi/source/web/lookup.cs b/inetsrv/uddi/source/web/lookup.cs new file mode 100644 index 0000000..f89e28f --- /dev/null +++ b/inetsrv/uddi/source/web/lookup.cs @@ -0,0 +1,233 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Globalization; +using UDDI.API; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class Lookup + { + public static string TModelName( string tModelKey ) + { + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "net_tModel_get", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@tModelKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName ) ).Direction = ParameterDirection.Output; + cmd.Parameters.Add( new SqlParameter( "@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName ) ).Direction = ParameterDirection.Output; + cmd.Parameters.Add( new SqlParameter( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ) ).Direction = ParameterDirection.Output; + cmd.Parameters.Add( new SqlParameter( "@overviewURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.OverviewURL ) ).Direction = ParameterDirection.Output; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetGuidFromKey( "@tModelKey", tModelKey ); + + cmd.ExecuteNonQuery(); + + Debug.Leave(); + + return paramacc.GetString( "@name" ); + } + + public static string BusinessName( string businessKey ) + { + string name = null; + + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "net_businessEntity_names_get", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@businessKey", SqlDbType.UniqueIdentifier ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetGuidFromString( "@businessKey", businessKey ); + + SqlDataReaderAccessor reader = new SqlDataReaderAccessor( cmd.ExecuteReader() ); + + try + { + if( reader.Read() ) + name = reader.GetString( "name" ); + } + finally + { + reader.Close(); + } + + Debug.Leave(); + + return name; + } + + public static DataView IdentifierTModels( string filter, string sort ) + { + DataView view = new DataView( GetIdentifierTModelsTable(), filter, sort, DataViewRowState.OriginalRows ); + + return view; + } + public static DataView IdentifierTModels() + { + return GetIdentifierTModelsTable().DefaultView; + } + + // + // This method is a work around to remove the Owning-Business + // + public static DataView IdentifierTModelsFiltered() + { + DataTable tModels = GetIdentifierTModelsTable(); + + for( int i = 0; i < tModels.Rows.Count; i ++ ) + { + DataRow row = tModels.Rows[ i ]; + + if( (new Guid( "4064C064-6D14-4F35-8953-9652106476A9" ).Equals( (Guid)row[ "tModelKey" ] ) )) + + { + tModels.Rows.Remove( row ); + break; + } + } + return tModels.DefaultView; + + } + protected static DataTable GetIdentifierTModelsTable() + { + Debug.Enter(); + + DataSet tModels = new DataSet(); + + SqlCommand cmd = new SqlCommand( "UI_getIdentifierTModels", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + SqlDataAdapter adapter = new SqlDataAdapter( cmd ); + + adapter.Fill( tModels, "tModels" ); + + // + // Add the general keywords taxonomy + // + //string tModelKey = Config.GetString( "TModelKey.GeneralKeywords" ); + // + //if( null != tModelKey ) + //{ + // Guid guidGeneralKeywords = new Guid( Conversions.GuidStringFromKey( tModelKey ) ); + // + // tModels.Tables[ "tModels" ].Rows.Add( + // new object[] { + // guidGeneralKeywords, + // Localization.GetString( "TAXONOMY_MISC" ) + // } ); + //} + + // + // Remove the operators taxonomy. + // + Guid guidOperators = new Guid( Conversions.GuidStringFromKey( Config.GetString( "TModelKey.Operators" ) ) ); + + for( int i = 0; i < tModels.Tables[ "tModels" ].Rows.Count; i ++ ) + { + DataRow row = tModels.Tables[ "tModels" ].Rows[ i ]; + + if( guidOperators == (Guid)row[ "tModelKey" ] ) + { + tModels.Tables[ "tModels" ].Rows.Remove( row ); + break; + } + } + + Debug.Leave(); + + return tModels.Tables[ "tModels" ]; + } + + public static DataView GetLanguages() + { + Debug.Enter(); + + DataSet languages = new DataSet(); + + + /* + * BUG: 722086 + * + * Removed logic to read from the database. We now use the CultureInfo.GetCultures() method + * to get all available languages. + * + SqlCommand cmd = new SqlCommand( "UI_getLanguages", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + SqlDataAdapter adapter = new SqlDataAdapter( cmd ); + + adapter.Fill( languages, "languages" ); + */ + + languages.Tables.Add( "languages" ); + languages.Tables[ "languages" ].Columns.Add( "isoLangCode" ); + languages.Tables[ "languages" ].Columns.Add( "language" ); + + CultureInfo[] cultures = CultureInfo.GetCultures( CultureTypes.AllCultures ); + + foreach( CultureInfo ci in cultures ) + { + // + // Check for invariat culture, and add all others. + // + if( !Utility.StringEmpty( ci.Name ) ) + languages.Tables[ "languages" ].LoadDataRow( + new object[]{ ci.Name.ToLower(),ci.Name },true ); + } + + + Debug.Leave(); + + return languages.Tables[ "languages" ].DefaultView; + } + + public static string GetLanguageName( string isoLangCode ) + { + Debug.Enter(); + + /* + * BUG: 722086 + * + SqlCommand cmd = new SqlCommand( "UI_getLanguages", ConnectionManager.GetConnection() ); + + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + + cmd.Parameters.Add( new SqlParameter( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode ) ).Direction = ParameterDirection.Input; + cmd.Parameters[ "@isoLangCode" ].Value = isoLangCode; + + Debug.Leave(); + + */ + try + { + CultureInfo ci = new CultureInfo( isoLangCode ); + + return ci.Name; + } + catch + { + return isoLangCode; + } + //return (string)cmd.ExecuteScalar(); + } + } +} diff --git a/inetsrv/uddi/source/web/makefile b/inetsrv/uddi/source/web/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/web/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/web/makefile.inc b/inetsrv/uddi/source/web/makefile.inc new file mode 100644 index 0000000..47a253a --- /dev/null +++ b/inetsrv/uddi/source/web/makefile.inc @@ -0,0 +1,3 @@ +foo.cs: + ..\version\$(O)\version.exe -outfile .\assemblyversioninfo.cs + diff --git a/inetsrv/uddi/source/web/menu.cs b/inetsrv/uddi/source/web/menu.cs new file mode 100644 index 0000000..dd9769c --- /dev/null +++ b/inetsrv/uddi/source/web/menu.cs @@ -0,0 +1,609 @@ +using System; +using System.Collections; +using System.Data; +using System.IO; +using System.Reflection; +using System.Resources; +using System.Web.UI; +using System.Web.UI.WebControls; +namespace UDDI.Web +{ + public delegate void MenuEventHandler( object sender, MenuEventArgs e ); + + [ParseChildren()] + public class MenuControl : UddiControl, IPostBackEventHandler + { + public MenuControl() + { + this.SelectedIndexChanged += new MenuEventHandler( this.MenuControl_SelectedIndexChanged ); + MenuItems = new MenuItemControlCollection(); + } + public event MenuEventHandler SelectedIndexChanged; + + protected string Roots + { + get + { + return HyperLinkManager.GetSecureHyperLink( "" ); + } + } + protected MenuItemControlCollection MenuItems; + public string CssClass + { + get{ return this.Name; } + } + + private string name; + public string Name + { + get{ return name; } + set{ name=value; } + } + + private MenuType type; + public MenuType Type + { + get{ return type; } + set{ type=(MenuType)value; } + } + + private string width = "100%"; + public string Width + { + get{ return width; } + set{ width=value; } + } + private string borderwidth = "0"; + public string BorderWidth + { + get{ return borderwidth; } + set{ borderwidth=value; } + } + + + //private int selectedindex; + public int SelectedIndex + { + + get + { + if( null==ViewState[ this.Name + "_Index" ] ) + ViewState[ this.Name + "_Index" ] = 0; + + return (int)ViewState[ this.Name + "_Index" ]; + } + set{ ViewState[ this.Name + "_Index" ]=value; } + } + + public MenuItemControl SelectedItem + { + get + { + return (MenuItemControl)this.Controls[ this.SelectedIndex ]; + } + } + + + private string height = "100%"; + public string Height + { + get{ return height; } + set{ height=value; } + } + + private string topoffset; + public string TopOffset + { + get{ return topoffset; } + set{ topoffset=value; } + } + private string leftoffset; + public string LeftOffset + { + get{ return leftoffset; } + set{ leftoffset=value; } + } + + private int staticindex=-1; + public int StaticIndex + { + get{ return staticindex; } + set{ staticindex=(int)value; } + } + + + private ArrayList items = new ArrayList(); + + + protected override void OnLoad( EventArgs e ) + { + // + // This script code is now in client.js + // + //if( !Page.IsClientScriptBlockRegistered( "SideNav_ClientScript" ) ) + //{ + //Page.RegisterClientScriptBlock( "SideNav_ClientScript",MenuControl.ClientScript ); + //} + + if( !Page.IsPostBack ) + { + if( null!=Request[ this.Name + "_Index" ] ) + this.SelectedIndex = Convert.ToInt32( Request[ this.Name + "_Index" ] ); + } + + base.OnLoad( e ); + } + + protected override void Render( HtmlTextWriter output ) + { + + output.Write( + "\r\n" + ); + + + + if( MenuType.Horizontal==this.Type ) + { + output.Write( + "\r\n\t" ); + + this.RenderChildren( output ); + + output.Write( + "\r\n" + ); + + } + else//vertical + { + output.Write( + " \r\n"+ + " \r\n" + + " \r\n" + ); + + this.RenderChildren( output ); + + //render the tail of the menu + output.Write( + "" + ); + } + + + output.Write( + "
 


" + ); + + + } + protected override void RenderChildren( HtmlTextWriter output ) + { + this.EnsureChildControls(); + + + for( int i=0;i=0 ) + { + if( i==this.StaticIndex ) + item.Selected=true; + else + item.Selected=false; + } + else + { + if( i==this.SelectedIndex ) + item.Selected=true; + else + item.Selected=false; + } + if( null==item.NavigateUrl && MenuItemType.Item==item.Type ) + { + item.NavigateUrl="javascript:"+Page.GetPostBackEventReference( this, i.ToString() ); + } + } + base.RenderChildren( output ); + } + protected override void AddParsedSubObject( object obj ) + { + if( obj is MenuItemControl ) + this.AddItem( (MenuItemControl)obj ); + + base.AddParsedSubObject( obj ); + } + public int AddItem( MenuItemControl item ) + { + if( null==item.Name ) + item.Name = this.Name; + + item.MenuType = this.Type; + item.LeftOffSet = this.LeftOffset; + + return this.MenuItems.Add( item ); + } + public void RaisePostBackEvent( string eventArgument ) + { + int newIndex = Convert.ToInt32( eventArgument ); + + this.EnsureChildControls(); + + this.OnSelectedIndexChanged( new MenuEventArgs( newIndex ) ); + } + + protected void OnSelectedIndexChanged( MenuEventArgs e ) + { + if( null!=SelectedIndexChanged ) + this.SelectedIndexChanged( this,e ); + + } + private void MenuControl_SelectedIndexChanged( object sender, MenuEventArgs e ) + { + this.SelectedIndex = e.Index; + } + + + public const string ClientScript = @" + + "; + + } + + public class MenuEventArgs : EventArgs + { + public MenuEventArgs( int newindex ) + { + this.index = newindex; + } + + private int index; + public int Index + { + get{ return index; } + } + + } + public class MenuItemControlCollection : CollectionBase + { + public MenuItemControl this[ int index ] + { + get{ return (MenuItemControl)this.List[ index ]; } + set{ this.List[ index ] = value; } + } + protected internal int Add( MenuItemControl item ) + { + return this.List.Add( item ); + } + protected internal void Remove( MenuItemControl item ) + { + this.List.Remove( item ); + } + protected internal void Remove( int index ) + { + this.List.RemoveAt( index ); + } + } + [ParseChildren()] + public class MenuItemControl : UserControl + { + + private ArrayList items = new ArrayList(); + protected string Root + { + get{ return ( "/" == Request.ApplicationPath ) ? "" : Request.ApplicationPath; } + } + protected string Roots + { + get + { + + return HyperLinkManager.GetSecureHyperLink( "" ); + } + } + private bool requirehttps; + public bool RequireHttps + { + get{ return requirehttps; } + set{ requirehttps=value; } + } + private bool requirehttp; + public bool RequireHttp + { + get{ return requirehttp; } + set{ requirehttp=value; } + } + private string cssclass; + public string CssClass + { + get{ return cssclass; } + set{ cssclass=value; } + } + protected string root + { + get{ return HyperLinkManager.GetHyperLink( "" ); } + } + private bool selected; + public bool Selected + { + get{ return selected; } + set{ selected=value; } + } + + private string text; + public string Text + { + get + { + if( null!=text ) + { + if( text.Length>65 ) + text=text.Substring( 0,65 ) + "..."; + } + return text; + } + set{ text=value; } + } + + private string navigateurl; + public string NavigateUrl + { + get{ return navigateurl; } + set{ navigateurl=value; } + } + private string navigatepage; + public string NavigatePage + { + get{ return navigatepage; } + set{ navigatepage=value; } + } + private string navigatetarget; + public string NavigateTarget + { + get{ return navigatetarget; } + set{ navigatetarget=value; } + } + + private string name; + public string Name + { + get{ return name; } + set{ name=value; } + } + + private MenuType menutype; + public MenuType MenuType + { + get{ return menutype; } + set{ menutype=(MenuType)value; } + } + + private MenuItemType type; + public MenuItemType Type + { + get{ return type; } + set{ type=(MenuItemType)value;} + } + + + protected internal string LeftOffSet="0"; + + + protected override void Render( HtmlTextWriter output ) + { + if( MenuType.Vertical==this.MenuType ) + { + RenderVertical( output ); + + } + else + { + RenderHorizontal( output ); + } + + } + protected void RenderVertical( HtmlTextWriter output ) + { + output.Write( + "\r\n\t" + ); + + RenderHorizontal( output ); + + output.Write( + "\r\n" + ); + + + } + protected void RenderHorizontal( HtmlTextWriter output ) + { + output.Write( + "" + + ); + + output.Write( + "" + ); + + + RenderText( output ); + + + + + output.Write( + "\r\n" ); + + } + protected void RenderText( HtmlTextWriter output ) + { + + switch( this.Type ) + { + case MenuItemType.Item: + HyperLink l = new HyperLink(); + l.Text = this.Text; + if( null!=this.NavigateTarget && ""!=this.NavigateTarget.Trim() ) + l.Target = this.NavigateTarget; + + string classname = this.Name + "_Text"; + + if( this.Selected ) + { + classname += "Selected"; + } + else + { + if( null!=this.NavigatePage ) + { + if( RequireHttps ) + { + l.NavigateUrl = HyperLinkManager.GetSecureHyperLink( NavigatePage ); + } + else if( RequireHttp ) + { + l.NavigateUrl = HyperLinkManager.GetNonSecureHyperLink( NavigatePage ); + } + else + { + l.NavigateUrl = HyperLinkManager.GetHyperLink( NavigatePage ); + } + } + else if( null!=this.NavigateUrl ) + { + l.NavigateUrl = this.NavigateUrl; + } + } + + + l.CssClass=classname; + l.Target = this.NavigateTarget; + + output.Write( "" ); + l.RenderControl( output ); + output.Write( "" ); + break; + case MenuItemType.Separator: + Image i = new Image(); + i.ImageUrl = Root + "/images/pixel.gif"; + i.Height = new Unit( 1 ); + i.Width = new Unit( 1 ); + i.BorderWidth = new Unit( 0 ); + i.RenderControl( output ); + break; + case MenuItemType.Title: + Label label = new Label(); + label.Text = this.Text; + output.Write( "" ); + label.RenderControl( output ); + output.Write( "" ); + break; + } + + } + + public void RenderChildrenExt( HtmlTextWriter output ) + { + EnsureChildControls(); + RenderChildren( output ); + } + } + + public enum MenuType + { + Horizontal, + Vertical + + } + public enum MenuItemType + { + Title, + Separator, + Item + } + + +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/name.cs b/inetsrv/uddi/source/web/name.cs new file mode 100644 index 0000000..b08368e --- /dev/null +++ b/inetsrv/uddi/source/web/name.cs @@ -0,0 +1,199 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class NameControl : UddiControl + { + protected NameCollection names = null; + protected EntityBase parentEntity = null; + protected string parentKey = null; + + protected DataGrid grid; + + public void Initialize( NameCollection names ) + { + this.names = names; + + grid.Columns[ 1 ].Visible = false; + } + + public void Initialize( NameCollection names, EntityBase parentEntity, string parentKey ) + { + this.names = names; + this.parentEntity = parentEntity; + this.parentKey = parentKey; + + grid.Columns[ 1 ].Visible = true; + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + grid.DataSource = names; + grid.DataBind(); + } + + + protected DataView GetLanguages() + { + DataView view = Lookup.GetLanguages(); + + int index = 0; + foreach( Name name in names ) + { + if( index != grid.EditItemIndex ) + { + foreach( DataRowView row in view ) + { + if( row[ "isoLangCode" ].ToString() == name.IsoLangCode ) + { + row.Delete(); + break; + } + } + } + + index ++; + } + + return view; + } + + protected void Name_OnEdit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + grid.EditItemIndex = index; + SetEditMode(); + + PopulateDataGrid(); + + Name name = names[ index ]; + + DropDownList list = (DropDownList)grid.Items[ index ].Cells[ 0 ].FindControl( "language" ); + + if( null != list ) + { + ListItem item = list.Items.FindByValue( name.IsoLangCode ); + + if( null != item ) + { + item.Selected = true; + } + else + { + item = new ListItem( name.IsoLangCode, name.IsoLangCode ); + list.Items.Add( item ); + item.Selected = true; + } + + } + } + + protected void OnEnterKeyPressed( object sender, EventArgs e ) + { + Name_OnUpdate( sender, null ); + } + + protected void Name_OnUpdate( object sender, DataGridCommandEventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + int index = grid.EditItemIndex; + DataGridItem item = grid.Items[ index ]; + + if( index >= names.Count ) + names.Add( "" ); + + Name name = names[ index ]; + + name.IsoLangCode = ((DropDownList)item.FindControl( "language" )).SelectedItem.Value; + name.Value = ((TextBox)item.FindControl( "name" )).Text.Trim(); + + CheckBox checkbox = (CheckBox)item.FindControl( "default" ); + + if( index > 0 && null != checkbox && checkbox.Checked ) + { + for( int i = index; i > 0; i -- ) + names[ i ] = names[ i - 1 ]; + + names[ 0 ] = name; + index = 0; + } + + parentEntity.Save(); + + if( 0 == index && !IsDownlevel ) + { + Page.RegisterStartupScript( + "Reload", + ClientScripts.ReloadExplorerPane( + parentKey ) ); + } + + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + } + + protected void Name_OnCancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void Name_OnDelete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + names.RemoveAt( index ); + parentEntity.Save(); + + PopulateDataGrid(); + + if( 0 == index && !IsDownlevel ) + { + Page.RegisterStartupScript( + "Reload", + ClientScripts.ReloadExplorerPane( + parentKey ) ); + } + } + + protected void Name_OnAdd( object sender, EventArgs e ) + { + int index = names.Count; + + grid.EditItemIndex = index; + SetEditMode(); + + names.Add( "" ); + PopulateDataGrid(); + + DropDownList list = (DropDownList)grid.Items[ index ].Cells[ 0 ].FindControl( "language" ); + ListItem item = list.Items.FindByValue( Localization.GetCulture().TwoLetterISOLanguageName ); + + if( null != item ) + item.Selected = true; + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/obj/_objects.mac b/inetsrv/uddi/source/web/obj/_objects.mac new file mode 100644 index 0000000..d0f2d2c --- /dev/null +++ b/inetsrv/uddi/source/web/obj/_objects.mac @@ -0,0 +1,188 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\address.obj \ + $(_OBJ_DIR)\i386\assemblyinfo.obj \ + $(_OBJ_DIR)\i386\assemblyversioninfo.obj \ + $(_OBJ_DIR)\i386\base.obj \ + $(_OBJ_DIR)\i386\bindings.obj \ + $(_OBJ_DIR)\i386\box.obj \ + $(_OBJ_DIR)\i386\breadcrumb.obj \ + $(_OBJ_DIR)\i386\businesses.obj \ + $(_OBJ_DIR)\i386\cache.obj \ + $(_OBJ_DIR)\i386\categorybag.obj \ + $(_OBJ_DIR)\i386\clientscripts.obj \ + $(_OBJ_DIR)\i386\contacts.obj \ + $(_OBJ_DIR)\i386\contextmenu.obj \ + $(_OBJ_DIR)\i386\description.obj \ + $(_OBJ_DIR)\i386\discoveryurl.obj \ + $(_OBJ_DIR)\i386\editcontrol.obj \ + $(_OBJ_DIR)\i386\email.obj \ + $(_OBJ_DIR)\i386\explorer.obj \ + $(_OBJ_DIR)\i386\format.obj \ + $(_OBJ_DIR)\i386\header.obj \ + $(_OBJ_DIR)\i386\helpcontrol.obj \ + $(_OBJ_DIR)\i386\identifierbag.obj \ + $(_OBJ_DIR)\i386\instanceinfos.obj \ + $(_OBJ_DIR)\i386\localization.obj \ + $(_OBJ_DIR)\i386\lookup.obj \ + $(_OBJ_DIR)\i386\name.obj \ + $(_OBJ_DIR)\i386\owner.obj \ + $(_OBJ_DIR)\i386\phone.obj \ + $(_OBJ_DIR)\i386\publisher.obj \ + $(_OBJ_DIR)\i386\security.obj \ + $(_OBJ_DIR)\i386\selection.obj \ + $(_OBJ_DIR)\i386\services.obj \ + $(_OBJ_DIR)\i386\sidenav.obj \ + $(_OBJ_DIR)\i386\statistics.obj \ + $(_OBJ_DIR)\i386\tab.obj \ + $(_OBJ_DIR)\i386\taxonomy.obj \ + $(_OBJ_DIR)\i386\tmodelbag.obj \ + $(_OBJ_DIR)\i386\tmodels.obj \ + $(_OBJ_DIR)\i386\tree.obj \ + $(_OBJ_DIR)\i386\categorybrowser.obj \ + $(_OBJ_DIR)\i386\taxonomytree.obj \ + $(_OBJ_DIR)\i386\menu.obj \ + $(_OBJ_DIR)\i386\validators.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\address.obj \ + $(_OBJ_DIR)\ia64\assemblyinfo.obj \ + $(_OBJ_DIR)\ia64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\ia64\base.obj \ + $(_OBJ_DIR)\ia64\bindings.obj \ + $(_OBJ_DIR)\ia64\box.obj \ + $(_OBJ_DIR)\ia64\breadcrumb.obj \ + $(_OBJ_DIR)\ia64\businesses.obj \ + $(_OBJ_DIR)\ia64\cache.obj \ + $(_OBJ_DIR)\ia64\categorybag.obj \ + $(_OBJ_DIR)\ia64\clientscripts.obj \ + $(_OBJ_DIR)\ia64\contacts.obj \ + $(_OBJ_DIR)\ia64\contextmenu.obj \ + $(_OBJ_DIR)\ia64\description.obj \ + $(_OBJ_DIR)\ia64\discoveryurl.obj \ + $(_OBJ_DIR)\ia64\editcontrol.obj \ + $(_OBJ_DIR)\ia64\email.obj \ + $(_OBJ_DIR)\ia64\explorer.obj \ + $(_OBJ_DIR)\ia64\format.obj \ + $(_OBJ_DIR)\ia64\header.obj \ + $(_OBJ_DIR)\ia64\helpcontrol.obj \ + $(_OBJ_DIR)\ia64\identifierbag.obj \ + $(_OBJ_DIR)\ia64\instanceinfos.obj \ + $(_OBJ_DIR)\ia64\localization.obj \ + $(_OBJ_DIR)\ia64\lookup.obj \ + $(_OBJ_DIR)\ia64\name.obj \ + $(_OBJ_DIR)\ia64\owner.obj \ + $(_OBJ_DIR)\ia64\phone.obj \ + $(_OBJ_DIR)\ia64\publisher.obj \ + $(_OBJ_DIR)\ia64\security.obj \ + $(_OBJ_DIR)\ia64\selection.obj \ + $(_OBJ_DIR)\ia64\services.obj \ + $(_OBJ_DIR)\ia64\sidenav.obj \ + $(_OBJ_DIR)\ia64\statistics.obj \ + $(_OBJ_DIR)\ia64\tab.obj \ + $(_OBJ_DIR)\ia64\taxonomy.obj \ + $(_OBJ_DIR)\ia64\tmodelbag.obj \ + $(_OBJ_DIR)\ia64\tmodels.obj \ + $(_OBJ_DIR)\ia64\tree.obj \ + $(_OBJ_DIR)\ia64\categorybrowser.obj \ + $(_OBJ_DIR)\ia64\taxonomytree.obj \ + $(_OBJ_DIR)\ia64\menu.obj \ + $(_OBJ_DIR)\ia64\validators.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\address.obj \ + $(_OBJ_DIR)\amd64\assemblyinfo.obj \ + $(_OBJ_DIR)\amd64\assemblyversioninfo.obj \ + $(_OBJ_DIR)\amd64\base.obj \ + $(_OBJ_DIR)\amd64\bindings.obj \ + $(_OBJ_DIR)\amd64\box.obj \ + $(_OBJ_DIR)\amd64\breadcrumb.obj \ + $(_OBJ_DIR)\amd64\businesses.obj \ + $(_OBJ_DIR)\amd64\cache.obj \ + $(_OBJ_DIR)\amd64\categorybag.obj \ + $(_OBJ_DIR)\amd64\clientscripts.obj \ + $(_OBJ_DIR)\amd64\contacts.obj \ + $(_OBJ_DIR)\amd64\contextmenu.obj \ + $(_OBJ_DIR)\amd64\description.obj \ + $(_OBJ_DIR)\amd64\discoveryurl.obj \ + $(_OBJ_DIR)\amd64\editcontrol.obj \ + $(_OBJ_DIR)\amd64\email.obj \ + $(_OBJ_DIR)\amd64\explorer.obj \ + $(_OBJ_DIR)\amd64\format.obj \ + $(_OBJ_DIR)\amd64\header.obj \ + $(_OBJ_DIR)\amd64\helpcontrol.obj \ + $(_OBJ_DIR)\amd64\identifierbag.obj \ + $(_OBJ_DIR)\amd64\instanceinfos.obj \ + $(_OBJ_DIR)\amd64\localization.obj \ + $(_OBJ_DIR)\amd64\lookup.obj \ + $(_OBJ_DIR)\amd64\name.obj \ + $(_OBJ_DIR)\amd64\owner.obj \ + $(_OBJ_DIR)\amd64\phone.obj \ + $(_OBJ_DIR)\amd64\publisher.obj \ + $(_OBJ_DIR)\amd64\security.obj \ + $(_OBJ_DIR)\amd64\selection.obj \ + $(_OBJ_DIR)\amd64\services.obj \ + $(_OBJ_DIR)\amd64\sidenav.obj \ + $(_OBJ_DIR)\amd64\statistics.obj \ + $(_OBJ_DIR)\amd64\tab.obj \ + $(_OBJ_DIR)\amd64\taxonomy.obj \ + $(_OBJ_DIR)\amd64\tmodelbag.obj \ + $(_OBJ_DIR)\amd64\tmodels.obj \ + $(_OBJ_DIR)\amd64\tree.obj \ + $(_OBJ_DIR)\amd64\categorybrowser.obj \ + $(_OBJ_DIR)\amd64\taxonomytree.obj \ + $(_OBJ_DIR)\amd64\menu.obj \ + $(_OBJ_DIR)\amd64\validators.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\address.obj \ + $(_OBJ_DIR)\arm\assemblyinfo.obj \ + $(_OBJ_DIR)\arm\assemblyversioninfo.obj \ + $(_OBJ_DIR)\arm\base.obj \ + $(_OBJ_DIR)\arm\bindings.obj \ + $(_OBJ_DIR)\arm\box.obj \ + $(_OBJ_DIR)\arm\breadcrumb.obj \ + $(_OBJ_DIR)\arm\businesses.obj \ + $(_OBJ_DIR)\arm\cache.obj \ + $(_OBJ_DIR)\arm\categorybag.obj \ + $(_OBJ_DIR)\arm\clientscripts.obj \ + $(_OBJ_DIR)\arm\contacts.obj \ + $(_OBJ_DIR)\arm\contextmenu.obj \ + $(_OBJ_DIR)\arm\description.obj \ + $(_OBJ_DIR)\arm\discoveryurl.obj \ + $(_OBJ_DIR)\arm\editcontrol.obj \ + $(_OBJ_DIR)\arm\email.obj \ + $(_OBJ_DIR)\arm\explorer.obj \ + $(_OBJ_DIR)\arm\format.obj \ + $(_OBJ_DIR)\arm\header.obj \ + $(_OBJ_DIR)\arm\helpcontrol.obj \ + $(_OBJ_DIR)\arm\identifierbag.obj \ + $(_OBJ_DIR)\arm\instanceinfos.obj \ + $(_OBJ_DIR)\arm\localization.obj \ + $(_OBJ_DIR)\arm\lookup.obj \ + $(_OBJ_DIR)\arm\name.obj \ + $(_OBJ_DIR)\arm\owner.obj \ + $(_OBJ_DIR)\arm\phone.obj \ + $(_OBJ_DIR)\arm\publisher.obj \ + $(_OBJ_DIR)\arm\security.obj \ + $(_OBJ_DIR)\arm\selection.obj \ + $(_OBJ_DIR)\arm\services.obj \ + $(_OBJ_DIR)\arm\sidenav.obj \ + $(_OBJ_DIR)\arm\statistics.obj \ + $(_OBJ_DIR)\arm\tab.obj \ + $(_OBJ_DIR)\arm\taxonomy.obj \ + $(_OBJ_DIR)\arm\tmodelbag.obj \ + $(_OBJ_DIR)\arm\tmodels.obj \ + $(_OBJ_DIR)\arm\tree.obj \ + $(_OBJ_DIR)\arm\categorybrowser.obj \ + $(_OBJ_DIR)\arm\taxonomytree.obj \ + $(_OBJ_DIR)\arm\menu.obj \ + $(_OBJ_DIR)\arm\validators.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/web/obj/i386/uddi.web.dll b/inetsrv/uddi/source/web/obj/i386/uddi.web.dll new file mode 100644 index 0000000..11799cc Binary files /dev/null and b/inetsrv/uddi/source/web/obj/i386/uddi.web.dll differ diff --git a/inetsrv/uddi/source/web/obj/i386/uddi.web.pdb b/inetsrv/uddi/source/web/obj/i386/uddi.web.pdb new file mode 100644 index 0000000..0e28807 Binary files /dev/null and b/inetsrv/uddi/source/web/obj/i386/uddi.web.pdb differ diff --git a/inetsrv/uddi/source/web/owner.cs b/inetsrv/uddi/source/web/owner.cs new file mode 100644 index 0000000..b0f9a7e --- /dev/null +++ b/inetsrv/uddi/source/web/owner.cs @@ -0,0 +1,46 @@ +using System; +using System.Data; +using UDDI; + +namespace UDDI.Web +{ + public class Owner + { + public static void Change( string entityType, string entityKey, string puid ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + switch( entityType ) + { + case "business": + sp.ProcedureName = "net_businessEntity_owner_update"; + sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromString( "@businessKey", entityKey ); + + break; + + case "tmodel": + sp.ProcedureName = "net_tModel_owner_update"; + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKey", entityKey ); + + break; + + default: + { +#if never + throw new UDDIException( + ErrorType.E_fatalError, + "Unknown entity type '" + entityType + "'" ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UKNOWN_ENTITY_TYPE", entityType ); + } + } + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, 450 ); + sp.Parameters.SetString( "@PUID", puid ); + + sp.ExecuteNonQuery(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/phone.cs b/inetsrv/uddi/source/web/phone.cs new file mode 100644 index 0000000..fa74087 --- /dev/null +++ b/inetsrv/uddi/source/web/phone.cs @@ -0,0 +1,126 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class PhoneControl : UddiControl + { + protected PhoneCollection phones; + protected EntityBase entity; + + protected DataGrid grid; + + public void Initialize( PhoneCollection phones ) + { + this.phones = phones; + + grid.Columns[ 1 ].Visible = false; + } + + public void Initialize( PhoneCollection phones, EntityBase entity ) + { + this.phones = phones; + this.entity = entity; + + grid.Columns[ 1 ].Visible = true; + } + + protected void Page_Init( object sender, EventArgs e ) + { + grid.Columns[ 0 ].HeaderText = Localization.GetString( "HEADING_PHONE" ); + grid.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_ACTIONS" ); + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid(); + + if( grid.EditItemIndex >= 0 ) + SetEditMode(); + } + + void PopulateDataGrid() + { + grid.DataSource = phones; + grid.DataBind(); + } + + protected void DataGrid_Edit( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + grid.EditItemIndex = index; + SetEditMode(); + + PopulateDataGrid(); + } + + protected void OnEnterKeyPressed( object sender, EventArgs e ) + { + DataGrid_Update( sender, null ); + } + + protected void DataGrid_Update( object sender, DataGridCommandEventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + int index = grid.EditItemIndex; + + if( index >= phones.Count ) + phones.Add( "" ); + + Phone phone = phones[ index ]; + + DataGridItem item = grid.Items[ index ]; + + phone.Value = ((TextBox)item.FindControl( "phone" )).Text; + phone.UseType = ((TextBox)item.FindControl( "useType" )).Text; + + entity.Save(); + + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + } + + protected void DataGrid_Cancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid(); + } + + protected void DataGrid_Delete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + phones.RemoveAt( index ); + entity.Save(); + + PopulateDataGrid(); + } + + protected void DataGrid_Add( object sender, EventArgs e ) + { + grid.EditItemIndex = phones.Count; + SetEditMode(); + + phones.Add( "" ); + + PopulateDataGrid(); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/placefil.txt b/inetsrv/uddi/source/web/placefil.txt new file mode 100644 index 0000000..fb0671d --- /dev/null +++ b/inetsrv/uddi/source/web/placefil.txt @@ -0,0 +1,2 @@ +uddi.web.dll uddi\bin:uddi\webroot\bin + diff --git a/inetsrv/uddi/source/web/publisher.cs b/inetsrv/uddi/source/web/publisher.cs new file mode 100644 index 0000000..0819b4f --- /dev/null +++ b/inetsrv/uddi/source/web/publisher.cs @@ -0,0 +1,248 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Web; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class Publisher + { + public string Puid; + public string IsoLangCode; + public string Name; + public string Email; + public string Phone; + public string CompanyName; + public string AltPhone; + public string AddressLine1; + public string AddressLine2; + public string City; + public string StateProvince; + public string PostalCode; + public string Country; + public string SecurityToken; + + public bool Validated; + public bool TrackPassport; + public bool Exists; + + public int BusinessLimit; + public int BusinessCount; + public int TModelLimit; + public int TModelCount; + public int ServiceLimit; + public int BindingLimit; + public int AssertionLimit; + public int AssertionCount; + + public void GetPublisherFromSecurityToken( string securityToken ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_getPublisherFromSecurityToken"; + + sp.Parameters.Add( "@securityToken", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromString( "@securityToken", securityToken ); + sp.ExecuteNonQuery(); + + Puid = sp.Parameters.GetString( "@PUID" ); + + Debug.Leave(); + } + + public void Save() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_savePublisher"; + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode ); + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp.Parameters.Add( "@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email ); + sp.Parameters.Add( "@phone", SqlDbType.NVarChar, UDDI.Constants.Lengths.Phone ); + sp.Parameters.Add( "@companyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.CompanyName ); + sp.Parameters.Add( "@altphone", SqlDbType.NVarChar, UDDI.Constants.Lengths.Phone ); + sp.Parameters.Add( "@addressLine1", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine ); + sp.Parameters.Add( "@addressLine2", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine ); + sp.Parameters.Add( "@city", SqlDbType.NVarChar, UDDI.Constants.Lengths.City ); + sp.Parameters.Add( "@stateProvince", SqlDbType.NVarChar, UDDI.Constants.Lengths.StateProvince ); + sp.Parameters.Add( "@postalCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.PostalCode ); + sp.Parameters.Add( "@country", SqlDbType.NVarChar, UDDI.Constants.Lengths.Country ); + sp.Parameters.Add( "@flag", SqlDbType.Int ); + sp.Parameters.Add( "@securityToken", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@tier", SqlDbType.NVarChar, UDDI.Constants.Lengths.Tier ); + + + sp.Parameters.SetString( "@PUID", Puid ); + sp.Parameters.SetString( "@isoLangCode", IsoLangCode ); + sp.Parameters.SetString( "@name", Name ); + sp.Parameters.SetString( "@email", Email ); + sp.Parameters.SetString( "@phone", Phone ); + sp.Parameters.SetString( "@companyName", CompanyName ); + sp.Parameters.SetString( "@altphone", AltPhone ); + sp.Parameters.SetString( "@addressLine1", AddressLine1 ); + sp.Parameters.SetString( "@addressLine2", AddressLine2 ); + sp.Parameters.SetString( "@city", City ); + sp.Parameters.SetString( "@stateProvince", StateProvince ); + sp.Parameters.SetString( "@postalCode", PostalCode ); + sp.Parameters.SetString( "@country", Country ); + sp.Parameters.SetString( "@tier", Config.GetString( "Publisher.DefaultTier", "2" ) ); + + int flag = 0; + + if( !TrackPassport ) + flag = flag | 0x02; + + if( Validated ) + flag = flag | 0x01; + + sp.Parameters.SetInt( "@flag", flag ); + sp.Parameters.SetGuidFromString( "@securityToken", SecurityToken ); + + sp.ExecuteNonQuery(); + + Debug.Leave(); + } + + public void Get() + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_getPublisher"; + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.SetString( "@PUID", Puid ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + Exists = false; + + try + { + if( reader.Read() ) + { + int flag; + + IsoLangCode = reader.GetString( 1 ); + Name = reader.GetString( 2 ); + Email = reader.GetString( 3 ); + Phone = reader.GetString( 4 ); + CompanyName = reader.GetString( 5 ); + AltPhone = reader.GetString( 6 ); + AddressLine1 = reader.GetString( 7 ); + AddressLine2 = reader.GetString( 8 ); + City = reader.GetString( 9 ); + StateProvince = reader.GetString( 10 ); + PostalCode = reader.GetString( 11 ); + Country = reader.GetString( 12 ); + flag = reader.GetInt( 13 ); + SecurityToken = reader.GetGuidString( 14 ); + + TrackPassport = ( 0x00 == ( flag & 0x02 ) ); + Validated = ( 0x01 == ( flag & 0x01 ) ); + + Exists = true; + } + } + finally + { + reader.Close(); + } + + Debug.Leave(); + } + + public static int Validate( string userid ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_validatePublisher"; + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@returnValue", SqlDbType.Int, ParameterDirection.ReturnValue ); + + sp.Parameters.SetString( "@PUID", userid ); + sp.ExecuteNonQuery(); + + int returnValue = sp.Parameters.GetInt( "@returnValue" ); + + Debug.Leave(); + + return returnValue; + } + + public void Login( string userid, string email ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "net_publisher_login"; + + sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID ); + sp.Parameters.Add( "@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email, ParameterDirection.InputOutput ); + + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name, ParameterDirection.Output ); + sp.Parameters.Add( "@phone", SqlDbType.VarChar, UDDI.Constants.Lengths.Phone, ParameterDirection.Output ); + sp.Parameters.Add( "@companyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.CompanyName, ParameterDirection.Output ); + sp.Parameters.Add( "@altPhone", SqlDbType.VarChar, UDDI.Constants.Lengths.Phone, ParameterDirection.Output ); + sp.Parameters.Add( "@addressLine1", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine, ParameterDirection.Output ); + sp.Parameters.Add( "@addressLine2", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine, ParameterDirection.Output ); + sp.Parameters.Add( "@city", SqlDbType.NVarChar, UDDI.Constants.Lengths.City, ParameterDirection.Output ); + sp.Parameters.Add( "@stateProvince", SqlDbType.NVarChar, UDDI.Constants.Lengths.StateProvince, ParameterDirection.Output ); + sp.Parameters.Add( "@postalCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.PostalCode, ParameterDirection.Output ); + sp.Parameters.Add( "@country", SqlDbType.NVarChar, UDDI.Constants.Lengths.Country, ParameterDirection.Output ); + sp.Parameters.Add( "@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode, ParameterDirection.Output ); + sp.Parameters.Add( "@businessLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@businessCount", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@tModelLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@tModelCount", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@serviceLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@bindingLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@assertionLimit", SqlDbType.Int, ParameterDirection.Output ); + sp.Parameters.Add( "@assertionCount", SqlDbType.Int, ParameterDirection.Output ); + + sp.Parameters.SetString( "@PUID", userid ); + sp.Parameters.SetString( "@email", email ); + + sp.ExecuteNonQuery(); + + Email = sp.Parameters.GetString( "@email" ); + Name = sp.Parameters.GetString( "@name" ); + Phone = sp.Parameters.GetString( "@phone" ); + CompanyName = sp.Parameters.GetString( "@companyName" ); + AltPhone = sp.Parameters.GetString( "@altPhone" ); + AddressLine1 = sp.Parameters.GetString( "@addressLine1" ); + AddressLine2 = sp.Parameters.GetString( "@addressLine2" ); + City = sp.Parameters.GetString( "@city" ); + StateProvince = sp.Parameters.GetString( "@stateProvince" ); + PostalCode = sp.Parameters.GetString( "@postalCode" ); + Country = sp.Parameters.GetString( "@country" ); + IsoLangCode = sp.Parameters.GetString( "@isoLangCode" ); + + BusinessLimit = sp.Parameters.GetInt( "@businessLimit" ); + BusinessCount = sp.Parameters.GetInt( "@businessCount" ); + TModelLimit = sp.Parameters.GetInt( "@tModelLimit" ); + TModelCount = sp.Parameters.GetInt( "@tModelCount" ); + ServiceLimit = sp.Parameters.GetInt( "@serviceLimit" ); + BindingLimit = sp.Parameters.GetInt( "@bindingLimit" ); + AssertionLimit = sp.Parameters.GetInt( "@assertionLimit" ); + AssertionCount = sp.Parameters.GetInt( "@assertionCount" ); + + Debug.Leave(); + } + } +} diff --git a/inetsrv/uddi/source/web/security.cs b/inetsrv/uddi/source/web/security.cs new file mode 100644 index 0000000..09eebb3 --- /dev/null +++ b/inetsrv/uddi/source/web/security.cs @@ -0,0 +1,581 @@ +using System; +using System.ComponentModel; +using System.Security.Principal; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using UDDI; + +namespace UDDI.Web +{ + /// ******************************************************************** + /// public class SignInControl + /// -------------------------------------------------------------------- + /// + /// Web control for producing a sign-in link. + /// + /// ******************************************************************** + /// + public class SignInControl : UserControl + { + protected string returnUrl = null; + protected bool forceLogin = true; + + /// **************************************************************** + /// public ForceLogin [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies whether the user will be forced to re-enter his + /// or her password after the time window has expired. + /// + /// **************************************************************** + /// + [ Bindable( true ), Category( "Behavior" ), DefaultValue( true ) ] + public bool ForceLogin + { + get { return forceLogin; } + set { forceLogin = value; } + } + + /// **************************************************************** + /// public ReturnUrl [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies the URL we should redirect to after a user + /// has signed in. + /// + /// **************************************************************** + /// + [ Bindable( true ), Category( "Behavior" ), DefaultValue( null ) ] + public string ReturnUrl + { + get { return returnUrl; } + set { returnUrl = value; } + } + + /// **************************************************************** + /// protected Render + /// ---------------------------------------------------------------- + /// + /// Renders the control. + /// + /// **************************************************************** + /// + protected override void Render( HtmlTextWriter output ) + { + if( ( Config.GetInt( "Security.AuthenticationMode", (int)AuthenticationMode.Windows ) & (int)AuthenticationMode.Passport ) != 0 ) + { + PassportIdentity passport = (PassportIdentity)Context.User.Identity; + + // + // Display the Passport login image. + // + int timeWindow = Config.GetInt( "Passport.TimeWindow", 14400 ); + bool secure = Request.IsSecureConnection; + + string thisUrl = ( Request.IsSecureConnection ? "https://" : "http://" ) + + Request.ServerVariables["SERVER_NAME"] + + Request.ServerVariables["SCRIPT_NAME"]; + + if( Utility.StringEmpty( ReturnUrl ) ) + ReturnUrl = thisUrl; + + // + // Update this to LogoTag2 when Passport .NET support is updated. + // + string html = passport.LogoTag( ReturnUrl, timeWindow, forceLogin, "", 0, secure, "", 0, false ); + + output.WriteLine( + "  " + + html.Replace( " + /// Specifies the user role is required for the page. + /// + /// **************************************************************** + /// + public bool UserRequired + { + get { return userRequired; } + set { userRequired = value; } + } + + /// **************************************************************** + /// public PublisherRequired [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies the publisher role is required for the page. + /// + /// **************************************************************** + /// + public bool PublisherRequired + { + get { return publisherRequired; } + set { publisherRequired = value; } + } + + /// **************************************************************** + /// public CoordinatorRequired [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies the coordinator role is required for the page. + /// + /// **************************************************************** + /// + public bool CoordinatorRequired + { + get { return coordinatorRequired; } + set { coordinatorRequired = value; } + } + + /// **************************************************************** + /// public AdminRequired [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies the administrator role is required for the page. + /// + /// **************************************************************** + /// + public bool AdminRequired + { + get { return adminRequired; } + set { adminRequired = value; } + } + + /// **************************************************************** + /// public ForceLogin [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies whether the user will be forced to re-enter his + /// or her password after the time window has expired. + /// + /// **************************************************************** + /// + [ Bindable( true ), Category( "Behavior" ), DefaultValue( true ) ] + public bool ForceLogin + { + get { return forceLogin; } + set { forceLogin = value; } + } + + /// **************************************************************** + /// public LoginUrl [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies the login page. + /// + /// **************************************************************** + /// + [ Bindable( true ), Category( "Behavior" ), DefaultValue( "/login.aspx" ) ] + public string LoginUrl + { + get { return loginUrl; } + set { loginUrl = value; } + } + + /// **************************************************************** + /// public ReturnUrl [get/set] + /// ---------------------------------------------------------------- + /// + /// Specifies the URL Passport should redirect to after a user + /// has signed in. + /// + /// **************************************************************** + /// + [ Bindable( true ), Category( "Behavior" ), DefaultValue( null ) ] + public string ReturnUrl + { + get { return returnUrl; } + set { returnUrl = value; } + } + + /// **************************************************************** + /// public IsAuthenticated [get] + /// ---------------------------------------------------------------- + /// + /// Returns true if the user is authenticated. + /// + /// **************************************************************** + /// + public bool IsAuthenticated + { + get { return passport.GetIsAuthenticated( timeWindow, ForceLogin, false ); } + } + + /// **************************************************************** + /// protected OnInit + /// ---------------------------------------------------------------- + /// + /// Initializes the security control. + /// + /// **************************************************************** + /// + protected override void OnInit( EventArgs e ) + { + // + // Check to make sure config settings are fresh. + // + Config.CheckForUpdate(); + + // + // Check to see if the server has been manually stopped. + // + if( 0 == Config.GetInt( "Run", 1 ) ) + { +#if never + throw new UDDIException( + ErrorType.E_busy, + "UDDI Services are currently unavailable." ); +#endif + throw new UDDIException( ErrorType.E_busy, "UDDI_ERROR_SERVICES_NOT_AVAILABLE" ); + } + + int mode = Config.GetInt( "Security.AuthenticationMode", (int)AuthenticationMode.Windows ); + + + // + // TODO: This code should be simplified to simple if statements. + // It is obviously old code that needs to be updated. + // + if( ( mode & (int)AuthenticationMode.Passport ) != 0 ) + { + // + // SECURITY: Passport.TimeWindow should be the same + // timeout as API authentication. + // + passport = (PassportIdentity)Context.User.Identity; + + + + timeWindow = Config.GetInt( "Passport.TimeWindow", 14400 ); + + string thisUrl = ( Request.IsSecureConnection ? "https://" : "http://" ) + + Request.ServerVariables[ "SERVER_NAME" ] + + Request.ServerVariables[ "SCRIPT_NAME" ]; + + if( Utility.StringEmpty( ReturnUrl ) ) + ReturnUrl = thisUrl; + + // + // If the user just logged in, clean up the query string by redirecting + // to this page. + // + if( passport.GetFromNetworkServer ) + Response.Redirect( thisUrl ); + + // + // Check to see if the current role is more that a passport user + // can do. + // + if( AdminRequired || CoordinatorRequired ) + { + // + //Passport Users are not allowed in these areas. + // +#if never + throw new UDDIException( + ErrorType.E_unknownUser, + "Access denied." ); +#endif + throw new UDDIException( + ErrorType.E_unknownUser, + "UDDI_ERROR_ACCESS_DENIED" ); + } + + // + // Check to see if the user is authenticated. + // + if( !passport.GetIsAuthenticated( timeWindow, ForceLogin, false ) ) + { + // + // If the user already has a ticket, force them to re-enter + // their password. + // + if( passport.HasTicket ) + { + bool secure = Request.IsSecureConnection; + + // + // Update this to AuthUrl2 when Passport .NET support is updated. + // + Response.Redirect( passport.AuthUrl( ReturnUrl, timeWindow, ForceLogin, "", 0, "", 0, secure ) ); + } + + // + // If login is required, redirect the user to the login page. + // + if( PublisherRequired ) + Response.Redirect( LoginUrl + "?publish=true" ); + } + else + { + string userID = passport.HexPUID; + + // + // Check to ensure that the passport UserID is not "" + // if it is, force them to retype thier password + // + // if( ""==userID ) + // Response.Redirect( LoginUrl ); + + + string email = (string)passport.GetProfileObject( "PreferredEmail" ); + + UDDI.Context.User.SetPublisherRole( userID ); + + if( PublisherRequired ) + { + // + // SECURITY: Is Validate the same as IsRegistered? + // lucasm: no, Validate makes sure the registered publisher has validated + // the email address they have supplied. IsRegistered checks to see + // if we have added this uses to the publishers table. + // + int valid = Publisher.Validate( userID ); + if( 50013 == valid ) + { + // + // Need to create a page that tells the + // user to click the link in the email + // + Response.Redirect( LoginUrl ); + } + else if( 0 != valid ) + { + Response.Redirect( LoginUrl ); + } + + Publisher publisher = new Publisher(); + publisher.Login( userID, email ); + + if( null == email ) + email = publisher.Email; + + // + // TODO: this REALLY should be merged with the PublisherInfo class + // in core!! + // + UDDI.Context.User.Name = publisher.Name; + UDDI.Context.User.BindingLimit = publisher.BindingLimit; + UDDI.Context.User.BusinessCount = publisher.BusinessCount; + UDDI.Context.User.BusinessLimit = publisher.BusinessLimit; + UDDI.Context.User.CompanyName = publisher.CompanyName; + UDDI.Context.User.IsoLangCode = publisher.IsoLangCode; + UDDI.Context.User.ServiceLimit = publisher.ServiceLimit; + UDDI.Context.User.TModelCount = publisher.TModelCount; + UDDI.Context.User.TModelLimit = publisher.TModelLimit; + } + + + // + // Save the credentials for the authenticated user. + // + UDDI.Context.User.ID = userID; + UDDI.Context.User.Email = email; + } + } + else + { + WindowsPrincipal principal = (WindowsPrincipal)HttpContext.Current.User; + + UDDI.Context.User.SetRole( principal ); + UDDI.Context.User.Name = principal.Identity.Name; + + if( UserRequired && !UDDI.Context.User.IsUser && ( mode & (int)AuthenticationMode.AuthenticatedRead ) != 0 || + PublisherRequired && !UDDI.Context.User.IsPublisher || + CoordinatorRequired && !UDDI.Context.User.IsCoordinator || + AdminRequired && !UDDI.Context.User.IsAdministrator ) + { +#if never + throw new UDDIException( + ErrorType.E_unknownUser, + "Access denied." ); +#endif + throw new UDDIException( ErrorType.E_unknownUser, "UDDI_ERROR_ACCESS_DENIED" ); + } + + if( PublisherRequired || CoordinatorRequired || AdminRequired ) + { + if( !UDDI.Context.User.IsRegistered ) + { + if( 1 == Config.GetInt( "Security.AutoRegister", 0 ) ) + { + UDDI.Context.User.TrackPassport = false; + UDDI.Context.User.Verified = true; + + UDDI.Context.User.Register(); + } + else + { +#if never + throw new UDDIException( UDDI.ErrorType.E_unknownUser, + "User login failed" ); +#endif + throw new UDDIException( UDDI.ErrorType.E_unknownUser, "UDDI_ERROR_USER_LOGIN_FAILED" ); + } + } + + UDDI.Context.User.Login(); + } + } + + // + // SECURITY: put this in the Windows Authentication block... not available + // for Passport auth. + // + // If the user is a coordinator and they have a cookie indicating they are + // impersonating another user, setup the user info in the current UDDI + // context. + // + + // + // 734292 - Make sure the user is an administrator if they are trying to impersonate the system. + // + if( true == ViewAsPublisher.IsValid() ) + { + UDDI.Context.User.ImpersonatorID = UDDI.Context.User.ID; + UDDI.Context.User.ID = ViewAsPublisher.GetPublisherID(); + } + } + } + + /// + /// This class will handle all of the operations necessary to set and get the impersontation publisher ID value + /// from HTTP cookies. The name of this class is obscure by design. + /// + public class ViewAsPublisher + { + // + // This value is used as the name of a cookie sent to the client. + // + private static string name = "ViewAsPublisher"; + + /// + /// This method will clear any current impersonation publisher ID's. + /// + public static void Reset() + { + // + // Remove any current cookies. + // + HttpContext.Current.Response.Cookies.Remove( ViewAsPublisher.name ); + + // + // Clear out any current values the client may be holding onto + // + HttpCookie viewAsPublisher = new HttpCookie( name, "" ); + HttpContext.Current.Response.Cookies.Add( viewAsPublisher ); + } + + /// + /// This method will set the publisher ID to impersonate. + /// + /// + /// + public static bool Set( string publisherID ) + { + bool success = false; + + // + // Make sure the name we are given is OK + // + if( true == ViewAsPublisher.IsValid( publisherID ) ) + { + // + // Remove any current cookies. + // + HttpContext.Current.Response.Cookies.Remove( ViewAsPublisher.name ); + + // + // Set the impersonation publisher ID in a cookie. + // + HttpCookie viewAsPublisher = new HttpCookie( name, publisherID ); + HttpContext.Current.Response.Cookies.Add( viewAsPublisher ); + + success = true; + } + + return success; + } + + /// + /// This method will return the value of the publisher to impersonate, or null if there isn't one. + /// + /// + public static string GetPublisherID() + { + string publisherID = null; + + HttpCookie viewAsPublisher = HttpContext.Current.Request.Cookies[ ViewAsPublisher.name ]; + if( null != viewAsPublisher ) + { + publisherID = viewAsPublisher.Value as string; + if( true == Utility.StringEmpty( publisherID ) ) + { + publisherID = null; + } + } + + return publisherID; + } + + /// + /// This method will return false if the user is not an administrator and they are trying to impersonate system + /// + /// + public static bool IsValid( string publisherID ) + { + bool isValid = false; + + // + // The minimum requirement is that the publisherID is not null and that the user is a coordinator. + // + if( true == UDDI.Context.User.IsCoordinator && + null != publisherID ) + { + // + // At this point, we are in a valid state. + // + isValid = true; + + // + // Check to see if the user is trying to impersonate the system account. + // + if( true == publisherID.ToLower().Equals( "system" ) ) + { + // + // If the value is System, make sure the user is an administrator + // + isValid = UDDI.Context.User.IsAdministrator; + } + } + + return isValid; + } + + public static bool IsValid() + { + return ViewAsPublisher.IsValid( ViewAsPublisher.GetPublisherID() ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/selection.cs b/inetsrv/uddi/source/web/selection.cs new file mode 100644 index 0000000..99d45e9 --- /dev/null +++ b/inetsrv/uddi/source/web/selection.cs @@ -0,0 +1,257 @@ +using System; +using System.Data; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; + +namespace UDDI.Web +{ + public delegate void SelectEventHandler( object sender, string key, string name ); + + public abstract class SelectionControl : UserControl + { + public event SelectEventHandler Select; + + protected Panel resultsPanel = null; + protected TextBox query = null; + protected DataGrid grid = null; + protected Label count = null; + protected RequiredFieldValidator requiredField = null; + + public SelectionControl() + { + } + + public void ResetControl() + { + resultsPanel.Visible = false; + + } + protected override void OnInit( EventArgs e ) + { + requiredField.ErrorMessage = Localization.GetString( "ERROR_FIELD_REQUIRED" ); + } + + protected void Grid_OnItemCommand( object sender, DataGridCommandEventArgs e ) + { + switch( e.CommandName ) + { + case "select": + OnSelect( this, e ); + + break; + } + } + + protected void Grid_OnPageIndexChange( object sender, DataGridPageChangedEventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + grid.CurrentPageIndex = e.NewPageIndex; + OnSearch( this, query.Text ); + } + } + + protected void Search_OnClick( object sender, EventArgs e ) + { + Page.Validate(); + + if( Page.IsValid ) + { + OnSearch( this, query.Text ); + } + } + + protected virtual void OnSelect( object sender, DataGridCommandEventArgs e ) + { + switch( e.CommandName ) + { + case "select": + string key = ((UddiLabel)e.Item.Cells[ 0 ].FindControl( "key" )).Text; + string name = ((LinkButton)e.Item.Cells[ 1 ].FindControl( "name" )).Text; + + name = HttpUtility.HtmlDecode( name ); + + if( null != Select ) + Select( this, key, name ); + + break; + } + } + + protected virtual void OnSearch( object sender, string query ) + { + resultsPanel.Visible = true; + } + } + + public class PublisherSelector : SelectionControl + { + public PublisherSelector() + { + } + + protected override void OnSearch( object sender, string query ) + { + base.OnSearch( sender, query ); + + if( query.IndexOf( "%" ) < 0 ) + query += "%"; + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + DataSet ds = new DataSet(); + + sp.ProcedureName = "ADM_findPublisher"; + + sp.Parameters.Add( "@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name ); + sp.Parameters.SetString( "@name", query ); + + sp.Fill( ds, "Publishers" ); + + if( null != ds.Tables[ "Publishers" ] ) + { + DataView view; + + // + // To eliminate the system account from the list + // we should not do it this way. we should change the SP to accept a role + // and then elimiate the rows before they placed in the DataSet. + // + + // + // If the user is an Admin, don't filter the data + // + if( UDDI.Context.User.IsAdministrator ) + { + view = ds.Tables[ "Publishers" ].DefaultView; + } + else + { + view = new DataView( ds.Tables[ "Publishers" ],//use the publisher table + "PUID <> 'System'", //filter by puid. + "name", //name is the sort column + DataViewRowState.CurrentRows ); // Show all current rows after filtering + } + + grid.DataSource = view; + grid.DataBind(); + + count.Text = String.Format( + Localization.GetString( "TEXT_QUERY_COUNT" ), + view.Count ); + } + else + { + grid.DataSource = null; + grid.DataBind(); + + count.Text = String.Format( + Localization.GetString( "TEXT_QUERY_COUNT" ), + 0 ); + } + } + } + + public class TModelSelector : SelectionControl + { + public TModelSelector() + { + } + + protected override void OnSearch( object sender, string query ) + { + base.OnSearch( sender, query ); + + if( query.IndexOf( "%" ) < 0 ) + query += "%"; + + FindTModel find = new FindTModel(); + find.Name = query; + + TModelList list = find.Find(); + + grid.DataSource = list.TModelInfos; + grid.DataBind(); + + count.Text = String.Format( + Localization.GetString( "TEXT_QUERY_COUNT" ), + list.TModelInfos.Count ); + } + } + + public class BusinessSelector : SelectionControl + { + public BusinessSelector() + { + } + + protected override void OnSearch( object sender, string query ) + { + if( null == query ) + return; + + query = query.Trim(); + + if( 0 == query.Length ) + return; + + base.OnSearch( sender, query ); + + if( query.IndexOf( "%" ) < 0 ) + query += "%"; + + FindBusiness find = new FindBusiness(); + find.Names.Add( null, query ); + + BusinessList list = find.Find(); + + grid.DataSource = list.BusinessInfos; + grid.DataBind(); + + count.Text = String.Format( + Localization.GetString( "TEXT_QUERY_COUNT" ), + list.BusinessInfos.Count ); + } + } + + public class ServiceSelector : SelectionControl + { + public ServiceSelector() + { + } + + protected override void OnSearch( object sender, string query ) + { + if( null == query ) + return; + + query = query.Trim(); + + if( 0 == query.Length ) + return; + + base.OnSearch( sender, query ); + + if( query.IndexOf( "%" ) < 0 ) + query += "%"; + + FindService find = new FindService(); + find.Names.Add( null, query ); + + ServiceList list = find.Find(); + + grid.DataSource = list.ServiceInfos; + grid.DataBind(); + + count.Text = String.Format( + Localization.GetString( "TEXT_QUERY_COUNT" ), + list.ServiceInfos.Count ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/services.cs b/inetsrv/uddi/source/web/services.cs new file mode 100644 index 0000000..e47d8a6 --- /dev/null +++ b/inetsrv/uddi/source/web/services.cs @@ -0,0 +1,169 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.Service; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class ServiceControl : UddiControl + { + protected BusinessServiceCollection services; + + private BusinessServiceCollection bindableServices; + private BusinessServiceCollection bindableServiceProjections; + + protected BusinessEntity parent; + protected bool frames; + protected string parentKey; + protected DataGrid grid; + protected DataGrid projectionsGrid; + + public void Initialize( BusinessServiceCollection services, string parentKey ) + { + this.services = services; + this.parentKey = parentKey; + this.parent = null; + + InitializeBindableData(); + + grid.Columns[ 0 ].Visible = false; + grid.Columns[ 1 ].Visible = false; + grid.Columns[ 2 ].Visible = true; + + grid.ShowFooter = false; + + projectionsGrid.Columns[ 0 ].Visible = false; + projectionsGrid.Columns[ 1 ].Visible = false; + projectionsGrid.Columns[ 2 ].Visible = true; + + } + + public void Initialize( BusinessServiceCollection services, BusinessEntity parent ) + { + this.services = services; + this.parent = parent; + this.parentKey = parent.BusinessKey; + + InitializeBindableData(); + + grid.Columns[ 0 ].Visible = true; + grid.Columns[ 1 ].Visible = true; + grid.Columns[ 2 ].Visible = false; + + grid.ShowFooter = true; + + projectionsGrid.Columns[ 0 ].Visible = true; + projectionsGrid.Columns[ 1 ].Visible = true; + projectionsGrid.Columns[ 2 ].Visible = false; + + } + private void InitializeBindableData( ) + { + // + // Fix to filter out service projections + // + + bindableServices = new BusinessServiceCollection(); + bindableServiceProjections = new BusinessServiceCollection(); + + foreach( BusinessService s in services ) + { + + if( s.BusinessKey!=parentKey ) + { + bindableServiceProjections.Add( s ); + } + else + { + bindableServices.Add( s ); + } + + } + } + protected void Page_Load( object sender, EventArgs e ) + { + frames = ( "true" == Request[ "frames" ] ); + + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + + projectionsGrid.DataSource = bindableServiceProjections; + projectionsGrid.DataBind(); + + grid.DataSource = bindableServices; + // commented for service projection fix. + //grid.DataSource = services; + grid.DataBind(); + } + protected void ServiceProjection_View( object sender, DataGridCommandEventArgs e ) + { + string key = bindableServiceProjections[ e.Item.ItemIndex ].ServiceKey; + string root = ((Request.ApplicationPath=="/")?"":Request.ApplicationPath ); + if( frames ) + { + string explkey = "sp:" + bindableServiceProjections[ e.Item.ItemIndex ].BusinessKey + ":" + key; + Response.Write( + ClientScripts.ReloadExplorerAndViewPanes( root+"/details/servicedetail.aspx?projectionContext=edit&frames=true&projectionKey="+parentKey+"&key=" + key, explkey ) ); + + Response.End(); + } + else + { + Response.Redirect( "editservice.aspx?frames=false&key=" + key ); + Response.End(); + } + + } + protected void Service_Edit( object sender, DataGridCommandEventArgs e ) + { + string key = bindableServices[ e.Item.ItemIndex ].ServiceKey; + + if( frames ) + { + Response.Write( + ClientScripts.ReloadExplorerAndViewPanes( "editservice.aspx?frames=true&key=" + key, key ) ); + + Response.End(); + } + else + { + Response.Redirect( "editservice.aspx?frames=false&key=" + key ); + Response.End(); + } + } + + protected void Service_Delete( object sender, DataGridCommandEventArgs e ) + { + string name = bindableServices[ e.Item.ItemIndex ].Names[ 0 ].Value; + string key = bindableServices[ e.Item.ItemIndex ].ServiceKey; + + // + // The user has not yet confirmed the delete operation, so display + // a confirmation dialog. + // + string message = String.Format( + Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), + name ); + + Page.RegisterStartupScript( + "Confirm", + ClientScripts.Confirm( + message, + "editservice.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + key + "&mode=delete&confirm=true&tab=1" ) ); + } + + protected void Service_Add( object sender, EventArgs e ) + { + Response.Redirect( "editservice.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + parent.BusinessKey + "&mode=add" ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/sidenav.cs b/inetsrv/uddi/source/web/sidenav.cs new file mode 100644 index 0000000..6740e5d --- /dev/null +++ b/inetsrv/uddi/source/web/sidenav.cs @@ -0,0 +1,159 @@ +namespace UDDI.Web +{ + using System; + using System.Web; + using System.Web.UI; + using System.Web.UI.WebControls; + using System.ComponentModel; + using System.Collections; + using System.Collections.Specialized; + using System.Web.Configuration; + using UDDI; + + + + /// ******************************************************************** + /// public class SideNav + /// -------------------------------------------------------------------- + /// + /// Produces the Side navigatio bar. + /// + /// ******************************************************************** + /// + public class SideNav : System.Web.UI.WebControls.WebControl + { + protected string root; + protected string roots; + + /// **************************************************************** + /// protected Render + /// ---------------------------------------------------------------- + /// + /// Renders the control. + /// + /// ---------------------------------------------------------------- + /// + /// The output stream. + /// + /// **************************************************************** + /// + protected override void Render( HtmlTextWriter output ) + { + HttpRequest request = HttpContext.Current.Request; + + root = ( "/" == request.ApplicationPath ) ? "" : request.ApplicationPath; + + if( 1 == Config.GetInt( "Security.HTTPS", 0 ) ) + roots = "https://" + request.Url.Host + root; + else + roots = "http://" + request.Url.Host + root; + + root = "http://" + request.Url.Host + root; + + output.WriteLine( "" ); + output.WriteLine( "" ); + + RenderMenuHeader( output, "LINKS" ); + RenderMenuItem( output, "Home", "/default.aspx", "", false ); + RenderMenuItem( output, "News", "http://www.uddi.org/news.html", "", false ); + + RenderMenuHeader( output, "TOOLS" ); + RenderMenuItem( output, "Register", "/register.aspx", "/registrationcomplete.aspx", true ); + RenderMenuItem( output, "Publish", "/edit/default.aspx", "", true ); + RenderMenuItem( output, "Search", "/search/default.aspx", "", false ); + + RenderMenuHeader( output, "DEVELOPERS" ); + RenderMenuItem( output, "For Developers", "/developer/default.aspx", "/developer/techOverview.aspx;/developer/KnownIssues.aspx", false ); + RenderMenuItem( output, "Solutions", "/solutions.aspx", "", false ); + + RenderMenuHeader( output, "HELP" ); + RenderMenuItem( output, "Help", "/help/default.aspx", "", false ); + RenderMenuItem( output, "Frequently Asked Questions", "/about/faq.aspx", "/about/faqbasics.aspx;/about/faqcost.aspx;/about/faqoperators.aspx;/about/faqregistration.aspx;/about/faqscope.aspx;/about/faqsearching.aspx;/about/faqsecurity.aspx;/about/faqtech.aspx", false ); + RenderMenuItem( output, "Policies", "/policies/default.aspx", "/policies/privacypolicy.aspx;/policies/termsofuse.aspx", false ); + RenderMenuItem( output, "About UDDI", "/about/default.aspx", "", false ); + RenderMenuItem( output, "Contact Us", "/contact/default.aspx", "", false ); + + output.WriteLine(""); + output.WriteLine(""); + output.WriteLine(""); + output.WriteLine( "
"); + output.WriteLine(" 
" ); + } + + /// **************************************************************** + /// private RenderMenuHeader + /// ---------------------------------------------------------------- + /// + /// Renders a menu header. + /// + /// ---------------------------------------------------------------- + /// + /// The output stream. + /// + /// + /// + /// Menu header name. + /// + /// **************************************************************** + /// + private void RenderMenuHeader( HtmlTextWriter output, string name ) + { + output.WriteLine( " " ); + output.WriteLine( " " ); + output.WriteLine( " " ); + output.WriteLine( " " ); + output.WriteLine( " " ); + output.WriteLine( " " + name + "" ); + output.WriteLine( " " ); + } + + /// **************************************************************** + /// private RenderMenuItem + /// ---------------------------------------------------------------- + /// + /// Renders a menu item. + /// + /// ---------------------------------------------------------------- + /// + /// The output stream. + /// + /// + /// + /// Menu item name. + /// + /// + /// + /// Menu item url. + /// + /// + /// + /// Alternate URLs that this menu item is associated with. + /// + /// **************************************************************** + /// + private void RenderMenuItem( HtmlTextWriter output, string name, string url, string alternateURLs, bool secure ) + { + string thisPage = HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"].ToLower(); + + bool currentPage = false; + + if( url.ToLower() == thisPage ) + currentPage = true; + else if( null != alternateURLs ) + { + alternateURLs = ";" + alternateURLs.ToLower() + ";"; + + if( alternateURLs.IndexOf( thisPage ) >= 0 ) + currentPage = true; + } + + string color = ( currentPage ? "#ffffff" : "#f1f1f1" ); + string border = ( currentPage ? "border-bottom: 1px solid #639ACE; border-top: 1px solid #639ACE; border-left: 1px solid #639ACE;" : " border-right: solid 1px #639ACE;" ); + + output.WriteLine( " " ); + output.WriteLine( " " ); + output.WriteLine( "
" + name.Replace( " ", " " ) + "" ); + output.WriteLine( " " ); + } + } +} diff --git a/inetsrv/uddi/source/web/sources b/inetsrv/uddi/source/web/sources new file mode 100644 index 0000000..7379ed5 --- /dev/null +++ b/inetsrv/uddi/source/web/sources @@ -0,0 +1,59 @@ +MANAGED_CODE=1 +URT_VER=1.1 + +TARGETNAME=uddi.web +TARGETPATH=obj +TARGETTYPE=DYNLINK +SYNCHRONIZE_PASS2_BLOCK=1 + +NTTARGETFILE1=foo.cs + +REFERENCES=system.dll, system.data.dll, system.web.dll, system.web.services.dll, system.xml.dll, ..\core\obj\*\uddi.core.dll,..\api\obj\*\uddi.api.dll + +SOURCES=\ + address.cs \ + assemblyinfo.cs \ + assemblyversioninfo.cs \ + base.cs \ + bindings.cs \ + box.cs \ + breadcrumb.cs \ + businesses.cs \ + cache.cs \ + categorybag.cs \ + clientscripts.cs \ + contacts.cs \ + contextmenu.cs \ + description.cs \ + discoveryurl.cs \ + editcontrol.cs \ + email.cs \ + explorer.cs \ + format.cs \ + header.cs \ + helpcontrol.cs \ + identifierbag.cs \ + instanceinfos.cs \ + localization.cs \ + lookup.cs \ + name.cs \ + owner.cs \ + phone.cs \ + publisher.cs \ + security.cs \ + selection.cs \ + services.cs \ + sidenav.cs \ + statistics.cs \ + tab.cs \ + taxonomy.cs \ + tmodelbag.cs \ + tmodels.cs \ + tree.cs \ + categorybrowser.cs \ + taxonomytree.cs \ + menu.cs \ + validators.cs \ + +BINPLACE_PLACEFILE=placefil.txt + diff --git a/inetsrv/uddi/source/web/statistics.cs b/inetsrv/uddi/source/web/statistics.cs new file mode 100644 index 0000000..f46123a --- /dev/null +++ b/inetsrv/uddi/source/web/statistics.cs @@ -0,0 +1,136 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Web; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public enum ReportType + { + GetEntityCounts = 0, + GetPublisherStats = 1, + GetTopPublishers = 2, + GetTaxonomyStats = 3 + } + + public enum ReportStatus + { + Available = 0, + Processing = 1 + } + + public class Statistics + { + public static DataView GetStatistics( ReportType reporttype, ref DateTime lastchange ) + { + string reportid = GetReportID( reporttype ); + + Debug.Enter(); + + + // + // Get Report Header + // + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + sp.ProcedureName = "net_report_get"; + + sp.Parameters.Add( "@reportID", SqlDbType.NVarChar, 128 ); + sp.Parameters.Add( "@lastChange", SqlDbType.DateTime, ParameterDirection.Output ); + + sp.Parameters.SetString( "@reportID", reportid ); + sp.ExecuteNonQuery(); + + lastchange = (DateTime)sp.Parameters.GetDateTime( "@lastChange" ); + + // + // Get Report Detail + // + + DataSet statistics = new DataSet(); + + SqlStoredProcedureAccessor sp2 = new SqlStoredProcedureAccessor(); + sp2.ProcedureName = "net_reportLines_get"; + + sp2.Parameters.Add( "@reportID", SqlDbType.NVarChar, 128 ); + sp2.Parameters.SetString( "@reportID", reportid ); + + sp2.Fill( statistics, "Statistics" ); + + Debug.Leave(); + + return statistics.Tables[ "Statistics" ].DefaultView; + } + + public static void RecalculateStatistics( ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + sp.ProcedureName = "net_statistics_recalculate"; + try + { + sp.ExecuteNonQuery(); + } + catch( Exception e ) + { + Debug.Write( UDDI.Diagnostics.SeverityType.Info, CategoryType.Website, "Exception during statistic recalculation:\r\n\r\n" + e.ToString() ); +#if never + throw new UDDIException( ErrorType.E_fatalError, "Unable to recalculate statistics:" + e.Message ); +#endif + throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UNABLE_TO_RECALC_STATS", e.Message ); + } + + Debug.Leave(); + } + + public static ReportStatus GetReportStatus( ReportType reporttype ) + { + string reportid = GetReportID( reporttype ); + ReportStatus reportstatus; + + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + sp.ProcedureName = "net_report_get"; + + sp.Parameters.Add( "@reportID", SqlDbType.NVarChar, 128 ); + sp.Parameters.Add( "@reportStatusID", SqlDbType.TinyInt, ParameterDirection.Output ); + + sp.Parameters.SetString( "@reportID", reportid ); + sp.ExecuteNonQuery(); + + reportstatus = (ReportStatus)sp.Parameters.GetInt( "@reportStatusID" ); + + Debug.Leave(); + + return reportstatus; + } + + private static string GetReportID ( ReportType reporttype ) + { + string reportid = ""; + + switch( reporttype ) + { + case ReportType.GetEntityCounts : + reportid = "UI_getEntityCounts"; + break; + case ReportType.GetPublisherStats : + reportid = "UI_getPublisherStats"; + break; + case ReportType.GetTopPublishers : + reportid = "UI_getTopPublishers"; + break; + case ReportType.GetTaxonomyStats : + reportid = "UI_getTaxonomyStats"; + break; + } + + return reportid; + } + + } +} diff --git a/inetsrv/uddi/source/web/tab.cs b/inetsrv/uddi/source/web/tab.cs new file mode 100644 index 0000000..19773e2 --- /dev/null +++ b/inetsrv/uddi/source/web/tab.cs @@ -0,0 +1,417 @@ +using System; +using System.Collections; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.HtmlControls; +using UDDI; + +namespace UDDI.Web +{ + public class TabControl : Control, INamingContainer, IPostBackEventHandler + { + protected TableStyle style = new TableStyle(); + protected TableItemStyle tabBeginStyle = new TableItemStyle(); + protected TableItemStyle tabBeginSelectedStyle = new TableItemStyle(); + protected TableItemStyle tabStyle = new TableItemStyle(); + protected TableItemStyle tabSelectedStyle = new TableItemStyle(); + protected TableItemStyle tabEndStyle = new TableItemStyle(); + protected TableItemStyle tabEndSelectedStyle = new TableItemStyle(); + protected TableItemStyle tabGapStyle = new TableItemStyle(); + protected TableItemStyle tabPageStyle = new TableItemStyle(); + protected TableStyle tabBodyStyle = new TableStyle(); + + protected bool defaultStyle = true; + protected bool tabSwitch = false; + + public delegate void TabChangeEventHandler( object sender, int oldIndex, int newIndex ); + + public event TabChangeEventHandler BeforeTabChange; + public event TabChangeEventHandler TabChange; + + public TabControl() + { + } + + public int SelectedIndex + { + get + { + if( null == ViewState[ "index" ] ) + return 0; + + return (int)ViewState[ "index" ]; + } + + set { ViewState[ "index" ] = value; } + } + + public TableStyle Style + { + get { return style; } + } + + public TableItemStyle TabBeginStyle + { + get { return tabBeginStyle; } + } + + public TableItemStyle TabBeginSelectedStyle + { + get { return tabBeginSelectedStyle; } + } + + public TableItemStyle TabStyle + { + get { return tabStyle; } + } + + public TableItemStyle TabSelectedStyle + { + get { return tabSelectedStyle; } + } + + public TableItemStyle TabEndStyle + { + get { return tabEndStyle; } + } + + public TableItemStyle TabEndSelectedStyle + { + get { return tabEndSelectedStyle; } + } + + public TableItemStyle TabGapStyle + { + get { return tabGapStyle; } + } + + public TableItemStyle TabPageStyle + { + get { return tabPageStyle; } + } + public TableStyle TabBodyStyle + { + get{ return tabBodyStyle; } + } + + + public bool DefaultStyle + { + get { return defaultStyle; } + set { defaultStyle = value; } + } + + protected override void OnInit( EventArgs e ) + { + if( defaultStyle ) + { + TabBeginStyle.CssClass = "tabBegin"; + TabStyle.CssClass = "tab"; + TabEndStyle.CssClass = "tabEnd"; + + TabBeginSelectedStyle.CssClass = "tabBeginSelected"; + TabSelectedStyle.CssClass = "tabSelected"; + TabEndSelectedStyle.CssClass = "tabEndSelected"; + + TabGapStyle.CssClass = "tabGap"; + TabPageStyle.CssClass = "tabPage"; + TabBodyStyle.CssClass = "tabPage"; + } + } + + protected override void AddParsedSubObject( object obj ) + { + if( obj is TabPage ) + this.Controls.Add( (Control)obj ); + } + + void IPostBackEventHandler.RaisePostBackEvent( string eventArgument ) + { + tabSwitch = true; + + if( ((UddiPage)Page).EditMode ) + return; + + int oldIndex = SelectedIndex; + int newIndex = Convert.ToInt32( eventArgument ); + + this.EnsureChildControls(); + + if( null != BeforeTabChange ) + BeforeTabChange( this, oldIndex, newIndex ); + + SelectedIndex = newIndex; + + if( null != TabChange ) + TabChange( this, oldIndex, newIndex ); + } + + protected override void Render( HtmlTextWriter output ) + { + int index = 0; + int visiblePageCount = 0; + int capWidth = ( ( UddiBrowser.IsDownlevel && !UddiBrowser.IsNetscape6 ) ? 1 : 4 ); + + output.AddAttribute( HtmlTextWriterAttribute.Cellpadding, "0" ); + output.AddAttribute( HtmlTextWriterAttribute.Cellspacing, "0" ); + output.AddAttribute( HtmlTextWriterAttribute.Border, "0" ); + + if( !UddiBrowser.IsDownlevel || UddiBrowser.IsNetscape6 ) + output.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + + Style.AddAttributesToRender( output ); + output.RenderBeginTag( HtmlTextWriterTag.Table ); + + output.RenderBeginTag( HtmlTextWriterTag.Colgroup ); + + foreach( TabPage page in Controls ) + { + if( page.ShouldDisplay ) + { + output.Write( "" ); + output.Write( "" ); + output.Write( "" ); + } + } + + if( !UddiBrowser.IsDownlevel || UddiBrowser.IsNetscape6 ) + output.Write( "" ); + + output.RenderEndTag(); + + output.RenderBeginTag( HtmlTextWriterTag.Tr ); + + foreach( TabPage page in Controls ) + { + if( page.ShouldDisplay ) + { + // + // Create the begin tab cell. + // + if( index == SelectedIndex ) + TabBeginSelectedStyle.AddAttributesToRender( output ); + else + TabBeginStyle.AddAttributesToRender( output ); + + output.AddAttribute( "width", capWidth.ToString() ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + output.Write( "" ); + output.RenderEndTag(); + + // + // Create the link and text for the tab. + // + if( index == SelectedIndex ) + TabSelectedStyle.AddAttributesToRender( output ); + else + TabStyle.AddAttributesToRender( output ); + + if( !UddiBrowser.IsDownlevel || UddiBrowser.IsNetscape6 ) + output.AddAttribute( "width", "100" ); + + output.AddAttribute( "align", "center" ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + output.AddAttribute( HtmlTextWriterAttribute.Href, "javascript:" + Page.GetPostBackEventReference( this, Convert.ToString( index ) ) ); + output.Write( "  " ); + output.RenderBeginTag( HtmlTextWriterTag.A ); + output.Write( Localization.GetString( page.Name ) ); + output.RenderEndTag(); + output.Write( "  " ); + + output.RenderEndTag(); + + // + // Create the closing tab cell. + // + if( index == SelectedIndex ) + TabEndSelectedStyle.AddAttributesToRender( output ); + else + TabEndStyle.AddAttributesToRender( output ); + + output.AddAttribute( "width", capWidth.ToString() ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + output.Write( "" ); + output.RenderEndTag(); + + visiblePageCount ++; + } + + index ++; + } + + // + // Render the leftover space at the end of the tabs + // + if( !UddiBrowser.IsDownlevel || UddiBrowser.IsNetscape6 ) + { + TabGapStyle.AddAttributesToRender( output ); + + output.AddAttribute( "width", "100%" ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + output.Write( "" ); + output.RenderEndTag(); + } + + // + // Add the completed tab row to the table. + // + output.RenderEndTag(); + + // + // Test to see if we can fix the table spacing problems in IE6 + // Task: Split the table in to tables + // + output.RenderEndTag(); + + output.AddAttribute( HtmlTextWriterAttribute.Cellpadding, "10" ); + output.AddAttribute( HtmlTextWriterAttribute.Cellspacing, "0" ); + output.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + + + + if( UddiBrowser.IsDownlevel && !UddiBrowser.IsNetscape6 ) + { + output.AddAttribute( HtmlTextWriterAttribute.Border, "1" ); + output.AddAttribute( HtmlTextWriterAttribute.Bordercolor, "#639ace" ); + } + + output.AddAttribute( HtmlTextWriterAttribute.Bgcolor, "#f0f8ff" ); + TabBodyStyle.AddAttributesToRender( output ); + output.RenderBeginTag( HtmlTextWriterTag.Table ); + + output.RenderBeginTag( HtmlTextWriterTag.Tr ); + + output.AddAttribute( "valign", "top" ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + if( ((UddiPage)Page).EditMode && tabSwitch ) + { + output.AddAttribute( "color", "red" ); + output.RenderBeginTag( HtmlTextWriterTag.Font ); + output.Write( Localization.GetString( "ERROR_FINISH_EDIT" ) ); + output.RenderEndTag(); + output.Write( "

" ); + } + + this.Controls[ SelectedIndex ].RenderControl( output ); + + output.RenderEndTag(); + output.RenderEndTag(); + output.RenderEndTag(); + output.Write( "
" ); + + /* + // + // Create the tab page content + // + //if( UddiBrowser.IsDownlevel ) + //{ + output.RenderEndTag(); + + output.AddAttribute( HtmlTextWriterAttribute.Cellpadding, "10" ); + output.AddAttribute( HtmlTextWriterAttribute.Cellspacing, "0" ); + output.AddAttribute( HtmlTextWriterAttribute.Width, "100%" ); + output.AddAttribute( HtmlTextWriterAttribute.Border, "1" ); + output.AddAttribute( HtmlTextWriterAttribute.Bordercolor, "#639ace" ); + output.AddAttribute( HtmlTextWriterAttribute.Bgcolor, "#f0f8ff" ); + output.RenderBeginTag( HtmlTextWriterTag.Table ); + + output.RenderBeginTag( HtmlTextWriterTag.Tr ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + if( ((UddiPage)Page).EditMode && tabSwitch ) + { + output.AddAttribute( "color", "red" ); + output.RenderBeginTag( HtmlTextWriterTag.Font ); + output.Write( Localization.GetString( "ERROR_FINISH_EDIT" ) ); + output.RenderEndTag(); + output.Write( "

" ); + } + + this.Controls[ SelectedIndex ].RenderControl( output ); + + output.RenderEndTag(); + output.RenderEndTag(); + output.RenderEndTag(); + output.Write( "
" ); + } + else + { + + output.RenderBeginTag( HtmlTextWriterTag.Tr ); + + TabPageStyle.AddAttributesToRender( output ); + output.AddAttribute( HtmlTextWriterAttribute.Valign, "top" ); + output.AddAttribute( HtmlTextWriterAttribute.Colspan, Convert.ToString( visiblePageCount * 3 + 1 ) ); + output.RenderBeginTag( HtmlTextWriterTag.Td ); + + if( ((UddiPage)Page).EditMode && tabSwitch ) + { + output.AddAttribute( "color", "red" ); + output.RenderBeginTag( HtmlTextWriterTag.Font ); + output.Write( Localization.GetString( "ERROR_FINISH_EDIT" ) ); + output.RenderEndTag(); + output.Write( "

" ); + } + + this.Controls[ SelectedIndex ].RenderControl( output ); + + output.RenderEndTag(); + output.RenderEndTag(); + output.RenderEndTag(); + } + */ + } + + } + + public class TabPage : Control, INamingContainer + { + protected RoleType requiredRole = RoleType.Anonymous; + + protected bool downlevelOnly = false; + protected string name; + + public string Name + { + get { return name; } + set { name = value; } + } + + public RoleType RequiredRole + { + get { return requiredRole; } + set { requiredRole = value; } + } + + public bool AccessAllowed + { + get + { + return + ( RoleType.Anonymous == requiredRole ) || + ( RoleType.User == requiredRole && UDDI.Context.User.IsUser ) || + ( RoleType.Publisher == requiredRole && UDDI.Context.User.IsPublisher ) || + ( RoleType.Coordinator == requiredRole && UDDI.Context.User.IsCoordinator ) || + ( RoleType.Administrator == requiredRole && UDDI.Context.User.IsAdministrator ); + } + } + + public bool DownlevelOnly + { + get { return downlevelOnly; } + set { downlevelOnly = value; } + } + + public bool ShouldDisplay + { + get + { + return + AccessAllowed && Visible && + ( !DownlevelOnly || ( ((UddiPage)Page).IsDownlevel && DownlevelOnly ) ); + } + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/taxonomy.cs b/inetsrv/uddi/source/web/taxonomy.cs new file mode 100644 index 0000000..3d15962 --- /dev/null +++ b/inetsrv/uddi/source/web/taxonomy.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Web; +using UDDI; +using UDDI.API; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class Taxonomy + { + public static DataView GetTaxonomies() + { + Debug.Enter(); + + DataTable taxonomies = GetTaxonomiesDataSet(); + + Debug.Leave(); + + return taxonomies.DefaultView; + } + public static DataView GetTaxonomies( string filter, string sort) + { + Debug.Enter(); + + DataTable taxonomies = GetTaxonomiesDataSet(); + + DataView view = new DataView( taxonomies, filter, sort,DataViewRowState.OriginalRows ); + + Debug.Leave(); + + return view; + } + protected static DataTable GetTaxonomiesDataSet( ) + { + Debug.Enter(); + + DataSet taxonomies = new DataSet(); + + SqlCommand cmd = new SqlCommand( "UI_getTaxonomies", ConnectionManager.GetConnection() ); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Transaction = ConnectionManager.GetTransaction(); + + SqlDataAdapter adapter = new SqlDataAdapter( cmd ); + + adapter.Fill( taxonomies, "Taxonomies" ); + + Debug.Leave(); + + return taxonomies.Tables[ "Taxonomies" ]; + } + + public static int GetTaxonomyID( string tModelKey ) + { + int taxonomyID; + + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_getTaxonomies"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.SetGuidFromKey( "@tModelKey", tModelKey ); + + SqlDataReaderAccessor reader = sp.ExecuteReader(); + + try + { + if( reader.Read() ) + taxonomyID = reader.GetInt( "taxonomyID" ); + else + taxonomyID = -1; + } + finally + { + reader.Close(); + } + + Debug.Leave(); + return taxonomyID; + } + + public static string GetTaxonomyParent( int taxonomyID, string ID ) + { + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "UI_getTaxonomyParent", ConnectionManager.GetConnection() ); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.Parameters.Add( new SqlParameter( "@TaxonomyID", SqlDbType.Int ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@ID", SqlDbType.NVarChar, 450 ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetInt( "@TaxonomyID", taxonomyID ); + paramacc.SetString( "@ID", ID ); + + string parent = (string)cmd.ExecuteScalar(); + + Debug.Leave(); + + return parent; + } + public static string GetTaxonomyKeyName( int taxonomyID, string keyValue ) + { + Debug.Enter(); + + SqlCommand cmd = new SqlCommand( "UI_getTaxonomyName", ConnectionManager.GetConnection() ); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.Parameters.Add( new SqlParameter( "@TaxonomyID", SqlDbType.Int ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@ID", SqlDbType.NVarChar, 450 ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetInt( "@TaxonomyID", taxonomyID ); + paramacc.SetString( "@ID", keyValue ); + + string keyName = (string)cmd.ExecuteScalar(); + + + Debug.Leave(); + + return keyName; + } + public static DataView GetTaxonomyChildrenNode( int taxonomyID, string node ) + { + Debug.Enter(); + + DataSet categories = new DataSet(); + + SqlCommand cmd = new SqlCommand( "UI_getTaxonomyChildrenNode", ConnectionManager.GetConnection() ); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.Parameters.Add( new SqlParameter( "@rowCount", SqlDbType.Int ) ).Direction = ParameterDirection.ReturnValue; + cmd.Parameters.Add( new SqlParameter( "@taxonomyID", SqlDbType.Int ) ).Direction = ParameterDirection.Input; + cmd.Parameters.Add( new SqlParameter( "@node", SqlDbType.NVarChar, 450 ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetInt( "@taxonomyID", taxonomyID ); + paramacc.SetString( "@node", node ); + + SqlDataAdapter adapter = new SqlDataAdapter( cmd ); + + adapter.Fill( categories, "categories" ); + + Debug.Leave(); + + return categories.Tables[ "categories" ].DefaultView; + } + + public static DataView GetTaxonomyChildrenRoot( int taxonomyID ) + { + Debug.Enter(); + + DataSet categories = new DataSet(); + + SqlCommand cmd = new SqlCommand( "UI_getTaxonomyChildrenRoot", ConnectionManager.GetConnection() ); + cmd.CommandType = CommandType.StoredProcedure; + cmd.Transaction = ConnectionManager.GetTransaction(); + cmd.Parameters.Add( new SqlParameter( "@rowCount", SqlDbType.Int ) ).Direction = ParameterDirection.ReturnValue; + cmd.Parameters.Add( new SqlParameter( "@taxonomyID", SqlDbType.Int ) ).Direction = ParameterDirection.Input; + + SqlParameterAccessor paramacc = new SqlParameterAccessor( cmd.Parameters ); + + paramacc.SetInt( "@taxonomyID", taxonomyID ); + + SqlDataAdapter adapter = new SqlDataAdapter( cmd ); + + adapter.Fill( categories, "Categories" ); + + Debug.Leave(); + + return categories.Tables[ "Categories" ].DefaultView; + } + + public static bool IsValidForClassification( int taxonomyID, string node ) + { + Debug.Enter(); + + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_isNodeValidForClassification"; + + sp.Parameters.Add( "@taxonomyID", SqlDbType.Int ); + sp.Parameters.Add( "@node", SqlDbType.NVarChar, 450 ); + + sp.Parameters.SetInt( "@taxonomyID", taxonomyID ); + sp.Parameters.SetString( "@node", node ); + + bool valid = (bool)sp.ExecuteScalar(); + + Debug.Leave(); + + return valid; + } + public static void SetTaxonomyBrowsable( string tModelKey, bool enabled ) + { + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_setTaxonomyBrowsable"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@enabled", SqlDbType.TinyInt ); + + sp.Parameters.SetGuidFromKey( "@tModelKey", tModelKey ); + sp.Parameters.SetInt( "@enabled", Convert.ToInt32( enabled ) ); + sp.ExecuteNonQuery(); + } + public static DataTable GetTaxonomiesForBrowsingDataTable() + { + Debug.Enter( ); + DataSet taxonomies = new DataSet( ); + + SqlCommand cmd = new SqlCommand( "UI_getBrowsableTaxonomies", ConnectionManager.GetConnection() ); + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Transaction = ConnectionManager.GetTransaction(); + + SqlDataAdapter adapter = new SqlDataAdapter( cmd ); + + adapter.Fill( taxonomies, "Taxonomies" ); + Debug.Leave(); + return taxonomies.Tables[ "Taxonomies" ]; + } + public static DataView GetTaxonomiesForBrowsing( ) + { + Debug.Enter( ); + + DataTable taxonomies = GetTaxonomiesForBrowsingDataTable(); + + Debug.Leave(); + + return taxonomies.DefaultView; + + } + public static DataView GetTaxonomiesForBrowsing( string filter, string sort ) + { + Debug.Enter( ); + + DataTable taxonomies = GetTaxonomiesForBrowsingDataTable(); + DataView view = new DataView( taxonomies, filter, sort, DataViewRowState.OriginalRows ); + + Debug.Leave(); + + return view; + + } + + ///******************************************************************************************************** + /// + /// Used to determine if the current taxonomy object is valid for use in the User Interface for + /// browsing purposes. + /// + /// Checks a flag in the database to see if the taxonomy is browsable. + /// + /// If flag 0x02 is set, then it is browsable. + /// + ///******************************************************************************************************** + /// tModelKey to get + ///******************************************************************************************************** + /// + /// boolean indicating that the taxonomy is valid for browsing in the search via the User Interface + /// + ///******************************************************************************************************** + public static bool IsValidForBrowsing( string tModelKey ) + { + bool r = false; + SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor(); + + sp.ProcedureName = "UI_isTaxonomyBrowsable"; + + sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier ); + sp.Parameters.Add( "@isBrowsable", SqlDbType.TinyInt, ParameterDirection.Output ); + + sp.Parameters.SetGuidFromKey( "@tModelKey", tModelKey ); + + sp.ExecuteNonQuery(); + + r = sp.Parameters.GetBool( "@isBrowsable" ); + + sp.Close(); + + return r; + } + + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/taxonomytree.cs b/inetsrv/uddi/source/web/taxonomytree.cs new file mode 100644 index 0000000..61062bb --- /dev/null +++ b/inetsrv/uddi/source/web/taxonomytree.cs @@ -0,0 +1,504 @@ +using System; +using System.Collections; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ +// +// TODO: Move most of this code into a base class (HyarchicalBreadCrumbsControl) and inherit from that +// + public delegate void TaxonomyTreeControlEventHandler( object sender, TaxonomyTreeControlEventArgs e ); + public class TaxonomyTreeControl : TaxonomyTreeItemControl + { + public TaxonomyTreeControl() : base() + { + // + // wire up local event handlers + // + this.Init += new EventHandler( TaxonomyTreeControl_Init ); + this.Load += new EventHandler( TaxonomyTreeControl_Load ); + + } + + private static string root = ( ( "/" == HttpContext.Current.Request.ApplicationPath )?"": HttpContext.Current.Request.ApplicationPath ); + public static string SpacerImage + { + get{ return root+"/images/blank.gif"; } + } + public static string ItemImage + { + get{ return root+"/images/bluebox.gif"; } + } + public static string SelectedItemImage + { + get{ return root+"/images/bluearrow.gif"; } + } + + + + private int selectedIndex = 0; + /// ******************************************************************************************************* + /// + /// Gets the Selected Index of the Tree + /// + /// ******************************************************************************************************* + public int SelectedIndex + { + get{ return selectedIndex; } + } + + private string cssClass; + /// ******************************************************************************************************* + /// + /// Gets or Sets the Style Sheet class to use. + /// + /// ******************************************************************************************************* + public string CssClass + { + get{ return this.cssClass; } + set{ this.cssClass = value; } + } + + /// ******************************************************************************************************* + /// + /// Selects and Item in the Tree by the index of the item + /// + /// Index in the tree you want to be selected. Rendering will stop at this node + /// ******************************************************************************************************* + public void SelectItem( int index ) + { + TaxonomyTreeItemControl item = this; + while( item.Index!=index ) + { + item.isSelected = false; + item = item.Child; + } + item.isSelected = true; + this.selectedIndex = item.Index; + } + + + /// + /// + /// + /// + protected override void Render( HtmlTextWriter output ) + { + //wrap all items in a parent div. + + output.Write( "
\r\n" ); + + base.Render( output ); + + output.Write( "
\r\n" ); + } + + + /// ******************************************************************************************************* + /// + /// + /// + /// object that triggered the event + /// EventArguments for this Event. + /// ******************************************************************************************************* + private void TaxonomyTreeControl_Init( object sender, EventArgs e ) + { + + + } + + /// ******************************************************************************************************* + /// + /// + /// + /// object that triggered the event + /// EventArguments for this Event. + /// ******************************************************************************************************* + private void TaxonomyTreeControl_Load( object sender, EventArgs e ) + { + + + } + + } + + + + /// *********************************************************************************************************** + /// + /// TaxonomyTreeItemControl + /// Holds information about a selected Taxonomy Item. + /// + /// *********************************************************************************************************** + public class TaxonomyTreeItemControl : UddiControl, IPostBackEventHandler + { + public event TaxonomyTreeControlEventHandler ChildClick; + public event TaxonomyTreeControlEventHandler Click; + + public TaxonomyTreeItemControl() + { + this.ChildClick += new TaxonomyTreeControlEventHandler( TaxonomyTreeItemControl_ChildClick ); + + + } + + + protected internal bool isSelected; + /// ******************************************************************************************************* + /// + /// Get if the node is the selected node. + /// + /// ******************************************************************************************************* + public bool IsSelected + { + get{ return isSelected; } + } + + + private bool bubbleEvents = false; + /// + /// Gets or Sets if the TreeItem should bubble its ClickClick Events up. + /// + public bool BubbleEvents + { + get + { + if( null!=this.ParentTree ) + return this.ParentTree.BubbleEvents; + return bubbleEvents; + } + set{ bubbleEvents=value; } + } + + private int indentBase=0; + /// + /// Gets or Sets the base number of pixels to indent each node in the tree. + /// This number will be multiplied by the index to find the total indent space. + /// + public int IndentBase + { + get + { + if( 0==indentBase ) + { + if( null!=this.ParentTreeItem ) + indentBase = this.ParentTreeItem.IndentBase; + } + + return indentBase; + + } + set{ indentBase=value; } + } + + /// + /// Gets the Total Indent space used for this Tree Item + /// + public int TotalIndentSpace + { + get{ return ( IndentBase * Index ); } + } + + /// + /// Gets the Total count of Children in the hyarchy of the tree including it self + /// + public int Count + { + get + { + int i = 1; + TaxonomyTreeItemControl item = this; + while( null!=item.Child ) + { + item = item.Child; + i++; + } + return i; + } + } + + protected string keyValue; + /// ******************************************************************************************************* + /// + /// Gets or Sets the KeyValue associated with the item + /// + /// ******************************************************************************************************* + public string KeyValue + { + get{ return keyValue; } + set{ keyValue = value; } + } + + protected int taxonomyID; + /// ******************************************************************************************************* + /// + /// Gets or Sets the TaxonomyID associated with this item + /// + /// ******************************************************************************************************* + public int TaxonomyID + { + get{ return taxonomyID; } + set{ taxonomyID = value; } + } + + protected string keyName; + /// ******************************************************************************************************* + /// + /// Gets or Sets the KeyName associated with this item + /// + /// ******************************************************************************************************* + public string KeyName + { + get{ return keyName; } + set{ keyName = value; } + } + + + protected TaxonomyTreeItemControl child; + /// ******************************************************************************************************* + /// + /// Gets the Active child of the current Taxonomy Item + /// + /// ******************************************************************************************************* + public TaxonomyTreeItemControl Child + { + get{ return child; } + } + /// ******************************************************************************************************* + /// + /// Gets the Active parent of the current Taxonomy Item + /// + /// ******************************************************************************************************* + public TaxonomyTreeItemControl ParentTreeItem + { + get + { + if( null!=this.Parent && this.Parent is TaxonomyTreeItemControl ) + { + return (TaxonomyTreeItemControl)this.Parent; + } + else + { + return null; + } + } + } + /// ******************************************************************************************************* + /// + /// Gets the Tree that this item belong to + /// + /// ******************************************************************************************************* + public TaxonomyTreeControl ParentTree + { + get + { + TaxonomyTreeItemControl item = this.ParentTreeItem; + while( null!=item && !(item is TaxonomyTreeControl ) ) + { + item = item.ParentTreeItem; + } + return (TaxonomyTreeControl)item; + } + } + /// ******************************************************************************************************* + /// + /// Gets the index of this Item in the Tree + /// + /// ******************************************************************************************************* + public int Index + { + get + { + int i = 0; + TaxonomyTreeItemControl item = this.ParentTreeItem; + while( null!=item ) + { + item = item.ParentTreeItem; + i++; + } + return i; + } + } + + /// ******************************************************************************************************* + /// + /// Sets the Active Child to this Taxonomy Item + /// + /// TreeItem you want to be the child + /// ******************************************************************************************************* + public void SetChild( TaxonomyTreeItemControl child ) + { + this.Controls.Clear(); + this.Controls.Add( child ); + this.child = child; + this.Child.IndentBase = this.IndentBase; + this.Child.BubbleEvents = this.BubbleEvents; + this.Child.Click += new TaxonomyTreeControlEventHandler( TaxonomyTreeItemControl_ChildClick ); + } + + /// ******************************************************************************************************* + /// + /// Renders this Tree Item + /// + /// HtmlTextWriter to use to write to the stream + /// ******************************************************************************************************* + protected override void Render( HtmlTextWriter output ) + { + //render the begin tag + output.Write( "
" ); + + Image spacer = new Image(); + Image item = new Image(); + Control text; + + + + if( IsSelected ) + { + // + // set the item Image + // + item.ImageUrl = TaxonomyTreeControl.SelectedItemImage; + + // + //selected item, not clickable. + // + text = (Control)new Label(); + ((Label)text).Text= ""+HttpUtility.HtmlEncode( KeyName )+""; + } + else + { + // + //item is clickable. + // + text = (Control)new HyperLink(); + ((HyperLink)text).Text= ""+HttpUtility.HtmlEncode( KeyName )+""; + + // + //set up the postback event handler + // + ((HyperLink)text).NavigateUrl = Page.GetPostBackClientHyperlink( this, "" ); + + // + // set the item Image + // + item.ImageUrl = TaxonomyTreeControl.ItemImage; + + } + + item.ImageAlign = ImageAlign.AbsBottom; + + // + // setup the spacer Image + // + spacer.Width = new Unit( this.TotalIndentSpace ); + spacer.ImageUrl = TaxonomyTreeControl.SpacerImage; + spacer.Height = new Unit( 1 ); + spacer.ImageAlign = ImageAlign.AbsBottom; + + //render the controls. + spacer.RenderControl( output ); + item.RenderControl( output ); + + + text.RenderControl( output ); + + + //render the end tag + output.Write( "
\r\n" ); + + //if this item is selected, don't render any children. + if( !IsSelected ) + RenderChildren( output ); + } + + protected override void RenderChildren( HtmlTextWriter output ) + { + if( null!=this.Child ) + this.Child.RenderControl( output ); + } + + /// ******************************************************************************************************* + /// + /// Catches the PostBack event from the server + /// + /// Required by interface, but ignored in this implentation + /// ******************************************************************************************************* + void IPostBackEventHandler.RaisePostBackEvent( string eventArgument ) + { + // + // fire the Click event + // + this.OnClick( new TaxonomyTreeControlEventArgs( this ) ); + } + + /// ******************************************************************************************************* + /// + /// Code to execute when a ChildClick event is Captured. + /// + /// object that triggered the event + /// EventArguments for this Event. + /// ******************************************************************************************************* + private void TaxonomyTreeItemControl_ChildClick( object sender, TaxonomyTreeControlEventArgs e ) + { + if( BubbleEvents ) + { + this.OnClick( e ); + } + } + + /// ******************************************************************************************************* + /// + /// Fires the ChildClick event + /// + /// EventArguments to pass in the Event + /// ******************************************************************************************************* + protected void OnChildClick( TaxonomyTreeControlEventArgs e ) + { + if( null!=this.ChildClick ) + this.ChildClick( this, e ); + } + + /// ******************************************************************************************************* + /// + /// Fires the ChildClick event + /// + /// EventArguments to pass in the Event + /// ******************************************************************************************************* + protected void OnClick( TaxonomyTreeControlEventArgs e ) + { + if( null!=this.Click ) + this.Click( this, e ); + } + } + /// *********************************************************************************************************** + /// + /// EventArguments Class + /// + /// *********************************************************************************************************** + public class TaxonomyTreeControlEventArgs : EventArgs + { + private TaxonomyTreeItemControl item; + /// ******************************************************************************************************* + /// + /// Gets the TaxonomyTreeItemControl that triggered the event + /// + /// ******************************************************************************************************* + public TaxonomyTreeItemControl Item + { + get{ return item; } + } + + public TaxonomyTreeControlEventArgs( TaxonomyTreeItemControl item ) + { + this.item = item; + } + } +} diff --git a/inetsrv/uddi/source/web/tmodelbag.cs b/inetsrv/uddi/source/web/tmodelbag.cs new file mode 100644 index 0000000..f441c9a --- /dev/null +++ b/inetsrv/uddi/source/web/tmodelbag.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Specialized; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.API; +using UDDI.API.Business; +using UDDI.API.ServiceType; +using UDDI; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class TModelBagControl : UddiControl + { + protected CacheObject cache = null; + protected StringCollection tModelBag = null; + + protected DataGrid grid; + + public void Initialize( StringCollection tModelBag, CacheObject cache ) + { + this.cache = cache; + this.tModelBag = tModelBag; + } + + protected void Page_Load( object sender, EventArgs e ) + { + if( !Page.IsPostBack ) + PopulateDataGrid( false ); + } + + void PopulateDataGrid( bool createNewRow ) + { + DataTable table = new DataTable(); + DataRow row; + + int index = 0; + + table.Columns.Add( new DataColumn( "Index", typeof( int ) ) ); + table.Columns.Add( new DataColumn( "TModelName", typeof( string ) ) ); + table.Columns.Add( new DataColumn( "TModelKey", typeof( string ) ) ); + + foreach( string tModelKey in tModelBag ) + { + row = table.NewRow(); + + row[0] = index; + row[1] = Lookup.TModelName( tModelKey ); + row[2] = tModelKey; + + table.Rows.Add( row ); + + index ++; + } + + if( createNewRow ) + { + row = table.NewRow(); + + row[0] = index; + row[1] = ""; + row[2] = ""; + + table.Rows.Add( row ); + + index ++; + } + + grid.DataSource = new DataView( table ); + grid.DataBind(); + } + + protected void Grid_OnDelete( object sender, DataGridCommandEventArgs e ) + { + int index = e.Item.ItemIndex; + + tModelBag.RemoveAt( index ); + + if( null != cache ) + cache.Save(); + + PopulateDataGrid( false ); + } + + protected void Grid_OnCancel( object sender, DataGridCommandEventArgs e ) + { + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid( false ); + } + + protected void Grid_OnAdd( object sender, EventArgs e ) + { + grid.EditItemIndex = tModelBag.Count; + SetEditMode(); + + PopulateDataGrid( true ); + } + + protected void Selector_OnSelect( object sender, string key, string name ) + { + tModelBag.Add( key ); + + if( null != cache ) + cache.Save(); + + grid.EditItemIndex = -1; + CancelEditMode(); + + PopulateDataGrid( false ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/tmodels.cs b/inetsrv/uddi/source/web/tmodels.cs new file mode 100644 index 0000000..485cf03 --- /dev/null +++ b/inetsrv/uddi/source/web/tmodels.cs @@ -0,0 +1,83 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI; +using UDDI.API; +using UDDI.API.ServiceType; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class TModelControl : UddiControl + { + protected TModelInfoCollection tModelInfos; + protected bool frames; + + protected DataGrid grid; + + public void Initialize( TModelInfoCollection tModelInfos, bool allowEdit ) + { + this.tModelInfos = tModelInfos; + + grid.Columns[ 0 ].Visible = allowEdit; + grid.Columns[ 1 ].Visible = allowEdit; + grid.Columns[ 2 ].Visible = !allowEdit; + } + + protected void Page_Load( object sender, EventArgs e ) + { + frames = ( "true" == Request[ "frames" ] ); + PopulateDataGrid(); + } + + void PopulateDataGrid() + { + grid.DataSource = tModelInfos; + grid.DataBind(); + } + + protected void TModel_Edit( object sender, DataGridCommandEventArgs e ) + { + string key = tModelInfos[ e.Item.ItemIndex ].TModelKey; + + if( frames ) + { + // + // Reload explorer and view panes. + // + Response.Write( + ClientScripts.ReloadExplorerAndViewPanes( "editmodel.aspx?frames=true&key=" + key, key ) ); + } + else + { + Response.Redirect( "editmodel.aspx?frames=false&key=" + key ); + } + } + + protected void TModel_Delete( object sender, DataGridCommandEventArgs e ) + { + string name = tModelInfos[ e.Item.ItemIndex ].Name; + string key = tModelInfos[ e.Item.ItemIndex ].TModelKey; + + // + // The user has not yet confirmed the delete operation, so display + // a confirmation dialog. + // + string message = String.Format( + Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), + name ); + + Page.RegisterStartupScript( + "Confirm", + ClientScripts.Confirm( + message, + "editmodel.aspx?frames=" + ( frames ? "true" : "false" ) + "&key=" + key + "&mode=delete&confirm=true&tab=2" ) ); + } + + protected void TModel_Add( object sender, EventArgs e ) + { + Response.Redirect( "editmodel.aspx?frames=" + ( frames ? "true" : "false" ) + "&mode=add" ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/tree.cs b/inetsrv/uddi/source/web/tree.cs new file mode 100644 index 0000000..19a1839 --- /dev/null +++ b/inetsrv/uddi/source/web/tree.cs @@ -0,0 +1,530 @@ +using System; +using System.Collections; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using UDDI.Diagnostics; + +namespace UDDI.Web +{ + public class TreeView : UserControl + { + protected string binhex = @"!""#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr"; + protected string clientScript = @" + "; + + protected string root; + protected TreeNodeCollection nodes; + protected TreeNode selectedNode = null; + protected int count; + protected string selectedID = null; + + protected override void OnInit( EventArgs e ) + { + root = ( "/" == Request.ApplicationPath ) ? "" : Request.ApplicationPath; + nodes = new TreeNodeCollection( this ); + + if( !Page.IsClientScriptBlockRegistered( "UDDI.Web.TreeView" ) ) + { + clientScript = clientScript.Replace( "{root}", root ); + clientScript = clientScript.Replace( "{id}", this.UniqueID ); + clientScript = clientScript.Replace( "{binhex}", binhex.Replace( "\"", "\\\"" ) ); + + Page.RegisterClientScriptBlock( + "UDDI.Web.TreeView", + clientScript ); + } + } + + public TreeNodeCollection Nodes + { + get { return nodes; } + } + + public TreeNode SelectedNode + { + get { return selectedNode; } + set { selectedNode = value; } + } + + protected void LoadTreeStateForNode( TreeNode node, string viewState ) + { + int index = count / 6; + int bit = 1 << ( count % 6 ); + + bool expanded = false; + + if( index < viewState.Length ) + expanded = ( binhex.IndexOf( viewState[ index ] ) & bit ) > 0; + + if( expanded ) + node.Expand(); + + count ++; + + foreach( TreeNode child in node.Nodes ) + LoadTreeStateForNode( child, viewState ); + } + + protected void SaveTreeStateForNode( TreeNode node, ref string viewState ) + { + if( node.IsExpanded ) + { + int index = count / 6; + int bit = 1 << ( count % 6 ); + + while( index >= viewState.Length ) + viewState += binhex[ 0 ]; + + viewState = + viewState.Substring( 0, index ) + + binhex[ binhex.IndexOf( viewState[ index ] ) | bit ] + + viewState.Substring( index + 1 ); + } + + count ++; + + foreach( TreeNode child in node.Nodes ) + SaveTreeStateForNode( child, ref viewState ); + } + + protected override void Render( HtmlTextWriter output ) + { + string treeState = Request[ this.UniqueID + ":state" ]; + + if( null != treeState ) + { + count = 0; + foreach( TreeNode child in nodes ) + LoadTreeStateForNode( child, treeState ); + } + + if( null != selectedNode ) + selectedNode.EnsureVisible(); + + treeState = ""; + + count = 0; + foreach( TreeNode child in nodes ) + SaveTreeStateForNode( child, ref treeState ); + + count = 0; + foreach( TreeNode node in Nodes ) + RenderNode( output, node ); + + output.WriteLine( "" ); + + output.WriteLine( "" ); + } + + protected void RenderNode( HtmlTextWriter output, TreeNode node ) + { + string root = ( "/" == Request.ApplicationPath ) ? "" : Request.ApplicationPath; + string text = HttpUtility.HtmlEncode( node.Text ); + string image; + + string id = this.UniqueID + ":" + count; + + string oncontextmenu = null; + string onclick = null; + + if( null != node.OnContextMenu ) + oncontextmenu = " oncontextmenu='" + node.OnContextMenu.Replace( "'", "\"" ).Replace( "[[node]]", "document.getElementById( \"" + id + "\" )" ) + "'"; + + if( null != node.OnClick ) + onclick = " onclick='" + node.OnClick.Replace( "'", "\"" ).Replace( "[[node]]", "document.getElementById( \"" + id + "\" )" ) + "'"; + + if( node.IsSelected ) + output.Write( "" ); + + output.Write( "" ); + + // + // Generate ancestor lines. + // + string lines = ""; + + TreeNode ancestor = node.Parent; + while( null != ancestor ) + { + image = "line-ns.gif"; + + if( null == ancestor.Parent || ancestor.Index >= ancestor.Parent.Nodes.Count - 1 ) + image = "blank.gif"; + + lines = "" + lines; + + ancestor = ancestor.Parent; + } + + output.Write( lines ); + + // + // Generate expand/collapse image. + // + bool north = false; + bool south = false; + + if( null == node.Parent ) + { + if( node.Index > 0 ) + north = true; + + if( node.Index < node.TreeView.Nodes.Count - 1 ) + south = true; + } + else + { + north = true; + + if( node.Index < node.Parent.Nodes.Count - 1 ) + south = true; + } + + // + // Determine which expander image we should use. + // + string dir = ( north ? "n" : "" ) + "e" + ( south ? "s" : "" ); + + if( node.Nodes.Count > 0 ) + { + if( node.IsExpanded ) + image = "minus-"; + else + image = "plus-"; + + output.Write( "" ); + } + else + output.Write( "" ); + + // + // Display the node image (or a blank image if none was specified). + // + if( null != node.ImageUrl ) + { + output.Write( "" ); + + } + else + output.Write( "" ); + + // + // Display the node text. + // + output.Write( "" ); + output.Write( "" ); + output.Write( text + "
\n" ); + + count ++; + + // + // Render this node's children. + // + foreach( TreeNode child in node.Nodes ) + RenderNode( output, child ); + + output.WriteLine( "
" ); + } + + } + + /// ******************************************************************** + /// public class TreeNode + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class TreeNode + { + internal protected TreeNode parent; + internal protected TreeView treeView; + internal protected TreeNodeCollection nodes; + + protected bool expanded = false; + + public string Text; + public string Key; + public string ImageUrl; + public string OpenImageUrl; + public string OnClick; + public string OnContextMenu; + public string Tooltip; + + public TreeNode() + : this( null, null, null, null ) + { + } + + public TreeNode( string text ) + : this( text, null, null, null ) + { + } + + public TreeNode( string text, string key ) + : this( text, key, null, null ) + { + } + + public TreeNode( string text, string key, string imageUrl ) + : this( text, key, null, null ) + { + } + + public TreeNode( string text, string key, string imageUrl, string openImageUrl ) + { + this.Text = text; + this.Key = key; + this.ImageUrl = imageUrl; + this.OpenImageUrl = openImageUrl; + + this.nodes = new TreeNodeCollection( this ); + } + + public string FullPath + { + get + { + string path = this.Text; + + TreeNode node = this; + while( null != node.Parent ) + { + node = node.Parent; + path = path + "\\" + node.Text; + } + + return path; + } + } + + public int Index + { + get + { + if( null == parent ) + return treeView.Nodes.IndexOf( this ); + + return parent.Nodes.IndexOf( this ); + } + } + + public bool IsExpanded + { + get { return expanded; } + } + + public bool IsSelected + { + get + { + if( null == treeView ) + return false; + + return treeView.SelectedNode == this; + } + } + + public TreeNodeCollection Nodes + { + get { return nodes; } + } + + public TreeNode Parent + { + get { return parent; } + } + + public UDDI.Web.TreeView TreeView + { + get { return treeView; } + } + + public void Collapse() + { + expanded = false; + } + + public void EnsureVisible() + { + TreeNode node = this; + + while( null != node.Parent ) + { + node = node.Parent; + node.Expand(); + } + } + + public void Expand() + { + expanded = true; + } + + public void Remove() + { + if( null != parent ) + parent.Nodes.RemoveAt( Index ); + } + + public void Select() + { + treeView.SelectedNode = this; + } + + public void Toggle() + { + expanded = !expanded; + } + } + + /// ******************************************************************** + /// public class TreeNodeCollection + /// -------------------------------------------------------------------- + /// + /// + /// ******************************************************************** + /// + public class TreeNodeCollection : CollectionBase + { + protected TreeNode parent; + protected TreeView treeView; + + internal protected TreeNodeCollection( TreeNode parent ) + { + this.parent = parent; + this.treeView = parent.TreeView; + } + + internal protected TreeNodeCollection( TreeView treeView ) + { + this.parent = null; + this.treeView = treeView; + } + + public TreeNode this[ int index ] + { + get { return (TreeNode)List[ index ]; } + set { List[ index ] = value; } + } + + public TreeNode Add( string text ) + { + return Add( text, null, null, null ); + } + + public TreeNode Add( string text, string key ) + { + return Add( text, key, null, null ); + } + + public TreeNode Add( string text, string key, string imageUrl ) + { + return Add( text, key, imageUrl, null ); + } + + public TreeNode Add( string text, string key, string imageUrl, string openImageUrl ) + { + TreeNode node = new TreeNode( text, key, imageUrl, openImageUrl ); + + node.parent = this.parent; + node.treeView = this.treeView; + node.Nodes.treeView = this.treeView; + + List.Add( node ); + + return node; + } + + public int Add( TreeNode node ) + { + node.parent = this.parent; + node.treeView = this.treeView; + node.Nodes.treeView = this.treeView; + + return List.Add( node ); + } + + public int IndexOf( TreeNode node ) + { + return List.IndexOf( node ); + } + + public void Remove( TreeNode node ) + { + List.Remove( node ); + } + } +} \ No newline at end of file diff --git a/inetsrv/uddi/source/web/validators.cs b/inetsrv/uddi/source/web/validators.cs new file mode 100644 index 0000000..44b1822 --- /dev/null +++ b/inetsrv/uddi/source/web/validators.cs @@ -0,0 +1,102 @@ +using System; +using System.Text.RegularExpressions; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +namespace UDDI.Web +{ + /// + /// Summary description for validators. + /// + public class EmailValidator : BaseValidator + { + public const string Expression = "(?[^@]+)@{1}(?.+)"; + + + + private const string csName = "ValidateEmail"; + private Regex regexp; + private Control control; + + + private bool resolvehost; + public bool ResolveHost + { + get{ return resolvehost; } + set{ resolvehost=value; } + } + + + /// + /// + /// + public EmailValidator() + { + // + // TODO: Add constructor logic here + // + regexp = new Regex( Expression ); + + } + + /// + /// + /// + /// + protected override void OnInit( EventArgs e ) + { + + base.OnInit( e ); + } + + /// + /// + /// + /// EventArguments + protected override void OnLoad( EventArgs e ) + { + control = FindControl( this.ControlToValidate ); + if( null==control ) + { + throw new Exception( "The Control Specified can not be found: '" + this.ControlToValidate + "'" ); + } + + base.OnLoad( e ); + } + + /// + /// + /// + /// Boolean indicating that the email address is valid + protected override bool EvaluateIsValid() + { + Match m = regexp.Match( ((TextBox)control).Text ); + try + { + if( m.Success ) + { + if( ResolveHost ) + { + + System.Net.IPHostEntry host = System.Net.Dns.Resolve( m.Groups[ "host" ].Value ); + + if( null!=host ) + return true; + } + else + { + return true; + } + } + } + catch{}//swallow and return false. + + return false; + } + + + + + + } +} diff --git a/inetsrv/uddi/source/web/web.csproj b/inetsrv/uddi/source/web/web.csproj new file mode 100644 index 0000000..fb9da32 --- /dev/null +++ b/inetsrv/uddi/source/web/web.csproj @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/web/web.snk b/inetsrv/uddi/source/web/web.snk new file mode 100644 index 0000000..d404b74 Binary files /dev/null and b/inetsrv/uddi/source/web/web.snk differ diff --git a/inetsrv/uddi/source/xp/makefile b/inetsrv/uddi/source/xp/makefile new file mode 100644 index 0000000..c91f9f5 --- /dev/null +++ b/inetsrv/uddi/source/xp/makefile @@ -0,0 +1,16 @@ +!IF 0 + +Copyright (C) Microsoft Corporation, 1996 - 1999 + +Module Name: + + makefile. + +!ENDIF + +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/inetsrv/uddi/source/xp/obj/_objects.mac b/inetsrv/uddi/source/xp/obj/_objects.mac new file mode 100644 index 0000000..9cef8d8 --- /dev/null +++ b/inetsrv/uddi/source/xp/obj/_objects.mac @@ -0,0 +1,28 @@ +386_OBJECTS= \ + $(_OBJ_DIR)\i386\uddi.xp.obj \ + $(_OBJ_DIR)\i386\xp_recalculate_statistics.obj \ + $(_OBJ_DIR)\i386\xp_reset_key.obj + +PASS0_386_OBJECTS= + +IA64_OBJECTS= \ + $(_OBJ_DIR)\ia64\uddi.xp.obj \ + $(_OBJ_DIR)\ia64\xp_recalculate_statistics.obj \ + $(_OBJ_DIR)\ia64\xp_reset_key.obj + +PASS0_IA64_OBJECTS= + +AMD64_OBJECTS= \ + $(_OBJ_DIR)\amd64\uddi.xp.obj \ + $(_OBJ_DIR)\amd64\xp_recalculate_statistics.obj \ + $(_OBJ_DIR)\amd64\xp_reset_key.obj + +PASS0_AMD64_OBJECTS= + +ARM_OBJECTS= \ + $(_OBJ_DIR)\arm\uddi.xp.obj \ + $(_OBJ_DIR)\arm\xp_recalculate_statistics.obj \ + $(_OBJ_DIR)\arm\xp_reset_key.obj + +PASS0_ARM_OBJECTS= + diff --git a/inetsrv/uddi/source/xp/obj/i386/uddi.xp.dll b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.dll new file mode 100644 index 0000000..4a6d06e Binary files /dev/null and b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.dll differ diff --git a/inetsrv/uddi/source/xp/obj/i386/uddi.xp.exp b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.exp new file mode 100644 index 0000000..3a81648 Binary files /dev/null and b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.exp differ diff --git a/inetsrv/uddi/source/xp/obj/i386/uddi.xp.lib b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.lib new file mode 100644 index 0000000..19fdcba Binary files /dev/null and b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.lib differ diff --git a/inetsrv/uddi/source/xp/obj/i386/uddi.xp.obj b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.obj new file mode 100644 index 0000000..4d652d5 Binary files /dev/null and b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.obj differ diff --git a/inetsrv/uddi/source/xp/obj/i386/uddi.xp.pdb b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.pdb new file mode 100644 index 0000000..9f0a4c7 Binary files /dev/null and b/inetsrv/uddi/source/xp/obj/i386/uddi.xp.pdb differ diff --git a/inetsrv/uddi/source/xp/obj/i386/xp_recalculate_statistics.obj b/inetsrv/uddi/source/xp/obj/i386/xp_recalculate_statistics.obj new file mode 100644 index 0000000..3df4e9f Binary files /dev/null and b/inetsrv/uddi/source/xp/obj/i386/xp_recalculate_statistics.obj differ diff --git a/inetsrv/uddi/source/xp/obj/i386/xp_reset_key.obj b/inetsrv/uddi/source/xp/obj/i386/xp_reset_key.obj new file mode 100644 index 0000000..93dd362 Binary files /dev/null and b/inetsrv/uddi/source/xp/obj/i386/xp_reset_key.obj differ diff --git a/inetsrv/uddi/source/xp/opends60.lib b/inetsrv/uddi/source/xp/opends60.lib new file mode 100644 index 0000000..19f2b5e Binary files /dev/null and b/inetsrv/uddi/source/xp/opends60.lib differ diff --git a/inetsrv/uddi/source/xp/placefil.txt b/inetsrv/uddi/source/xp/placefil.txt new file mode 100644 index 0000000..0d9d500 --- /dev/null +++ b/inetsrv/uddi/source/xp/placefil.txt @@ -0,0 +1 @@ +uddi.xp.dll uddi\bin \ No newline at end of file diff --git a/inetsrv/uddi/source/xp/sources b/inetsrv/uddi/source/xp/sources new file mode 100644 index 0000000..f841734 --- /dev/null +++ b/inetsrv/uddi/source/xp/sources @@ -0,0 +1,27 @@ +TARGETNAME=uddi.xp +TARGETPATH=obj +TARGETTYPE=DYNLINK +DLLDEF=uddi.xp.def +DLLENTRY=_DllMainCRTStartup +386_STDCALL=0 +USE_MFCUNICODE=1 +USE_STL=1 +USE_MSVCRT=1 + + +TARGETLIBS=\ + opends60.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\comsvcs.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\version.lib \ + $(SDK_LIB_PATH)\winspool.lib \ + $(SDK_LIB_PATH)\rpcrt4.lib + +SOURCES=\ +uddi.xp.cpp \ +xp_recalculate_statistics.cpp \ +xp_reset_key.cpp + +BINPLACE_PLACEFILE=placefil.txt diff --git a/inetsrv/uddi/source/xp/srv.h b/inetsrv/uddi/source/xp/srv.h new file mode 100644 index 0000000..3f12a34 --- /dev/null +++ b/inetsrv/uddi/source/xp/srv.h @@ -0,0 +1,531 @@ +//------------------------------------------------------------ +// Open Data Services header file: srv.h +// Copyright (c) 1989 - 1999 by Microsoft Corp. +// + +// Avoid double inclusion +#ifndef _ODS_SRV_H_ +#define _ODS_SRV_H_ + +#include "windows.h" + +// ODS uses pack(4) on all CPU types +#pragma pack(4) + +#ifdef __cplusplus +extern "C" { +#endif + +// define model +#if !defined( FAR ) +#define FAR far +#endif + +//------------------------------------------------------------ +// Formats of data types +#if !defined(DBTYPEDEFS) // Do not conflict with DBLIB definitions +#if !defined(MAXNUMERICLEN) // Do not conflict with ODBC definitions + +#define DBTYPEDEFS + +typedef unsigned char DBBOOL; +typedef unsigned char DBBYTE; +typedef unsigned char DBTINYINT; +typedef short DBSMALLINT; +typedef unsigned short DBUSMALLINT; +typedef long DBINT; +typedef char DBCHAR; +typedef unsigned char DBBINARY; +typedef unsigned char DBBIT; +typedef double DBFLT8; + +typedef struct srv_datetime +{ // Format for SRVDATETIME + long dtdays; // number of days since 1/1/1900 + unsigned long dttime; // number 300th second since mid +} DBDATETIME; + +typedef struct srv_money +{ // Format for SRVMONEY + long mnyhigh; + unsigned long mnylow; +} DBMONEY; + +typedef float DBFLT4; +typedef long DBMONEY4; + +typedef struct dbdatetime4 +{ // Format for SRVDATETIM4 + unsigned short numdays; // number of days since 1/1/1900 + unsigned short nummins; // number of minutes sicne midnight +} DBDATETIM4; + +#define MAXNUMERICLEN 16 +typedef struct dbnumeric +{ // Format for SRVNUMERIC,SRVNUMERICN,SRVDECIMAL,SRVDECIMALN + BYTE precision; + BYTE scale; + BYTE sign; + BYTE val[MAXNUMERICLEN]; +} DBNUMERIC; +typedef DBNUMERIC DBDECIMAL; + +#endif // #if !defined(MAXNUMERICLEN) +#endif // #if !defined( DBTYPEDEFS ) + +//------------------------------------------------------------ +// Constants used by APIs + +// Type Tokens +#define SRV_TDS_NULL (BYTE) 0x1f +#define SRV_TDS_TEXT (BYTE) 0x23 +#define SRV_TDS_GUID (BYTE) 0x24 +#define SRV_TDS_VARBINARY (BYTE) 0x25 +#define SRV_TDS_INTN (BYTE) 0x26 +#define SRV_TDS_VARCHAR (BYTE) 0x27 +#define SRV_TDS_BINARY (BYTE) 0x2d +#define SRV_TDS_IMAGE (BYTE) 0x22 +#define SRV_TDS_CHAR (BYTE) 0x2f +#define SRV_TDS_INT1 (BYTE) 0x30 +#define SRV_TDS_BIT (BYTE) 0x32 +#define SRV_TDS_INT2 (BYTE) 0x34 +#define SRV_TDS_DECIMAL (BYTE) 0x37 +#define SRV_TDS_INT4 (BYTE) 0x38 +#define SRV_TDS_DATETIM4 (BYTE) 0x3a +#define SRV_TDS_FLT4 (BYTE) 0x3b +#define SRV_TDS_MONEY (BYTE) 0x3c +#define SRV_TDS_DATETIME (BYTE) 0x3d +#define SRV_TDS_FLT8 (BYTE) 0x3e +#define SRV_TDS_NUMERIC (BYTE) 0x3f +#define SRV_TDS_NTEXT (BYTE) 0x63 +#define SRV_TDS_BITN (BYTE) 0x68 +#define SRV_TDS_DECIMALN (BYTE) 0x6a +#define SRV_TDS_NUMERICN (BYTE) 0x6c +#define SRV_TDS_FLTN (BYTE) 0x6d +#define SRV_TDS_MONEYN (BYTE) 0x6e +#define SRV_TDS_DATETIMN (BYTE) 0x6f +#define SRV_TDS_MONEY4 (BYTE) 0x7a +#define SRV_TDS_BIGVARBINARY (BYTE) 0xA5 +#define SRV_TDS_BIGVARCHAR (BYTE) 0xA7 +#define SRV_TDS_BIGBINARY (BYTE) 0xAD +#define SRV_TDS_BIGCHAR (BYTE) 0xAF +#define SRV_TDS_NVARCHAR (BYTE) 0xe7 +#define SRV_TDS_NCHAR (BYTE) 0xef + +// Datatypes +// Also: values of symbol parameter to srv_symbol when type = SRV_DATATYPE +#define SRVNULL SRV_TDS_NULL +#define SRVTEXT SRV_TDS_TEXT +#define SRVGUID SRV_TDS_GUID +#define SRVVARBINARY SRV_TDS_VARBINARY +#define SRVINTN SRV_TDS_INTN +#define SRVVARCHAR SRV_TDS_VARCHAR +#define SRVBINARY SRV_TDS_BINARY +#define SRVIMAGE SRV_TDS_IMAGE +#define SRVCHAR SRV_TDS_CHAR +#define SRVINT1 SRV_TDS_INT1 +#define SRVBIT SRV_TDS_BIT +#define SRVINT2 SRV_TDS_INT2 +#define SRVDECIMAL SRV_TDS_DECIMAL +#define SRVINT4 SRV_TDS_INT4 +#define SRVDATETIM4 SRV_TDS_DATETIM4 +#define SRVFLT4 SRV_TDS_FLT4 +#define SRVMONEY SRV_TDS_MONEY +#define SRVDATETIME SRV_TDS_DATETIME +#define SRVFLT8 SRV_TDS_FLT8 +#define SRVNUMERIC SRV_TDS_NUMERIC +#define SRVNTEXT SRV_TDS_NTEXT +#define SRVBITN SRV_TDS_BITN +#define SRVDECIMALN SRV_TDS_DECIMALN +#define SRVNUMERICN SRV_TDS_NUMERICN +#define SRVFLTN SRV_TDS_FLTN +#define SRVMONEYN SRV_TDS_MONEYN +#define SRVDATETIMN SRV_TDS_DATETIMN +#define SRVMONEY4 SRV_TDS_MONEY4 +#define SRVBIGVARBINARY SRV_TDS_BIGVARBINARY +#define SRVBIGVARCHAR SRV_TDS_BIGVARCHAR +#define SRVBIGBINARY SRV_TDS_BIGBINARY +#define SRVBIGCHAR SRV_TDS_BIGCHAR +#define SRVNVARCHAR SRV_TDS_NVARCHAR +#define SRVNCHAR SRV_TDS_NCHAR + +// values for srv_symbol type parameter +#define SRV_ERROR 0 +#define SRV_DONE 1 +#define SRV_DATATYPE 2 +#define SRV_EVENT 4 + +// values for srv_symbol symbol parameter, when type = SRV_ERROR +#define SRV_ENO_OS_ERR 0 +#define SRV_INFO 1 +#define SRV_FATAL_PROCESS 10 +#define SRV_FATAL_SERVER 19 + +// Types of server events +// Also: values for srv_symbol symbol parameter, when type = SRV_EVENT +#define SRV_CONTINUE 0 +#define SRV_LANGUAGE 1 +#define SRV_CONNECT 2 +#define SRV_RPC 3 +#define SRV_RESTART 4 +#define SRV_DISCONNECT 5 +#define SRV_ATTENTION 6 +#define SRV_SLEEP 7 +#define SRV_START 8 +#define SRV_STOP 9 +#define SRV_EXIT 10 +#define SRV_CANCEL 11 +#define SRV_SETUP 12 +#define SRV_CLOSE 13 +#define SRV_PRACK 14 +#define SRV_PRERROR 15 +#define SRV_ATTENTION_ACK 16 +#define SRV_CONNECT_V7 16 // TDS type for TDS 7 clients. Overloaded with SRV_ATTENTION_ACK +#define SRV_SKIP 17 +#define SRV_TRANSMGR 18 +#define SRV_OLEDB 20 +#define SRV_INTERNAL_HANDLER 99 +#define SRV_PROGRAMMER_DEFINED 100 + +// values for srv_config option parameter +#define SRV_CONNECTIONS 1 +#define SRV_LOGFILE 2 +#define SRV_STACKSIZE 3 +#define SRV_REMOTE_ACCESS 7 +#define SRV_REMOTE_CONNECTIONS 9 +#define SRV_MAX_PACKETS 10 +#define SRV_MAXWORKINGTHREADS 11 +#define SRV_MINWORKINGTHREADS 12 +#define SRV_THREADTIMEOUT 13 +#define SRV_MAX_PACKETSIZE 17 +#define SRV_THREADPRIORITY 18 +#define SRV_ANSI_CODEPAGE 19 +#define SRV_DEFAULT_PACKETSIZE 26 +#define SRV_PASSTHROUGH 27 + +// vlaues for srv_config value parameter when option = SRV_THREADPRIORITY +#define SRV_PRIORITY_LOW THREAD_PRIORITY_LOWEST +#define SRV_PRIORITY_NORMAL THREAD_PRIORITY_NORMAL +#define SRV_PRIORITY_HIGH THREAD_PRIORITY_HIGHEST +#define SRV_PRIORITY_CRITICAL THREAD_PRIORITY_TIME_CRITICAL + +// values for srv_sfield field parameter +#define SRV_SERVERNAME 0 +#define SRV_VERSION 6 + +// Length to indicate string is null terminated +#define SRV_NULLTERM -1 + +// values of msgtype parameter to srv_sendmsg +#define SRV_MSG_INFO 1 +#define SRV_MSG_ERROR 2 + +// values of status parameter to srv_senddone +// Also: values for symbol parameters to srv_symbol when type = SRV_DONE +#define SRV_DONE_FINAL (USHORT) 0x0000 +#define SRV_DONE_MORE (USHORT) 0x0001 +#define SRV_DONE_ERROR (USHORT) 0x0002 +#define SRV_DONE_COUNT (USHORT) 0x0010 +#define SRV_DONE_RPC_IN_BATCH (USHORT) 0x0080 + +// return values of srv_paramstatus +#define SRV_PARAMRETURN 0x0001 +#define SRV_PARAMDEFAULT 0x0002 + +// return values of srv_rpcoptions +#define SRV_RECOMPILE 0x0001 +#define SRV_NOMETADATA 0x0002 + +// values of field parameter to srv_pfield +//#define SRV_LANGUAGE 1 already defined above +//#define SRV_EVENT 4 already defined above +#define SRV_SPID 10 +#define SRV_NETSPID 11 +#define SRV_TYPE 12 +#define SRV_STATUS 13 +#define SRV_RMTSERVER 14 +#define SRV_HOST 15 +#define SRV_USER 16 +#define SRV_PWD 17 +#define SRV_CPID 18 +#define SRV_APPLNAME 19 +#define SRV_TDS 20 +#define SRV_CLIB 21 +#define SRV_LIBVERS 22 +#define SRV_ROWSENT 23 +#define SRV_BCPFLAG 24 +#define SRV_NATLANG 25 +#define SRV_PIPEHANDLE 26 +#define SRV_NETWORK_MODULE 27 +#define SRV_NETWORK_VERSION 28 +#define SRV_NETWORK_CONNECTION 29 +#define SRV_LSECURE 30 +#define SRV_SAXP 31 +#define SRV_UNICODE_USER 33 +#define SRV_UNICODE_PWD 35 +#define SRV_SPROC_CODEPAGE 36 + +// return value of SRV_TDSVERSION macro +#define SRV_TDS_NONE 0 +#define SRV_TDS_2_0 1 +#define SRV_TDS_3_4 2 +#define SRV_TDS_4_2 3 +#define SRV_TDS_6_0 4 +#define SRV_TDS_7_0 5 + +// Return values from APIs +typedef int SRVRETCODE; // SUCCEED or FAIL +#ifndef ODBCVER +typedef int RETCODE; +#endif + +#if !defined( SUCCEED ) +#define SUCCEED 1 // Successful return value +#endif + +#if !defined( FAIL ) +#define FAIL 0 // Unsuccessful return value +#endif + +#define SRV_DUPLICATE_HANDLER 2 // additional return value for srv_pre/post_handle + +//------------------------------------------------ +//PreDeclare structures +// +struct srv_server; +typedef struct srv_server SRV_SERVER; + +struct srv_config; +typedef struct srv_config SRV_CONFIG; + +struct srv_proc; +typedef struct srv_proc SRV_PROC; + +//------------------------------------------------ +//------------------------------------------------ +// ODS MACROs & APIs + +// Describing and sending a result set +int srv_describe(SRV_PROC*,int,char*,int,long int,long int,long int,long int,void*); +int srv_setutype(SRV_PROC* srvproc,int column,long int usertype); +int srv_setcoldata(SRV_PROC* srvproc,int column,void* data); +int srv_setcollen( SRV_PROC* srvproc,int column,int len); +int srv_sendrow(SRV_PROC* srvproc ); +int srv_senddone(SRV_PROC* srvproc,USHORT status,USHORT curcmd,long int count); + +// Dealing with Extended Procedure parameters +int srv_rpcparams(SRV_PROC*); +int srv_paraminfo(SRV_PROC*,int,BYTE*,ULONG*,ULONG*,BYTE*,BOOL*); +int srv_paramsetoutput(SRV_PROC*,int,BYTE*,ULONG,BOOL); + +void* srv_paramdata(SRV_PROC*,int); +int srv_paramlen(SRV_PROC*,int); +int srv_parammaxlen(SRV_PROC*,int); +int srv_paramtype(SRV_PROC*,int); +int srv_paramset(SRV_PROC*,int,void*,int); + +char* srv_paramname(SRV_PROC*,int,int*); +int srv_paramnumber(SRV_PROC*,char*,int); + +//-------------------------------------------------------------- +//-------------------------------------------------------------- +// The rest of these APIs are still supported, in SQL Server 7.0, +// but may not be supported after SQL Server 7.0 + +// MACROs +#define SRV_GETCONFIG(a) srv_getconfig ( a ) +#define SRV_GETSERVER(a) srv_getserver ( a ) +#define SRV_GOT_ATTENTION(a) srv_got_attention ( a ) +#define SRV_EVENTDATA(a) srv_eventdata ( a ) +#define SRV_IODEAD(a) srv_iodead ( a ) +#define SRV_TDSVERSION(a) srv_tdsversion ( a ) + +SRV_CONFIG* srv_getconfig( SRV_SERVER * server ); +SRV_SERVER* srv_getserver( SRV_PROC * srvproc ); +BOOL srv_got_attention( SRV_PROC * srvproc ); +void* srv_eventdata( SRV_PROC * srvproc ); + +// Memory +void* srv_alloc(long int ulSize); +int srv_bmove(void* from,void* to,long int count); +int srv_bzero( void * location,long int count); +int srv_free( void * ptr ); + +int srv_config( SRV_CONFIG * config,long int option,char* value,int valuelen); +SRV_CONFIG * srv_config_alloc( void ); + + +int srv_convert(SRV_PROC*,int,void*,long int,int,void*,long int); + +int (* srv_errhandle(int (* handler)(SRV_SERVER * server, + SRV_PROC * srvproc, + int srverror, + BYTE severity, + BYTE state, + int oserrnum, + char * errtext, + int errtextlen, + char * oserrtext, + int oserrtextlen))) + ( SRV_SERVER * server, + SRV_PROC * srvproc, + int srverror, + BYTE severity, + BYTE state, + int oserrnum, + char * errtext, + int errtextlen, + char * oserrtext, + int oserrtextlen ); + +int srv_event(SRV_PROC * srvproc,int event,BYTE* data); + +void* srv_getuserdata( SRV_PROC * srvproc ); + +int srv_getbindtoken(SRV_PROC * srvproc,char* token_buf); + +int srv_getdtcxact(SRV_PROC * srvproc,void ** ppv); + +typedef int (* EventHandler)(void*); +EventHandler srv_handle(SRV_SERVER*,long int,EventHandler); + +int srv_impersonate_client( SRV_PROC * srvproc ); + +SRV_SERVER* srv_init( SRV_CONFIG * config, + char * connectname, + int namelen ); + +BOOL srv_iodead( SRV_PROC * srvproc ); + +long srv_langcpy(SRV_PROC * srvproc,long start,long nbytes,char* buffer); +long srv_langlen( SRV_PROC * srvproc ); +void* srv_langptr( SRV_PROC *srvproc ); + +int + srv_log( SRV_SERVER * server, + BOOL datestamp, + char * msg, + int msglen ); + +int srv_paramstatus(SRV_PROC*,int); + +char* srv_pfield( SRV_PROC * srvproc,int field,int * len ); + +int srv_returnval( SRV_PROC * srvproc, + char * valuename, + int len, + BYTE status, + long int type, + long int maxlen, + long int datalen, + void * value ); + +int srv_revert_to_self( SRV_PROC * srvproc ); + +char* srv_rpcdb(SRV_PROC* srvproc,int* len ); +char* srv_rpcname(SRV_PROC * srvproc,int* len ); +int srv_rpcnumber( SRV_PROC * srvproc ); +USHORT srv_rpcoptions( SRV_PROC * srvproc ); +char* srv_rpcowner( SRV_PROC * srvproc,int * len ); + +int srv_run( SRV_SERVER * server ); + +int + srv_sendmsg( SRV_PROC * srvproc, + int msgtype, + long int msgnum, + BYTE msgclass, + BYTE state, + char * rpcname, + int rpcnamelen, + USHORT linenum, + char * message, + int msglen ); + +int + srv_ansi_sendmsg( SRV_PROC * srvproc, + int msgtype, + long int msgnum, + BYTE msgclass, + BYTE state, + char * rpcname, + int rpcnamelen, + USHORT linenum, + char * message, + int msglen ); + +int srv_sendstatus( SRV_PROC * srvproc,long int status ); + + +int srv_setuserdata(SRV_PROC* srvproc,void* ptr); + + +char* srv_sfield( SRV_SERVER * server,int field,int* len); + +char* srv_symbol(int type,int symbol,int* len); + +int srv_tdsversion(SRV_PROC* srvproc); + +int srv_writebuf(SRV_PROC* srvproc, void* ptr, WORD count); + +BOOL srv_willconvert(int srctype,int desttype ); + +void srv_ackattention( SRV_PROC * srvproc ); + +int srv_terminatethread( SRV_PROC * srvproc ); + +int srv_sendstatistics( SRV_PROC * srvproc ); + +int srv_clearstatistics( SRV_PROC * srvproc ); + +int srv_setevent( SRV_SERVER * server, int event); + +int srv_message_handler( SRV_PROC * srvproc, + int errornum, + BYTE severity, + BYTE state, + int oserrnum, + char * errtext, + int errtextlen, + char * oserrtext, + int oserrtextlen ); + +int srv_pre_handle( SRV_SERVER * server, + SRV_PROC * srvproc, + long int event, + EventHandler handler, + BOOL remove ); +int srv_post_handle( SRV_SERVER * server, + SRV_PROC * srvproc, + long int event, + EventHandler handler, + BOOL remove ); + +int srv_post_completion_queue( SRV_PROC * srvproc, + char * inbuf, + int inbuflen ); + +int srv_IgnoreAnsiToOem( SRV_PROC * srvproc,BOOL bTF); + +#ifdef __cplusplus +} +#endif + +#pragma pack() + +#define SS_MAJOR_VERSION 7 +#define SS_MINOR_VERSION 00 +#define SS_LEVEL_VERSION 0000 +#define SS_MINIMUM_VERSION "7.00.00.0000" +#define ODS_VERSION ((SS_MAJOR_VERSION << 24) | (SS_MINOR_VERSION << 16)) + +#endif //_ODS_SRV_H_ + +////////////////////////////////////////////////////////////////// +// Suggested implementation of __GetXpVersion +// +//__declspec(dllexport) ULONG __GetXpVersion() +// { +// return ODS_VERSION; +// } +////////////////////////////////////////////////////////////////// diff --git a/inetsrv/uddi/source/xp/uddi.xp.cpp b/inetsrv/uddi/source/xp/uddi.xp.cpp new file mode 100644 index 0000000..1b2d7a0 --- /dev/null +++ b/inetsrv/uddi/source/xp/uddi.xp.cpp @@ -0,0 +1,90 @@ +#include "uddi.xp.h" + +BOOL APIENTRY DllMain( HANDLE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + return TRUE; +} + +void GetRegKeyStringValue( HKEY& hKey, const char* regKeyName, string& regKeyValue ) +{ + long nResult = ERROR_SUCCESS; + DWORD dwType = REG_SZ; + DWORD dwCount = 0; + + nResult = ::RegQueryValueExA( hKey, + regKeyName, + NULL, + &dwType, + NULL, + &dwCount ); + + if( dwCount && ( nResult == ERROR_SUCCESS ) && ( dwType == REG_SZ || dwType == REG_EXPAND_SZ ) ) + { + char* pszBuf = new char[ dwCount ]; + + if( NULL != pszBuf ) + { + __try + { + nResult = ::RegQueryValueExA( hKey, + regKeyName, + NULL, + &dwType, + ( LPBYTE )pszBuf, + &dwCount ); + regKeyValue = pszBuf; + } + __finally + { + delete [] pszBuf; + pszBuf = NULL; + } + } + } +} + +string g_strUddiInstallDirectory = ""; + +string& GetUddiInstallDirectory() +{ + HKEY hKey = NULL; + + if( 0 == g_strUddiInstallDirectory.length() ) + { + if( ::RegOpenKeyEx( HKEY_LOCAL_MACHINE, + L"Software\\Microsoft\\UDDI", + 0, + KEY_QUERY_VALUE, + &hKey ) == ERROR_SUCCESS ) + { + GetRegKeyStringValue( hKey, "InstallRoot", g_strUddiInstallDirectory ); + if( g_strUddiInstallDirectory.length() != 0 ) + { + g_strUddiInstallDirectory += "bin"; + } + + ::RegCloseKey( hKey ); + } + } + + return g_strUddiInstallDirectory; +} + +void ReportError( SRV_PROC *srvproc, LPCSTR sz, DWORD dwResult ) +{ + CHAR szErr[ MAXERROR ]; + + _snprintf( szErr, MAXERROR, "%s failed with error code %d while executing the xsp\n", sz, dwResult ); + szErr[ MAXERROR - 1 ] = 0x00; + + srv_sendmsg( srvproc, SRV_MSG_ERROR, 0, XP_SRVMSG_SEV_ERROR, (DBTINYINT)0, NULL, 0, 0, szErr, SRV_NULLTERM ); +} + +ULONG __GetXpVersion() +{ + return ODS_VERSION; +} + diff --git a/inetsrv/uddi/source/xp/uddi.xp.def b/inetsrv/uddi/source/xp/uddi.xp.def new file mode 100644 index 0000000..d8e5fe1 --- /dev/null +++ b/inetsrv/uddi/source/xp/uddi.xp.def @@ -0,0 +1,5 @@ +EXPORTS + xp_reset_key PRIVATE + xp_recalculate_statistics PRIVATE + __GetXpVersion PRIVATE + \ No newline at end of file diff --git a/inetsrv/uddi/source/xp/uddi.xp.h b/inetsrv/uddi/source/xp/uddi.xp.h new file mode 100644 index 0000000..813f070 --- /dev/null +++ b/inetsrv/uddi/source/xp/uddi.xp.h @@ -0,0 +1,29 @@ +#include +#include +#include + +// +// Include ODS headers +// +#include "srv.h" + +#include +using namespace std; + +#define XP_NOERROR 0 +#define XP_ERROR 1 +#define MAXCOLNAME 25 +#define MAXNAME 50 +#define MAXTEXT 255 +#define MAXERROR 80 +#define XP_SRVMSG_SEV_ERROR 11 + +extern "C" +{ + RETCODE xp_reset_key( SRV_PROC *srvproc ); + RETCODE xp_reclaculate_statistics( SRV_PROC *srvproc ); +} + +void ReportError( SRV_PROC *srvproc, LPCSTR sz, DWORD dwResult = 0 ); +string& GetUddiInstallDirectory(); +ULONG __GetXpVersion(); \ No newline at end of file diff --git a/inetsrv/uddi/source/xp/xp.vcproj b/inetsrv/uddi/source/xp/xp.vcproj new file mode 100644 index 0000000..42512fd --- /dev/null +++ b/inetsrv/uddi/source/xp/xp.vcproj @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inetsrv/uddi/source/xp/xp.vcxproj b/inetsrv/uddi/source/xp/xp.vcxproj new file mode 100644 index 0000000..504cf04 --- /dev/null +++ b/inetsrv/uddi/source/xp/xp.vcxproj @@ -0,0 +1,130 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + 18.0 + {35D639CF-608C-4810-95A3-4895185E6A54} + ExtStoredProcProj + + + + DynamicLibrary + v145 + Unicode + + + DynamicLibrary + v145 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>18.0.11304.63 + + + Debug\ + Debug\ + true + + + Release\ + Release\ + false + + + + Disabled + WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + Level3 + EditAndContinue + Cdecl + + + opends60.lib;%(AdditionalDependencies) + uddi.xp.def + true + Windows + MachineX86 + + + _DEBUG;%(PreprocessorDefinitions) + false + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + MaxSpeed + OnlyExplicitInline + true + WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + Level3 + ProgramDatabase + + + opends60.lib;%(AdditionalDependencies) + uddi.xp.def + true + Windows + true + true + MachineX86 + + + NDEBUG;%(PreprocessorDefinitions) + false + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/xp/xp.vcxproj.filters b/inetsrv/uddi/source/xp/xp.vcxproj.filters new file mode 100644 index 0000000..e2fab83 --- /dev/null +++ b/inetsrv/uddi/source/xp/xp.vcxproj.filters @@ -0,0 +1,43 @@ + + + + + {04e252dc-08f0-4b3b-9c00-526e8e87fd0e} + cpp;c;cxx;rc;def;odl;idl;hpj;bat;asm + + + {99ca79ec-56c4-48d3-902f-87d00c6b8e0d} + h;hpp;hxx;hm;inl;inc + + + {e981c191-0d95-42d9-a64d-f39cb53f4721} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + + Header Files + + + + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/xp/xp.vcxproj.user b/inetsrv/uddi/source/xp/xp.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/inetsrv/uddi/source/xp/xp.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/inetsrv/uddi/source/xp/xp_recalculate_statistics.cpp b/inetsrv/uddi/source/xp/xp_recalculate_statistics.cpp new file mode 100644 index 0000000..5cf8f23 --- /dev/null +++ b/inetsrv/uddi/source/xp/xp_recalculate_statistics.cpp @@ -0,0 +1,277 @@ +#include "uddi.xp.h" + +// +// Add your new Extended Stored Procedure from a Visual Studio Data Project, +// or using the SQL Server Enterprise Manager, or by executing the following +// SQL command: +// sp_addextendedproc 'xp_recalculate_statistics', 'uddi.xp.dll' +// +// You may drop the extended stored procedure by using the SQL command: +// sp_dropextendedproc 'xp_recalculate_statistics' +// +// You may release the DLL from the Server (to delete or replace the file), by +// using the SQL command: +// DBCC xp_recalculate_statistics(FREE) +// +// sp_addextendedproc 'xp_recalculate_statistics', 'uddi.xp.dll' +// sp_dropextendedproc 'xp_recalculate_statistics' +// exec xp_recalculate_statistics +// +// DBCC xp_recalculate_statistics(FREE) +// + +RETCODE xp_recalculate_statistics( SRV_PROC *srvproc ) +{ + DBSMALLINT i = 0; + DBCHAR spName[MAXNAME]; + DBCHAR spText[MAXTEXT]; + DWORD cbReadBuffer = 0; + DBINT cnt = 0; + BOOL fSuccess = FALSE; + STARTUPINFOA si; + PROCESS_INFORMATION pi; + +#if defined( _DEBUG ) || defined( DBG ) + CHAR bReadBuffer[255]; + SECURITY_ATTRIBUTES saPipe; + HANDLE hReadPipe = NULL; + HANDLE hWritePipe = NULL; + DWORD dwExitCode = 0; + BOOL fSendRowNotFailed = TRUE; +#endif + + // + // Name of this procedure + // + _snprintf( spName, MAXNAME, "xp_recalculate_statistics" ); + spName[ MAXNAME - 1 ] = 0x00; + + // + // Send a text message + // + _snprintf( spText, MAXTEXT, "UDDI Services Extended Stored Procedure: %s\n", spName ); + spText[ MAXTEXT - 1 ] = 0x00; + + srv_sendmsg( + srvproc, + SRV_MSG_INFO, + 0, + (DBTINYINT)0, + (DBTINYINT)0, + NULL, + 0, + 0, + spText, + SRV_NULLTERM ); + + string strRecalcStatsFile = GetUddiInstallDirectory(); + if( 0 == strRecalcStatsFile.length() ) + { + ReportError( srvproc, "GetUddiInstallDirectory" ); + return FAIL; + } + + strRecalcStatsFile += "\\recalcstats.exe"; + + _snprintf( spText, MAXTEXT, "Recalcstats.exe Installed at location: %s\n", strRecalcStatsFile.c_str() ); + spText[ MAXTEXT - 1 ] = 0x00; + + srv_sendmsg( + srvproc, + SRV_MSG_INFO, + 0, + (DBTINYINT)0, + (DBTINYINT)0, + NULL, + 0, + 0, + spText, + SRV_NULLTERM ); + +#if defined( _DEBUG ) || defined( DBG ) + // + // Create child process to execute the command string. Use an + // anonymous pipe to read the output from the command and send + // any results to the client. + // In order for the child process to be able to write + // to the anonymous pipe, the handle must be marked as + // inheritable by child processes by setting the + // SECURITY_ATTRIBUTES.bInheritHandle flag to TRUE. + // + saPipe.nLength = sizeof( SECURITY_ATTRIBUTES ); + saPipe.lpSecurityDescriptor = NULL; + saPipe.bInheritHandle = TRUE; + + fSuccess = CreatePipe( + &hReadPipe, // read handle + &hWritePipe, // write handle + &saPipe, // security descriptor + 0 ); // use default pipe buffer size + + if( !fSuccess ) + { + ReportError( srvproc, "CreatePipe", GetLastError() ); + return FAIL; + } +#endif //DBG || _DEBUG + + // + // Now we must set standard out and standard error to the + // write end of the pipe. Once standard out and standard + // error are set to the pipe handle, we must close the pipe + // handle so that when the child process dies, the write end + // of the pipe will close, setting an EOF condition on the pipe. + // + memset( &si, 0, sizeof(si) ); + si.cb = sizeof(si); + si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; + si.wShowWindow = SW_HIDE; + +#if defined( _DEBUG ) || defined( DBG ) + + si.hStdOutput = hWritePipe; + si.hStdError = hWritePipe; +#endif // DBG || _DEBUG + + // + // Set the fInheritHandles parameter to TRUE so that open + // file handles will be inheritied. We can close the child + // process and thread handles as we won't be needing them. + // The child process will not die until these handles are + // closed. + // + fSuccess = CreateProcessA( + strRecalcStatsFile.c_str(), // filename + NULL, // command line for child + NULL, // process security descriptor + NULL, // thread security descriptor + TRUE, // inherit handles? + 0, // creation flags + NULL, // inherited environment address + NULL, // startup dir; NULL = start in current + &si, // pointer to startup info (input) + &pi ); // pointer to process info (output) + + if( !fSuccess ) + { + ReportError( srvproc, "CreateProcess", GetLastError() ); + return FAIL; + } + +#if defined( _DEBUG ) || defined( DBG ) + + + // + // We need to close our instance of the inherited pipe write + // handle now that it's been inherited so that it will actually + // close when the child process ends. This will put an EOF + // condition on the pipe which we can then detect. + // + fSuccess = CloseHandle( hWritePipe ); + + if( !fSuccess ) + { + ReportError( srvproc, "CloseHandle", GetLastError() ); + + CloseHandle( pi.hThread ); + CloseHandle( pi.hProcess ); + return FAIL; + } + + // + // Now read from the pipe until EOF condition reached. + // + do + { + cnt = 0; + while( ( cnt < ( sizeof( bReadBuffer ) / sizeof( bReadBuffer[0] ) ) ) && + ( 0 != (fSuccess = ReadFile( + hReadPipe, // read handle + &bReadBuffer[cnt], // buffer for incoming data + 1, // number of bytes to read + &cbReadBuffer, // number of bytes actually read + NULL ) ) ) ) + { + if( !fSuccess ) + { + if( ERROR_BROKEN_PIPE == GetLastError() ) + { + break; + } + + // + // Child has died + // + ReportError( srvproc, "CloseHandle", GetLastError() ); + CloseHandle( pi.hThread ); + CloseHandle( pi.hProcess ); + + return FAIL; + } + + if( '\n' == bReadBuffer[ cnt ] ) + { + break; + } + else + { + cnt++; + } + } + + if( fSuccess && cbReadBuffer ) + { + if( !cnt ) + { + bReadBuffer[ 0 ] = ' '; + cnt = 1; + } + + // + // Remove carriage return if it exists + // + if( 0x0D == bReadBuffer[ cnt-1 ] ) + { + cnt--; + } + + if( cnt >= 0 ) + { + bReadBuffer[ cnt ] = 0; + + // + // Send program output back as information + // + srv_sendmsg( + srvproc, + SRV_MSG_INFO, + 0, + (DBTINYINT)0, + (DBTINYINT)0, + NULL, + 0, + 0, + bReadBuffer, + cnt ); + } + } + } + while( fSuccess && cbReadBuffer ); + + // + // Close the trace file, pipe handles + // + CloseHandle( hReadPipe ); + + if( !GetExitCodeProcess( pi.hProcess, &dwExitCode ) || dwExitCode != 0 ) + { + ReportError( srvproc, "GetExitCodeProcess", dwExitCode ); + return FAIL; + } +#endif // DBG || _DEBUG + + CloseHandle( pi.hThread ); + CloseHandle( pi.hProcess ); + + return XP_NOERROR ; +} \ No newline at end of file diff --git a/inetsrv/uddi/source/xp/xp_reset_key.cpp b/inetsrv/uddi/source/xp/xp_reset_key.cpp new file mode 100644 index 0000000..9cf0916 --- /dev/null +++ b/inetsrv/uddi/source/xp/xp_reset_key.cpp @@ -0,0 +1,279 @@ +#include "uddi.xp.h" + +// +// Add your new Extended Stored Procedure from a Visual Studio Data Project, +// or using the SQL Server Enterprise Manager, or by executing the following +// SQL command: +// sp_addextendedproc 'xp_reset_key', 'uddi.xp.dll' +// +// You may drop the extended stored procedure by using the SQL command: +// sp_dropextendedproc 'xp_reset_key' +// +// You may release the DLL from the Server (to delete or replace the file), by +// using the SQL command: +// DBCC xp_reset_key(FREE) +// +// sp_addextendedproc 'xp_reset_key', 'uddi.xp.dll' +// sp_dropextendedproc 'xp_reset_key' +// exec xp_reset_key +// +// DBCC xp_reset_key(FREE) +// + +RETCODE xp_reset_key( SRV_PROC *srvproc ) +{ + DBSMALLINT i = 0; + DBCHAR spName[ MAXNAME ]; + DBCHAR spText[ MAXTEXT ]; + CHAR bReadBuffer[ 255 ]; + DWORD cbReadBuffer = 0; + DBINT cnt = 0; + DBINT rows = 0; + BOOL fSuccess = FALSE; + STARTUPINFOA si; + PROCESS_INFORMATION pi; + SECURITY_ATTRIBUTES saPipe; + HANDLE hReadPipe = NULL; + HANDLE hWritePipe = NULL; + DWORD dwExitCode = 0; + BOOL fSendRowNotFailed = TRUE; + + // + // Name of this procedure + // + _snprintf( spName, MAXNAME, "xp_reset_key" ); + spName[ MAXNAME - 1 ] = 0x00; + + // + // Send a text message + // + _snprintf( spText, MAXTEXT, "UDDI Services Extended Stored Procedure: %s\n", spName ); + spText[ MAXTEXT - 1 ] = 0x00; + + srv_sendmsg( + srvproc, + SRV_MSG_INFO, + 0, + (DBTINYINT)0, + (DBTINYINT)0, + NULL, + 0, + 0, + spText, + SRV_NULLTERM ); + + string strResetKeyFile = GetUddiInstallDirectory(); + if( 0 == strResetKeyFile.length() ) + { + ReportError( srvproc, "GetUddiInstallDirectory" ); + return FAIL; + } + + strResetKeyFile += "\\resetkey.exe"; + + _snprintf( spText, MAXTEXT, "Resetkey.exe Installed at location: %s\n", strResetKeyFile.c_str() ); + spText[ MAXTEXT - 1 ] = 0x00; + + srv_sendmsg( + srvproc, + SRV_MSG_INFO, + 0, + (DBTINYINT)0, + (DBTINYINT)0, + NULL, + 0, + 0, + spText, + SRV_NULLTERM ); + + // + // Create child process to execute the command string. Use an + // anonymous pipe to read the output from the command and send + // any results to the client. + // In order for the child process to be able to write + // to the anonymous pipe, the handle must be marked as + // inheritable by child processes by setting the + // SECURITY_ATTRIBUTES.bInheritHandle flag to TRUE. + // + saPipe.nLength = sizeof( SECURITY_ATTRIBUTES ); + saPipe.lpSecurityDescriptor = NULL; + saPipe.bInheritHandle = TRUE; + + fSuccess = CreatePipe( + &hReadPipe, // read handle + &hWritePipe, // write handle + &saPipe, // security descriptor + 0 ); // use default pipe buffer size + + if( !fSuccess ) + { + ReportError( srvproc, "CreatePipe", GetLastError() ); + return FAIL; + } + + // + // Now we must set standard out and standard error to the + // write end of the pipe. Once standard out and standard + // error are set to the pipe handle, we must close the pipe + // handle so that when the child process dies, the write end + // of the pipe will close, setting an EOF condition on the pipe. + // + memset( &si, 0, sizeof(si) ); + si.cb = sizeof(si); + si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; + si.wShowWindow = SW_HIDE; + si.hStdOutput = hWritePipe; + si.hStdError = hWritePipe; + + // + // Set the fInheritHandles parameter to TRUE so that open + // file handles will be inheritied. We can close the child + // process and thread handles as we won't be needing them. + // The child process will not die until these handles are + // closed. + // + char params[ 6 ]; + params[ 0 ] = 0x00; + strncat( params, " /now", 6 ); + params[ 5 ] = 0x00; + + fSuccess = CreateProcessA( + strResetKeyFile.c_str(), // filename + params, // command line for child + NULL, // process security descriptor + NULL, // thread security descriptor + TRUE, // inherit handles? + 0, // creation flags + NULL, // inherited environment address + NULL, // startup dir; NULL = start in current + &si, // pointer to startup info (input) + &pi ); // pointer to process info (output) + + if (!fSuccess) + { + ReportError( srvproc, "CreateProcess", GetLastError() ); + return FAIL; + } + + // + // We need to close our instance of the inherited pipe write + // handle now that it's been inherited so that it will actually + // close when the child process ends. This will put an EOF + // condition on the pipe which we can then detect. + // + fSuccess = CloseHandle( hWritePipe ); + + if( !fSuccess ) + { + ReportError( srvproc, "CloseHandle", GetLastError() ); + + CloseHandle( pi.hThread ); + CloseHandle( pi.hProcess ); + return FAIL; + } + + string strOutput = ""; + + // + // Now read from the pipe until EOF condition reached. + // + do + { + cnt = 0; + while( ( cnt < ( sizeof( bReadBuffer ) / sizeof( bReadBuffer[0] ) ) ) && + ( 0 != (fSuccess = ReadFile( + hReadPipe, // read handle + &bReadBuffer[cnt], // buffer for incoming data + 1, // number of bytes to read + &cbReadBuffer, // number of bytes actually read + NULL ) ) ) ) + { + if( !fSuccess ) + { + if( ERROR_BROKEN_PIPE == GetLastError() ) + { + break; + } + + // + // Child has died + // + ReportError( srvproc, "CloseHandle", GetLastError() ); + CloseHandle( pi.hThread ); + CloseHandle( pi.hProcess ); + + return FAIL; + } + + if( '\n' == bReadBuffer[ cnt ] ) + { + break; + } + else + { + cnt++; + } + } + + if( fSuccess && cbReadBuffer ) + { + if( !cnt ) + { + bReadBuffer[ 0 ] = ' '; + cnt = 1; + } + + // + // Remove carriage return if it exists + // +// if( 0x0D == bReadBuffer[ cnt-1 ] ) +// { +// cnt--; +// } + + if( cnt >= 0 ) + { + bReadBuffer[ cnt ] = 0x00; + + // + // Send program output back as information + // + strOutput.append( bReadBuffer, cnt ); + + srv_sendmsg( + srvproc, + SRV_MSG_INFO, + 0, + (DBTINYINT)0, + (DBTINYINT)0, + NULL, + 0, + 0, + bReadBuffer, + cnt ); + } + } + } + while( fSuccess && cbReadBuffer ); + + OutputDebugStringA( strOutput.c_str() ); + + // + // Close the trace file, pipe handles + // + CloseHandle( hReadPipe ); + + if( !GetExitCodeProcess( pi.hProcess, &dwExitCode ) || dwExitCode != 0 ) + { + ReportError( srvproc, "GetExitCodeProcess", dwExitCode ); + return FAIL; + } + + CloseHandle( pi.hThread ); + CloseHandle( pi.hProcess ); + + return XP_NOERROR ; +} + + +