Property types

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: 

CheckBox property

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

 checkbox

Integer property

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

integer

Float property

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

Short String property

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. Name of class is ShortStringPropertyClass. 

Long String property

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. Name of class is LongStringPropertyClass. 

longstring

HTML property

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. Name of class is HTMLPropertyClass.

The following tools can be added or removed to the toolbars:

a11ycheck addcomment aligncenter alignjustify alignleft alignright anchor backcolor bold bullist bullistremoveformatlink casechange charmap checklist code edit emoticons file fontselect fontsizeselect forecolor format formatpainter help image indent insert insertfile italic link ltr media numlist outdent permanentpen preview print redo redostyleselect removeformat rtl save showcomments spellchecker strikethrough styleselect table tc template tools underline undo view waf_edit_image waf_fullscreen_mode waf_normal_mode waf_panel_mode waf_spellcheck waf_tag waf_translate code

The property setting is called "Add Tools" and "Remove Tools" and is available in the definition plugin in Visual Studio.

Your also have the option of adding or removing items from the style "Drop down" selector in the editor. The property found in the definition moduled called "Tiny mce style formats" accepts a string in JSON format ( single line ). This accepts all the customizations descripbed here: TINY MCE Style formats 

Here is an example:

   1:  [{"title":"Bold text","inline":"b"},{"title":"Red text","inline":"span","styles":{"color":"#ff0000"}},{"title":"Red header","block":"h1","styles":{"color":"#ff0000"}},{"title":"Example 1","inline":"span","classes":"example1"},{"title":"Example 2","inline":"span","classes":"example2"},{"title":"Table styles"},{"title":"Table row 1","selector":"tr","classes":"tablerow1"}]

 (Remember it must be formattet as a JSON string, all prop names must be quoted)

def

editor

Date Time property

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”. Name of class is DateTimePropertyClass. 

 datetime

datetime2

Inner Contents property

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. Name of class is InnerContentsPropertyClass. 

inner-contents2

The different inner contents can be expaned, one or several at the same time:

inner-contents 

File property

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. Name of class is FilePropertyClass. 

file

File Folder property

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. Name of class is FileFolderPropertyClass.

 filefolder

Node Parent property

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. Name of class is NodeParentPropertyClass. 

NodeParent

Parent Node Relation property

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. Name of class is ParentNodeRelationPropertyClass  

Parents Node Relations property / Children Node Relations property

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. Name of the classes are ParentsNodeRelationsPropertyClass / ChildrenNodeRelationsPropertyClass. 

childrenrelationprop

Access property

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.Name of property class is AccessPropertyClass. 

Access

When clicking on the select icon, this dialogue is shown:

Access2

Link property

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

link

The dropdown contains the following choices:

link2

Content : choose a node in the system to link to.

Url: Specify a full url

Email: Specify an email address.

Enumeration property

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. Name of property class is EnumerationPropertyClass. 

Enumerations property

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. Name of property class is EnumerationsPropertyClass. 

Password property

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. Available for legacy projects. DO NOT USE for new projects.
  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. Use only in special circumstances.
  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. Default.

Name of property class is PasswordPropertyClass

Culture property

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

Command property

This is a property used to start a server side method on the content class partial file. The property is rendered as a button, and you specify the method to call when clicked in the settings of the property. Name of property class is CommandPropertyClass. 

command

Heading property

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. Bane of property class is HeadingPropertyClass.