Made a separate ApiInteraction solution with platform-specific builds

pull/702/head
LukePulverenti Luke Pulverenti luke pulverenti 12 years ago
parent 5dd7080084
commit 0fb0d52a4c

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{94CEA07A-307C-4663-AA43-7BD852808574}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.ApiInteraction.Metro</RootNamespace>
<AssemblyName>MediaBrowser.ApiInteraction.Metro</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</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\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
<Name>MediaBrowser.Model</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\MediaBrowser.ApiInteraction\ApiClient.cs">
<Link>ApiClient.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.ApiInteraction\DataSerializer.cs">
<Link>DataSerializer.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="protobuf-net">
<HintPath>..\protobuf-net\Full\netcore45\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text">
<HintPath>..\packages\ServiceStack.Text.3.9.5\lib\sl5\ServiceStack.Text.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

@ -0,0 +1,30 @@
using System.Resources;
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("MediaBrowser.ApiInteraction.Metro")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MediaBrowser.ApiInteraction.Metro")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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")]

@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Model", "MediaBrowser.Model\MediaBrowser.Model.csproj", "{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.ApiInteraction", "MediaBrowser.ApiInteraction\MediaBrowser.ApiInteraction.csproj", "{921C0F64-FDA7-4E9F-9E73-0CB0EEDB2422}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F0E0E64C-2A6F-4E35-9533-D53AC07C2CD1}"
ProjectSection(SolutionItems) = preProject
.nuget\packages.config = .nuget\packages.config
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.ApiInteraction.Metro", "MediaBrowser.ApiInteraction.Metro\MediaBrowser.ApiInteraction.Metro.csproj", "{94CEA07A-307C-4663-AA43-7BD852808574}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Release|Any CPU.Build.0 = Release|Any CPU
{921C0F64-FDA7-4E9F-9E73-0CB0EEDB2422}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{921C0F64-FDA7-4E9F-9E73-0CB0EEDB2422}.Debug|Any CPU.Build.0 = Debug|Any CPU
{921C0F64-FDA7-4E9F-9E73-0CB0EEDB2422}.Release|Any CPU.ActiveCfg = Release|Any CPU
{921C0F64-FDA7-4E9F-9E73-0CB0EEDB2422}.Release|Any CPU.Build.0 = Release|Any CPU
{94CEA07A-307C-4663-AA43-7BD852808574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94CEA07A-307C-4663-AA43-7BD852808574}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94CEA07A-307C-4663-AA43-7BD852808574}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94CEA07A-307C-4663-AA43-7BD852808574}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -18,6 +18,8 @@ namespace MediaBrowser.ApiInteraction
handler.AutomaticDecompression = DecompressionMethods.Deflate;
HttpClient = new HttpClient(handler);
DataSerializer.Configure();
}
/// <summary>
@ -48,24 +50,11 @@ namespace MediaBrowser.ApiInteraction
{
get
{
// First try Protobuf since it has the best performance
if (DataSerializer.CanDeserializeProtobuf)
{
return ApiInteraction.SerializationFormat.Protobuf;
}
// Next best is jsv
if (DataSerializer.CanDeserializeJsv)
{
return ApiInteraction.SerializationFormat.Jsv;
}
return ApiInteraction.SerializationFormat.Json;
return ApiInteraction.SerializationFormat.Jsv;
}
}
public HttpClient HttpClient { get; private set; }
public IDataSerializer DataSerializer { get; set; }
/// <summary>
/// Gets an image url that can be used to download an image from the api
@ -597,7 +586,7 @@ namespace MediaBrowser.ApiInteraction
string url = ApiUrl + "/ServerConfiguration";
// At the moment this can't be retrieved in protobuf format
SerializationFormat format = DataSerializer.CanDeserializeJsv ? SerializationFormat.Jsv : ApiInteraction.SerializationFormat.Json;
SerializationFormat format = SerializationFormat.Jsv;
using (Stream stream = await GetSerializedStreamAsync(url, format).ConfigureAwait(false))
{
@ -613,7 +602,7 @@ namespace MediaBrowser.ApiInteraction
string url = ApiUrl + "/PluginConfiguration?assemblyfilename=" + plugin.AssemblyFileName;
// At the moment this can't be retrieved in protobuf format
SerializationFormat format = DataSerializer.CanDeserializeJsv ? SerializationFormat.Jsv : ApiInteraction.SerializationFormat.Json;
SerializationFormat format = SerializationFormat.Jsv;
using (Stream stream = await GetSerializedStreamAsync(url, format).ConfigureAwait(false))
{
@ -708,7 +697,7 @@ namespace MediaBrowser.ApiInteraction
{
if (format == ApiInteraction.SerializationFormat.Protobuf)
{
return DataSerializer.DeserializeProtobufFromStream(stream, type);
throw new NotImplementedException();
}
if (format == ApiInteraction.SerializationFormat.Jsv)
{
@ -731,11 +720,4 @@ namespace MediaBrowser.ApiInteraction
HttpClient.Dispose();
}
}
public enum SerializationFormat
{
Json,
Jsv,
Protobuf
}
}

@ -0,0 +1,49 @@
using System;
using System.IO;
using ProtoBuf;
using ServiceStack.Text;
namespace MediaBrowser.ApiInteraction
{
public static class DataSerializer
{
public static T DeserializeJsonFromStream<T>(Stream stream)
{
return JsonSerializer.DeserializeFromStream<T>(stream);
}
public static T DeserializeJsvFromStream<T>(Stream stream)
{
return TypeSerializer.DeserializeFromStream<T>(stream);
}
public static object DeserializeJsvFromStream(Stream stream, Type type)
{
return TypeSerializer.DeserializeFromStream(type, stream);
}
public static object DeserializeJsonFromStream(Stream stream, Type type)
{
return JsonSerializer.DeserializeFromStream(type, stream);
}
public static T DeserializeProtobufFromStream<T>(Stream stream)
{
return Serializer.Deserialize<T>(stream);
}
public static void Configure()
{
JsConfig.DateHandler = ServiceStack.Text.JsonDateHandler.ISO8601;
JsConfig.ExcludeTypeInfo = true;
JsConfig.IncludeNullValues = false;
}
}
public enum SerializationFormat
{
Json,
Jsv,
Protobuf
}
}

@ -1,22 +0,0 @@
using System;
using System.IO;
namespace MediaBrowser.ApiInteraction
{
/// <summary>
/// Since ServiceStack Json is not portable, we need to abstract required json functions into an interface
/// </summary>
public interface IDataSerializer
{
T DeserializeJsonFromStream<T>(Stream stream);
T DeserializeJsvFromStream<T>(Stream stream);
T DeserializeProtobufFromStream<T>(Stream stream);
object DeserializeJsonFromStream(Stream stream, Type type);
object DeserializeJsvFromStream(Stream stream, Type type);
object DeserializeProtobufFromStream(Stream stream, Type type);
bool CanDeserializeJsv { get; }
bool CanDeserializeProtobuf { get; }
}
}

@ -4,15 +4,13 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B1C27231-7017-4C9B-A678-DE891954FA38}</ProjectGuid>
<ProjectGuid>{921C0F64-FDA7-4E9F-9E73-0CB0EEDB2422}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.ApiInteraction</RootNamespace>
<AssemblyName>MediaBrowser.ApiInteraction</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -32,18 +30,36 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
<Reference Include="protobuf-net">
<HintPath>..\protobuf-net\Full\net30\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text">
<HintPath>..\packages\ServiceStack.Text.3.9.5\lib\net35\ServiceStack.Text.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ApiClient.cs" />
<Compile Include="DataSerializer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
<Name>MediaBrowser.Model</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="ApiClient.cs" />
<Compile Include="IDataSerializer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<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">

