Content Application Developer Manual / Version 2307
Table Of ContentsThis section examines the structure of Blueprint content beans. The structure of these content beans shows best practices to be considered when writing or modifying content bean classes.
The Blueprint content bean classes comprise three files per content type:
An interface with the same name as the content type, for example
CMArticle
.An abstract class ending with “Base”, for example
CMArticleBase
, andA concrete class ending with “Impl", for example
CMArticleImpl
.
The interface is what you should use in other classes, “*Base” contains the repository access code and “*Impl” is the actual class that is instantiated. This class is the place for you to add business logic. When a content type inherits from another type, its "*Base" class inherits the "*Impl" class of its parent. This way, it inherits the custom extensions made for the supertype. For content types that do not have a parent, the "*Base" class inherits from a framework class AbstractContentBean that defines the underlying content bean, factory, equality and hash code as well as a few convenience methods.
The "*Base" class contains property getters for every user-defined property in the corresponding content type. Getters are not used for metadata such as name or creation date. The property types are mapped to Java as follows:
Property Type | Java Type | Conversion |
---|---|---|
IntProperty
| int | Simply the value from the underlying content object |
StringProperty
| String | Simply the value from the underlying content object |
DateProperty
| Calendar | Simply the value from the underlying content object |
XmlProperty
(with grammar "coremedia-struct-2008")
| Struct |
The parsed
Struct
value from the underlying content object
|
XmlProperty
| Markup | The markup is transformed. Every internal xlink to a content item or blob is transformed into the corresponding content bean id or blob id. |
BlobProperty
|
CapBlobRef
|
This is the result of
#getBlobRef
of the underlying content object
|
LinkListProperty
| List | Every content object in the link list is converted to a bean through the content bean factory |
Table 4.1. Content property to Java property mappings