A custom object is a general-purpose object represented by a CustomObject
object that can be subclassed, is independently securable, and can be persisted to the object store.
The CustomObject
class provides a minimal set of properties and exists primarily as a simple, customizable class that you can subclass and to which you can add custom properties. Unlike a Document
object, a CustomObject
object does not carry content, is not versionable, and does not support lifecycle functionality. In cases in which you need an object simply to carry properties and do not need it to carry content or be versionable, a CustomObject
object is preferable to a Document
object without content because there are fewer properties and therefore less overhead.
To increase its flexibility, the CustomObject
class (unlike most Content Engine classes) does not provide a specific property designated as its name property. Therefore, unless you add a custom name property to the CustomObject
class or its subclass, the value of a CustomObject
object's Name property defaults to the value of its ID property. To create a custom name property for a CustomObject
class, add a custom string-valued property to its class definition (or the class definition of a subclass) and set the IsNameProperty property of the custom property's
PropertyDefinitionString
object to true
. After you instantiate a new CustomObject
object and set the value of its custom name property, the CustomObject
object's Name property will be automatically populated with the value of the custom name property instead of the ID property.
A custom object has the following characteristics:
ReferentialContainmentRelationship
object).For code examples demonstrating how to create and use custom objects, see Working with Custom Objects.