@ -1,5 +1,4 @@
using System.Resources;
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@ -14,7 +13,14 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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("677618f2-de4b-44f4-8dfd-a90176297ee2")]
// Version information for an assembly consists of the following four values:
//

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ServiceStack.Text" version="3.9.5" targetFramework="net45" />
</packages>

@ -39,9 +39,8 @@
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="protobuf-net, Version=2.0.0.580, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\protobuf-net.2.0.0.580\lib\net40\protobuf-net.dll</HintPath>
<Reference Include="protobuf-net">
<HintPath>..\protobuf-net\Full\net30\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=3.9.5.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MahApps.Metro" version="0.9.0.0" targetFramework="net45" />
<package id="protobuf-net" version="2.0.0.580" targetFramework="net45" />
<package id="Rx-Core" version="2.0.20823" targetFramework="net45" />
<package id="Rx-Interfaces" version="2.0.20823" targetFramework="net45" />
<package id="Rx-Linq" version="2.0.20823" targetFramework="net45" />

@ -30,9 +30,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="protobuf-net, Version=2.0.0.580, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\protobuf-net.2.0.0.580\lib\net40\protobuf-net.dll</HintPath>
<Reference Include="protobuf-net">
<HintPath>..\protobuf-net\Full\net30\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="protobuf-net" version="2.0.0.580" targetFramework="net45" />
<package id="Rx-Core" version="2.0.20823" targetFramework="net45" />
<package id="Rx-Interfaces" version="2.0.20823" targetFramework="net45" />
<package id="Rx-Linq" version="2.0.20823" targetFramework="net45" />

