|
3 | 3 | using System.Collections.Generic; |
4 | 4 | using System.Collections.Specialized; |
5 | 5 | using System.Text; |
| 6 | +using Atom.Core; |
6 | 7 | using BaiRong.Core; |
7 | 8 | using BaiRong.Core.IO; |
8 | 9 | using BaiRong.Core.Model.Enumerations; |
@@ -256,6 +257,34 @@ public void ImportChannelsAndContentsByZipFile(int parentId, string zipFilePath, |
256 | 257 | ImportChannelsAndContentsFromZip(parentId, siteContentDirectoryPath, isOverride); |
257 | 258 |
|
258 | 259 | DataProvider.NodeDao.UpdateContentNum(Fso.PublishmentSystemInfo); |
| 260 | + |
| 261 | + string filePath = PathUtils.Combine(siteContentDirectoryPath, BackupUtility.UploadFolderName, BackupUtility.UploadFileName); |
| 262 | + var UploadFolderPath = PathUtils.Combine(siteContentDirectoryPath, BackupUtility.UploadFolderName); |
| 263 | + var UploadFilePath = PathUtils.Combine(UploadFolderPath, BackupUtility.UploadFileName); |
| 264 | + if (!FileUtils.IsFileExists(UploadFilePath)) |
| 265 | + { |
| 266 | + return; |
| 267 | + } |
| 268 | + var feed = AtomFeed.Load(FileUtils.GetFileStreamReadOnly(UploadFilePath)); |
| 269 | + if (feed != null) |
| 270 | + { |
| 271 | + AtomEntry entry = feed.Entries[0]; |
| 272 | + string imageUploadDirectoryPath = AtomUtility.GetDcElementContent(entry.AdditionalElements, "ImageUploadDirectoryName"); |
| 273 | + if(imageUploadDirectoryPath != null) |
| 274 | + { |
| 275 | + DirectoryUtils.MoveDirectory(PathUtils.Combine(siteContentDirectoryPath, imageUploadDirectoryPath), PathUtils.Combine(Fso.PublishmentSystemPath, Fso.PublishmentSystemInfo.Additional.ImageUploadDirectoryName), isOverride); |
| 276 | + } |
| 277 | + string videoUploadDirectoryPath = AtomUtility.GetDcElementContent(entry.AdditionalElements, "VideoUploadDirectoryName"); |
| 278 | + if (videoUploadDirectoryPath != null) |
| 279 | + { |
| 280 | + DirectoryUtils.MoveDirectory(PathUtils.Combine(siteContentDirectoryPath, videoUploadDirectoryPath), PathUtils.Combine(Fso.PublishmentSystemPath, Fso.PublishmentSystemInfo.Additional.VideoUploadDirectoryName), isOverride); |
| 281 | + } |
| 282 | + string fileUploadDirectoryPath = AtomUtility.GetDcElementContent(entry.AdditionalElements, "FileUploadDirectoryName"); |
| 283 | + if (fileUploadDirectoryPath != null) |
| 284 | + { |
| 285 | + DirectoryUtils.MoveDirectory(PathUtils.Combine(siteContentDirectoryPath, fileUploadDirectoryPath), PathUtils.Combine(Fso.PublishmentSystemPath, Fso.PublishmentSystemInfo.Additional.FileUploadDirectoryName), isOverride); |
| 286 | + } |
| 287 | + } |
259 | 288 | } |
260 | 289 |
|
261 | 290 | public void ImportChannelsAndContentsFromZip(int parentId, string siteContentDirectoryPath, bool isOverride) |
|
0 commit comments