...
The JSMA content provides the following methods:
...
Pathname content.asPdf([filename])
Renders an HTML-content into a PDF via wkhtmltopdf and returns it as a JSMA File for further access.
...
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.flexAttributes
... |
string content.get(key)
Returns the flex attribute for specified parameter keyvalue of key as string or null if no value is set under the key.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.get(key)
... |
Parameter key:string (required)
The key to be looked up in the flexAttributes of the content.
string content.cacheKey
Returns a string that you can use in the fragment cache. This string will change whenever the content changes.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.cacheKey # => "7346689223053409007"
... |
String content.getContentUnprocessed()
Returns the raw unprocessed body of a content.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.getContentUnprocessed()
... |
...
Returns the date of when a content has been locked on
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.getLockDate
... |
...
Returns the specified locking reason.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.getLockMessage
... |
...
Returns an information object about the user.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.getLockUser # => { id: 1, email: 'user@example.org' }
... |
boolean content.has(key)
Checks whether a content has flex attribute with the specified parameter keyReturns a boolean value depending on whether key is present for a given content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.has(key)
... |
Parameter key:string (required)
The key to be checked in the flexAttributes of the content
content.id
Return the ID of a content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.id
... |
...
Increments the vale of a given key by one.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.increment(key)
... |
Parameter key:string (required)
The key to be incremented in the flexAttributes of the order.
Boolean content.isLocked
Returns whether a content is currently locked.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.isLocked
... |
...
Returns the last changes that have been made to the content.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.lastChanges
... |
...
Returns the name of the last user that changed the content.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.lastChangesBy => 'a.user'
... |
Void content.lock([reason])
Locks a content.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.lock('Do not edit.')
... |
...
Returns the regular expression this content is mapped with.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.mapping
... |
...
Returns the mapping type of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.mappingType
... |
...
Return the meta description of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.metaDescription
... |
...
Returns the meta keywords of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.metaKeywords
... |
...
Returns the meta title of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.metaTitle
... |
...
Returns the mime type of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.mimeType
... |
...
Returns the name of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.name
... |
...
Returns the package ID of a content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.packageId
... |
content.remove(key)
Removes flex attribute for specified parameter the key from a the flexAttributes of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.remove(key)
... |
Parameter key:string (required)
The key to be removed from the flexAttributes of the order.
int content.revision
Returns the revision of a content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.revision
... |
content.set(key, value, [options])
Sets the value of a (key, value) pair as flex attributes specified key for a given content.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.set(key, value, [options])
... |
Parameter key:string (required)
The key to be set in the flexAttributes of the content.
Parameter value:string (required)
The value to be set for the key
Parameter options:object (optional)
May have a key 'broadcastEvent':bool which determines whether the log message shows up in the websocket log view.
content.setBody(body)
Sets the body of the content to the specified parameter
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.setBody(body)
... |
...
Sets the name of the content to the specified parameter
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.setName(name)
... |
...
Info |
---|
|
This entity is slice aware, which means that to use this facility: - there must be a logged in user in the context of the execution
- this user must be currently within a slice
- this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)
|
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.sliceId
... |
...
Returns an arrow of the tags for a content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.tags
... |
...
Returns the template used for a content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.template
... |
...
Returns the content type of a content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.type
... |
content.unlock([reason])
Unlocks a content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.unlock([reason])
... |
...
content.update(options)
Updates the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.update(options)
... |
...
Returns the UUID of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.uuid
... |
...
Returns the version of the content
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
content.version
... |
...