Skip to content

Commit

Permalink
release 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pofider committed Mar 30, 2015
1 parent 58248fc commit d7651c5
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 64 deletions.
2 changes: 1 addition & 1 deletion jsreport/NugetPack.cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
call .\.nuget\nuget pack -sym jsreport.Client.nuspec -Symbols -Version %1 -OutputDirectory Packages
call .\.nuget\nuget pack -sym jsreport.Embedded.nuspec -Symbols -Version %1 -OutputDirectory Packages
2 changes: 1 addition & 1 deletion jsreport/jsreport.Client.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<package id="Microsoft.OData.Edm" version="6.10.0" targetFramework="net45" />
<package id="Microsoft.Spatial" version="6.10.0" targetFramework="net45" />
<package id="NUnit" version="2.6.3" targetFramework="net45" />
<package id="Simple.OData.Client" version="4.2.1" targetFramework="net45" />
<package id="Simple.OData.Client" version="4.3.0" targetFramework="net45" />
<package id="System.Spatial" version="5.6.3" targetFramework="net45" />
</packages>
2 changes: 1 addition & 1 deletion jsreport/jsreport.Client.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency id="Microsoft.Net.Http" version="2.2.18" />
<dependency id="Microsoft.Bcl.Async" version="1.0.168"/>
<dependency id="Newtonsoft.Json" version="6.0.1"/>
<dependency id="Simple.OData.Client" version="[4.2.1]"/>
<dependency id="Simple.OData.Client" version="[4.3.0]"/>
</dependencies>
</metadata>
<files>
Expand Down
5 changes: 0 additions & 5 deletions jsreport/jsreport.Client/Entities/Template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ public Template()
/// </summary>
public string shortid { get; set; }

/// <summary>
/// Used only when rendering in https://playground.jsreport.nets
/// </summary>
public int version { get; set; }

/// <summary>
/// Content of report, most often this is html with javasript templating engines
/// </summary>
Expand Down
10 changes: 0 additions & 10 deletions jsreport/jsreport.Client/IReportingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ public interface IReportingService
/// <exception cref="JsReportException"></exception>
/// <returns>Report result promise</returns>
Task<Report> RenderAsync(string templateShortid, string jsonData);

/// <summary>
/// The simpliest rendering using template shortid and input data used with https://playground.jsreport.net
/// </summary>
/// <param name="templateShortid">template shortid can be taken from jsreport playground studio</param>
/// <param name="data">any json serializable object</param>
/// <param name="version">template version number taken from playground</param>
/// <exception cref="JsReportException"></exception>
/// <returns>Report result promise</returns>
Task<Report> RenderAsync(string templateShortid, int version, object data);

