Property types

Created by Relatude

There are a series of built-in property types you can add the content classes you define in the semantics module. With each property type it follows a set of rules and characteristics. These are defined in the PropertyClass that belongs to each property.

To define your own property classes you need to define a class that inherits from one of the existing PropertyClasses.

The PropertyClass defines things like: the code to be generated in the content classes that use it. What DataValues are relevant? How the search index should index it. What web controls should be used in edit. What the relevant settings are. Etc.

All database values in WAF are abstracted into a set of 6 universal data value classes:

BooleanDataValue                        True/False, can be indexed in db
IntegerDataValue                         32 bit signed integer, can be indexed in db
FloatDataValue                             32 bit floating point, can be indexed in db
ShortStringDataValue                   Up to 255 unicode characters, no null, can be indexed in db
LongStringDataValue                    Unlimited unicode characters, no null, cannot be indexed in db
DateTimeDataValue                      Date and time value, 1800-01-01 00:00:00 is null, can be indexed in db

There are two data value types for holding node relational data:

NodeRelationDataValue         A relation to one content node. Can be specific to culture and revision.
NodeRelationsDataValue       Relations to content nodes. Can be specific to culture and revision.

And last, one to hold the values of related inner contents

InnerContentsDataValue       A container for related inner contents.

Although you normally do not relate directly to these value classes and most property classes use a combination of the data values, the values form the bases for the query system and built-in cache mechanisms.

One the next pages you will find a description of all the built-in property classes:

 

CheckBoxPropertyClass

This property class is of type bool and a checkbox is displayed in the edit interface. The underlying datavalue is BooleanDataValue.

 

IntegerPropertyClass

This property class is of type 32 bit integer and a text box is displayed the edit interface. The underlying datavalue is IntegerDataValue.

 

FloatPropertyClass

This property class if of type 32 bit double and a text box is displayed in the edit interface. The underlying datavalue is FloatDataValue.

 

ShortStringPropertyClass

This property is of type string and a one line textbox field is displayed in the edit interface. The underlying datavalue is ShortStringDataValue. The length is limited to 255 characters. An exception will be thrown if you set a value longer than 255. The property is never null and if you set it to a null value the saved value is an empty string. The content of the text is not HTML encoded so remember to use “HttpUtility.HtmlEncode” if you write the value of the property out as HTML.

 

LongStringPropertyClass

This property class is of type string and a multiline textbox field is displayed in the edit interface. The underlying datavalue is LongStringDataValue. The length has no limit, but if you enter text longer than a million characters the system will slow down and load time in the client browser will be very long. The content of the text is not HTML encoded so remember to use “HttpUtility.HtmlEncode” if you write the value of the property out as HTML.

 

HTMLPropertyClass

This property class is of type string and a WYSIWYG HTML editor is used in the edit interface. The underlying datavalue is LongStringDataValue. The length has no limit, but if you enter text longer than a million characters the system will slow down and load time in the client browser will be very long. The content of the text is HTML and the value can be written directly to the response stream. All URL references in the HTML are parsed and changed to use ID numbers each time a new value is set. Each time a value is read the HTML is parsed to friendly addresses with the correct relative reference to the current page. The WYSIWIG editor loads the CSS stylesheets that belongs to the template the content is using.

 

DateTimePropertyClass

This property class is of type DateTime and a basic date time picker is used in the edit interface. The underlying datavalue is DateTimeDataValue. A value of 1800-01-01 00:00 is considered a null value. The null can be references “Utils.DateTimeNull”.

 

InnerContentsPropertyClass

This property class is of type InnerContentsDataValueand the field is rendered as a set of expandable panels that contain the fields for each of the related inner contents. There is not specific limit to the number of inner contents there can be in one relation field, but for performance reasons we recommend you limit the number to about 100.  If you need to relate more items we recommend you use a node relation field where each item is not rendered with edit controls and is shown in a list with buttons for paging. InnerContents supports nested relations and you can have relations fields inside related inner contents. The property type is well suited to paragraphs, optional document elements, smaller image galleries etc.

 

FilePropertyClass

This property class is of type FilePropertyValueClass and holds the content of a file. The actual file is stored in the file system under “WAF/Files/Content/[content_id]/[property_id]/[guid]”. The [content_id] is the ContentId of the content or inner content. (Not NodeId). [property_id] is the numeric id assigned to each property. The [guid] is a folder generated for each file to protect the file from direct download by guessing file ids. The property has several methods to retrieve information related to the file like, the type of file, the size, the dimensions, the duration (if relevant) etc. Some of the key properties such as name, size, extension and type are store in the database so that you make queries on file properties. The Property also has a number of useful functions for generating URL’s to scaled versions of images, converted video, generating HTML for flash players etc.

 

FileFolderPropertyClass

