13. Datasource

This chapter covers implementation-oriented topics on datasources. See Section 4, “Datasources” to learn how to configure your datasources.

Datasources provide an easy and abstracted way to query and manage data, independent of the specific backend system using a common query language (expressions). Currently 2 types of datasource implementation exist: Gentics .Node ContentRepository datasources are often called enhanced relational databases, are stored in SQL92 compliant database systems in a fixed database layout, and bring several advantages against common relational SQL layouts. LDAP datasources are stored in LDAPv3 compliant directories.

See the Gentics Infoportal for a detailed list of database products which were successfully tested for compatibility.

Please also consult the Gentics Infoportal for a list of limitations in functionality for different datasources and/or datastore products.

13.1. ContentRepository

13.1.1. typeid

The typeid of a datasource of type ContentRepository is contentrepository

13.1.2. Primary Key

The primary key for Gentics .Node ContentRepository datasources is "contentid".

13.1.3. Advantages

  • Versioning (store, read) datasets
  • Multivalue attributes
  • Runtime datastructure changes
  • Simplified relational queries

13.1.4. Database scheme

A generic database scheme, used for storing content published by Gentics Content.Node;, all standard modules provided by Gentics and the Gentics .Node PortalConnector. The scheme is independent of your data structure, and must not be adapted for new attributes. See “ContentRepository” (Section 4.3) for more information.

The following datatypes are supported:

Table 4.169. Attribute Types

Type IdTypeJava RepresentationType Description
1Text ShortStringA short text (maximum length 255 characters)
2Object LinkResolvableLink to another object (the 1:n relation, the id to the linkedobject is stored in this attribute)
3IntegerStringA normal-sized Integer (signed 32 bit integer). Will be returned as String for backward compatibility reasons.
5Text LongStringFor example used for Page content in Gentics Content.Node; (Replaced the deprecated type 4)
6Binary Contentbyte arrayBinary data (e.g. files)
7Foreign LinkCollection of ResolvablesReverse attribute to type 2. the n:1 relation. this attribute contains no data , it just points to the linkattribute of the foreignobject.
8Long IntegerLongA large integer (signed 64 bit integer).
9DoubleDoubleA normal-size (double-precision) floating-point number.
10DateTimestampAn attributetype which can hold a date and time.
[Note]Note

If you retrieve a Multivalue attribute the result will be a Collection containing all values as described above (Except Object Links which will be retruend as Collection of Resolvables).

13.2. Multichannelling ContentRepository

13.2.1. typeid

The typeid of a datasource of type ContentRepository is mccr

13.2.2. Primary Key

The Primary Key for MCCR datasources is "contentid".

13.2.3. Channel selection

The main difference between a Multichannelling ContentRepository and a ContentRepository is that when using a Multichannelling ContentRepository, the channel (or channels) to be used have to be selected.

Selecting channels can be done for each separate channel structure, that is published into the Multichannelling ContentRepository. A channel structure is a master node together with all its channels.

Initially, for each channel structure, the master node is selected.

The channel can be set using the mccr specific portal property path portal.datasources.[id].channel = [channelid]. (See “Portal” (Section 8.1) portal property paths). Selecting a channel using the portal property path will store this setting in the user session. Every datasource instance fetched by a portlet will now have the modified set of channels selected.

Alternatively, the channels may be set on a datasource instance, which will only affect this instance, e.g. like documented in “DatasourceQueryImp for MCCR datasources” (Section 1.7.3).

13.2.4. Meta Attributes

Meta Attributes are always present for all objects and can be used in filter rules.

Table 4.170. Multichannelling ContentRepository Meta Attributes

NameTypeDescription 
obj_typeIntegerType of the object: 10002 for folders, 10007 for pages and 10008 for files 
obj_idIntegerObject ID 
contentidStringComposition of "[obj_type].[obj_id]" 
channel_idIntegerChannel ID of the object 
channelset_idIntegerChannelset ID of the object. The channelset_id is a unique identifier of an object in a channel. Objects in different channels with the same channelset_id are channel-specific variants of the same object. 
updatetimestampIntegerUnix Timestamp of the last update to the object 

13.3. LDAP

13.3.1. typeid

The typeid of a datasource of type ContentRepository is ldap

13.3.2. Primary Key

The primary key for LDAP datasources is "dn".

13.3.3. Limitations

Gentics .Node ContentRepository specific datatypes like LinkedObject are not supported.

Writing is currently not supported.

Limited filter functionality in queries.