ePages 6.17.40 - DE_EPAGES/Presentation/Servlet/JSON.pm

Package DE_EPAGES::Presentation::Servlet::JSON

Extends the permission servlet with processing json request of an object

Base
DE_EPAGES::Presentation::Servlet::Permission

Functions

errorFiles
errorText
handleInvalidForm
handlePermissionDenied
processMonitorContent
viewError
writeContentOutput

errorFiles

Returns a list of error files for a language-neutral template file.

Syntax
$aFiles = $Servlet->errorFiles( $Package, $LanguageCode );
Example
$aFiles = $Servlet->errorFiles( 'DE_EPAGES::Presentation::UI::Object', 'de' );
Input
$Package (string)
package name of error
$LanguageCode (string)
language code
Return
$aFiles (array ref)
list of error file names

errorText

Returns a localized error message.

Syntax
$Message = $Servlet->errorText($Reason, $Package, $hVars);
Input
$Reason (string)
error code
$Package (string)
package of error
$hVars (ref.hash)
TLE variables
Return
$Message (string)
error message

handleInvalidForm

calls viewError direct, if no ErrorAction defined

Syntax
$self->handleInvalidForm( $Error );
$self->handleInvalidForm( $Error, $OnChangeAction, $ErrorAction, $ErrorObjectID );
Input
$Error (object)
error object
$OnChangeAction (boolean)
(optional) see DE_EPAGES::Presentation::Servlet::Permission::handleInvalidForm
$ErrorAction (object)
(optional) error action
$ErrorObjectID (integer)
(optional) error object id

handlePermissionDenied

Dispays the login form as a result of an unauthorized view action. Triggers the action ViewLoginForm and sets the followg TLE variables:

Syntax
$self->handlePermissionDenied( $Error );
Input
$Error (object)
error object

processMonitorContent

Disables the monitor page

Syntax
$MonitorContentSub = $self->processMonitorContent
$MonitorContentSub | undef | ref.code

viewError

Displays an error page by processing the page type Error with the System object. Information about the error is added as TLE variables

Syntax
$self->viewError( $Error );
Input
$Error (object)
error object

writeContentOutput

Writes the json content direct to the servlet output. If parameter 'callback' is set, then a JSONP answer is generated.

Syntax
$Servlet->writeContentOutput( $rContent );
Example
$Servlet->writeContentOutput($Object->get([qw (Alias NameOrAlias ObjectID Position)]));
Input
$rContent (ref)
array or hash reference containing string values (not encoded)
Only HASH and ARRAY references are allowed.
Object references are not allowed.
See also "JSON::encode()".