Skip to content

Commit e912ce7

Browse files
committed
number of bug fixes and couple new uis (AST, NuGet, API_ASMX_Proxy)
1 parent 4515ebd commit e912ce7

18 files changed

+1359
-268
lines changed

3rdParty/CheckMarx/VistaDB/API_VistaDB.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
using VistaDB.Provider;
23-
//O2Ref:C:\Program Files\Checkmarx\Checkmarx Engine Server\VistaDB.NET20.dll
23+
//O2Ref:C:\Program Files (x86)\Checkmarx\Checkmarx Engine Server\VistaDB.NET20.dll
2424

2525
namespace O2.XRules.Database.APIs
2626
{
@@ -39,7 +39,7 @@ public class API_VistaDB
3939

4040
public API_VistaDB()
4141
{
42-
ConnectionString = @"data source='C:\Program Files\Checkmarx\Checkmarx Application Server\CxDB.vdb3'"; //default to this one
42+
ConnectionString = @"data source='C:\Program Files (x86)\Checkmarx\Checkmarx Application Server\CxDB.vdb3'"; //default to this one
4343
}
4444

4545
public API_VistaDB(string connectionString)
@@ -462,7 +462,7 @@ public static T add_ConnectionStringTester<T>(this API_VistaDB vistaDB , T contr
462462
//connectionString.set_Text(@"Data Source=.\SQLExpress;Trusted_Connection=True");
463463
var sampleConnectionStrings = new List<string>();
464464
//from http://www.connectionstrings.com/sql-server-2005
465-
sampleConnectionStrings.add(@"data source='C:\Program Files\Checkmarx\Checkmarx Application Server\CxDB.vdb3'")
465+
sampleConnectionStrings.add(@"data source='C:\Program Files (x86)\Checkmarx\Checkmarx Application Server\CxDB.vdb3'")
466466
.add(@"Data Source=.\SQLExpress;Trusted_Connection=True")
467467
.add(@"Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI")
468468
.add(@"Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;")

3rdParty/CheckMarx/VistaDB/Util - VistaDB Browser.h2

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
<?xml version="1.0"?>
2-
<H2>
3-
<SourceCode>//O2Tag:SkipGlobalCompilation
4-
1+
//O2Tag:SkipGlobalCompilation
2+
53
//var topPanel = panel.clear().add_Panel();
6-
var topPanel = O2Gui.open&lt;Panel&gt;("Sql Info",900,500);
4+
var topPanel = O2Gui.open<Panel>("Sql Info",900,500);
75
topPanel.insert_Below(100).add_LogViewer();
86
var vistaDb = new API_VistaDB();
97
var show= false;
108
show = true;
119
TabControl tabControl = null;
1210
Action loadDataFromCurrentConnection =
13-
()=&gt;{
11+
()=>{
1412
tabControl.remove_Tab("Database details viewer");
1513
tabControl.remove_Tab("Table's Schema");
1614
tabControl.remove_Tab("Table's Data");
@@ -32,6 +30,4 @@ if(show)
3230

3331
//O2Ref:System.Data.dll
3432
//O2File:API_VistaDB.cs
35-
//O2Tag_DontAddExtraO2Files</SourceCode>
36-
<ReferencedAssemblies />
37-
</H2>
33+
//O2Tag_DontAddExtraO2Files
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var topPanel = "Util - CheckMarx - Create proxy files for CxWebService".popupWindow(700,400);
2+
//var topPanel = panel.clear().add_Panel();
3+
var webRoot_Folder = "_cxProxy".tempDir(false);
4+
var webBrowser = topPanel.insert_Right().add_WebBrowser();
5+
var folderViewer = topPanel.add_FolderViewer(webRoot_Folder);
6+
7+
var baseUrl = "http://local:57879/Cxwebinterface";
8+
var wsdlUrl = "http://local/CxWebInterface/CxWebService.asmx";
9+
var asmxFileName = wsdlUrl.fileName();
10+
var webServiceNamespace = "http://Checkmarx.com/"; // note: just http://Checkmarx.com will not work
11+
12+
var wsdl_CS_File = "wsdl_CS_File".o2Cache<string>(()=> new DotNet_SDK_WSDL().wsdl_CreateCSharp(wsdlUrl));
13+
14+
new API_ASMX_Proxy().create_Proxy_Files_For_WSDL(webRoot_Folder, wsdl_CS_File, webServiceNamespace, asmxFileName);
15+
16+
folderViewer.refresh();
17+
webBrowser.open(baseUrl);
18+
19+
return "done";
20+
//O2File:API_ASMX_Proxy.cs
21+
//O2File:DotNet_SDK_WSDL.cs
22+
//using O2.XRules.Database.Languages_and_Frameworks.DotNet
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Diagnostics;
3+
using O2.Kernel;
4+
using O2.Kernel.ExtensionMethods;
5+
using O2.DotNetWrappers.ExtensionMethods;
6+
using O2.XRules.Database.Utils;
7+
8+
//O2File:Tool_API.cs
9+
10+
namespace O2.XRules.Database.APIs
11+
{
12+
public class Installer_Test
13+
{
14+
public void test()
15+
{
16+
new SWFScan_Installer().start();
17+
}
18+
}
19+
public class SWFScan_Installer : Tool_API
20+
{
21+
22+
public SWFScan_Installer()
23+
{
24+
config("SWFScan",
25+
"http://h30499.www3.hp.com/hpeb/attachments/hpeb/sws-119/721/1/HP_FREE_TOOL_SwfScan.zip".uri(),
26+
"AppScanSDK.chm");
27+
installFromZip_Web();
28+
}
29+
30+
public Process start()
31+
{
32+
if (isInstalled())
33+
return Executable.startProcess();
34+
return null;
35+
}
36+
}
37+
}

3rdParty/ILSpy/ILSpy_Installer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ILSpy_Installer : Tool_API
2121
public ILSpy_Installer()
2222
{
2323
config("ILSpy",
24-
"http://downloads.sourceforge.net/project/sharpdevelop/ILSpy/2.0/ILSpy_Master_2.1.0.1603_RTW_Binaries.zip".uri(),
24+
"http://downloads.sourceforge.net/project/sharpdevelop/ILSpy/2.0/ILSpy_Master_2.1.0.1603_RTW_Binaries.zip".uri(),
2525
"ILSpy.exe");
2626
installFromZip_Web();
2727
}

3rdParty/NuGet/API_NuGet.cs

Lines changed: 147 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,46 @@
99
using O2.Kernel.ExtensionMethods;
1010
using O2.DotNetWrappers.DotNet;
1111
using O2.DotNetWrappers.ExtensionMethods;
12+
using NuGet;
13+
using NuGet.Common;
14+
//O2Ref:NuGet\NutGet.exe
1215
//Installer:NuGet_Installer.cs!NuGet\NutGet.exe
1316

1417
namespace O2.XRules.Database.APIs
1518
{
1619
public class API_NuGet
1720
{
18-
public string NuGet_Exe { get; set;}
21+
//public string NuGet_Exe { get; set;}
1922
//public string NuGet_Exe_DownloadUrl { get; set;}
23+
public Program NuGet_Program { get; set; }
24+
public Console NuGet_Console { get; set; }
2025

2126
public API_NuGet()
2227
{
23-
this.NuGet_Exe = PublicDI.config.ToolsOrApis
24-
.pathCombine("NuGet").createDir()
25-
.pathCombine("NuGet.exe");
26-
//this.NuGet_Exe_DownloadUrl = "http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=nuget&DownloadId=412077&FileTime=129851621946970000&Build=19310";
27-
//this.checkInstall();*/
28+
//this.NuGet_Exe = PublicDI.config.ToolsOrApis
29+
// .pathCombine("NuGet").createDir()
30+
// .pathCombine("NuGet.exe");
31+
2832
}
2933

30-
public string execute(string command)
34+
public API_NuGet SetUp()
3135
{
32-
return this.NuGet_Exe.startProcess_getConsoleOut(command);
36+
NuGet_Program = new Program();
37+
NuGet_Console = new Console();
3338
}
39+
/*public string execute(string command)
40+
{
41+
return this.NuGet_Exe.startProcess_getConsoleOut(command);
42+
}*/
3443
}
3544

3645
public static class API_NuGet_ExtensionMethods
3746
{
38-
/*public static API_NuGet checkInstall(this API_NuGet nuGet)
39-
{
40-
if (nuGet.NuGet_Exe.fileExists())
41-
"[API_NuGet] found NuGet.exe: {0}".info(nuGet.NuGet_Exe);
42-
else
43-
{
44-
"[API_NuGet] NuGet.exe not found, so downloading it".debug();
45-
nuGet.NuGet_Exe_DownloadUrl.download(nuGet.NuGet_Exe);
46-
}
47-
return nuGet;
48-
}*/
47+
48+
}
49+
50+
/*public static class API_NuGet_ExtensionMethods
51+
{
4952
5053
public static string list(this API_NuGet nuGet, string filter)
5154
{
@@ -74,5 +77,129 @@ public static string push(this API_NuGet nuGet, string pathToNuSpec)
7477
return nuGet.execute("Push " + pathToNuSpec);
7578
return "[API_NuGet] could not find provided NuSpec file: {0}".error(pathToNuSpec);
7679
}
80+
}*/
81+
}
82+
83+
/*
84+
85+
panel.clear().add_ConsoleOut(false); // adds a console out viewer
86+
87+
var program = new Program();
88+
var console = new NuGet.Common.Console();
89+
console.WriteLine("Testing NuGet Console out");
90+
91+
Action<Command> setupCommand =
92+
(command)=>{
93+
// this.Settings = Settings.LoadDefaultSettings(this.FileSystem);
94+
var defaultSettings = Settings.LoadDefaultSettings(command.FileSystem);
95+
command.prop("Settings", defaultSettings);
96+
97+
//this.SourceProvider = PackageSourceBuilder.CreateSourceProvider(this.Settings);
98+
var sourceProvider = (IPackageSourceProvider)"NuGet.exe".assembly()
99+
.type("PackageSourceBuilder")
100+
.invokeStatic("CreateSourceProvider",
101+
defaultSettings);
102+
command.prop("SourceProvider", sourceProvider);
103+
104+
//SettingsCredentialProvider defaultCredentialProvider
105+
// = new SettingsCredentialProvider(new ConsoleCredentialProvider(this.Console),
106+
// this.SourceProvider, this.Console);
107+
var defaultCredentialProvider = new SettingsCredentialProvider(
108+
new ConsoleCredentialProvider(command.Console),
109+
sourceProvider, command.Console);
110+
111+
HttpClient.DefaultCredentialProvider = defaultCredentialProvider;
112+
113+
//this.RepositoryFactory = new CommandLineRepositoryFactory(this.Console);
114+
command.prop("RepositoryFactory", new CommandLineRepositoryFactory(command.Console));
115+
};
116+
117+
var tempDir = "_NuGet".tempDir(false);
118+
var fileSystem = new PhysicalFileSystem(tempDir);
119+
program.invoke("Initialize", fileSystem, console);
120+
121+
var commands = program.Commands
122+
.ToDictionary((command)=> command.CommandAttribute.CommandName);
123+
var listCommand = (ListCommand)commands["list"];
124+
125+
setupCommand(listCommand);
126+
127+
var start = DateTime.Now;
128+
"Starting download of Metadata".info();
129+
var packages = listCommand.GetPackages().toList(); // force download of all metadata
130+
"Metadata completed in {0} for {1} packages".debug(start.duration_to_Now(), packages.size());
131+
132+
packages.script_Me("_packages");
133+
134+
return "Continue on scriptMe";
135+
136+
//return "done. packages size = {0} sharedPackageRepository size = {1}"
137+
// .format(packages.size(), sharedPackageRepository.GetPackages().size());
138+
139+
140+
return "done";
141+
142+
143+
144+
145+
146+
147+
Web.Https.ignoreServerSslErrors();
148+
149+
return listCommand.GetPackages().take(250);
150+
151+
"before".info();
152+
var sw = new Stopwatch();
153+
sw.Start();
154+
//using System.Diagnostics
155+
listCommand.GetPackages().take(5500);
156+
"after".info();
157+
sw.Stop();
158+
return sw.Elapsed.str();
159+
160+
161+
162+
//using NuGet
163+
//using NuGet.Common
164+
//using NuGet.Commands
165+
//O2Ref:NuGet/Nuget.exe
166+
167+
*/
168+
169+
170+
/*
171+
172+
var tempDir = "_NuGet".tempDir(false);
173+
174+
var packages = (List<IPackage>)_packages;
175+
176+
var start = DateTime.Now;
177+
var sharedPackageRepository = new SharedPackageRepository(tempDir);
178+
var count = 0;
179+
var errors = new List<IPackage>();
180+
foreach(var package in packages) // download the nupkg files
181+
{
182+
try
183+
{
184+
"[{0}/{1}] fetching package {2}".info(++count, packages.size(), package.Id);
185+
sharedPackageRepository.AddPackage(package);
186+
}
187+
catch(Exception ex)
188+
{
189+
errors.add(package);
190+
ex.log("in package: {0}".info(package.Id));
77191
}
78-
}
192+
}
193+
194+
"Completed download of all packages in {0}".debug(start.duration_to_Now());
195+
"There where {0} errors".error(errors.size());
196+
return errors;
197+
//using NuGet
198+
//using NuGet.Common
199+
//using NuGet.Commands
200+
//O2Ref:NuGet/Nuget.exe
201+
//O2Ref:mscorlib.dll
202+
//O2Tag_SetInvocationParametersToDynamic
203+
//O2Ref:Microsoft.CSharp.dll
204+
205+
*/

0 commit comments

Comments
 (0)