public static MediaFileViewModel GetViewModel(MediaFileInfo mediaFileInfo, IMediaFileUrlRetriever fileUrlRetriever)
 {
     return(new MediaFileViewModel
     {
         Guid = mediaFileInfo.FileGUID,
         Title = mediaFileInfo.FileTitle,
         Name = mediaFileInfo.FileName,
         RelativePath = fileUrlRetriever.Retrieve(mediaFileInfo).WithSizeConstraint(SizeConstraint.MaxWidthOrHeight(400)).RelativePath
     });
 }
예제 #2
0
 // Initializes instances of required services using dependency injection
 public MediaLibraryController(IMediaFileUrlRetriever mediaFileUrlRetriever,
                               IMediaLibraryInfoProvider mediaLibraryInfoProvider,
                               IMediaFileInfoProvider mediaFileInfoProvider,
                               ISiteService siteService)
 {
     this.mediaFileUrlRetriever    = mediaFileUrlRetriever;
     this.mediaLibraryInfoProvider = mediaLibraryInfoProvider;
     this.mediaFileInfoProvider    = mediaFileInfoProvider;
     this.siteService = siteService;
 }
 /// <summary>
 /// Creates an instance of <see cref="CardWidgetController"/> class.
 /// </summary>
 public CardWidgetController(IMediaFileRepository mediaFileRepository,
                             IOutputCacheDependencies outputCacheDependencies,
                             IComponentPropertiesRetriever componentPropertiesRetriever,
                             IMediaFileUrlRetriever mediaFileUrlRetriever)
 {
     this.mediaFileRepository          = mediaFileRepository;
     this.outputCacheDependencies      = outputCacheDependencies;
     this.componentPropertiesRetriever = componentPropertiesRetriever;
     this.mediaFileUrlRetriever        = mediaFileUrlRetriever;
 }
예제 #4
0
 public SelectorsWidgetViewComponent(IPageAttachmentUrlRetriever attachmentUrlRetriever,
                                     IMediaFileInfoProvider mediaFileInfoProvider,
                                     IMediaFileUrlRetriever mediaFileUrlRetriever,
                                     ISiteService siteService)
 {
     this.attachmentUrlRetriever = attachmentUrlRetriever;
     this.mediaFileInfoProvider  = mediaFileInfoProvider;
     this.mediaFileUrlRetriever  = mediaFileUrlRetriever;
     this.siteService            = siteService;
 }
예제 #5
0
 public SelectorsWidgetController(IPageAttachmentUrlRetriever attachmentUrlRetriever,
                                  IComponentPropertiesRetriever propertiesRetriever,
                                  IMediaFileInfoProvider mediaFileInfoProvider,
                                  IMediaFileUrlRetriever mediaFileUrlRetriever,
                                  ISiteService siteService)
 {
     this.attachmentUrlRetriever = attachmentUrlRetriever;
     this.propertiesRetriever    = propertiesRetriever;
     this.mediaFileInfoProvider  = mediaFileInfoProvider;
     this.mediaFileUrlRetriever  = mediaFileUrlRetriever;
     this.siteService            = siteService;
 }
예제 #6
0
 public MediaFileRepository(
     IMediaLibraryInfoProvider mediaLibraryInfoProvider,
     IMediaFileInfoProvider mediaFileInfoProvider,
     ISiteService siteService,
     IMediaFileUrlRetriever mediaFileUrlRetriever,
     IOptionsMonitor <XperienceOptions> optionsMonitor)
 {
     _mediaLibraryInfoProvider = mediaLibraryInfoProvider ?? throw new ArgumentNullException(nameof(mediaLibraryInfoProvider));
     _mediaFileInfoProvider    = mediaFileInfoProvider ?? throw new ArgumentNullException(nameof(mediaFileInfoProvider));
     _siteService           = siteService ?? throw new ArgumentNullException(nameof(siteService));
     _mediaFileUrlRetriever = mediaFileUrlRetriever ?? throw new ArgumentNullException(nameof(mediaFileUrlRetriever));
     _optionsMonitor        = optionsMonitor ?? throw new ArgumentNullException(nameof(optionsMonitor));
 }
예제 #7
0
 /// <summary>
 /// Creates an instance of <see cref="CardWidgetViewComponent"/> class.
 /// </summary>
 /// <param name="mediaFileRepository">Repository for media files.</param>
 /// <param name="mediaFileUrlRetriever">The media file URL retriever.</param>
 public CardWidgetViewComponent(MediaFileRepository mediaFileRepository, IMediaFileUrlRetriever mediaFileUrlRetriever)
 {
     this.mediaFileRepository   = mediaFileRepository;
     this.mediaFileUrlRetriever = mediaFileUrlRetriever;
 }
예제 #8
0
 public MediaGalleryViewComponent(MediaFileRepository mediaFileRepository, IMediaFileUrlRetriever fileUrlRetriever)
 {
     this.mediaFileRepository = mediaFileRepository;
     this.fileUrlRetriever    = fileUrlRetriever;
 }
예제 #9
0
 public MediaController(IMediaFileRepository mediaFileRepository, IMediaFileUrlRetriever fileUrlRetriever)
 {
     this.mediaFileRepository = mediaFileRepository;
     this.fileUrlRetriever    = fileUrlRetriever;
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BannerWidgetViewComponent"/> class.
 /// </summary>
 /// <param name="mediaFileProvider">The media file provider.</param>
 /// <param name="fileUrlRetriever">The media file URL retriever.</param>
 public BannerWidgetViewComponent(IMediaFileInfoProvider mediaFileProvider, IMediaFileUrlRetriever fileUrlRetriever)
 {
     this.mediaFileProvider = mediaFileProvider;
     this.fileUrlRetriever  = fileUrlRetriever;
 }