Difference between revisions of "Attributes"
(Created page with "=== Prerequisite === Attributes are supported since UBIK Version 2.5. === Introduction === UBIK Attributes are used to store additional information per property. Attributes a...") |
m |
||
(16 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Attributes are used to store extended information per property. Attributes are objects managing additional fields for properties. As every {{UBIK}} object they are configurable according the set of their properties. {{Version/ServerSince|2.5.0}} | |
− | Attributes are | + | |
− | + | It is also possible to derive from the standard attributes in customizing and add additional attributes. | |
− | + | ||
− | + | ||
− | + | == Configuration == | |
− | + | [[File:UI_MetaAttribute.PNG|border|thumb|MetaAttribute property]] | |
+ | Attributes must be activated by defining the '''MetaAttribute''' property for a MetaProperty. | ||
− | + | {{Attention|The new MetaAttribute Property does replace the NEEDS_VALIDATION property (Version 2.5)!}} | |
− | {{ | + | {{UBIK}} supports the following types of attributes |
− | + | * Content Attributes | |
− | + | * Proxy Attributes | |
− | + | ||
+ | === Standard properties of Attributes === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Property !! Purpose | ! Property !! Purpose | ||
|- | |- | ||
− | | ValidationTimestamp || Time stamp | + | | ''ValidationTimestamp'' || Time stamp the property value was validated |
|- | |- | ||
− | | ValidationUser || Login | + | | ''ValidationUser'' || Login validating the property value |
|- | |- | ||
− | | Owner || | + | | ''Owner'' || {{UBIK}} content object the attribute is associated to (the owner of the according property) |
|- | |- | ||
− | | MetaProperty|| MetaProperty of the related | + | | ''MetaProperty'' || MetaProperty of the related property |
|- | |- | ||
− | |} | + | |} |
+ | === Properties for Proxy Attributes === | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Property !! Purpose | ||
+ | |- | ||
+ | | ''InterfaceTimestamp'' || Time stamp the property value was ex- / imported | ||
+ | |- | ||
+ | |} | ||
+ | == Accessing the data == | ||
+ | Attribute data must be accessed via their properties. Therefore, properties provide methods to read and write attribute values: | ||
− | + | <syntaxhighlight lang="csharp"> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | < | + | |
− | + | ||
/// <summary> | /// <summary> | ||
/// Tries the get attribute value. | /// Tries the get attribute value. | ||
Line 80: | Line 77: | ||
public virtual bool TrySetAttributeValue<T>(SystemStrings attributeID, T value) | public virtual bool TrySetAttributeValue<T>(SystemStrings attributeID, T value) | ||
− | </ | + | </syntaxhighlight> |
+ | {{Category/Version|2.5.0}} | ||
− | + | [[Category:2.5.0|Attributes]] | |
+ | [[Category:UBIK Object|Attributes]] |
Latest revision as of 08:59, 3 August 2016
Attributes are used to store extended information per property. Attributes are objects managing additional fields for properties. As every UBIK® object they are configurable according the set of their properties.
It is also possible to derive from the standard attributes in customizing and add additional attributes.
Contents
[hide]Configuration
Attributes must be activated by defining the MetaAttribute property for a MetaProperty.
UBIK® supports the following types of attributes
- Content Attributes
- Proxy Attributes
Standard properties of Attributes
Property | Purpose |
---|---|
ValidationTimestamp | Time stamp the property value was validated |
ValidationUser | Login validating the property value |
Owner | UBIK® content object the attribute is associated to (the owner of the according property) |
MetaProperty | MetaProperty of the related property |
Properties for Proxy Attributes
Property | Purpose |
---|---|
InterfaceTimestamp | Time stamp the property value was ex- / imported |
Accessing the data
Attribute data must be accessed via their properties. Therefore, properties provide methods to read and write attribute values:
/// <summary>
/// Tries the get attribute value.
/// </summary>
/// <typeparam name="T">attribute value type</typeparam>
/// <param name="attributeName">Name of the attribute.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TryGetAttributeValue<T>(string attributeName, out T value)
/// <summary>
/// Tries the get attribute value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="attributeID">The attribute identifier.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TryGetAttributeValue<T>(SystemStrings attributeID, out T value)
/// <summary>
/// Tries the set attribute value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="attributeName">Name of the attribute.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TrySetAttributeValue<T>(string attributeName, T value)
/// <summary>
/// Tries the set attribute value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="attributeID">The attribute identifier.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TrySetAttributeValue<T>(SystemStrings attributeID, T value)
/// Tries the get attribute value.
/// </summary>
/// <typeparam name="T">attribute value type</typeparam>
/// <param name="attributeName">Name of the attribute.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TryGetAttributeValue<T>(string attributeName, out T value)
/// <summary>
/// Tries the get attribute value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="attributeID">The attribute identifier.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TryGetAttributeValue<T>(SystemStrings attributeID, out T value)
/// <summary>
/// Tries the set attribute value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="attributeName">Name of the attribute.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TrySetAttributeValue<T>(string attributeName, T value)
/// <summary>
/// Tries the set attribute value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="attributeID">The attribute identifier.</param>
/// <param name="value">The value.</param>
/// <returns>true as successfull</returns>
public virtual bool TrySetAttributeValue<T>(SystemStrings attributeID, T value)