Exemple #1
0
 public Worker(
     IServiceProvider serviceProvider,
     IOptionsMonitor <ILog> options,
     Common.Utils.ConfigurationExtension configurationExtension)
 {
     this.serviceProvider   = serviceProvider;
     this.thumbnailSettings = ThumbnailSettings.GetInstance(configurationExtension);
     logger = options.Get("ASC.Files.ThumbnailBuilder");
 }
        public static ThumbnailSettings GetInstance(ConfigurationExtension configuration)
        {
            var result = new ThumbnailSettings();
            var cfg    = configuration.GetSetting <ThumbnailSettings>("thumbnail");

            result.ServerRoot           = cfg.ServerRoot ?? "http://localhost/";
            result.LaunchFrequency      = cfg.LaunchFrequency != 0 ? cfg.LaunchFrequency : 1;
            result.ConnectionStringName = cfg.ConnectionStringName ?? "default";
            result.Formats                = cfg.Formats ?? ".pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.gslides|.xlsx|.xlsm|.xls|.xltx|.xltm|.xlt|.ods|.fods|.ots|.gsheet|.csv|.docx|.docxf|.oform|.docm|.doc|.dotx|.dotm|.dot|.odt|.fodt|.ott|.gdoc|.txt|.rtf|.mht|.html|.htm|.fb2|.epub|.pdf|.djvu|.xps|.bmp|.jpeg|.jpg|.png|.gif|.tiff|.tif|.ico";
            result.SqlMaxResults          = cfg.SqlMaxResults != 0 ? cfg.SqlMaxResults : 1000;
            result.MaxDegreeOfParallelism = cfg.MaxDegreeOfParallelism != 0 ? cfg.MaxDegreeOfParallelism : 10;
            result.AvailableFileSize      = cfg.AvailableFileSize ?? 100L * 1024L * 1024L;
            result.AttemptsLimit          = cfg.AttemptsLimit ?? 3;
            result.AttemptWaitInterval    = cfg.AttemptWaitInterval != 0 ? cfg.AttemptWaitInterval : 1000;
            result.ThumbnaillHeight       = cfg.ThumbnaillHeight != 0 ? cfg.ThumbnaillHeight : 128;
            result.ThumbnaillWidth        = cfg.ThumbnaillWidth != 0 ? cfg.ThumbnaillWidth : 192;
            return(result);
        }
Exemple #3
0
 public Builder(
     Common.Utils.ConfigurationExtension configurationExtension,
     TenantManager tenantManager,
     IDaoFactory daoFactory,
     DocumentServiceConnector documentServiceConnector,
     DocumentServiceHelper documentServiceHelper,
     Global global,
     PathProvider pathProvider,
     IOptionsMonitor <ILog> log)
 {
     this.config              = ThumbnailSettings.GetInstance(configurationExtension);
     TenantManager            = tenantManager;
     DaoFactory               = daoFactory;
     DocumentServiceConnector = documentServiceConnector;
     DocumentServiceHelper    = documentServiceHelper;
     Global       = global;
     PathProvider = pathProvider;
     logger       = log.Get("ASC.Files.ThumbnailBuilder");
 }
Exemple #4
0
 public BuilderQueue(IServiceProvider serviceProvider, IOptionsMonitor <ILog> log, ASC.Common.Utils.ConfigurationExtension configurationExtension)
 {
     logger          = log.Get("ASC.Files.ThumbnailBuilder");
     ServiceProvider = serviceProvider;
     config          = ThumbnailSettings.GetInstance(configurationExtension);
 }