Exemplo n.º 1
0
 public async Task ImportTableStylesAsync(string tableDirectoryPath, string guid)
 {
     if (DirectoryUtils.IsDirectoryExists(tableDirectoryPath))
     {
         var tableStyleIe = new TableStyleIe(_databaseManager, _caching, tableDirectoryPath);
         await tableStyleIe.ImportTableStylesAsync(_site, guid);
     }
 }
Exemplo n.º 2
0
 public void ImportTableStyles(string tableDirectoryPath)
 {
     if (DirectoryUtils.IsDirectoryExists(tableDirectoryPath))
     {
         var tableStyleIe = new TableStyleIe(tableDirectoryPath, _adminName);
         tableStyleIe.ImportTableStyles(_siteInfo.Id);
     }
 }
Exemplo n.º 3
0
 public void ImportTableStyles(string tableDirectoryPath)
 {
     if (DirectoryUtils.IsDirectoryExists(tableDirectoryPath))
     {
         var tableStyleIe = new TableStyleIe(tableDirectoryPath);
         tableStyleIe.ImportTableStyles(Fso.PublishmentSystemId);
     }
 }
Exemplo n.º 4
0
        public static void ImportTableStyleByZipFile(string tableName, int channelId, string zipFilePath)
        {
            var styleDirectoryPath = PathUtils.GetTemporaryFilesPath("TableStyle");

            DirectoryUtils.DeleteDirectoryIfExists(styleDirectoryPath);
            DirectoryUtils.CreateDirectoryIfNotExists(styleDirectoryPath);

            ZipUtils.UnpackFiles(zipFilePath, styleDirectoryPath);

            TableStyleIe.SingleImportTableStyle(tableName, styleDirectoryPath, channelId);
        }
Exemplo n.º 5
0
        public static async Task <string> ExportRootSingleTableStyleAsync(IPathManager pathManager, IDatabaseManager databaseManager, int siteId, string tableName, List <int> relatedIdentities)
        {
            var filePath           = pathManager.GetTemporaryFilesPath("tableStyle.zip");
            var styleDirectoryPath = pathManager.GetTemporaryFilesPath("TableStyle");
            await TableStyleIe.SingleExportTableStylesAsync(databaseManager, siteId, tableName, relatedIdentities, styleDirectoryPath);

            pathManager.CreateZip(filePath, styleDirectoryPath);

            DirectoryUtils.DeleteDirectoryIfExists(styleDirectoryPath);

            return(PathUtils.GetFileName(filePath));
        }
Exemplo n.º 6
0
        public string ExportSingleTableStyle(string tableName, int relatedIdentity)
        {
            var filePath           = PathUtils.GetTemporaryFilesPath("tableStyle.zip");
            var styleDirectoryPath = PathUtils.GetTemporaryFilesPath("TableStyle");

            TableStyleIe.SingleExportTableStyles(tableName, _siteInfo.Id, relatedIdentity, styleDirectoryPath);
            ZipUtils.PackFiles(filePath, styleDirectoryPath);

            DirectoryUtils.DeleteDirectoryIfExists(styleDirectoryPath);

            return(PathUtils.GetFileName(filePath));
        }
Exemplo n.º 7
0
        public static string ExportRootSingleTableStyle(string tableName)
        {
            var filePath           = PathUtils.GetTemporaryFilesPath("tableStyle.zip");
            var styleDirectoryPath = PathUtils.GetTemporaryFilesPath("TableStyle");

            TableStyleIe.SingleExportTableStyles(tableName, styleDirectoryPath);
            ZipUtils.PackFiles(filePath, styleDirectoryPath);

            DirectoryUtils.DeleteDirectoryIfExists(styleDirectoryPath);

            return(PathUtils.GetFileName(filePath));
        }
Exemplo n.º 8
0
        public async Task <string> ExportSingleTableStyleAsync(string tableName, int relatedIdentity)
        {
            var filePath           = _pathManager.GetTemporaryFilesPath("tableStyle.zip");
            var styleDirectoryPath = _pathManager.GetTemporaryFilesPath("TableStyle");

            await TableStyleIe.SingleExportTableStylesAsync(_databaseManager, tableName, _site.Id, relatedIdentity, styleDirectoryPath);

            _pathManager.CreateZip(filePath, styleDirectoryPath);

            DirectoryUtils.DeleteDirectoryIfExists(styleDirectoryPath);

            return(PathUtils.GetFileName(filePath));
        }
