bug fix
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -39,6 +39,7 @@ using System.Net;
|
||||
using System.Xml;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Script.Serialization;
|
||||
using FileConverterUtils2;
|
||||
using log4net;
|
||||
using log4net.Config;
|
||||
@@ -63,6 +64,20 @@ namespace FileConverterService2
|
||||
}
|
||||
}
|
||||
|
||||
public class ChangesHistoryData
|
||||
{
|
||||
public string userid;
|
||||
public string username;
|
||||
public string date;
|
||||
|
||||
public ChangesHistoryData(string _userId, string _userName, DateTime _date)
|
||||
{
|
||||
userid = _userId;
|
||||
username = _userName;
|
||||
date = _date.ToString(Constants.mc_sDateTimeFormat);
|
||||
}
|
||||
}
|
||||
|
||||
public class FileConverter
|
||||
{
|
||||
private static readonly ILog _log = LogManager.GetLogger(typeof(FileConverter));
|
||||
@@ -387,9 +402,15 @@ namespace FileConverterService2
|
||||
string sChangesAuthor = null;
|
||||
int nIndexFile = 0;
|
||||
StreamWriter oStreamWriter = null;
|
||||
StreamWriter oStreamWriterChangesJSON = null;
|
||||
Ionic.Zip.ZipFile oZipFile = null;
|
||||
try
|
||||
{
|
||||
|
||||
List<ChangesHistoryData> arrChangesHistoryData = new List<ChangesHistoryData>();
|
||||
string strFileNameChange = "";
|
||||
|
||||
oZipFile = new Ionic.Zip.ZipFile();
|
||||
|
||||
for (int i = 0, length = aChanges.Count; i < length; ++i)
|
||||
{
|
||||
if (null == sChangesAuthor || sChangesAuthor != aChanges[i].userid)
|
||||
@@ -403,9 +424,13 @@ namespace FileConverterService2
|
||||
}
|
||||
sChangesAuthor = aChanges[i].userid;
|
||||
|
||||
oStreamWriter = new StreamWriter(Path.Combine(sChangesDir, "changes" + (nIndexFile++) + ".json"));
|
||||
strFileNameChange = Path.Combine(sChangesDir, string.Format("changes{0}.json", nIndexFile++));
|
||||
oZipFile.AddFile(strFileNameChange, "");
|
||||
oStreamWriter = new StreamWriter(strFileNameChange);
|
||||
oStreamWriter.Write("[");
|
||||
oStreamWriter.Write(aChanges[i].data);
|
||||
|
||||
arrChangesHistoryData.Add(new ChangesHistoryData(sChangesAuthor, aChanges[i].username, aChanges[i].date));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -421,6 +446,17 @@ namespace FileConverterService2
|
||||
oStreamWriter.Dispose();
|
||||
oStreamWriter = null;
|
||||
}
|
||||
|
||||
oStreamWriterChangesJSON = new StreamWriter(Path.Combine(sDirResult, "changesHistory.json"));
|
||||
JavaScriptSerializer oJsSerializer = new JavaScriptSerializer();
|
||||
|
||||
oStreamWriterChangesJSON.Write(oJsSerializer.Serialize(arrChangesHistoryData));
|
||||
oStreamWriterChangesJSON.Dispose();
|
||||
oStreamWriterChangesJSON = null;
|
||||
|
||||
oZipFile.Save(Path.Combine(sDirResult, "changes.zip"));
|
||||
oZipFile.Dispose();
|
||||
oZipFile = null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -429,6 +465,10 @@ namespace FileConverterService2
|
||||
{
|
||||
if (null != oStreamWriter)
|
||||
oStreamWriter.Dispose();
|
||||
if (null != oStreamWriterChangesJSON)
|
||||
oStreamWriterChangesJSON.Dispose();
|
||||
if (null != oZipFile)
|
||||
oZipFile.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,19 +75,23 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK, Version=1.3.19.0, Culture=neutral, PublicKeyToken=cd2d24cd2bace800, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\AWSSDK.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FileConverterUtils2, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Bin\FileConverterUtils2.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\FileConverterUtils2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip.Reduced, Version=1.9.1.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\Ionic.Zip.Reduced.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\log4net.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\MySql.Data.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\MySql.Data.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
@@ -115,6 +119,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="Settings.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="AVSGraphics">
|
||||
@@ -135,6 +142,8 @@
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) $(ProjectDir)..\Bin\</PostBuildEvent>
|
||||
<PostBuildEvent>copy $(ProjectDir)..\..\..\wwwroot\Bin\Settings.config $(TargetDir)
|
||||
copy $(ProjectDir)..\..\..\wwwroot\Bin\ConnectionStrings.config $(TargetDir)
|
||||
copy $(TargetPath) $(ProjectDir)..\..\..\wwwroot\Bin\</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -46,5 +46,5 @@ using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: Guid("2f0ef597-725c-4954-976e-9808c513f9a5")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.56")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.56")]
|
||||
[assembly: AssemblyVersion("1.0.0.57")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.57")]
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace FileConverterUtils2
|
||||
{
|
||||
public string data;
|
||||
public string userid;
|
||||
public string username;
|
||||
public DateTime date;
|
||||
}
|
||||
public class DocsChanges
|
||||
{
|
||||
@@ -66,6 +68,8 @@ namespace FileConverterUtils2
|
||||
DocsChange oDocsChange = new DocsChange();
|
||||
oDocsChange.data = Convert.ToString(oReader["dc_data"]);
|
||||
oDocsChange.userid = Convert.ToString(oReader["dc_user_id_original"]);
|
||||
oDocsChange.username = Convert.ToString(oReader["dc_user_name"]);
|
||||
oDocsChange.date = Convert.ToDateTime(oReader["dc_date"]);
|
||||
aChanges.Add(oDocsChange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ namespace FileConverterUtils2
|
||||
public const string mc_sPostgreProvider = "Npgsql";
|
||||
public static System.Globalization.CultureInfo mc_oCultureInfo = new System.Globalization.CultureInfo(0x409);
|
||||
public const string mc_sResourceServiceUrlRel = "/ResourceService.ashx?path=";
|
||||
|
||||
public const string mc_sWebClientUserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)";
|
||||
|
||||
public const string mc_sWebClientUserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2427.7 Safari/537.36";
|
||||
public const int mc_nBufferSize = 1024 * 1024;
|
||||
}
|
||||
public class Utils
|
||||
@@ -659,6 +659,7 @@ namespace FileConverterUtils2
|
||||
public bool embeddedfonts { get; set; }
|
||||
public bool innersave { get; set; }
|
||||
public string userid { get; set; }
|
||||
public bool viewmode { get; set; }
|
||||
|
||||
public int status { get; set; }
|
||||
public int status_info { get; set; }
|
||||
|
||||
@@ -33,35 +33,35 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="ASC.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\ASC.Common.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\ASC.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASC.Core.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\ASC.Core.Common.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\ASC.Core.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AWSSDK, Version=1.5.2.2, Culture=neutral, PublicKeyToken=cd2d24cd2bace800, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\AWSSDK.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Enyim.Caching, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\Enyim.Caching.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\Enyim.Caching.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip.Reduced, Version=1.9.1.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\Ionic.Zip.Reduced.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\Ionic.Zip.Reduced.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\log4net.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\MySql.Data.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenMcdf, Version=1.5.4.22637, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\ThirdParty\Bin\OpenMcdf.dll</HintPath>
|
||||
<HintPath>..\..\..\wwwroot\Bin\OpenMcdf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
@@ -125,6 +125,6 @@
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) $(ProjectDir)..\Bin\</PostBuildEvent>
|
||||
<PostBuildEvent>copy $(TargetPath) $(ProjectDir)..\..\..\wwwroot\Bin\</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -49,6 +49,8 @@ namespace FileConverterUtils2
|
||||
Convertation = 3
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -46,5 +46,5 @@ using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: Guid("9a6d8058-b3ef-4586-8492-0136f44cedd5")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.114")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.114")]
|
||||
[assembly: AssemblyVersion("1.0.0.118")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.118")]
|
||||
|
||||
Reference in New Issue
Block a user