-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:TellagoDevLabs/Hermes
Conflicts: src/RestService/RestService.csproj
- Loading branch information
Showing
46 changed files
with
2,435 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")] |
Oops, something went wrong.