class PageJsonProcessor

Helper for reading and interpreting the Frontend Page JSON Format We have two syntaxes for attachment:

  • Syntax A: A fixed defined structure of components having a fixed documentId reference
  • Syntax B: A new, more flexible way by allowing the frontend to define elements with a @type=attachment key

Constants

JSONPATH_ALL_COMPONENTS

TYPES_WITH_ATTACHMENTS

JSONPATH_ATTACHMENT_TYPE

JSONPATH_CONTENTREFERENCE_TYPE

TYPES_WITH_SIGNED_CONFIG

INDEX_PROPERTIES

Methods

__construct(string $pageJson = null)

No description

array
getAttachmentUuids()

Returns an array of all used attachment uuids

array
getContentReferenceUuids()

Return array of all used content reference uuids (e.g. trendvote)

array
getIndexableContent()

Returns an array of all indexable content of the page

string
getJson()

Return Page JSON incl. all modifications

array
getJsonElements($jsonPath)

Runs a custom query against the JSON

void
modifyComponents($callback, $limitToTypes = [])

Allows to modify the component configuration by providing a callback which is called for each component and includes the JsonObject representation which can be modified

setJsonObject(stdClass $pageJson)

No description

void
signConfiguration()

Adds a cryptographic signature to all component configurations which require it for a secure backend options transport

void
updateAttachments(array $replaceArray)

Replaces the attachments based on the passed replaceArray which assigns a new document info for existing documentIds

void
updateContentReferencess(array $replaceArray)

Replaces the references based on the passed replaceArray which assigns a new reference info for existing references

Details

at line 41
__construct(string $pageJson = null)

No description

Parameters

string $pageJson

at line 73
array getAttachmentUuids()

Returns an array of all used attachment uuids

Return Value

array

at line 81
array getContentReferenceUuids()

Return array of all used content reference uuids (e.g. trendvote)

Return Value

array

at line 160
array getIndexableContent()

Returns an array of all indexable content of the page

Return Value

array

at line 65
string getJson()

Return Page JSON incl. all modifications

Return Value

string

at line 200
array getJsonElements($jsonPath)

Runs a custom query against the JSON

Parameters

$jsonPath

Return Value

array

at line 183
void modifyComponents($callback, $limitToTypes = [])

Allows to modify the component configuration by providing a callback which is called for each component and includes the JsonObject representation which can be modified

Parameters

$callback

Callback with callback(String $type, JsonElements $component) signature

$limitToTypes

string[] Array to modify only specific types e.g. ['ImageComponent']

Return Value

void

at line 56
PageJsonProcessor setJsonObject(stdClass $pageJson)

No description

Parameters

stdClass $pageJson

Return Value

PageJsonProcessor

at line 147
void signConfiguration()

Adds a cryptographic signature to all component configurations which require it for a secure backend options transport

Return Value

void

at line 111
void updateAttachments(array $replaceArray)

Replaces the attachments based on the passed replaceArray which assigns a new document info for existing documentIds

Parameters

array $replaceArray

['OLD_UUID' => ]

Return Value

void

Exceptions

Exception

at line 131
void updateContentReferencess(array $replaceArray)

Replaces the references based on the passed replaceArray which assigns a new reference info for existing references

Parameters

array $replaceArray

['OLD_UUID' => ]

Return Value

void

Exceptions

Exception