close

Filter

loading table of contents...

Content Server Manual / Version 2010

Table Of Contents

4.1 Properties

Each content type needs a specification of all properties that the corresponding content items have. The properties, presented as fields to the editor, vary, for example simple strings (such as for the author), XML for the textual content or binary data for graphics. This is determined in the content definition type with appropriate property types.

Caution

Caution

A content type may contain a maximum of 91 properties.

All field types have the attribute Name, defining the name by which the field can be referenced in an item.

Caution

Caution

The name can have a maximum length of 18 characters (DateProperty field names only 15 characters) and must not contain umlauts or other special characters ("§", "&", ...). Two fields in a content type different only in upper or lower case are not allowed. Furthermore, a name's last character must not be an underscore, since these field names are reserved for CoreMedia.

The property types are:

  • IntProperty

  • StringProperty

  • DateProperty

  • XmlProperty

  • BlobProperty

  • LinkListProperty

When defining XML elements and attributes in the following sections, the default namespace is assumed to be http://www.coremedia.com/2008/documenttypes and the namespace prefix extensions is assumed to be bound to the namespace URL http://www.coremedia.com/2013/documenttypes-extensions.

Common Attributes

You can add the following attributes to each property:

Property Description

extensions:translatable

If set to true, this StringProperty field is exported to an XLIFF file during translation.

extensions:automerge

If set to true, the contents of this property field are merged automatically from the master content if the translation task is accepted by the owner of the derived content.

Table 4.1.  Common Attributes


IntProperty

With an IntProperty, a field's value must be a whole number.

Example for creating an IntProperty:

 <IntProperty Name="Priority"/>
StringProperty

In a StringProperty field, you can store unformatted text.

Property Description

Length

Maximum number of characters that can be entered

Utf8Length

Maximum number of bytes. This attribute is optional. If you do not use this attribute, the value of the attribute Utf8Weight of the <DocTypes> element will be used to calculate the maximum byte length (=Length * Utf8Weight /100). If you set none of the attributes Utf8Length and Utf8Weight, Utf8Weight=300 will be used (see below for details) to define the byte length.

extensions:observe

Set to 'true' to make the StringProperty an observed property. This attribute is optional.

Table 4.2.  Attributes of a StringProperty field


Caution

Caution

When the StringProperty is observed the length must not exceed 256. Otherwise, the content server cannot start and you will see a log entry like the following in the content server log:

 2018-12-10 15:01:38 [ERROR] hox.corem.server.Server [] - \
Cannot startup due to malformed document type definition: \
The length 257 of the observed StringProperty 'observed' exceeds the allowed maximum length 256 (Init Process) 

Example for creating a StringProperty:

 <StringProperty Name="Title" Length="200" Utf8Length="500"/>

The maximum number of characters to be entered is limited to 200 and the maximum length would be 500 bytes.

DateProperty

Such fields display dates and times. Editors for simple input are available

Example for creating a DateProperty:

<DateProperty Name="Date"/>
XmlProperty

Whereas for some properties, such as the author, a simple character string is sufficient, an XMLProperty field specifies an XML document field. XmlProperty fields require a Grammar attribute which refers to the DTD or Schema of the content.

Property Description

Grammar

Defines the DTD or Schema that should be used for this content. coremedia-richtext-1.0 is the standard grammar for CoreMedia RichText fields. The special predefined grammar coremedia-struct-2008 is used for properties that contain structured objects at the level of the Unified API, but that are represented as markup internally. Structs are typically used for highly dynamic configuration tasks.

Table 4.3.  Attributes of an XmlProperty field


Example for creating an XmlProperty with Structs:

<XmlProperty Name="Config" Grammar="coremedia-struct-2008"/>

BlobProperty

You can use a BlobProperty field to store binary data in CoreMedia Content Cloud. The attribute MimeType defines which binary types you can store in the field.

Example for creating a BlobProperty:

 <BlobProperty Name="Graphic" MimeType="image/*"/>

In this property you can store images of all types, such as PNG, JPEG, GIF.

LinkListProperty

Some content items belong together in terms of content, even if they do not reference each other with internal links in XML texts. For example, images belong to a press report which are not explicitly mentioned in the text as illustrations. The number of images differs from case to case, so that it is not practical to define one field per image in the content type. For such cases there is the LinkListProperty, which holds a list of content items.

Name Description
LinkTypeIf the attribute LinkType is given, all content items of the list must be of the same content type as determined with that attribute or a subtype of that content type.
MinThe minimum amount of references for this link property.
MaxThe maximum amount of references for this link property.
extensions:weakLink

Target items that are linked via weak link property will not be published or withdrawn together with the linking content item automatically. The default setting is "false".

At Unified API level non existing link targets are represented by a destroyed content object. During content bean creation the ContentBeanFactory converts these destroyed contents to null and filters them from created content bean lists.

Caution!

The introduction of weak links to a document type model comes with a caveat:

  • Weak links can cause dead links in the live environment.

  • Unified API client code has to cope with destroyed contents.

  • Content bean code has to cope with null values and filtered lists of content beans.

Table 4.4. Attributes of LinkListProperty


Example for creating a LinkListProperty:

<LinkListProperty Name="Images" LinkType="Image"/>

Only content items of type Image or subtypes are allowed in this link list.

Note

Note

If you want to create an annotated link list from the Blueprint (see Section 7.20, “Annotated LinkLists” in Studio Developer Manual), you have to define an XML Struct property, not a LinkList property.

