Esempio n. 1
0
 public SlickService(IWorkContextAccessor wca, ICacheManager cacheManager, ISignals signals, IMediaLibraryService mediaService)
 {
     _wca = wca;
     _cacheManager = cacheManager;
     _signals = signals;
     _mediaService = mediaService;
 }
        public FolderController(IOrchardServices services, IMediaLibraryService mediaManagerService) {
            _mediaLibraryService = mediaManagerService;

            Services = services;
            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }
 public OEmbedController(
     ITaxonomyService taxonomyService, 
     IMediaLibraryService mediaManagerService, 
     IOrchardServices services) {
     _taxonomyService = taxonomyService;
     _mediaLibraryService = mediaManagerService;
     Services = services;
 }
 public ClientStorageController(
     IMediaLibraryService mediaManagerService, 
     IContentManager contentManager,
     IOrchardServices orchardServices) {
     _mediaLibraryService = mediaManagerService;
     _contentManager = contentManager;
     Services = orchardServices;
 }
Esempio n. 5
0
 public ClientStorageController(
     IMediaLibraryService mediaManagerService, 
     IContentManager contentManager,
     IOrchardServices orchardServices) {
     _mediaLibraryService = mediaManagerService;
     Services = orchardServices;
     Services = orchardServices;
     T = NullLocalizer.Instance;
 }
        public DropboxStorageController(IDropboxService dropbox,
                                        IOrchardServices orchard,
                                        IMediaLibraryService media) {
            _dropbox = dropbox;
            _orchard = orchard;
            _media = media;

            Logger = NullLogger.Instance;
        }
        public AdminController(
            IOrchardServices services, 
            IMediaLibraryService mediaLibraryService,
            INavigationManager navigationManager ) {
            _mediaLibraryService = mediaLibraryService;
            _navigationManager = navigationManager;
            Services = services;

            T = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Esempio n. 8
0
        public XmlRpcHandler(
            IMembershipService membershipService,
            IAuthorizationService authorizationService,
            IMediaLibraryService mediaLibraryService,
            RouteCollection routeCollection) {
            _membershipService = membershipService;
            _authorizationService = authorizationService;
            _mediaLibraryService = mediaLibraryService;
            _routeCollection = routeCollection;

            T = NullLocalizer.Instance;
        }
Esempio n. 9
0
        public MediaPartHandler(
            IMediaLibraryService mediaLibraryService,
            IRepository<MediaPartRecord> repository, 
            IStorageProvider storageProvider) {
            _mediaLibraryService = mediaLibraryService;
            _storageProvider = storageProvider;

            Filters.Add(StorageFilter.For(repository));
            OnRemoving<MediaPart>((context, part) => RemoveMedia(part));
            OnLoaded<MediaPart>((context, part) => {
                if (!String.IsNullOrEmpty(part.FileName)) {
                    part._publicUrl.Loader(x => _mediaLibraryService.GetMediaPublicUrl(part.FolderPath, part.FileName));
                }
            });

            OnIndexing<MediaPart>((context, part) => 
                context.DocumentIndex
                    .Add("media-folderpath", Normalize(part.FolderPath)).Store()
                    .Add("media-filename", Normalize(part.FileName)).Store()
                    .Add("media-mimetype", Normalize(part.MimeType)).Store()
                    .Add("media-caption", part.Caption).Analyze()
                    .Add("media-alternatetext", part.AlternateText).Analyze()
                );

            OnIndexing<ImagePart>((context, part) =>
                context.DocumentIndex
                    .Add("image-height", part.Height).Analyze().Store()
                    .Add("image-width", part.Width).Analyze().Store()
                );

            OnIndexing<DocumentPart>((context, part) =>
                context.DocumentIndex
                    .Add("document-length", part.Length).Analyze().Store()
                );

            OnIndexing<VideoPart>((context, part) =>
                context.DocumentIndex
                    .Add("video-length", part.Length).Analyze().Store()
                );

            OnIndexing<AudioPart>((context, part) =>
                context.DocumentIndex
                    .Add("audio-length", part.Length).Analyze().Store()
                );

            OnIndexing<OEmbedPart>((context, part) =>
                context.DocumentIndex
                    .Add("oembed-source", part.Source).Analyze().Store()
                );
        }
Esempio n. 10
0
        public AdminController(
            IOrchardServices services,
            IMediaLibraryService mediaLibraryService,
            INavigationManager navigationManager,
            IContentDefinitionManager contentDefinitionManager)
        {
            _mediaLibraryService      = mediaLibraryService;
            _navigationManager        = navigationManager;
            _contentDefinitionManager = contentDefinitionManager;
            Services = services;

            T      = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Esempio n. 11
0
        public XmlRpcHandler(
            IMembershipService membershipService,
            IAuthorizationService authorizationService,
            IMediaLibraryService mediaLibraryService,
            RouteCollection routeCollection,
            IContentManager contentManager)
        {
            _membershipService    = membershipService;
            _authorizationService = authorizationService;
            _mediaLibraryService  = mediaLibraryService;
            _routeCollection      = routeCollection;
            _contentManager       = contentManager;

            T = NullLocalizer.Instance;
        }
Esempio n. 12
0
        public MediaPartHandler(
            IMediaLibraryService mediaLibraryService,
            IRepository<MediaPartRecord> repository, 
            IStorageProvider storageProvider) {
            _mediaLibraryService = mediaLibraryService;
            _storageProvider = storageProvider;

            Filters.Add(StorageFilter.For(repository));
            OnRemoving<MediaPart>((context, part) => RemoveMedia(part));
            OnLoading<MediaPart>((context, part) => {
                if (!String.IsNullOrEmpty(part.FileName)) {
                    part._publicUrl.Loader(x => _mediaLibraryService.GetMediaPublicUrl(part.FolderPath, part.FileName));
                }
            });
        }
Esempio n. 13
0
        public MediaPartHandler(
            IMediaLibraryService mediaLibraryService,
            IRepository <MediaPartRecord> repository,
            IStorageProvider storageProvider)
        {
            _mediaLibraryService = mediaLibraryService;
            _storageProvider     = storageProvider;

            Filters.Add(StorageFilter.For(repository));
            OnRemoving <MediaPart>((context, part) => RemoveMedia(part));
            OnLoading <MediaPart>((context, part) => {
                if (!String.IsNullOrEmpty(part.FileName))
                {
                    part._publicUrl.Loader(x => _mediaLibraryService.GetMediaPublicUrl(part.FolderPath, part.FileName));
                }
            });
        }
Esempio n. 14
0
        public static bool CanManageMediaFolder(this IMediaLibraryService service, string folderPath)
        {
            // The current user can manage a media if he has access to the whole hierarchy
            // or the media is under his personal storage folder.

            var rootMediaFolder = service.GetRootMediaFolder();

            if (rootMediaFolder == null)
            {
                return(true);
            }

            var mediaPath = service.Combine(folderPath, " ").Trim();
            var rootPath  = service.Combine(rootMediaFolder.MediaPath, " ").Trim();

            return(mediaPath.StartsWith(rootPath, StringComparison.OrdinalIgnoreCase));
        }
Esempio n. 15
0
        //TODO: Remove Image repository as soon as it can cascade the saving
        public ImageGalleryService(IMediaLibraryService mediaService, IRepository <ImageGallerySettingsRecord> repository,
                                   IRepository <ImageGalleryImageSettingsRecord> imageRepository, IThumbnailService thumbnailService,
                                   IRepository <ImageGalleryRecord> imageGalleryPartRepository, IOrchardServices services,
                                   IStorageProvider storageProvider)
        {
            _storageProvider            = storageProvider;
            _services                   = services;
            _imageGalleryPartRepository = imageGalleryPartRepository;
            _repository                 = repository;
            _mediaService               = mediaService;
            _imageRepository            = imageRepository;
            _thumbnailService           = thumbnailService;

            if (_mediaService.GetMediaFolders(string.Empty).All(o => o.Name != ImageGalleriesMediaFolder))
            {
                _mediaService.CreateFolder(string.Empty, ImageGalleriesMediaFolder);
            }
        }
Esempio n. 16
0
        //TODO: Remove Image repository as soon as it can cascade the saving
        public ImageGalleryService(IMediaLibraryService mediaService, IRepository<ImageGallerySettingsRecord> repository,
								   IRepository<ImageGalleryImageSettingsRecord> imageRepository, IThumbnailService thumbnailService,
								   IRepository<ImageGalleryRecord> imageGalleryPartRepository, IOrchardServices services,
								   IStorageProvider storageProvider)
        {
            _storageProvider = storageProvider;
            _services = services;
            _imageGalleryPartRepository = imageGalleryPartRepository;
            _repository = repository;
            _mediaService = mediaService;
            _imageRepository = imageRepository;
            _thumbnailService = thumbnailService;

            if (_mediaService.GetMediaFolders(string.Empty).All(o => o.Name != ImageGalleriesMediaFolder))
            {
                _mediaService.CreateFolder(string.Empty, ImageGalleriesMediaFolder);
            }
        }
 public FileUploadController(IMediaLibraryService mediaService,
                             IActivityStreamService activityStreamService,
                             ICRMContentOwnershipService contentOwnershipService,
                             IOrchardServices services,
                             IFileService fileService,
                             IRepository <FileUploadPartRecord> fileRepository,
                             IStorageProvider storageProvider,
                             IContentDefinitionManager contentDefinitionManager)
 {
     this.fileService             = fileService;
     this.fileRepository          = fileRepository;
     this.contentOwnershipService = contentOwnershipService;
     this.storageProvider         = storageProvider;
     _mediaService = mediaService;
     this.activityStreamService = activityStreamService;
     _services = services;
     _contentDefinitionManager = contentDefinitionManager;
     T = NullLocalizer.Instance;
 }
Esempio n. 18
0
        //private IRepository<EmployeePartRecord> _employeeRepository;

        public ADUpdaterService(IContentManager contentManager,
            IOrchardServices orchardServices,
            ICultureManager cultureManager,
            ICacheManager cacheManager,
            ILdapServiceFactory ldapServiceFactory,
            IMediaLibraryService mediaLibraryService,
            IStorageProvider storageProvider)
        {
            _contentManager = contentManager;
            this.orchardServices = orchardServices;
            originalMembershipService = new Lazy<IMembershipService>(() =>
                this.orchardServices.WorkContext.Resolve<IEnumerable<IMembershipService>>().Single(x => x is MembershipService));
            this.cultureManager = cultureManager;
            this.cacheManager = cacheManager;
            this.ldapServiceFactory = ldapServiceFactory;
            this.mediaLibraryService = mediaLibraryService;
            this.storageProvider = storageProvider;

            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }
Esempio n. 19
0
 public TemplateService(
     ITagForCache tagForCache,
     Notifier notifier,
     IEnumerable <IParserEngine> parsers,
     IOrchardServices services,
     IMessageService messageService,
     IJobsQueueService jobsQueueService,
     ShellSettings shellSettings,
     IMediaLibraryService mediaLibraryService,
     ILocalizationService localizationService,
     IWorkContextAccessor workContextAccessor)
 {
     _contentManager      = services.ContentManager;
     _tagForCache         = tagForCache;
     _parsers             = parsers;
     _services            = services;
     _messageService      = messageService;
     _jobsQueueService    = jobsQueueService;
     _notifier            = notifier;
     _shellSettings       = shellSettings;
     _mediaLibraryService = mediaLibraryService;
     _localizationService = localizationService;
     _workContextAccessor = workContextAccessor;
 }
 public ClientStorageController(IMediaLibraryService mediaManagerService, IContentManager contentManager) {
     _mediaLibraryService = mediaManagerService;
     _contentManager = contentManager;
 }
Esempio n. 21
0
        public MediaFileNameDriver(IAuthorizationService authorizationService, IAuthenticationService authenticationService, IMediaLibraryService mediaLibraryService, INotifier notifier)
        {
            _authorizationService  = authorizationService;
            _authenticationService = authenticationService;
            _mediaLibraryService   = mediaLibraryService;
            _notifier = notifier;

            T = NullLocalizer.Instance;
        }
Esempio n. 22
0
 public WebSearchController(IMediaLibraryService mediaManagerService) {
     _mediaLibraryService = mediaManagerService;
 }
 public ThumbnailService(IMediaLibraryService mediaService, IStorageProvider storageProvider)
 {
     _storageProvider = storageProvider;
     _mediaService    = mediaService;
 }
 public UploadFileController(IOrchardServices orchardServices, ShellSettings settings, IMediaLibraryService mediaLibraryService, IContentExtensionService contentExtensionsServices, INotifier notifier, ICsrfTokenHelper csrfTokenHelper, IUtilsServices utilsServices)
 {
     _notifier = notifier;
     _contentExtensionsServices = contentExtensionsServices;
     _settings            = settings;
     _orchardServices     = orchardServices;
     _mediaLibraryService = mediaLibraryService;
     _utilsServices       = utilsServices;
     T = NullLocalizer.Instance;
     _csrfTokenHelper = csrfTokenHelper;
 }
 public AdminController(IOrchardServices orchardServices, IMediaLibraryService mediaLibraryService) {
     _mediaLibraryService = mediaLibraryService;
     Services = orchardServices;
 }
 public ContactFormService(IOrchardServices orchardServices, INotifier notifier, IRepository <ContactFormRecord> contactFormRepository, ITemplateService templateServices, IContentManager contentManager, ISmtpChannel messageManager, IMediaLibraryService mediaLibraryService, IStorageProvider storageProvider)
 {
     _notifier              = notifier;
     _orchardServices       = orchardServices;
     _contactFormRepository = contactFormRepository;
     _templateServices      = templateServices;
     _messageManager        = messageManager;
     _contentManager        = contentManager;
     _mediaLibraryService   = mediaLibraryService;
     _storageProvider       = storageProvider;
     Logger = NullLogger.Instance;
 }
 public MediaController(IAuthorizer authorizer, IMediaLibraryService mediaLibraryService, IStorageProvider storageProvider)
 {
     _authorizer          = authorizer;
     _mediaLibraryService = mediaLibraryService;
     _storageProvider     = storageProvider;
 }
Esempio n. 28
0
 public ThumbnailService(IMediaLibraryService mediaService, IStorageProvider storageProvider)
 {
     _storageProvider = storageProvider;
     _mediaService = mediaService;
 }
Esempio n. 29
0
 public ClientStorageController(IMediaLibraryService mediaManagerService)
 {
     _mediaLibraryService = mediaManagerService;
 }
 public BingMapListDriver(IBingMapListService mapListService, IContentManager content, IMediaLibraryService mediaService, IShapeFactory shapeFactory)
 {
     _mapListService      = mapListService;
     _content             = content;
     _mediaLibraryService = mediaService;
     _shape = shapeFactory;
 }
 public FileUploadController(INotifier notifier, IContentManager contentManager, IMediaLibraryService mediaLibraryService, IContactFormService contactFormService)
 {
     _mediaLibraryService = mediaLibraryService;
     _contactFormService  = contactFormService;
     _contentManager      = contentManager;
     _notifier            = notifier;
     T = NullLocalizer.Instance;
 }
Esempio n. 32
0
 public MediaController(ILogger <MediaController> logger, IMediaLibraryService mediaLibraryService, IMediaItemRepository repository)
 {
     this.logger = logger;
     this.mediaLibraryService = mediaLibraryService;
     this.repository          = repository;
 }
Esempio n. 33
0
 public WebSearchController(IMediaLibraryService mediaManagerService, IContentManager contentManager) {
     _mediaLibraryService = mediaManagerService;
     _contentManager = contentManager;
 }
Esempio n. 34
0
        public MediaPartHandler(
            IStorageProvider storageProvider,
            IMediaLibraryService mediaLibraryService,
            IRepository <MediaPartRecord> repository,
            IContentDefinitionManager contentDefinitionManager)
        {
            _storageProvider          = storageProvider;
            _mediaLibraryService      = mediaLibraryService;
            _contentDefinitionManager = contentDefinitionManager;

            Filters.Add(StorageFilter.For(repository));
            Filters.Add(new ActivatingFilter <TitlePart>(contentType => {
                var typeDefinition = _contentDefinitionManager.GetTypeDefinition(contentType);
                // To avoid NRE when the handler runs for ad-hoc content types, e.g. MediaLibraryExplorer.
                return(typeDefinition == null ?
                       false :
                       typeDefinition.Parts.Any(contentTypePartDefinition =>
                                                contentTypePartDefinition.PartDefinition.Name == typeof(MediaPart).Name));
            }));

            OnRemoving <MediaPart>((context, part) => RemoveMedia(part));
            OnLoaded <MediaPart>((context, part) => {
                if (!String.IsNullOrEmpty(part.FileName))
                {
                    part._publicUrl.Loader(() => _mediaLibraryService.GetMediaPublicUrl(part.FolderPath, part.FileName));
                }
            });

            OnIndexing <MediaPart>((context, part) =>
                                   context.DocumentIndex
                                   .Add("media-folderpath", Normalize(part.FolderPath)).Store()
                                   .Add("media-filename", Normalize(part.FileName)).Store()
                                   .Add("media-mimetype", Normalize(part.MimeType)).Store()
                                   .Add("media-caption", part.Caption).Analyze()
                                   .Add("media-alternatetext", part.AlternateText).Analyze()
                                   );

            OnPublished <ImagePart>((context, part) => {
                var mediaPart = part.As <MediaPart>();
                var file      = _storageProvider.GetFile(_storageProvider.Combine(mediaPart.FolderPath, mediaPart.FileName));

                using (var stream = file.OpenRead()) {
                    try {
                        using (var image = System.Drawing.Image.FromStream(stream)) {
                            part.Width  = image.Width;
                            part.Height = image.Height;
                        }
                    }
                    catch (ArgumentException) {
                        if (mediaPart.MimeType != "image/x-icon" && mediaPart.MimeType != "image/vnd.microsoft.icon")
                        {
                            throw;
                        }
                        TryFillDimensionsForIco(stream, part);
                    }
                }
            });

            OnIndexing <ImagePart>((context, part) =>
                                   context.DocumentIndex
                                   .Add("image-height", part.Height).Analyze().Store()
                                   .Add("image-width", part.Width).Analyze().Store()
                                   );

            OnPublished <DocumentPart>((context, part) => {
                var mediaPart = part.As <MediaPart>();
                var file      = _storageProvider.GetFile(_storageProvider.Combine(mediaPart.FolderPath, mediaPart.FileName));

                using (var stream = file.OpenRead()) {
                    part.Length = stream.Length;
                }
            });

            OnIndexing <DocumentPart>((context, part) =>
                                      context.DocumentIndex
                                      .Add("document-length", part.Length).Analyze().Store()
                                      );

            OnPublished <VideoPart>((context, part) => part.Length = 0);

            OnIndexing <VideoPart>((context, part) =>
                                   context.DocumentIndex
                                   .Add("video-length", part.Length).Analyze().Store()
                                   );

            OnPublished <AudioPart>((context, part) => part.Length = 0);

            OnIndexing <AudioPart>((context, part) =>
                                   context.DocumentIndex
                                   .Add("audio-length", part.Length).Analyze().Store()
                                   );

            OnIndexing <OEmbedPart>((context, part) =>
                                    context.DocumentIndex
                                    .Add("oembed-source", part.Source).Analyze().Store()
                                    );
        }
Esempio n. 35
0
 public WebSearchController(IMediaLibraryService mediaManagerService, IContentManager contentManager)
 {
     _mediaLibraryService = mediaManagerService;
     _contentManager      = contentManager;
 }
 public MediaAuthorizationEventHandler(
     IAuthorizer authorizer,
     IMediaLibraryService mediaLibraryService) {
     _authorizer = authorizer;
     _mediaLibraryService = mediaLibraryService;
 }
 public MediaLibraryMetadataController(IMediaLibraryService mediaLibraryService, IOptions <AuthSettings> authSettings) : base(authSettings)
 {
     _mediaLibraryService = mediaLibraryService;
 }
Esempio n. 38
0
 public ContactController(IBusinessDependencies dependencies, IContactSectionRepository contactSectionRepository, IMapRepository mapRepository, IMediaLibraryService mediaLibraryService) : base(dependencies)
 {
     _contactSectionRepository = contactSectionRepository;
     _mapRepository            = mapRepository;
     _mediaLibraryService      = mediaLibraryService;
 }
Esempio n. 39
0
 public OEmbedController(
     IMediaLibraryService mediaManagerService, 
     IOrchardServices services) {
     _mediaLibraryService = mediaManagerService;
     Services = services;
 }
 public AdminController(IOrchardServices orchardServices, IMediaLibraryService mediaLibraryService)
 {
     _mediaLibraryService = mediaLibraryService;
     Services             = orchardServices;
 }
 public ClientStorageController(IMediaLibraryService mediaManagerService) {
     _mediaLibraryService = mediaManagerService;
 }
Esempio n. 42
0
 public EditorController(IMediaLibraryService mediaLibraryService, IOrchardServices orchardServices, IWorkContextAccessor workContextAccessor)
 {
     _mediaLibraryService = mediaLibraryService;
     _orchardServices     = orchardServices;
     _workContextAccessor = workContextAccessor;
 }
Esempio n. 43
0
 public MediaController(IMediaLibraryService mediaLibraryService)
 {
     _mediaLibraryService = mediaLibraryService ?? throw new ArgumentNullException(nameof(mediaLibraryService));
 }
 public ClientStorageController(IMediaLibraryService mediaManagerService, IContentManager contentManager)
 {
     _mediaLibraryService = mediaManagerService;
     _contentManager      = contentManager;
 }
Esempio n. 45
0
 public OEmbedController(
     IOrchardServices services,
     IMediaLibraryService mediaManagerService) {
     Services = services;
     _mediaLibraryService = mediaManagerService;
 }
Esempio n. 46
0
 public WebSearchController(IMediaLibraryService mediaManagerService)
 {
     _mediaLibraryService = mediaManagerService;
 }
 public BingLocationDriver(IBingMapListService mapListService, IMediaLibraryService mediaService, IOrchardServices services)
 {
     _mapListService      = mapListService;
     _mediaLibraryService = mediaService;
     _services            = services;
 }
Esempio n. 48
0
 public SlickService(IWorkContextAccessor wca, ICacheManager cacheManager, ISignals signals, IMediaLibraryService mediaService)
 {
     _wca          = wca;
     _cacheManager = cacheManager;
     _signals      = signals;
     _mediaService = mediaService;
 }
Esempio n. 49
0
        public ViewFileViewModel(IMainModel mainModel, IGoogleDriveService googleDriveService, IMessageBoxService messageBoxService, ISystemTrayService systemTrayService, IMediaLibraryService mediaLibraryService)
        {
            _mainModel = mainModel;
            _googleDriveService = googleDriveService;
            _messageBoxService = messageBoxService;
            _systemTrayService = systemTrayService;
            _mediaLibraryService = mediaLibraryService;

            DownloadFileCommand = new RelayCommand(DownloadFile, () => !IsBusy && CanDownload);

            BackKeyPressCommand = new RelayCommand<CancelEventArgs>(e =>
            {
                AbortCurrentCall(false);
            });
        }