Permalink
Browse files

number of bug fixes and couple new uis (AST, NuGet, API_ASMX_Proxy)

  • Loading branch information...
1 parent 4515ebd commit e912ce757f0192464e0676b8fec8e02016229374 @DinisCruz DinisCruz committed May 16, 2013
@@ -20,7 +20,7 @@
using VistaDB.Provider;
-//O2Ref:C:\Program Files\Checkmarx\Checkmarx Engine Server\VistaDB.NET20.dll
+//O2Ref:C:\Program Files (x86)\Checkmarx\Checkmarx Engine Server\VistaDB.NET20.dll
namespace O2.XRules.Database.APIs
{
@@ -39,7 +39,7 @@ public class API_VistaDB
public API_VistaDB()
{
- ConnectionString = @"data source='C:\Program Files\Checkmarx\Checkmarx Application Server\CxDB.vdb3'"; //default to this one
+ ConnectionString = @"data source='C:\Program Files (x86)\Checkmarx\Checkmarx Application Server\CxDB.vdb3'"; //default to this one
}
public API_VistaDB(string connectionString)
@@ -462,7 +462,7 @@ public static T add_ConnectionStringTester<T>(this API_VistaDB vistaDB , T contr
//connectionString.set_Text(@"Data Source=.\SQLExpress;Trusted_Connection=True");
var sampleConnectionStrings = new List<string>();
//from http://www.connectionstrings.com/sql-server-2005
- sampleConnectionStrings.add(@"data source='C:\Program Files\Checkmarx\Checkmarx Application Server\CxDB.vdb3'")
+ sampleConnectionStrings.add(@"data source='C:\Program Files (x86)\Checkmarx\Checkmarx Application Server\CxDB.vdb3'")
.add(@"Data Source=.\SQLExpress;Trusted_Connection=True")
.add(@"Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI")
.add(@"Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;")
@@ -1,16 +1,14 @@
-<?xml version="1.0"?>
-<H2>
- <SourceCode>//O2Tag:SkipGlobalCompilation
-
+//O2Tag:SkipGlobalCompilation
+
//var topPanel = panel.clear().add_Panel();
-var topPanel = O2Gui.open&lt;Panel&gt;("Sql Info",900,500);
+var topPanel = O2Gui.open<Panel>("Sql Info",900,500);
topPanel.insert_Below(100).add_LogViewer();
var vistaDb = new API_VistaDB();
var show= false;
show = true;
TabControl tabControl = null;
Action loadDataFromCurrentConnection =
- ()=&gt;{
+ ()=>{
tabControl.remove_Tab("Database details viewer");
tabControl.remove_Tab("Table's Schema");
tabControl.remove_Tab("Table's Data");
@@ -32,6 +30,4 @@ if(show)
//O2Ref:System.Data.dll
//O2File:API_VistaDB.cs
-//O2Tag_DontAddExtraO2Files</SourceCode>
- <ReferencedAssemblies />
-</H2>
+//O2Tag_DontAddExtraO2Files
@@ -0,0 +1,22 @@
+var topPanel = "Util - CheckMarx - Create proxy files for CxWebService".popupWindow(700,400);
+//var topPanel = panel.clear().add_Panel();
+var webRoot_Folder = "_cxProxy".tempDir(false);
+var webBrowser = topPanel.insert_Right().add_WebBrowser();
+var folderViewer = topPanel.add_FolderViewer(webRoot_Folder);
+
+var baseUrl = "http://local:57879/Cxwebinterface";
+var wsdlUrl = "http://local/CxWebInterface/CxWebService.asmx";
+var asmxFileName = wsdlUrl.fileName();
+var webServiceNamespace = "http://Checkmarx.com/"; // note: just http://Checkmarx.com will not work
+
+var wsdl_CS_File = "wsdl_CS_File".o2Cache<string>(()=> new DotNet_SDK_WSDL().wsdl_CreateCSharp(wsdlUrl));
+
+new API_ASMX_Proxy().create_Proxy_Files_For_WSDL(webRoot_Folder, wsdl_CS_File, webServiceNamespace, asmxFileName);
+
+folderViewer.refresh();
+webBrowser.open(baseUrl);
+
+return "done";
+//O2File:API_ASMX_Proxy.cs
+//O2File:DotNet_SDK_WSDL.cs
+//using O2.XRules.Database.Languages_and_Frameworks.DotNet
@@ -0,0 +1,37 @@
+using System;
+using System.Diagnostics;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.XRules.Database.Utils;
+
+//O2File:Tool_API.cs
+
+namespace O2.XRules.Database.APIs
+{
+ public class Installer_Test
+ {
+ public void test()
+ {
+ new SWFScan_Installer().start();
+ }
+ }
+ public class SWFScan_Installer : Tool_API
+ {
+
+ public SWFScan_Installer()
+ {
+ config("SWFScan",
+ "http://h30499.www3.hp.com/hpeb/attachments/hpeb/sws-119/721/1/HP_FREE_TOOL_SwfScan.zip".uri(),
+ "AppScanSDK.chm");
+ installFromZip_Web();
+ }
+
+ public Process start()
+ {
+ if (isInstalled())
+ return Executable.startProcess();
+ return null;
+ }
+ }
+}
@@ -21,7 +21,7 @@ public class ILSpy_Installer : Tool_API
public ILSpy_Installer()
{
config("ILSpy",
- "http://downloads.sourceforge.net/project/sharpdevelop/ILSpy/2.0/ILSpy_Master_2.1.0.1603_RTW_Binaries.zip".uri(),
+ "http://downloads.sourceforge.net/project/sharpdevelop/ILSpy/2.0/ILSpy_Master_2.1.0.1603_RTW_Binaries.zip".uri(),
"ILSpy.exe");
installFromZip_Web();
}
View
@@ -9,43 +9,46 @@
using O2.Kernel.ExtensionMethods;
using O2.DotNetWrappers.DotNet;
using O2.DotNetWrappers.ExtensionMethods;
+using NuGet;
+using NuGet.Common;
+//O2Ref:NuGet\NutGet.exe
//Installer:NuGet_Installer.cs!NuGet\NutGet.exe
namespace O2.XRules.Database.APIs
{
public class API_NuGet
{
- public string NuGet_Exe { get; set;}
+ //public string NuGet_Exe { get; set;}
//public string NuGet_Exe_DownloadUrl { get; set;}
+ public Program NuGet_Program { get; set; }
+ public Console NuGet_Console { get; set; }
public API_NuGet()
{
- this.NuGet_Exe = PublicDI.config.ToolsOrApis
- .pathCombine("NuGet").createDir()
- .pathCombine("NuGet.exe");
- //this.NuGet_Exe_DownloadUrl = "http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=nuget&DownloadId=412077&FileTime=129851621946970000&Build=19310";
- //this.checkInstall();*/
+ //this.NuGet_Exe = PublicDI.config.ToolsOrApis
+ // .pathCombine("NuGet").createDir()
+ // .pathCombine("NuGet.exe");
+
}
- public string execute(string command)
+ public API_NuGet SetUp()
{
- return this.NuGet_Exe.startProcess_getConsoleOut(command);
+ NuGet_Program = new Program();
+ NuGet_Console = new Console();
}
+ /*public string execute(string command)
+ {
+ return this.NuGet_Exe.startProcess_getConsoleOut(command);
+ }*/
}
public static class API_NuGet_ExtensionMethods
{
- /*public static API_NuGet checkInstall(this API_NuGet nuGet)
- {
- if (nuGet.NuGet_Exe.fileExists())
- "[API_NuGet] found NuGet.exe: {0}".info(nuGet.NuGet_Exe);
- else
- {
- "[API_NuGet] NuGet.exe not found, so downloading it".debug();
- nuGet.NuGet_Exe_DownloadUrl.download(nuGet.NuGet_Exe);
- }
- return nuGet;
- }*/
+
+ }
+
+ /*public static class API_NuGet_ExtensionMethods
+ {
public static string list(this API_NuGet nuGet, string filter)
{
@@ -74,5 +77,129 @@ public static string push(this API_NuGet nuGet, string pathToNuSpec)
return nuGet.execute("Push " + pathToNuSpec);
return "[API_NuGet] could not find provided NuSpec file: {0}".error(pathToNuSpec);
}
+ }*/
+}
+
+/*
+
+panel.clear().add_ConsoleOut(false); // adds a console out viewer
+
+var program = new Program();
+var console = new NuGet.Common.Console();
+console.WriteLine("Testing NuGet Console out");
+
+Action<Command> setupCommand =
+ (command)=>{
+ // this.Settings = Settings.LoadDefaultSettings(this.FileSystem);
+ var defaultSettings = Settings.LoadDefaultSettings(command.FileSystem);
+ command.prop("Settings", defaultSettings);
+
+ //this.SourceProvider = PackageSourceBuilder.CreateSourceProvider(this.Settings);
+ var sourceProvider = (IPackageSourceProvider)"NuGet.exe".assembly()
+ .type("PackageSourceBuilder")
+ .invokeStatic("CreateSourceProvider",
+ defaultSettings);
+ command.prop("SourceProvider", sourceProvider);
+
+ //SettingsCredentialProvider defaultCredentialProvider
+ // = new SettingsCredentialProvider(new ConsoleCredentialProvider(this.Console),
+ // this.SourceProvider, this.Console);
+ var defaultCredentialProvider = new SettingsCredentialProvider(
+ new ConsoleCredentialProvider(command.Console),
+ sourceProvider, command.Console);
+
+ HttpClient.DefaultCredentialProvider = defaultCredentialProvider;
+
+ //this.RepositoryFactory = new CommandLineRepositoryFactory(this.Console);
+ command.prop("RepositoryFactory", new CommandLineRepositoryFactory(command.Console));
+ };
+
+var tempDir = "_NuGet".tempDir(false);
+var fileSystem = new PhysicalFileSystem(tempDir);
+program.invoke("Initialize", fileSystem, console);
+
+var commands = program.Commands
+ .ToDictionary((command)=> command.CommandAttribute.CommandName);
+var listCommand = (ListCommand)commands["list"];
+
+setupCommand(listCommand);
+
+var start = DateTime.Now;
+"Starting download of Metadata".info();
+var packages = listCommand.GetPackages().toList(); // force download of all metadata
+"Metadata completed in {0} for {1} packages".debug(start.duration_to_Now(), packages.size());
+
+packages.script_Me("_packages");
+
+return "Continue on scriptMe";
+
+//return "done. packages size = {0} sharedPackageRepository size = {1}"
+// .format(packages.size(), sharedPackageRepository.GetPackages().size());
+
+
+return "done";
+
+
+
+
+
+
+Web.Https.ignoreServerSslErrors();
+
+return listCommand.GetPackages().take(250);
+
+"before".info();
+var sw = new Stopwatch();
+sw.Start();
+//using System.Diagnostics
+listCommand.GetPackages().take(5500);
+"after".info();
+sw.Stop();
+return sw.Elapsed.str();
+
+
+
+//using NuGet
+//using NuGet.Common
+//using NuGet.Commands
+//O2Ref:NuGet/Nuget.exe
+
+*/
+
+
+/*
+
+var tempDir = "_NuGet".tempDir(false);
+
+var packages = (List<IPackage>)_packages;
+
+var start = DateTime.Now;
+var sharedPackageRepository = new SharedPackageRepository(tempDir);
+var count = 0;
+var errors = new List<IPackage>();
+foreach(var package in packages) // download the nupkg files
+{
+ try
+ {
+ "[{0}/{1}] fetching package {2}".info(++count, packages.size(), package.Id);
+ sharedPackageRepository.AddPackage(package);
+ }
+ catch(Exception ex)
+ {
+ errors.add(package);
+ ex.log("in package: {0}".info(package.Id));
}
-}
+}
+
+"Completed download of all packages in {0}".debug(start.duration_to_Now());
+"There where {0} errors".error(errors.size());
+return errors;
+//using NuGet
+//using NuGet.Common
+//using NuGet.Commands
+//O2Ref:NuGet/Nuget.exe
+//O2Ref:mscorlib.dll
+//O2Tag_SetInvocationParametersToDynamic
+//O2Ref:Microsoft.CSharp.dll
+
+*/
Oops, something went wrong.

0 comments on commit e912ce7

Please sign in to comment.