Class MetaClass
Describes a configurable dynamic data class.
Inheritance
Inherited Members
Namespace: Mediachase.MetaDataPlus.Configurator
Assembly: Mediachase.MetaDataPlus.dll
Version: 10.8.0Syntax
public class MetaClass
Constructors
MetaClass(MetaDataContext)
Classes derived from MetaClass must call OnMetaClassLoadOrChange once the meta class is fully configured.
Declaration
protected MetaClass(MetaDataContext context)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The meta data context. |
Properties
Attributes
A collection of attributes describing additional properties of the meta class.
Declaration
public MetaAttributeCollection Attributes { get; }
Property Value
Type | Description |
---|---|
MetaAttributeCollection |
ChildClasses
A collection of child meta classes.
Declaration
public MetaClassCollection ChildClasses { get; }
Property Value
Type | Description |
---|---|
MetaClassCollection |
Context
The meta data context used to load or create this field.
Declaration
public MetaDataContext Context { get; }
Property Value
Type | Description |
---|---|
MetaDataContext |
Description
The long description of the meta class.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FieldListChangedSqlScript
A script to execute when the set of associated meta fields changes.
Declaration
public string FieldListChangedSqlScript { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FriendlyName
The friendly name of the meta class.
Declaration
public string FriendlyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Id
The unique identifier of the meta class.
Declaration
public int Id { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsAbstract
True
if this is an abstract meta class.
Declaration
public bool IsAbstract { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsCatalogMetaClass
Checks if a meta class is for catalog system (Meta class of CatalogNode, CatalogEntry)
Declaration
public bool IsCatalogMetaClass { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the metaclass is for catalog system; otherwise, false |
IsSystem
True
if this is a system meta class.
Declaration
public bool IsSystem { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsUser
True
if this is a user meta class.
Declaration
public bool IsUser { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MetaClassType
The type of the meta class.
Declaration
public MetaClassType MetaClassType { get; }
Property Value
Type | Description |
---|---|
MetaClassType | The type of the meta class. |
MetaFields
The meta fields associated with this meta class.
Declaration
public MetaFieldCollection MetaFields { get; }
Property Value
Type | Description |
---|---|
MetaFieldCollection |
Name
The unique name of the meta class.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Namespace
The namespace of the meta class.
Declaration
public string Namespace { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Parent
The parent meta class, or null if there is not a parent meta class.
Declaration
public MetaClass Parent { get; }
Property Value
Type | Description |
---|---|
MetaClass |
SystemMetaFields
A collection of system meta fields associated with this meta class.
Declaration
[Obsolete("The returned collection is created on each property access. Use GetSystemMetaFields() instead. Will remain at least until November 2016.")]
public MetaFieldCollection SystemMetaFields { get; }
Property Value
Type | Description |
---|---|
MetaFieldCollection |
TableName
The name of the table used to store values of the meta class.
Declaration
public string TableName { get; }
Property Value
Type | Description |
---|---|
System.String |
Tag
A binary value attached to the meta class.
Declaration
public object Tag { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
The usage of this data is unclear. The data for this property may only be a byte array.
UserMetaFields
A collection of user meta fields associated with this meta class.
Declaration
[Obsolete("The returned collection is created on each property access. Use GetUserMetaFields() instead. Will remain at least until November 2016.")]
public MetaFieldCollection UserMetaFields { get; }
Property Value
Type | Description |
---|---|
MetaFieldCollection |
Methods
AddField(MetaField)
Adds the specified meta field to this meta class.
Declaration
public virtual void AddField(MetaField field)
Parameters
Type | Name | Description |
---|---|---|
MetaField | field | The meta field to add. |
AddField(MetaField, Int32)
Adds the specified meta field to this meta class.
Declaration
public virtual void AddField(MetaField field, int weight)
Parameters
Type | Name | Description |
---|---|---|
MetaField | field | The meta field to add. |
System.Int32 | weight | The weight to add the meta field with. |
AddField(Int32, Int32)
Adds the specified meta field to this meta class.
Declaration
public virtual void AddField(int metaFieldId, int weight)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaFieldId | The id of the meta field to add. |
System.Int32 | weight | The weight to add the meta field with. |
ClearCache()
Clear meta classes in the cache.
Declaration
public static void ClearCache()
Create(MetaDataContext, String, String, String, MetaClass, MetaClassType, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string name, string friendlyName, string tableName, MetaClass parent, MetaClassType type, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
MetaClass | parent | |
MetaClassType | type | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Create(MetaDataContext, String, String, String, MetaClass, Boolean, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string name, string friendlyName, string tableName, MetaClass parent, bool isSystem, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
MetaClass | parent | |
System.Boolean | isSystem | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Create(MetaDataContext, String, String, String, Int32, MetaClassType, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string name, string friendlyName, string tableName, int parentId, MetaClassType type, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
System.Int32 | parentId | |
MetaClassType | type | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Create(MetaDataContext, String, String, String, Int32, Boolean, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string name, string friendlyName, string tableName, int parentId, bool isSystem, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
System.Int32 | parentId | |
System.Boolean | isSystem | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Create(MetaDataContext, String, String, String, String, MetaClass, MetaClassType, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string metaNamespace, string name, string friendlyName, string tableName, MetaClass parent, MetaClassType type, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | metaNamespace | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
MetaClass | parent | |
MetaClassType | type | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Create(MetaDataContext, String, String, String, String, MetaClass, Boolean, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string metaNamespace, string name, string friendlyName, string tableName, MetaClass parent, bool isSystem, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | metaNamespace | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
MetaClass | parent | |
System.Boolean | isSystem | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Create(MetaDataContext, String, String, String, String, Int32, MetaClassType, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string metaNamespace, string name, string friendlyName, string tableName, int parentId, MetaClassType type, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | metaNamespace | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
System.Int32 | parentId | |
MetaClassType | type | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Create(MetaDataContext, String, String, String, String, Int32, Boolean, String)
Creates the specified meta class.
Declaration
public static MetaClass Create(MetaDataContext context, string metaNamespace, string name, string friendlyName, string tableName, int parentId, bool isSystem, string description)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.String | metaNamespace | |
System.String | name | |
System.String | friendlyName | |
System.String | tableName | |
System.Int32 | parentId | |
System.Boolean | isSystem | |
System.String | description |
Returns
Type | Description |
---|---|
MetaClass |
Delete(MetaDataContext, Int32)
Deletes the specified meta class id.
Declaration
public static void Delete(MetaDataContext context, int metaClassId)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The context. |
System.Int32 | metaClassId | The meta class id. |
DeleteField(MetaField)
Removes the association from this meta class to the specified meta field.
Declaration
public virtual void DeleteField(MetaField field)
Parameters
Type | Name | Description |
---|---|---|
MetaField | field | The meta field. |
DeleteField(Int32)
Removes the association from this meta class to the specified meta field.
Declaration
public virtual void DeleteField(int metaFieldId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaFieldId | The meta field id. |
DeleteField(String)
Removes the association from this meta class to the specified meta field.
Declaration
public virtual void DeleteField(string metaFieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | metaFieldName | The meta field name. |
ExecuteFieldListChangedSqlScript()
Declaration
[Obsolete("This method exists for backwards comaptibility only. Will remain at least until November 2016.")]
protected virtual void ExecuteFieldListChangedSqlScript()
ExecuteFieldListChangedSqlScript(String)
Declaration
[Obsolete("This method exists for backwards compatibility only. Will remain at least until November 2016.")]
protected virtual string ExecuteFieldListChangedSqlScript(string script)
Parameters
Type | Name | Description |
---|---|---|
System.String | script |
Returns
Type | Description |
---|---|
System.String |
GenerateMetaClassView(MetaClass)
Generates view, a replacement for meta data tables.
Declaration
public static void GenerateMetaClassView(MetaClass metaClass)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaClass | The metaclass to generate view. |
GetAllMetaFields()
Enumerates all meta fields associated with this meta class.
Declaration
public IEnumerable<MetaField> GetAllMetaFields()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MetaField> | An enumerable of the meta fields. |
GetDataReader(MetaDataContext)
Declaration
[Obsolete("Use methods to load fully created classes, instead of handling the IDataReader directly. Will remain at least until November 2016.")]
public static IDataReader GetDataReader(MetaDataContext context)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context |
Returns
Type | Description |
---|---|
System.Data.IDataReader |
GetFieldEnabled(MetaField)
Gets a value indicating if the specified field is enabled for this meta class.
Declaration
public bool GetFieldEnabled(MetaField field)
Parameters
Type | Name | Description |
---|---|---|
MetaField | field | The meta field. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetFieldEnabled(Int32)
Gets a value indicating if the specified field is enabled for this meta class.
Declaration
public bool GetFieldEnabled(int metaFieldId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaFieldId | The meta field id. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetFieldEnabled(String)
Gets a value indicating if the specified field is enabled for this meta class.
Declaration
public bool GetFieldEnabled(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | The meta field name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetFieldWeight(MetaField)
Gets the weight value used to order a meta field within this meta class.
Declaration
public int GetFieldWeight(MetaField field)
Parameters
Type | Name | Description |
---|---|---|
MetaField | field | The meta field. |
Returns
Type | Description |
---|---|
System.Int32 | The weight value. |
GetFieldWeight(Int32)
Gets the weight value used to order a meta field within this meta class.
Declaration
public int GetFieldWeight(int metaFieldId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaFieldId | The meta field id. |
Returns
Type | Description |
---|---|
System.Int32 | The weight value. |
GetFieldWeight(String)
Gets the weight value used to order a meta field within this meta class.
Declaration
public int GetFieldWeight(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | The name of the meta field. |
Returns
Type | Description |
---|---|
System.Int32 | The weight value. |
GetList(MetaDataContext)
Gets the list.
Declaration
public static MetaClassCollection GetList(MetaDataContext context)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The context. |
Returns
Type | Description |
---|---|
MetaClassCollection |
GetList(MetaDataContext, Boolean)
Gets a collection of meta classes.
Declaration
public static MetaClassCollection GetList(MetaDataContext context, bool listInherited)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The meta data context. |
System.Boolean | listInherited | If |
Returns
Type | Description |
---|---|
MetaClassCollection | The collection of specified meta classes. |
GetList(MetaDataContext, String, Boolean)
Gets a list of meta classes by namespace.
Declaration
public static MetaClassCollection GetList(MetaDataContext context, string metaNamespace, bool deep)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The meta data context to access the database with. |
System.String | metaNamespace | The namespace to search. |
System.Boolean | deep | If |
Returns
Type | Description |
---|---|
MetaClassCollection | A collection of matching meta classes. |
GetMetaFieldList(String)
Gets a collection of all the meta fields associated with this meta class, matching the specified namespace.
Declaration
public MetaFieldCollection GetMetaFieldList(string metaNamespace)
Parameters
Type | Name | Description |
---|---|---|
System.String | metaNamespace | The namespace to match. |
Returns
Type | Description |
---|---|
MetaFieldCollection | A collection of matching meta fields. |
GetMetaFieldList(String, Boolean)
Gets a collection of all the meta fields associated with this meta class, matching the specified namespace.
Declaration
public MetaFieldCollection GetMetaFieldList(string metaNamespace, bool deep)
Parameters
Type | Name | Description |
---|---|---|
System.String | metaNamespace | The namespace to match. |
System.Boolean | deep | If |
Returns
Type | Description |
---|---|
MetaFieldCollection | A collection of matching meta fields. |
GetSystemMetaFields()
Enumerates the system meta fields associated with this meta class.
Declaration
public IEnumerable<MetaField> GetSystemMetaFields()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MetaField> | An enumerable of the system meta fields. |
GetUserMetaFields()
Enumerates the user meta fields associated with this meta class.
Declaration
public IEnumerable<MetaField> GetUserMetaFields()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MetaField> | An enumerable of the user meta fields. |
InvalidateCache(Int32)
Clear a specific meta class in the cache.
Declaration
public static void InvalidateCache(int metaClassId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaClassId | The meta class id. |
Load(MetaDataContext, IDataReader)
Declaration
[Obsolete("Use methods to load fully created classes, instead of handling the IDataReader directly. Will remain at least until November 2016.")]
public static MetaClass Load(MetaDataContext context, IDataReader reader)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | |
System.Data.IDataReader | reader |
Returns
Type | Description |
---|---|
MetaClass |
Load(MetaDataContext, Int32)
Loads a meta class by id.
Declaration
public static MetaClass Load(MetaDataContext context, int id)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The meta data context to access the database with. |
System.Int32 | id | The unique identifier of the meta class. |
Returns
Type | Description |
---|---|
MetaClass | The specified meta class. |
Load(MetaDataContext, String)
Loads a meta class by name.
Declaration
public static MetaClass Load(MetaDataContext context, string name)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The meta data context to access the database with. |
System.String | name | The name of the meta class. |
Returns
Type | Description |
---|---|
MetaClass | The specified meta class. |
SetFieldEnabled(MetaField, Boolean)
Enables or disables a field for this meta class.
Declaration
public void SetFieldEnabled(MetaField field, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
MetaField | field | The meta field. |
System.Boolean | enabled | If |
SetFieldEnabled(Int32, Boolean)
Enables or disables a field for this meta class.
Declaration
public void SetFieldEnabled(int metaFieldId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaFieldId | The meta field id. |
System.Boolean | enabled | If |
SetFieldEnabled(String, Boolean)
Enables or disables a field for this meta class.
Declaration
public void SetFieldEnabled(string fieldName, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | The meta field name. |
System.Boolean | enabled | If |
SetFieldWeight(MetaField, Int32)
Sets the weight value used to order a meta field within this meta class.
Declaration
public void SetFieldWeight(MetaField field, int weight)
Parameters
Type | Name | Description |
---|---|---|
MetaField | field | The meta field. |
System.Int32 | weight | The weight value. |
SetFieldWeight(Int32, Int32)
Sets the weight value used to order a meta field within this meta class.
Declaration
public void SetFieldWeight(int metaFieldId, int weight)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaFieldId | The id of the meta field. |
System.Int32 | weight | The weight value. |
SetFieldWeight(String, Int32)
Sets the weight value used to order a meta field within this meta class.
Declaration
public void SetFieldWeight(string fieldName, int weight)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | The name of the meta field. |
System.Int32 | weight | The weight value. |
TestMetaField(Int32)
Declaration
[Obsolete("This method exists for backwards compatibility only. Will remain at least until November 2016.")]
protected void TestMetaField(int metaFieldId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | metaFieldId |