@ -65,7 +65,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="protobuf-net">
<HintPath>..\packages\protobuf-net.2.0.0.580\lib\sl4\protobuf-net.dll</HintPath>
<HintPath>..\protobuf-net\Full\portable\protobuf-net.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />

@ -15,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Common", "Medi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Model", "MediaBrowser.Model\MediaBrowser.Model.csproj", "{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.ApiInteraction", "MediaBrowser.ApiInteraction\MediaBrowser.ApiInteraction.csproj", "{B1C27231-7017-4C9B-A678-DE891954FA38}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.ServerApplication", "MediaBrowser.ServerApplication\MediaBrowser.ServerApplication.csproj", "{156EA256-AD2D-4D2F-B116-2ED4B9EFD869}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.WebDashboard", "MediaBrowser.WebDashboard\MediaBrowser.WebDashboard.csproj", "{5624B7B5-B5A7-41D8-9F10-CC5611109619}"
@ -68,15 +66,8 @@ Global
{92B9F802-4415-438F-90E1-44602135EA41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92B9F802-4415-438F-90E1-44602135EA41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92B9F802-4415-438F-90E1-44602135EA41}.Release|Any CPU.Build.0 = Release|Any CPU
{B1C27231-7017-4C9B-A678-DE891954FA38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1C27231-7017-4C9B-A678-DE891954FA38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1C27231-7017-4C9B-A678-DE891954FA38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1C27231-7017-4C9B-A678-DE891954FA38}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal

Binary file not shown.

Binary file not shown.

@ -0,0 +1,118 @@
/* Body style, for the entire document */
body
{
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1
{
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2
{
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3
{
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a
{
color: #1382CE;
}
/* Table styles */
table
{
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th
{
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td
{
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink
{
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover
{
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered
{
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell
{
width: 100%;
}
/* Padding around the content after the h1 */
#content
{
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table
{
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table
{
width: 97%;
}

@ -0,0 +1,538 @@
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:output omit-xml-declaration="yes" />
<!-- Keys -->
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<!-- String split template -->
<xsl:template name="SplitString">
<xsl:param name="source" select="''" />
<xsl:param name="separator" select="','" />
<xsl:if test="not($source = '' or $separator = '')">
<xsl:variable name="head" select="substring-before(concat($source, $separator), $separator)" />
<xsl:variable name="tail" select="substring-after($source, $separator)" />
<part>
<xsl:value-of select="$head"/>
</part>
<xsl:call-template name="SplitString">
<xsl:with-param name="source" select="$tail" />
<xsl:with-param name="separator" select="$separator" />
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Intermediate Templates -->
<xsl:template match="UpgradeReport" mode="ProjectOverviewXML">
<Projects>
<xsl:for-each select="Event[generate-id(.) = generate-id(key('ProjectKey', @Project))]">
<Project>
<xsl:variable name="pNode" select="current()" />
<xsl:variable name="errorCount" select="count(../Event[@Project = current()/@Project and @ErrorLevel=2])" />
<xsl:variable name="warningCount" select="count(../Event[@Project = current()/@Project and @ErrorLevel=1])" />
<xsl:variable name="messageCount" select="count(../Event[@Project = current()/@Project and @ErrorLevel=0])" />
<xsl:variable name="pathSplitSeparator">
<xsl:text>\</xsl:text>
</xsl:variable>
<xsl:variable name="projectName">
<xsl:choose>
<xsl:when test="@Project = ''">Solution</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Project"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="IsSolution">
<xsl:value-of select="@Project = ''"/>
</xsl:attribute>
<xsl:attribute name="Project">
<xsl:value-of select="$projectName"/>
</xsl:attribute>
<xsl:attribute name="ProjectDisplayName">
<!-- Sometimes it is possible to have project name set to a path over a real project name,
we split the string on '\' and if we end up with >1 part in the resulting tokens set
we format the ProjectDisplayName as ..\prior\last -->
<xsl:variable name="pathTokens">
<xsl:call-template name="SplitString">
<xsl:with-param name="source" select="$projectName" />
<xsl:with-param name="separator" select="$pathSplitSeparator" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="count(msxsl:node-set($pathTokens)/part) > 1">
<xsl:value-of select="concat('..', $pathSplitSeparator, msxsl:node-set($pathTokens)/part[last() - 1], $pathSplitSeparator, msxsl:node-set($pathTokens)/part[last()])"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$projectName"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="ProjectSafeName">
<xsl:value-of select="translate($projectName, '\', '-')"/>
</xsl:attribute>
<xsl:attribute name="Solution">
<xsl:value-of select="/UpgradeReport/Properties/Property[@Name='Solution']/@Value"/>
</xsl:attribute>
<xsl:attribute name="Source">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:attribute name="Status">
<xsl:choose>
<xsl:when test="$errorCount > 0">Error</xsl:when>
<xsl:when test="$warningCount > 0">Warning</xsl:when>
<xsl:otherwise>Success</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="ErrorCount">
<xsl:value-of select="$errorCount" />
</xsl:attribute>
<xsl:attribute name="WarningCount">
<xsl:value-of select="$warningCount" />
</xsl:attribute>
<xsl:attribute name="MessageCount">
<xsl:value-of select="$messageCount" />
</xsl:attribute>
<xsl:attribute name="TotalCount">
<xsl:value-of select="$errorCount + $warningCount + $messageCount"/>
</xsl:attribute>
<xsl:for-each select="../Event[@Project = $pNode/@Project and @ErrorLevel=3]">
<ConversionStatus>
<xsl:value-of select="@Description"/>
</ConversionStatus>
</xsl:for-each>
<Messages>
<xsl:for-each select="../Event[@Project = $pNode/@Project and @ErrorLevel&lt;3]">
<Message>
<xsl:attribute name="Level">
<xsl:value-of select="@ErrorLevel" />
</xsl:attribute>
<xsl:attribute name="Status">
<xsl:choose>
<xsl:when test="@ErrorLevel = 0">Message</xsl:when>
<xsl:when test="@ErrorLevel = 1">Warning</xsl:when>
<xsl:when test="@ErrorLevel = 2">Error</xsl:when>
<xsl:otherwise>Message</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Source">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:attribute name="Message">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</Message>
</xsl:for-each>
</Messages>
</Project>
</xsl:for-each>
</Projects>
</xsl:template>
<!-- Project Overview template -->
<xsl:template match="Projects" mode="ProjectOverview">
<table>
<tr>
<th></th>
<th _locID="ProjectTableHeader">Project</th>
<th _locID="PathTableHeader">Path</th>
<th _locID="ErrorsTableHeader">Errors</th>
<th _locID="WarningsTableHeader">Warnings</th>
<th _locID="MessagesTableHeader">Messages</th>
</tr>
<xsl:for-each select="Project">
<xsl:sort select="@ErrorCount" order="descending" />
<xsl:sort select="@WarningCount" order="descending" />
<!-- Always make solution last within a group -->
<xsl:sort select="@IsSolution" order="ascending" />
<xsl:sort select="@ProjectSafeName" order="ascending" />
<tr>
<td>
<img width="16" height="16">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="@Status = 'Error'">_UpgradeReport_Files\UpgradeReport_Error.png</xsl:when>
<xsl:when test="@Status = 'Warning'">_UpgradeReport_Files\UpgradeReport_Warning.png</xsl:when>
<xsl:when test="@Status = 'Success'">_UpgradeReport_Files\UpgradeReport_Success.png</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="@Status" />
</xsl:attribute>
</img>
</td>
<td>
<strong>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#', @ProjectSafeName)"/>
</xsl:attribute>
<xsl:value-of select="@ProjectDisplayName" />
</a>
</strong>
</td>
<td>
<xsl:value-of select="@Source" />
</td>
<td class="textCentered">
<a>
<xsl:if test="@ErrorCount > 0">
<xsl:attribute name="href">
<xsl:value-of select="concat('#', @ProjectSafeName, 'Error')"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@ErrorCount" />
</a>
</td>
<td class="textCentered">
<a>
<xsl:if test="@WarningCount > 0">
<xsl:attribute name="href">
<xsl:value-of select="concat('#', @ProjectSafeName, 'Warning')"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@WarningCount" />
</a>
</td>
<td class="textCentered">
<a href="#">
<xsl:if test="@MessageCount > 0">
<xsl:attribute name="onclick">
<xsl:variable name="apos">
<xsl:text>'</xsl:text>
</xsl:variable>
<xsl:variable name="JS" select="concat('ScrollToFirstVisibleMessage(', $apos, @ProjectSafeName, $apos, ')')" />
<xsl:value-of select="concat($JS, '; return false;')"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@MessageCount" />
</a>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<!-- Show messages row -->
<xsl:template match="Project" mode="ProjectShowMessages">
<tr>
<xsl:attribute name="name">
<xsl:value-of select="concat('MessageRowHeaderShow', @ProjectSafeName)"/>
</xsl:attribute>
<td>
<img width="16" height="16" src="_UpgradeReport_Files\UpgradeReport_Information.png" />
</td>
<td class="messageCell">
<xsl:variable name="apos">
<xsl:text>'</xsl:text>
</xsl:variable>
<xsl:variable name="toggleRowsJS" select="concat('ToggleMessageVisibility(', $apos, @ProjectSafeName, $apos, ')')" />
<a _locID="ShowAdditionalMessages" href="#">
<xsl:attribute name="name">
<xsl:value-of select="concat(@ProjectSafeName, 'Message')"/>
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:value-of select="concat($toggleRowsJS, '; return false;')"/>
</xsl:attribute>
Show <xsl:value-of select="@MessageCount" /> additional messages
</a>
</td>
</tr>
</xsl:template>
<!-- Hide messages row -->
<xsl:template match="Project" mode="ProjectHideMessages">
<tr style="display: none">
<xsl:attribute name="name">
<xsl:value-of select="concat('MessageRowHeaderHide', @ProjectSafeName)"/>
</xsl:attribute>
<td>
<img width="16" height="16" src="_UpgradeReport_Files\UpgradeReport_Information.png" />
</td>
<td class="messageCell">
<xsl:variable name="apos">
<xsl:text>'</xsl:text>
</xsl:variable>
<xsl:variable name="toggleRowsJS" select="concat('ToggleMessageVisibility(', $apos, @ProjectSafeName, $apos, ')')" />
<a _locID="HideAdditionalMessages" href="#">
<xsl:attribute name="name">
<xsl:value-of select="concat(@ProjectSafeName, 'Message')"/>
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:value-of select="concat($toggleRowsJS, '; return false;')"/>
</xsl:attribute>
Hide <xsl:value-of select="@MessageCount" /> additional messages
</a>
</td>
</tr>
</xsl:template>
<!-- Message row templates -->
<xsl:template match="Message">
<tr>
<xsl:attribute name="name">
<xsl:value-of select="concat(@Status, 'RowClass', ../../@ProjectSafeName)"/>
</xsl:attribute>
<xsl:if test="@Level = 0">
<xsl:attribute name="style">display: none</xsl:attribute>
</xsl:if>
<td>
<a>
<xsl:attribute name="name">
<xsl:value-of select="concat(../../@ProjectSafeName, @Status)"/>
</xsl:attribute>
</a>
<img width="16" height="16">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="@Status = 'Error'">_UpgradeReport_Files\UpgradeReport_Error.png</xsl:when>
<xsl:when test="@Status = 'Warning'">_UpgradeReport_Files\UpgradeReport_Warning.png</xsl:when>
<xsl:when test="@Status = 'Message'">_UpgradeReport_Files\UpgradeReport_Information.png</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="@Status" />
</xsl:attribute>
</img>
</td>
<td class="messageCell">
<strong>
<xsl:value-of select="@Source"/>:
</strong>
<span>
<xsl:value-of select="@Message"/>
</span>
</td>
</tr>
</xsl:template>
<!-- Project Details Template -->
<xsl:template match="Projects" mode="ProjectDetails">
<xsl:for-each select="Project">
<xsl:sort select="@ErrorCount" order="descending" />
<xsl:sort select="@WarningCount" order="descending" />
<!-- Always make solution last within a group -->
<xsl:sort select="@IsSolution" order="ascending" />
<xsl:sort select="@ProjectSafeName" order="ascending" />
<a>
<xsl:attribute name="name">
<xsl:value-of select="@ProjectSafeName"/>
</xsl:attribute>
</a>
<h3>
<xsl:value-of select="@ProjectDisplayName"/>
</h3>
<table>
<tr>
<xsl:attribute name="id">
<xsl:value-of select="concat(@ProjectSafeName, 'HeaderRow')"/>
</xsl:attribute>
<th></th>
<th class="messageCell" _locID="MessageTableHeader">Message</th>
</tr>
<!-- Errors and warnings -->
<xsl:for-each select="Messages/Message[@Level &gt; 0]">
<xsl:sort select="@Level" order="descending" />
<xsl:apply-templates select="." />
</xsl:for-each>
<xsl:if test="@MessageCount > 0">
<xsl:apply-templates select="." mode="ProjectShowMessages" />
</xsl:if>
<!-- Messages -->
<xsl:for-each select="Messages/Message[@Level = 0]">
<xsl:apply-templates select="." />
</xsl:for-each>
<xsl:choose>
<!-- Additional row as a 'place holder' for 'Show/Hide' additional messages -->
<xsl:when test="@MessageCount > 0">
<xsl:apply-templates select="." mode="ProjectHideMessages" />
</xsl:when>
<!-- No messages at all, show blank row -->
<xsl:when test="@TotalCount = 0">
<tr>
<td>
<img width="16" height="16" src="_UpgradeReport_Files\UpgradeReport_Information.png" />
</td>
<td class="messageCell" _locID="NoMessagesRow">
<xsl:value-of select="@ProjectDisplayName" /> logged no messages.
</td>
</tr>
</xsl:when>
</xsl:choose>
</table>
</xsl:for-each>
</xsl:template>
<!-- Document, matches "UpgradeReport" -->
<xsl:template match="UpgradeReport">
<!-- Output doc type the 'Mark of the web' which disabled prompting to run JavaScript from local HTML Files in IE -->
<!-- NOTE: The whitespace around the 'Mark of the web' is important it must be exact -->
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
]]>
</xsl:text>
<html>
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<link type="text/css" rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title _locID="ConversionReport0">
Migration Report
</title>
<script type="text/javascript" language="javascript">
<xsl:text disable-output-escaping="yes">
<![CDATA[
// Startup
// Hook up the the loaded event for the document/window, to linkify the document content
var startupFunction = function() { linkifyElement("messages"); };
if(window.attachEvent)
{
window.attachEvent('onload', startupFunction);
}
else if (window.addEventListener)
{
window.addEventListener('load', startupFunction, false);
}
else
{
document.addEventListener('load', startupFunction, false);
}
// Toggles the visibility of table rows with the specified name
function toggleTableRowsByName(name)
{
var allRows = document.getElementsByTagName('tr');
for (i=0; i < allRows.length; i++)
{
var currentName = allRows[i].getAttribute('name');
if(!!currentName && currentName.indexOf(name) == 0)
{
var isVisible = allRows[i].style.display == '';
isVisible ? allRows[i].style.display = 'none' : allRows[i].style.display = '';
}
}
}
function scrollToFirstVisibleRow(name)
{
var allRows = document.getElementsByTagName('tr');
for (i=0; i < allRows.length; i++)
{
var currentName = allRows[i].getAttribute('name');
var isVisible = allRows[i].style.display == '';
if(!!currentName && currentName.indexOf(name) == 0 && isVisible)
{
allRows[i].scrollIntoView(true);
return true;
}
}
return false;
}
// Linkifies the specified text content, replaces candidate links with html links
function linkify(text)
{
if(!text || 0 === text.length)
{
return text;
}
// Find {DriveLetter}:\Something or \\{uncshare}\something strings and replace them with file:/// links
// It expects that a path ends in .extension, and that that extension does not have a space within it,
// it does this as not to greedily match in the case of "Text C:\foo\file.txt some other text"
var filePath = /([A-z]\:|\\{2}[A-z].+)\\([^<]+)\.([^<\s]+)/gi;
// Find http, https and ftp links and replace them with hyper links
var urlLink = /(http|https|ftp)\:\/\/[a-zA-Z0-9\-\.]+(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9\-\._\?\,\/\\\+&%\$#\=~;\{\}])*/gi;
return text.replace(filePath, '<a class="localLink" href="file:///$&">$&</a>')
.replace(urlLink, '<a href="$&">$&</a>') ;
}
// Linkifies the specified element by ID
function linkifyElement(id)
{
var element = document.getElementById(id);
if(!!element)
{
element.innerHTML = linkify(element.innerHTML);
}
}
function ToggleMessageVisibility(projectName)
{
if(!projectName || 0 === projectName.length)
{
return;
}
toggleTableRowsByName("MessageRowClass" + projectName);
toggleTableRowsByName('MessageRowHeaderShow' + projectName);
toggleTableRowsByName('MessageRowHeaderHide' + projectName);
}
function ScrollToFirstVisibleMessage(projectName)
{
if(!projectName || 0 === projectName.length)
{
return;
}
// First try the 'Show messages' row
if(!scrollToFirstVisibleRow('MessageRowHeaderShow' + projectName))
{
// Failed to find a visible row for 'Show messages', try an actual message row
scrollToFirstVisibleRow('MessageRowClass' + projectName);
}
}
]]>
</xsl:text>
</script>
</head>
<body>
<h1 _locID="ConversionReport">
Migration Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/>
</h1>
<div id="content">
<h2 _locID="OverviewTitle">Overview</h2>
<xsl:variable name="projectOverview">
<xsl:apply-templates select="self::node()" mode="ProjectOverviewXML" />
</xsl:variable>
<div id="overview">
<xsl:apply-templates select="msxsl:node-set($projectOverview)/*" mode="ProjectOverview" />
</div>
<h2 _locID="SolutionAndProjectsTitle">Solution and projects</h2>
<div id="messages">
<xsl:apply-templates select="msxsl:node-set($projectOverview)/*" mode="ProjectDetails" />
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Loading…
Cancel
Save