Class PropertyXhtmlString
A property representing a static or dynamic xhtml string value. This property has support to handle dynamic fragments like dynamic content, personalized content and permanent links.
Implements
Inherited Members
Namespace: EPiServer.SpecializedProperties
Assembly: EPiServer.dll
Version: 11.20.7Syntax
[PropertyDefinitionTypePlugIn]
public class PropertyXhtmlString : PropertyLongString, IReadOnly<PropertyData>, IReadOnly, ILazyProperty, IReferenceMap, IPropertyPreferLoadData, IPersonalizedRoles, IDeserializationCallback
Constructors
PropertyXhtmlString()
Initializes a new instance of the PropertyXhtmlString class.
Declaration
public PropertyXhtmlString()
PropertyXhtmlString(String)
Initializes a new instance of the PropertyXhtmlString class.
Declaration
public PropertyXhtmlString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
PropertyXhtmlString(String, IPrincipalAccessor)
Exposed for unit tests
Declaration
public PropertyXhtmlString(string value, IPrincipalAccessor principalAccessor)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | |
IPrincipalAccessor | principalAccessor |
Properties
FragmentParser
Gets or sets the current fragment parser used to parse the string to fragments.
Declaration
[Obsolete("Access FragmentParser through the XhtmlString.FragmentParser property")]
public IFragmentParser FragmentParser { get; set; }
Property Value
Type | Description |
---|---|
IFragmentParser |
Fragments
Exposes the different fragments in the underlying xhtml string. Can be used by rendering control to put fragments in rendered pages control collection
Declaration
[Obsolete("Access fragments through the XhtmlString.Fragments property")]
public StringFragmentCollection Fragments { get; }
Property Value
Type | Description |
---|---|
StringFragmentCollection | The string fragments. |
IsModified
Declaration
public override bool IsModified { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
IsNull
Check for null property (no value has been set).
Declaration
public override bool IsNull { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
LongString
Gets or sets the string representation with normal links. This is how actual content is accessed. The setter will parse the content, and insert permanent links where appropriate. The getter will, if necessary, reparse the content to split it into the mixed list representation to speed up dynamic rendering of links.
Declaration
protected override string LongString { get; set; }
Property Value
Type | Description |
---|---|
System.String | The long string. |
Overrides
PropertyValueType
Gets the System.Type for this property.
Declaration
public override Type PropertyValueType { get; }
Property Value
Type | Description |
---|---|
System.Type | The System.Type of the property value. |
Overrides
ReferencedPermanentLinkIds
Gets an System.Collections.Generic.IList<T> of permanent link ids that are referenced from this property.
Declaration
public IList<Guid> ReferencedPermanentLinkIds { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Guid> | An System.Collections.Generic.IList<T> of permanent link ids that are referenced from this property. |
Value
The value of the property.
Declaration
public override object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The value of the property. |
Overrides
Remarks
Value returns null if the property has no value defined.
XhtmlString
Gets or sets the XHTML string.
Declaration
public XhtmlString XhtmlString { get; set; }
Property Value
Type | Description |
---|---|
XhtmlString | The XHTML string. |
Methods
Copy()
Creates a copy of this object.
Declaration
public override PropertyData Copy()
Returns
Type | Description |
---|---|
PropertyData | A new PropertyData object. |
Overrides
CreateWritableClone()
Creates a writable clone of the property.
Declaration
public override PropertyData CreateWritableClone()
Returns
Type | Description |
---|---|
PropertyData | A writable copy of the property. |
Overrides
GetRoles()
Gets all used personalized content roles from it's fragments
Declaration
public virtual IEnumerable<string> GetRoles()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The names of all virtual roles that have personalized content in the property content. |
LoadData(Object)
Sets the internal representation from what is stored in the database. "Deserialize".
Declaration
public override void LoadData(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The internal value. |
Overrides
MakeReadOnly()
Override to avoid the base class referring to our Value property to avoid dead-lock when this happens indirectly via DataFactory.
Declaration
public override void MakeReadOnly()
Overrides
Parse(String)
Returns a new PropertyXhtmlString based on the string value.
Declaration
public static PropertyXhtmlString Parse(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
Returns
Type | Description |
---|---|
PropertyXhtmlString |
ParseToObject(String)
Returns a new PropertyXhtmlString based on the string value.
Declaration
[Obsolete("ParseToObject is no longer required to be implemented. The same functionality can be achieved by creating a new instance and calling the ParseToSelf method.")]
public override PropertyData ParseToObject(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
Returns
Type | Description |
---|---|
PropertyData |
Overrides
ParseToSelf(String)
Sets the LongString to the value.
Declaration
public override void ParseToSelf(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
Overrides
RemapPermanentLinkReferences(IDictionary<Guid, Guid>)
Remaps permanent links according to the provided link mapping.
Declaration
public virtual void RemapPermanentLinkReferences(IDictionary<Guid, Guid> idMap)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.Guid, System.Guid> | idMap | The link mapping. |
SaveData(PropertyDataCollection)
Get the data representation suitable for storing to the database. "Serialize".
Declaration
public override object SaveData(PropertyDataCollection properties)
Parameters
Type | Name | Description |
---|---|---|
PropertyDataCollection | properties | The properties for the current page. |
Returns
Type | Description |
---|---|
System.Object | A string representation of the xhtml where the permanent links have not been resolved. |
Overrides
Remarks
Returns with unresolved links
SetDefaultValue()
Sets the default value for this property.
Declaration
protected override void SetDefaultValue()
Overrides
ToRawString()
Gets the string representation of the "raw" data as it is represented externally in the database and in export packages.
Declaration
[Obsolete("Method will no longer be called on Export. See EPiServer.Core.Transfer.Internal.PropertyXhtmlStringTransform class for equivalent functionality.")]
public override string ToRawString()
Returns
Type | Description |
---|---|
System.String | external string representation of property value |
Overrides
Remarks
Override this method in derived classes that presents a different view of the data than what is actually stored internally. Access level is 'internal' to avoid public exposure of the internal data format
ToWebString()
The Xhtml string representation for view mode.
Declaration
public override string ToWebString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Explicit Interface Implementations
IDeserializationCallback.OnDeserialization(Object)
Runs when the entire object graph has been deserialized.
Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object that initiated the callback. The functionality for this parameter is not currently implemented. |