Indexing

If you initialize the Content Server, a lot of indices are created in the database. They will speed up the operation of the server, loading of resources, for instance. However, no indices are generated for the user defined content properties by default, because:

  • Indices for properties would only speed up queries.

  • Indices for properties would slow down creation and changing of content.

If you need to have a very fast query via the Site Manager or the Query-API (but not the CoreMedia Search Engine) you might create indices for the DateProperty, IntProperty and StringProperty.

It's possible to create these indices automatically, if you set the attribute Index of the DocType, DateProperty, IntProperty or StringProperty element to "true". If you set Index="true" for the DocType element, indices would be created for all DateProperty, IntProperty and StringProperty fields contained in this content type.

Attributes for Translation

The attributes extensions:translatable and extensions:automerge, which can be attached to all properties, affect the translation behavior. extensions:automerge also affects the synchronization behavior.

Translatable Properties

In order to support automatic translation processes, properties of the document model can be marked as translatable. When translating a document automatically, only properties that set the attribute extensions:translatable="true" should be included.

<StringProperty Name="keywords" Length="1024"
  extensions:translatable="true"/>

In general, most string and richtext properties will be marked translatable, excluding those that contain technical strings and identifiers.

Automatically Merged Properties

Usually all non-translatable properties in the master content will be applied automatically to the derived content when a translation task is accepted. This helps to keep binary and structural data in sync between sites, such as images, crops, settings, and the navigation hierarchy, and complements the XLIFF-based update of translatable properties. To enable the automatic merge for a translatable property or disable the automatic merge for a non-translatable property the extensions:automerge attribute has to be attached.

<XmlProperty Name="settings" Grammar="coremedia-struct-2008"
extensions:translatable="true" extensions:automerge="true"/>

For a synchronization workflow, all properties are synchronized, by default, between a master content and its derived content. You can disable this behavior by setting extensions:automerge to false or by unchecking the checkbox Keep synchronized with Master of the content in Studio (see Section 4.7.5.3, “Removing Content Permanently from Synchronization” in Studio User Manual for details).

Interaction of translation attributes

Both attributes have no effect when you derive a site. A derived site is a complete copy of the master site. Only links are changed, so that they point to content in the derived site and not to content in the master site.

However, the attribute extensions:translatable influences the effect of the extensions:automerge attribute during translation, as is shown in Table 4.5, “ Interaction between attributes ”.

Bold text in columns Translatable and Automerge in the table, marks default settings. So when translatable is true you do not have to set automerge to false because this is the default behavior.

A, AA', A' marks where a property has changed. If only the property in the original site has changed (A), only the property in the derived site has changed (A') or both sites have changed (AA').

Translatable Automerge Translation Workflow Result

True

True

A
A' is changed to new A value
AA'
A' keeps its value
A'
A' keeps its value

True

False

A
A' keeps its value
AA'
A' keeps its value
A'
A' keeps its value

False

True

A
A' is changed to new A value
AA'
A' keeps its value
A'
A' keeps its value

False

False

A
A' keeps its value
AA'
A' keeps its value
A'
A' keeps its value

Table 4.5.  Interaction between attributes


String Properties and UTF-8 Encoded Database

In an UTF-8 encoded database, up to three bytes are required to store a single character. ASCII characters are stored in one byte and non-ASCII Latin-1 characters (such as German umlauts) in two bytes. Asian characters need three bytes for representation.

The attribute Length in the element StringProperty defines the maximum length of allowed characters. The actual byte size of the generated varchar table column in the UTF-8 encoded relational database is a product of the value of Length with an additional factor.

To avoid representation problems and to store even Asian characters the simplest but wasteful way would be to multiply the string Length defined in the StringProperty element with a factor of three to compute the length of the generated varchar table column that holds the string values. In addition to the waste of storage, this could lead to database problems because database boundaries are reached when many string properties with big Length values are specified in one content type or within a content type inheritance hierarchy. To be more flexible, every StringProperty element can have an attribute UTF8Length to specify the maximum number of bytes to hold a string property value. The value must be at least equal and at most three times greater than the value of the Length attribute. If for nearly all string properties in the content type schema the ratio of maximum character length to byte length is the same, one can simply add an attribute Utf8Weight to the DocumentTypeModel element. The value must be between 100 and 300 and, when divided by 100, defines the ratio between character and byte length for all string properties in the type schema where the attribute Utf8Length is not explicitly set. The default value for the Utf8Weight attribute, if omitted, is 300.

For example the value of the attribute Utf8Weight can be set to 130. If a string property with a given Length attribute value of 50 and without Utf8Length attribute is specified, then the maximum byte length is 130/100 * 50 = 65. This may be enough for German text strings, because a string with a character length of 50 could contain 15 two byte encoded characters (such as German umlauts). If the length of a string is less than 49 characters, then even more non-ASCII characters are allowed.

Note

Note

If you are using a Microsoft SQL Server, things are easier. The CoreMedia server uses nvchar for string properties in the SQL Server which can simply be used for Unicode strings. So, you only need to set the UTF8Weight attribute of the DocTypes element to 100. No triple size is needed, no UTF8Length attributes for string properties are required.

Note

Note

If you are using MySQL, things are much easier. The Content Server will always use the defined length for creating columns in MySQL. Do not specify a UTF8Weight or a UTF8Length attribute.

Search Results

Table Of Contents