Merge branch 'release/1.0.0' of github.com:ONLYOFFICE/AppServer into bugfix/tile-view
This commit is contained in:
commit
80d9471f7a
@ -515,6 +515,7 @@ namespace ASC.Files.Core.Data
|
||||
|
||||
var toInsert = FilesDbContext.Tree
|
||||
.Where(r => r.FolderId == toFolderId)
|
||||
.OrderBy(r => r.Level)
|
||||
.ToList();
|
||||
|
||||
foreach (var subfolder in subfolders)
|
||||
@ -525,7 +526,7 @@ namespace ASC.Files.Core.Data
|
||||
{
|
||||
FolderId = subfolder.Key,
|
||||
ParentId = f.ParentId,
|
||||
Level = f.Level + 1
|
||||
Level = subfolder.Value + 1 + f.Level
|
||||
};
|
||||
FilesDbContext.AddOrUpdate(r => r.Tree, newTree);
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ using ASC.Common.Threading;
|
||||
using ASC.Common.Web;
|
||||
using ASC.Core.Tenants;
|
||||
using ASC.Files.Core;
|
||||
using ASC.Files.Core.EF;
|
||||
using ASC.Files.Core.Resources;
|
||||
using ASC.MessagingSystem;
|
||||
using ASC.Web.Core.Files;
|
||||
@ -116,11 +117,44 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
stream,
|
||||
MimeMapping.GetMimeMapping(path),
|
||||
"attachment; filename=\"" + fileName + "\"");
|
||||
Result = string.Format("{0}?{1}=bulk&ext={2}", filesLinkUtility.FileHandlerPath, FilesLinkUtility.Action, archiveExtension);
|
||||
Result = string.Format("{0}?{1}=bulk&ext={2}", filesLinkUtility.FileHandlerPath, FilesLinkUtility.Action, archiveExtension);
|
||||
|
||||
TaskInfo.SetProperty(PROGRESS, 100);
|
||||
TaskInfo.SetProperty(RESULT, Result);
|
||||
TaskInfo.SetProperty(FINISHED, true);
|
||||
|
||||
}
|
||||
|
||||
FillDistributedTask();
|
||||
TaskInfo.PublishChanges();
|
||||
}
|
||||
|
||||
public override void PublishChanges(DistributedTask task)
|
||||
{
|
||||
var thirdpartyTask = ThirdPartyOperation.GetDistributedTask();
|
||||
var daoTask = DaoOperation.GetDistributedTask();
|
||||
|
||||
var error1 = thirdpartyTask.GetProperty<string>(ERROR);
|
||||
var error2 = daoTask.GetProperty<string>(ERROR);
|
||||
|
||||
if (!string.IsNullOrEmpty(error1))
|
||||
{
|
||||
Error = error1;
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(error2))
|
||||
{
|
||||
Error = error2;
|
||||
}
|
||||
|
||||
successProcessed = thirdpartyTask.GetProperty<int>(PROCESSED) + daoTask.GetProperty<int>(PROCESSED);
|
||||
|
||||
var progressSteps = ThirdPartyOperation.Total + DaoOperation.Total + 1;
|
||||
|
||||
var progress = (int)(successProcessed / (double)progressSteps * 100);
|
||||
|
||||
base.FillDistributedTask();
|
||||
|
||||
TaskInfo.SetProperty(PROGRESS, progress < 100 ? progress : progress);
|
||||
TaskInfo.PublishChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +179,8 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
{
|
||||
if (!Files.Any() && !Folders.Any()) return;
|
||||
|
||||
entriesPathId = GetEntriesPathId(scope);
|
||||
entriesPathId = GetEntriesPathId(scope);
|
||||
|
||||
if (entriesPathId == null || entriesPathId.Count == 0)
|
||||
{
|
||||
if (Files.Count > 0)
|
||||
@ -156,7 +191,11 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
throw new DirectoryNotFoundException(FilesCommonResource.ErrorMassage_FolderNotFound);
|
||||
}
|
||||
|
||||
ReplaceLongPath(entriesPathId);
|
||||
ReplaceLongPath(entriesPathId);
|
||||
|
||||
Total = entriesPathId.Count;
|
||||
|
||||
TaskInfo.PublishChanges();
|
||||
}
|
||||
|
||||
private ItemNameValueCollection<T> ExecPathFromFile(IServiceScope scope, File<T> file, string path)
|
||||
@ -236,7 +275,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
}
|
||||
return entriesPathId;
|
||||
}
|
||||
|
||||
|
||||
internal void CompressToZip(Stream stream, IServiceScope scope)
|
||||
{
|
||||
if (entriesPathId == null) return;
|
||||
@ -345,6 +384,15 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
}
|
||||
compressTo.CloseEntry();
|
||||
counter++;
|
||||
|
||||
if (!Equals(entryId, default(T)) && file != null)
|
||||
{
|
||||
ProcessedFile(entryId);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessedFolder(default(T));
|
||||
}
|
||||
}
|
||||
|
||||
ProgressStep();
|
||||
|
@ -149,7 +149,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
base.FillDistributedTask();
|
||||
}
|
||||
|
||||
public void PublishChanges(DistributedTask task)
|
||||
public virtual void PublishChanges(DistributedTask task)
|
||||
{
|
||||
var thirdpartyTask = ThirdPartyOperation.GetDistributedTask();
|
||||
var daoTask = DaoOperation.GetDistributedTask();
|
||||
|
@ -11,7 +11,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AppLimit.CloudComputing.SharpBox" Version="1.1.0.456" />
|
||||
<PackageReference Include="AppLimit.CloudComputing.SharpBox" Version="1.1.0.457" />
|
||||
<PackageReference Include="Autofac" Version="6.0.0" />
|
||||
<PackageReference Include="Autofac.Configuration" Version="6.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user