/// <summary>
/// Overload for more sophisticated rendering.
Expand Down
1 change: 1 addition & 0 deletions jsreport/jsreport.Client/JsReportWebHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ private static void ParseRequestHeaders(HttpContext context, HttpWebRequest requ

if (ReportingService.Username != null)
{
request.Headers.Remove("Authorization");
request.Headers.Add("Authorization", "Basic " + System.Convert.ToBase64String(
Encoding.UTF8.GetBytes(String.Format("{0}:{1}", ReportingService.Username, ReportingService.Password))));
}
Expand Down
4 changes: 2 additions & 2 deletions jsreport/jsreport.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// 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("0.1.3.0")]
[assembly: AssemblyFileVersion("0.1.3.0")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
2 changes: 0 additions & 2 deletions jsreport/jsreport.Client/RenderRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ internal void CopyDynamicAttributes()
if (template.phantom != null)
dynamicTemplate.phantom = template.phantom;

dynamicTemplate.version = template.version;

if (template.additional != null)
{
foreach (var p in template.additional.GetType().GetRuntimeProperties())
Expand Down
27 changes: 8 additions & 19 deletions jsreport/jsreport.Client/ReportingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,6 @@ public Task<Report> RenderAsync(string templateShortid, string jsonData)
return RenderAsync(templateShortid, string.IsNullOrEmpty(jsonData) ? (object) null : JObject.Parse(jsonData));
}

/// <summary>
/// The simpliest rendering using template shortid and input data used with https://playground.jsreport.net
/// </summary>
/// <param name="templateShortid">template shortid can be taken from jsreport playground studio</param>
/// <param name="data">any json serializable object</param>
/// <param name="version">template version number taken from playground</param>
/// <exception cref="JsReportException"></exception>
/// <returns>Report result promise</returns>
public async Task<Report> RenderAsync(string templateShortid, int version, object data)
{
return await RenderAsync(new RenderRequest()
{
template = new Template() { shortid = templateShortid, version = version},
data = data
}).ConfigureAwait(false);
}

/// <summary>
/// Overload for more sophisticated rendering.
/// </summary>
Expand Down Expand Up @@ -241,13 +224,18 @@ public ODataClient CreateODataClient()
public async Task SynchronizeTemplatesAsync()
{
await EnsureVersion();
await SynchronizeTemplatesAsyncInner();
}

private async Task SynchronizeTemplatesAsyncInner()
{
string path = ReportsDirectory;

ODataClient client = CreateODataClient();

await SynchronizeImagesAsync(client, path).ConfigureAwait(false);
await SynchronizeSchemasAsync(client, path).ConfigureAwait(false);

foreach (string reportFilePath in ValidateUniquenes(Directory.GetFiles(path, "*.jsrep", SearchOption.AllDirectories)))
{
string reportName = Path.GetFileNameWithoutExtension(reportFilePath);
Expand All @@ -270,7 +258,7 @@ public async Task SynchronizeTemplatesAsync()
operation.recipe = reportDefinition.Recipe;

if (!string.IsNullOrEmpty(reportDefinition.SampleData))
operation.data = new {shortid = reportDefinition.SampleData};
operation.data = new { shortid = reportDefinition.SampleData };

operation.content = content;
operation.helpers = helpers;
Expand Down Expand Up @@ -357,6 +345,7 @@ private async Task SynchronizeImagesAsync(ODataClient client, string path)
dynamic operation = new ExpandoObject();
operation.content = File.ReadAllBytes(imagePath);
operation.shortid = imageName;
operation.contentType = "image/png";
operation.name = operation.shortid;

var image = await (client.For<Image>().Filter(x => x.name == imageName).FindEntryAsync()).ConfigureAwait(false);
Expand Down
41 changes: 30 additions & 11 deletions jsreport/jsreport.Client/jsreport.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>4a4505db</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -57,6 +58,23 @@
<Compile Include="VSConfiguration\VSReportingConfiguration.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Data.Edm, Version=5.6.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Data.Edm.5.6.3\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Data.OData.5.6.3\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.OData.Core">
<HintPath>..\packages\Microsoft.OData.Core.6.10.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.OData.Edm">
<HintPath>..\packages\Microsoft.OData.Edm.6.10.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Spatial">
<HintPath>..\packages\Microsoft.Spatial.6.10.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
Expand All @@ -72,26 +90,30 @@
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Simple.OData.Client.Net40, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Simple.OData.Client.Net40, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Simple.OData.Client.4.2.1\lib\net40\Simple.OData.Client.Net40.dll</HintPath>
<HintPath>..\packages\Simple.OData.Client.4.3.0\lib\net40\Simple.OData.Client.Net40.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
<HintPath>..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
<HintPath>..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Spatial, Version=5.6.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.Spatial.5.6.3\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand All @@ -114,12 +136,9 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.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">
Expand Down
15 changes: 11 additions & 4 deletions jsreport/jsreport.Client/packages.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="portable-win+net45+wp80" />
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="portable-win+net45+wp80" />
<package id="Microsoft.Net.Http" version="2.2.18" targetFramework="portable-win+net45+wp80" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.6.3" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.3" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.OData.Core" version="6.10.0" targetFramework="net45" />
<package id="Microsoft.OData.Edm" version="6.10.0" targetFramework="net45" />
<package id="Microsoft.Spatial" version="6.10.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="portable-net45+win+wp80" />
<package id="Simple.OData.Client" version="4.2.1" targetFramework="portable-net45+win+wp80" />
<package id="Simple.OData.Client" version="4.3.0" targetFramework="net45" />
<package id="System.Spatial" version="5.6.3" targetFramework="net45" />
</packages>
2 changes: 1 addition & 1 deletion jsreport/jsreport.Embedded.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net45" />
<package id="NUnit" version="2.6.3" targetFramework="net45" />
<package id="Simple.OData.Client" version="3.0.2" targetFramework="net45" />
<package id="Simple.OData.Client" version="4.3.0" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions jsreport/jsreport.Embedded.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<dependencies>
<dependency id="DotNetZip" version="1.9.3"/>
<dependency id="Microsoft.Bcl.Async" version="1.0.168"/>
<dependency id="jsreport.Client" version="0.1.3"/>
<dependency id="Simple.OData.Client" version="[4.2.1]"/>
<dependency id="jsreport.Client" version="0.3.0"/>
<dependency id="Simple.OData.Client" version="[4.3.0]"/>
</dependencies>
</metadata>
<files>
Expand Down
2 changes: 1 addition & 1 deletion jsreport/jsreport.Embedded/EmbeddedReportingServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace jsreport.Embedded
/// </summary>
public class EmbeddedReportingServer : IEmbeddedReportingServer
{
public const string PACKAGE_VERSION = "0.2.3";
public const string PACKAGE_VERSION = "0.3.0";
private readonly long _port;
private bool _disposed;
private bool _stopped = true;
Expand Down
4 changes: 2 additions & 2 deletions jsreport/jsreport.Embedded/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("0.1.3.0")]
[assembly: AssemblyFileVersion("0.1.3.0")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
4 changes: 4 additions & 0 deletions jsreport/jsreport.Embedded/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.22.0" newVersion="4.2.22.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.22.0" newVersion="2.2.22.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup></configuration>
Binary file modified jsreport/jsreport.Embedded/jsreport-net-embedded.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion jsreport/jsreport.Embedded/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.1" targetFramework="net45" />
<package id="Simple.OData.Client" version="4.2.1" targetFramework="net45" />
<package id="Simple.OData.Client" version="4.3.0" targetFramework="net45" />
</packages>
2 changes: 1 addition & 1 deletion jsreport/jsreport.MVC.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<tags>jsreport asp.net mvc</tags>
<dependencies>
<dependency id="Microsoft.AspNet.Mvc" version="5.0.0" />
<dependency id="jsreport.Client" version="0.1.2"/>
<dependency id="jsreport.Client" version="0.3.0"/>
<dependency id="Microsoft.Bcl.Async" version="1.0.168"/>
</dependencies>
</metadata>
Expand Down

0 comments on commit d7651c5

Please sign in to comment.