This property class inherits from inner content property and is a property specifically designed to hold a collection of inner content files. The property has an upload button where you can create multiple inner content files with by uploading multiple files in one click. An inner content of type InnerContentFile is created for each file. This property is particularly useful if you want to give the user the possibility to upload a collection of files as part of a document with no references to the file library.

 

NodeParentPropertyClass

This property can be used to relate of another content node. The relation is done through a NodeId stored in the content class table. Internally this property class is of type Integer and uses a IntegerDataValue to store a NodeId. The relation is one-to-many but there is no matching property type for the opposite side of the relation. There are no query expressions to perform query joins over this relation type either. The advantage with this relation is that it is easy to set up and that it can be used by inner contents. A typical usage is the start node of a site.

 

ParentNodeRelationPropertyClass / ChildNodeRelationPropertyClass

This property is used to relate one node to another node. The relation is stored in a relation table that is defined separately in the semantics module. This relation type cannot be used on inner contents. The relation is two way. That means that you can define another property on the content you are relating to that will show the opposite side of the relation. If you delete the relation from one of the contents, the relation will also be removed from property on the other content. This property supports a single relation and can be use in relations of type: one to one, one to many. You can perform join queries with this relation property. The relation can be set up to be specific to both culture and revision.

 

ParentsNodeRelationsPropertyClass / ChildrenNodeRelationsPropertyClass

This property is used to relate one node to multiple other nodes. The relation is stored in a relation table that is defined separately in the semantics module. This relation type cannot be used on inner contents. The relation is two way and can be used on relations of type: one to many and many to many. You can perform join queries with this relation property. The relation can be set up to be specific to both culture and revision.

 

AccessPropertyClass

This property stores a reference to a user group. You can relate to both built in groups such as Anonymous and Administrator and any other userdefined usergroup.

 

LinkPropertyClass

This property is useful for storing a link. The field can link to internal pages, external pages and emails.

 

EnumerationPropertyClass

This property is using a C# enumeration as the property value. Internally it is using an integer. The user is presented with a drop down control or a set of radio buttons. The enumeration type must be defined in the semantics module. Here you can use a different text for the interface control and the underlying codevalue. You can also define different text values for each culture. You can perform queries on enumeration properties. The property is ideal for values such as: country, county, fixed colours, layout style, fixed categories etc. Since the actual value is an enumeration it is not very easy for non technical users to add new values and it is therefore not suited for properties where the possible values are frequently changed. The advantage is efficient database storage and fast query performance. Working with enumeration values is also easier for a programmer.

 

EnumerationsPropertyClass

This property can contain a list of C# enumeration values. Internally it is using a series of integers and a BitArray to store the values. In the interface it is displayed as a set of checkboxes. The storage is very efficient and it supports AQL queries. You can use a different text for the interface control and the underlying codevalue. You can also define different text values for each culture. The property type is ideal for countries, counties, fixed categories etc. Since the actual value is an enumeration it is not very easy for non technical users to add new values and it is therefore not suited for properties where the possible values are frequently changed. The advantage is efficient database storage and fast query performance. Working with enumeration values is also easier for a programmer.

 

PasswordPropertyClass

This is a property type for storing passwords. Internally it uses a ShortStringDataValue. The property can store the password in three modes:

  1. Unencrypted: The password is stored as plain text. This mode will expose the password if the database is compromised.
  2. Encrypted: In this mode the full password is stored in the database, but it is encrypted with a installation specific key that is stored separately from the database. In this mode it is still possible to retrieve the password if the database is compromised, but it is considerably more difficult. It requires access to the database, the WAF code files and in depth knowledge of the encryption routine in WAF. The passwords stored in this mode can be retrieved at any point if you are an administrator. If you want to preserve to possibility of sending a user a password he has forgotten and do not want to generate a new one, then this is the best mode.
  3. Hashed. In this mode the password is hashed (and salted) so that the underlying password is never stored in full in the database. It is not possible to retrieve the password, in a compromised system as the full password is not stored. The disadvantage with this mode is that the original password can never be retrieved, you can only check if a given password generates the same hash code.

 

PropertyPropertyClass

This is a property class used to relate to the definition of a property of a WAF content class.

 

ContentClassPropertyClass

This is a property class used to relate to the definition of a WAF content class.

 

ContentClassesPropertyClass

This is a property class used to relate to the definition of one or more WAF content classes.

 

CulturePropertyClass

This is a property class used to relate to a specific system culture (LCID).

 

CommandPropertyClass

This is a property class used to relate to the definition of a WAF property class (or type).

 

HeadingPropertyClass

This is a property class with no resulting property on the actual c# class. It is used to add headers and information text in the edit module. It can also be used to insert HTML with client javascript.

 

ObjectPropertyClass

This is a property class for storing objects. Objects must be serializable and not too big. There is no specific limit on the size, but as the object is serialized as a 64 base encoded string and stored in the database an object larger than about 1 MB will start to have noticeable effects on the performance.

 

SettingsPropertyClass

This is an internal property class used for settings objects.