SaaS CMS has officially launched! Learn more now.

Class MetaHelper

Implements operations for the meta helper.

Inheritance
System.Object
MetaHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Storage
Assembly: Mediachase.Commerce.dll
Version: 11.8.3
Syntax
public static class MetaHelper

Methods

Deserialize(Byte[])

Deserializes the specified serialized data.

Declaration
public static MetaObjectSerialized Deserialize(byte[] serializedData)
Parameters
Type Name Description
System.Byte[] serializedData

The serialized data.

Returns
Type Description
MetaObjectSerialized

The deserialized object, or null if the input was null or contained errors.

GetCachedImageUrl(MetaFile, MetaField, String, Boolean, Int32, Int32, Boolean)

Returns the cached image urls. First will be regular image url, second will be thumbnail if thumbnail generation is available.

Declaration
[Obsolete("The old image system based on MetaData Plus is obsolete. You should use the new asset/media system in Episerver CMS instead. Will remain at least until January 2019")]
public static string[] GetCachedImageUrl(MetaFile file, MetaField metaField, string fileName, bool createThumbnail, int thumbnailHeight, int thumbnailWidth, bool thumbnailStretch)
Parameters
Type Name Description
MetaFile file

The file.

MetaField metaField

The meta field.

System.String fileName

Name of the file.

System.Boolean createThumbnail

if set to true [create thumbnail].

System.Int32 thumbnailHeight

Height of the thumbnail.

System.Int32 thumbnailWidth

Width of the thumbnail.

System.Boolean thumbnailStretch

if set to true [thumbnail stretch].

Returns
Type Description
System.String[]

GetMetaFieldValue(MetaField, Object)

Gets the meta field value.

Declaration
public static object GetMetaFieldValue(MetaField mf, object value)
Parameters
Type Name Description
MetaField mf

The mf.

System.Object value

The value.

Returns
Type Description
System.Object

SetMetaFieldValue(MetaDataContext, MetaObject, String, Object[])

Sets values for the meta object's meta field. Doesn't set file and image values.

Declaration
public static bool SetMetaFieldValue(MetaDataContext context, MetaObject obj, string fieldName, object[] values)
Parameters
Type Name Description
MetaDataContext context

The context.

MetaObject obj

The obj.

System.String fieldName

Name of the field.

System.Object[] values

The values.

Returns
Type Description
System.Boolean

True, if value was set successfully.

SetMetaFile(MetaDataContext, MetaObject, String, String, String, Byte[])

Sets MetaFile and Image values

Declaration
public static bool SetMetaFile(MetaDataContext context, MetaObject obj, string fieldName, string name, string contentType, byte[] fileContents)
Parameters
Type Name Description
MetaDataContext context

The context.

MetaObject obj

The obj.

System.String fieldName

Name of the field.

System.String name

The name.

System.String contentType

Type of the content.

System.Byte[] fileContents

The file contents.

Returns
Type Description
System.Boolean