Exemplo n.º 9
0
        public static async Task <string> ImportTableStyleByZipFileAsync(IPathManager pathManager, IDatabaseManager databaseManager, string tableName, List <int> relatedIdentities, string zipFilePath)
        {
            var styleDirectoryPath = pathManager.GetTemporaryFilesPath("TableStyle");

            DirectoryUtils.DeleteDirectoryIfExists(styleDirectoryPath);
            DirectoryUtils.CreateDirectoryIfNotExists(styleDirectoryPath);

            pathManager.ExtractZip(zipFilePath, styleDirectoryPath);

            await TableStyleIe.SingleImportTableStyleAsync(databaseManager, tableName, styleDirectoryPath, relatedIdentities);

            return(styleDirectoryPath);
        }
Exemplo n.º 10
0
        // 导出网站所有相关辅助表以及除提交表单外的所有表样式
        public async Task ExportTablesAndStylesAsync(string tableDirectoryPath)
        {
            DirectoryUtils.CreateDirectoryIfNotExists(tableDirectoryPath);
            var styleIe = new TableStyleIe(_databaseManager, _caching, tableDirectoryPath);

            var tableNameList = await _databaseManager.SiteRepository.GetTableNamesAsync(_site);

            foreach (var tableName in tableNameList)
            {
                await styleIe.ExportTableStylesAsync(_site.Id, tableName);
            }

            await styleIe.ExportTableStylesAsync(_site.Id, _databaseManager.ChannelRepository.TableName);

            await styleIe.ExportTableStylesAsync(_site.Id, _databaseManager.SiteRepository.TableName);
        }
Exemplo n.º 11
0
        // 导出网站所有相关辅助表以及除提交表单外的所有表样式
        public void ExportTablesAndStyles(string tableDirectoryPath)
        {
            DirectoryUtils.CreateDirectoryIfNotExists(tableDirectoryPath);
            var styleIe = new TableStyleIe(tableDirectoryPath, _adminName);

            var siteInfo      = SiteManager.GetSiteInfo(_siteInfo.Id);
            var tableNameList = SiteManager.GetTableNameList(siteInfo);

            foreach (var tableName in tableNameList)
            {
                styleIe.ExportTableStyles(siteInfo.Id, tableName);
            }

            styleIe.ExportTableStyles(siteInfo.Id, DataProvider.ChannelDao.TableName);
            styleIe.ExportTableStyles(siteInfo.Id, DataProvider.SiteDao.TableName);
        }
Exemplo n.º 12
0
        // 导出网站所有相关辅助表以及除提交表单外的所有表样式
        public void ExportTablesAndStyles(string tableDirectoryPath)
        {
            DirectoryUtils.CreateDirectoryIfNotExists(tableDirectoryPath);
            var tableIe = new AuxiliaryTableIe(tableDirectoryPath);
            var styleIe = new TableStyleIe(tableDirectoryPath);

            var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(Fso.PublishmentSystemId);
            var tableNameList         = PublishmentSystemManager.GetAuxiliaryTableNameList(publishmentSystemInfo);

            foreach (var tableName in tableNameList)
            {
                tableIe.ExportAuxiliaryTable(tableName);
                styleIe.ExportTableStyles(publishmentSystemInfo.PublishmentSystemId, tableName);
            }

            styleIe.ExportTableStyles(publishmentSystemInfo.PublishmentSystemId, DataProvider.NodeDao.TableName);
            styleIe.ExportTableStyles(publishmentSystemInfo.PublishmentSystemId, DataProvider.PublishmentSystemDao.TableName);
        }
Exemplo n.º 13
0
 public static async Task ImportTableStyleByDirectoryAsync(IDatabaseManager databaseManager, string tableName, List <int> relatedIdentities, string styleDirectoryPath)
 {
     await TableStyleIe.SingleImportTableStyleAsync(databaseManager, tableName, styleDirectoryPath, relatedIdentities);
 }