Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
content.cacheKey # => "7346689223053409007"
...

String content.getContentUnprocessed()

Returns the raw unprocessed body of a content.

Example

Code Block
languagejs
linenumberstrue
... 
content.getContentUnprocessed()
...

...

Returns the date of when a content has been locked on

Example

Code Block
languagejs
linenumberstrue
... 
content.getLockDate
...

...

Returns the specified locking reason.

Example

Code Block
languagejs
linenumberstrue
... 
content.getLockMessage
...

...

Returns an information object about the user.

Example

Code Block
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
content.id
...

...

Increments the vale of a given key by one.

Example

Code Block
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
content.isLocked
...

...

Returns the last changes that have been made to the content.

Example

Code Block
languagejs
linenumberstrue
... 
content.lastChanges
...

...

Returns the name of the last user that changed the content.

Example

Code Block
languagejs
linenumberstrue
... 
content.lastChangesBy => 'a.user'
...

Void content.lock([reason])

Locks a content.

Example

Code Block
languagejs
linenumberstrue
... 
content.lock('Do not edit.')
...

...

Returns the regular expression this content is mapped with.

Example

Code Block
languagejs
linenumberstrue
... 
content.mapping
...

...

Returns the mapping type of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.mappingType
...

...

Return the meta description of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.metaDescription
...

...

Returns the meta keywords of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.metaKeywords
...

...

Returns the meta title of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.metaTitle
...

...

Returns the mime type of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.mimeType
...

...

Returns the name of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.name
...

...

Returns the package ID of a content

Example

Code Block
languagejs
linenumberstrue
... 
content.packageId
...

content.remove(key)

Removes flex attribute for specified parameter the key from a the flexAttributes of the content

Example

Code Block
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
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
languagejs
linenumberstrue
... 
content.setBody(body)
...

...

Sets the name of the content to the specified parameter

Example

Code Block
languagejs
linenumberstrue
... 
content.setName(name)
...

...

Info
titleSlice aware

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
languagejs
linenumberstrue
... 
content.sliceId
...

...

Returns an arrow of the tags for a content

Example

Code Block
languagejs
linenumberstrue
... 
content.tags
...

...

Returns the template used for a content

Example

Code Block
languagejs
linenumberstrue
... 
content.template
...

...

Returns the content type of a content

Example

Code Block
languagejs
linenumberstrue
... 
content.type
...

content.unlock([reason])

Unlocks a content

Example

Code Block
languagejs
linenumberstrue
... 
content.unlock([reason])
...

...

content.update(options)

Updates the content

Example

Code Block
languagejs
linenumberstrue
... 
content.update(options)
...

...

Returns the UUID of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.uuid
...

...

Returns the version of the content

Example

Code Block
languagejs
linenumberstrue
... 
content.version
...

...