Class CMSRecord
This class represents a Salesforce CMS record, exposing its:
id, see getID()type, see getType()attributes, see getAttributes()
The attributes are key value pairs:
- the key being the attribute id as given in the
type.attribute_definitionsentries - the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the
type.attribute_definitionsentries (similar to how ComponentScriptContext.getContent()exposes the raw attribute value of a Component.getAttribute(String)in shape of a DWScript API object based on the attribute type)
| Property | Description |
|---|---|
ID: String (read-only) | Return the id of the Salesforce CMS record. |
attributes: Map (read-only) | Return the Salesforce CMS record attributes as key value pairs:
|
type: Map (read-only) | Return the type of the Salesforce CMS record sufficing the content/schema/cmsrecord.json#/definitions/cms_content_type schema. |
This class does not have a constructor, so you cannot create it directly.
| Method | Description |
|---|---|
| getAttributes() | Return the Salesforce CMS record attributes as key value pairs:
|
| getID() | Return the id of the Salesforce CMS record. |
| getType() | Return the type of the Salesforce CMS record sufficing the content/schema/cmsrecord.json#/definitions/cms_content_type schema. |
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
- ID: String
(read-only) Return the id of the Salesforce CMS record.
- attributes: Map
(read-only) Return the Salesforce CMS record attributes as key value pairs:
-
the key being the attribute id as given in the
[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries -
the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the
[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries (similar to how ComponentScriptContext.getContent()exposes the raw attribute value of a Component.getAttribute(String)in shape of a DWScript API object based on the attribute type)
The attributes are also conveniently accessible through named property support. That means if
myCmsRecord.getAttributes().get('foo')yields value'bar', thenmyCmsRecord.foowill give the same results.-
the key being the attribute id as given in the
- type: Map
(read-only) Return the type of the Salesforce CMS record sufficing the
content/schema/cmsrecord.json#/definitions/cms_content_typeschema. Properties can be accessed accordingly:getType().id : stringgetType().name : stringgetType().attribute_definitions : Map(seecontent/schema/attributedefinition.json)
- getAttributes(): Map
Return the Salesforce CMS record attributes as key value pairs:
-
the key being the attribute id as given in the
[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries -
the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the
[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries (similar to how ComponentScriptContext.getContent()exposes the raw attribute value of a Component.getAttribute(String)in shape of a DWScript API object based on the attribute type)
The attributes are also conveniently accessible through named property support. That means if
myCmsRecord.getAttributes().get('foo')yields value'bar', thenmyCmsRecord.foowill give the same results.Returns:
- the cms record attributes
-
the key being the attribute id as given in the
- getID(): String
Return the id of the Salesforce CMS record.
Returns:
- the id of the Salesforce CMS record
- getType(): Map
Return the type of the Salesforce CMS record sufficing the
content/schema/cmsrecord.json#/definitions/cms_content_typeschema. Properties can be accessed accordingly:getType().id : stringgetType().name : stringgetType().attribute_definitions : Map(seecontent/schema/attributedefinition.json)
Returns:
- the type of the cms record