Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataValueEditor"/> class.
        /// </summary>
        public DataValueEditor(
            ILocalizedTextService localizedTextService,
            IShortStringHelper shortStringHelper,
            IJsonSerializer jsonSerializer,
            IIOHelper ioHelper,
            DataEditorAttribute attribute)
        {
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }
            _localizedTextService = localizedTextService;
            _shortStringHelper    = shortStringHelper;
            _jsonSerializer       = jsonSerializer;

            var view = attribute.View;

            if (string.IsNullOrWhiteSpace(view))
            {
                throw new ArgumentException("The attribute does not specify a view.", nameof(attribute));
            }

            if (view.StartsWith("~/"))
            {
                view = ioHelper.ResolveRelativeOrVirtualUrl(view);
            }

            View      = view;
            ValueType = attribute.ValueType;
            HideLabel = attribute.HideLabel;
        }
 public TextOnlyValueEditor(
     DataEditorAttribute attribute,
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
 }
Example #3
0
 public MediaPickerPropertyValueEditor(
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     DataEditorAttribute attribute)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
 }
 public MultipleTextStringPropertyValueEditor(
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     DataEditorAttribute attribute)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _localizedTextService = localizedTextService;
 }
 public DateValueEditor(
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     DataEditorAttribute attribute)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     Validators.Add(new DateTimeValidator());
 }
 public MediaPicker3PropertyValueEditor(
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     DataEditorAttribute attribute,
     IDataTypeService dataTypeService)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _jsonSerializer  = jsonSerializer;
     _dataTypeService = dataTypeService;
 }
Example #7
0
 public FileUploadPropertyValueEditor(
     DataEditorAttribute attribute,
     MediaFileManager mediaFileManager,
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     IOptions <ContentSettings> contentSettings,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _mediaFileManager = mediaFileManager ?? throw new ArgumentNullException(nameof(mediaFileManager));
     _contentSettings  = contentSettings.Value ?? throw new ArgumentNullException(nameof(contentSettings));
 }
 public GridPropertyValueEditor(
     IDataValueEditorFactory dataValueEditorFactory,
     DataEditorAttribute attribute,
     IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
     ILocalizedTextService localizedTextService,
     HtmlImageSourceParser imageSourceParser,
     RichTextEditorPastedImages pastedImages,
     IShortStringHelper shortStringHelper,
     IImageUrlGenerator imageUrlGenerator,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper)
     : this(dataValueEditorFactory, attribute, backOfficeSecurityAccessor, localizedTextService,
            imageSourceParser, pastedImages, shortStringHelper, imageUrlGenerator, jsonSerializer, ioHelper,
            StaticServiceProvider.Instance.GetRequiredService <IHtmlMacroParameterParser>())
 {
 }
 public MultiUrlPickerValueEditor(
     IEntityService entityService,
     IPublishedSnapshotAccessor publishedSnapshotAccessor,
     ILogger <MultiUrlPickerValueEditor> logger,
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     DataEditorAttribute attribute,
     IPublishedUrlProvider publishedUrlProvider,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _entityService             = entityService ?? throw new ArgumentNullException(nameof(entityService));
     _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _publishedUrlProvider = publishedUrlProvider;
 }
Example #10
0
 public ImageCropperPropertyValueEditor(
     DataEditorAttribute attribute,
     ILogger <ImageCropperPropertyValueEditor> logger,
     MediaFileManager mediaFileSystem,
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     IOptions <ContentSettings> contentSettings,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     IDataTypeService dataTypeService)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     _mediaFileManager = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem));
     _contentSettings  = contentSettings.Value;
     _dataTypeService  = dataTypeService;
 }
Example #11
0
 public NestedContentPropertyValueEditor(
     IDataTypeService dataTypeService,
     ILocalizedTextService localizedTextService,
     IContentTypeService contentTypeService,
     IShortStringHelper shortStringHelper,
     DataEditorAttribute attribute,
     PropertyEditorCollection propertyEditors,
     ILogger <NestedContentPropertyEditor> logger,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     IPropertyValidationService propertyValidationService)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _propertyEditors     = propertyEditors;
     _dataTypeService     = dataTypeService;
     _logger              = logger;
     _nestedContentValues = new NestedContentValues(contentTypeService);
     Validators.Add(new NestedContentValidator(propertyValidationService, _nestedContentValues, contentTypeService));
 }
Example #12
0
 public RichTextPropertyValueEditor(
     DataEditorAttribute attribute,
     IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     HtmlImageSourceParser imageSourceParser,
     HtmlLocalLinkParser localLinkParser,
     RichTextEditorPastedImages pastedImages,
     IImageUrlGenerator imageUrlGenerator,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _backOfficeSecurityAccessor = backOfficeSecurityAccessor;
     _imageSourceParser          = imageSourceParser;
     _localLinkParser            = localLinkParser;
     _pastedImages      = pastedImages;
     _imageUrlGenerator = imageUrlGenerator;
 }
Example #13
0
 public GridPropertyValueEditor(
     IDataValueEditorFactory dataValueEditorFactory,
     DataEditorAttribute attribute,
     IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
     ILocalizedTextService localizedTextService,
     HtmlImageSourceParser imageSourceParser,
     RichTextEditorPastedImages pastedImages,
     IShortStringHelper shortStringHelper,
     IImageUrlGenerator imageUrlGenerator,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _backOfficeSecurityAccessor = backOfficeSecurityAccessor;
     _imageSourceParser          = imageSourceParser;
     _pastedImages = pastedImages;
     _richTextPropertyValueEditor =
         dataValueEditorFactory.Create <RichTextPropertyEditor.RichTextPropertyValueEditor>(attribute);
     _mediaPickerPropertyValueEditor =
         dataValueEditorFactory.Create <MediaPickerPropertyEditor.MediaPickerPropertyValueEditor>(attribute);
     _imageUrlGenerator = imageUrlGenerator;
 }