Skip to content

Commit

Permalink
Merge branch 'master' of github.com:TellagoDevLabs/Hermes
Browse files Browse the repository at this point in the history
Conflicts:
	src/RestService/RestService.csproj
  • Loading branch information
jasondentler committed Jul 18, 2011
2 parents f4ed3f2 + f14437e commit cc462b3
Show file tree
Hide file tree
Showing 46 changed files with 2,435 additions and 90 deletions.
12 changes: 8 additions & 4 deletions src/Client.Tests/Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<Reference Include="MongoDB.Driver">
<HintPath>..\..\lib\Mongo\MongoDB.Driver.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunit.mocks">
Expand All @@ -50,12 +50,12 @@
<HintPath>..\packages\SharpTestsEx.1.1.1\lib\SharpTestsEx.dll</HintPath>
</Reference>
<Reference Include="SharpTestsEx.Mvc">
<HintPath>..\packages\SharpTestsEx.1.1.1\lib\SharpTestsEx.Mvc.dll</HintPath>
<HintPath>..\packages\SharpTestsEx.MVC.1.1.1\lib\SharpTestsEx.Mvc.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Reactive, Version=1.0.10621.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Reactive">
<HintPath>..\packages\Rx-Main.1.0.10621\lib\Net4\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
Expand Down Expand Up @@ -85,7 +85,11 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
<Exec Condition="Exists('$(ProjectDir)packages.config')" Command="&quot;$(SolutionDir)..\Tools\nuget.exe&quot; install &quot;$(ProjectDir)packages.config&quot; -o &quot;$(SolutionDir)Packages&quot;" />
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
5 changes: 3 additions & 2 deletions src/Client.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="SharpTestsEx" version="1.1.1" />
<package id="NUnit" version="2.5.10.11092" />
<package id="Rx-Main" version="1.0.10621" />
<package id="NUnit" version="2.5.10.11092" />
<package id="SharpTestsEx" version="1.1.1" />
<package id="SharpTestsEx.MVC" version="1.1.1" />
</packages>
94 changes: 94 additions & 0 deletions src/Installers/CustomActions/CustomActions.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C0B58D43-BDA2-4D6F-8F45-9FED078B7777}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TellagoStudios.ApplicationRepository.CustomActions</RootNamespace>
<AssemblyName>CustomActions</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.CA.targets</WixCATargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Express|AnyCPU'">
<OutputPath>bin\Express\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\CustomActions.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Enterprise|AnyCPU'">
<OutputPath>bin\Enterprise\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\CustomActions.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Deployment.WindowsInstaller, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ce35f76fcda82bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\Microsoft.Deployment.WindowsInstaller.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataService.cs" />
<Compile Include="IIServer.cs" />
<Compile Include="Services.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(WixCATargetsPath)" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
43 changes: 43 additions & 0 deletions src/Installers/CustomActions/DataService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Deployment.WindowsInstaller;
using System.Web;
using System.Net;

namespace TellagoStudios.Hermes.CustomActions
{
public class DataServiceServer
{
[CustomAction]
public static ActionResult CheckDataServiceConnection(Session session)
{
try
{
session["APPLICATIONREPOSITORY_TESTRESULT"] = "Not Checked";

var url = session["APPLICATIONREPOSITORY_URL"];

var request = HttpWebRequest.Create(url + "/Hermes");
request.UseDefaultCredentials = true;

var response = (HttpWebResponse)request.GetResponse();

using (var stream = response.GetResponseStream())
{
var buffer = new byte[4096];
while (stream.Read(buffer, 0, 4096) > 0) ;
}
session["APPLICATIONREPOSITORY_TESTRESULT"] = "1";
}
catch (Exception ex)
{
session["APPLICATIONREPOSITORY_TESTRESULT"] = "0";
session.Log("EXCEPTION:" + Environment.NewLine + ex.ToString());
}

session.Log("4 ");
return ActionResult.Success;
}
}
}
95 changes: 95 additions & 0 deletions src/Installers/CustomActions/IIServer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using System;
using Microsoft.Deployment.WindowsInstaller;
using System.DirectoryServices;

namespace TellagoStudios.Hermes.CustomActions
{
public class IIServer
{
[CustomAction]
public static ActionResult GetWebSites(Session session)
{
try
{
View listBoxView = session.Database.OpenView("select * from ListBox");
View availableWSView = session.Database.OpenView("select * from AvailableWebSites");

DirectoryEntry iisRoot = new DirectoryEntry("IIS://localhost/W3SVC");

int order = 1;
foreach (DirectoryEntry webSite in iisRoot.Children)
{
if (webSite.SchemaClassName.ToLower() == "iiswebserver" &&
webSite.Name.ToLower() != "administration web site")
{
StoreWebSiteDataInListBoxTable(webSite, order, listBoxView);
StoreWebSiteDataInAvailableWebSitesTable(webSite, availableWSView);
order++;
}
}
}
catch (Exception ex)
{
return ActionResult.Failure;
}
return ActionResult.Success;
}

private static void StoreWebSiteDataInListBoxTable(DirectoryEntry webSite, int order, View listBoxView)
{
Record newListBoxRecord = new Record(4);
newListBoxRecord[1] = "WEBSITE";
newListBoxRecord[2] = order;
newListBoxRecord[3] = webSite.Name;
newListBoxRecord[4] = webSite.Properties["ServerComment"].Value;

listBoxView.Modify(ViewModifyMode.InsertTemporary, newListBoxRecord);
}

private static void StoreWebSiteDataInAvailableWebSitesTable(DirectoryEntry webSite, View availableWSView)
{
//Get Ip, Port and Header from server bindings
string[] serverBindings = ((string)webSite.Properties["ServerBindings"].Value).Split(':');
string ip = serverBindings[0];
string port = serverBindings[1];
string header = serverBindings[2];

Record newFoundWebSiteRecord = new Record(5);
newFoundWebSiteRecord[1] = webSite.Name;
newFoundWebSiteRecord[2] = webSite.Properties["ServerComment"].Value;
newFoundWebSiteRecord[3] = port;
newFoundWebSiteRecord[4] = ip;
newFoundWebSiteRecord[5] = header;

availableWSView.Modify(ViewModifyMode.InsertTemporary, newFoundWebSiteRecord);
}

[CustomAction]
public static ActionResult UpdatePropsWithSelectedWebSite(Session session)
{
try
{
string selectedWebSiteId = session["WEBSITE"];
session.Log("CA: Found web site id: " + selectedWebSiteId);

View availableWebSitesView = session.Database.OpenView("Select * from AvailableWebSites where WebSiteNo=" + selectedWebSiteId);
availableWebSitesView.Execute();

Record record = availableWebSitesView.Fetch();
if ((record[1].ToString()) == selectedWebSiteId)
{
session["WEBSITE_DESCRIPTION"] = (string)record[2];
session["WEBSITE_PORT"] = (string)record[3];
session["WEBSITE_IP"] = (string)record[4];
session["WEBSITE_HEADER"] = (string)record[5];
}
}
catch (Exception ex)
{
session.Log("CustomActionException: " + ex.ToString());
return ActionResult.Failure;
}
return ActionResult.Success;
}
}
}
36 changes: 36 additions & 0 deletions src/Installers/CustomActions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 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("TellagoStudios.Hermes.CustomActions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Tellago Studios")]
[assembly: AssemblyProduct("TellagoStudios.Hermes.CustomActions")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("60c8686f-27bd-481a-bb22-f3984aa7f701")]

// 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 Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit cc462b3

Please sign in to comment.