Properties

$components

$components : array

Required components

Type

array

$models

$models : array

Required models

Type

array

$seminary

$seminary : 

Current Seminary

var array

Type

$character

$character : array

Character of current user and Seminary

Type

array

$user

$user : array

Current user

Type

array

$permissions

$permissions : array

User permissions

Type

array

$seminaryPermissions

$seminaryPermissions : array

User seminary permissions

Type

array

$view

$view : \nre\core\View

View of the Controller

Type

\nre\core\View

$viewData

$viewData : array

Data to pass to the View

Type

array

$title

$title : array

Title information

Type

array

Methods

preFilter()

preFilter(\nre\core\Request  $request, \nre\core\Response  $response) 

Prefilter that is executed before running the Controller.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

postFilter()

postFilter(\nre\core\Request  $request, \nre\core\Response  $response) 

Prefilter that is executed after running the Controller.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

getTitle()

getTitle() : string

Return current title information.

Returns

string —

Title information

load()

load(string  $controllerName) 

Load the class of a Controller.

Parameters

string $controllerName

Name of the Controller to load

Throws

\nre\exceptions\ControllerNotFoundException
\nre\exceptions\ControllerNotValidException

factory()

factory(string  $controllerName, string  $layoutName, string  $action, string  $agent) 

Instantiate a Controller (Factory Pattern).

Parameters

string $controllerName

Name of the Controller to instantiate

string $layoutName

Name of the current Layout

string $action

Current Action

string $agent

Corresponding Agent

Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ViewNotFoundException

run()

run(\nre\core\Request  $request, \nre\core\Response  $response) 

Run the Controller.

This method executes the Action of the Controller defined by the current Request.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

Throws

\nre\exceptions\ParamsNotValidException
\nre\exceptions\IdNotFoundException
\nre\exceptions\DatamodelException
\nre\exceptions\ActionNotFoundException

render()

render(array  $viewData = null) : string

Generate the output.

Parameters

array $viewData

Data to pass to the View

Returns

string —

Generated output

index()

index(string  $seminaryUrl, string  $all = null) 

Action: index.

List all Quests for a Seminary.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $all

Show all Quests

quest()

quest(string  $seminaryUrl, string  $questgroupUrl, string  $questUrl, string  $questtexttypeUrl = null, integer  $questtextPos = 1) 

Action: quest.

Show a quest and its task.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $questgroupUrl

URL-Title of Questgroup

string $questUrl

URL-Title of Quest

string $questtexttypeUrl

URL-Title of Questtexttype

integer $questtextPos

Position of Questtext

Throws

\nre\exceptions\IdNotFoundException

submissions()

submissions(string  $seminaryUrl, string  $questgroupUrl, string  $questUrl) 

List Character submissions for a Quest.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $questgroupUrl

URL-Title of Questgroup

string $questUrl

URL-Title of Quest

Throws

\nre\exceptions\IdNotFoundException

submission()

submission(string  $seminaryUrl, string  $questgroupUrl, string  $questUrl, string  $characterUrl) 

Show and handle the submission of a Character for a Quest.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $questgroupUrl

URL-Title of Questgroup

string $questUrl

URL-Title of Quest

string $characterUrl

URL-Title of Character

Throws

\nre\exceptions\IdNotFoundException

create()

create(string  $seminaryUrl, string  $questgroupUrl) 

Action: create.

Create a new Quest.

Parameters

string $seminaryUrl

URL-Title of a Seminary

string $questgroupUrl

URL-Title of Questgroup

edit()

edit(string  $seminaryUrl, string  $questgroupUrl, string  $questUrl) 

Action: edit.

Edit a Quest of a Seminary.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $questgroupUrl

URL-Title of Questgroup

string $questUrl

URL-Title of Quest

Throws

\nre\exceptions\IdNotFoundException

edittask()

edittask(string  $seminaryUrl, string  $questgroupUrl, string  $questUrl) 

Action: edittask.

Edit the task of a Quest of a Seminary.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $questgroupUrl

URL-Title of Questgroup

string $questUrl

URL-Title of Quest

Throws

\nre\exceptions\IdNotFoundException

edittexts()

edittexts(string  $seminaryUrl, string  $questgroupUrl, string  $questUrl) 

Action: edittexts.

Edit the texts of a Quest of a Seminary.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $questgroupUrl

URL-Title of Questgroup

string $questUrl

URL-Title of Quest

Throws

\nre\exceptions\IdNotFoundException

delete()

delete(string  $seminaryUrl, string  $questgroupUrl, string  $questUrl) 

Action: delete.

Delete a Quest of a Seminary.

Parameters

string $seminaryUrl

URL-Title of Seminary

string $questgroupUrl

URL-Title of Questgroup

string $questUrl

URL-Title of Quest

Throws

\nre\exceptions\IdNotFoundException

__construct()

__construct(string  $layoutName, string  $action, \nre\core\Agent  $agent) 

Construct a new Controller.

Parameters

string $layoutName

Name of the current Layout

string $action

Current Action

\nre\core\Agent $agent

Corresponding Agent

Throws

\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ViewNotFoundException

checkAchievements()

checkAchievements(\nre\core\Request  $request, \nre\core\Response  $response, array  $checkConditions = null) 

Check for newly achieved Achievements.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

array $checkConditions

Conditions to check

addTitle()

addTitle(string  $title) 

Add a piece of information to the current title.

Parameters

string $title

Title information

addTitleLocalized()

addTitleLocalized(string  $title) 

Add a piece of information to the current title and localize it.

Parameters

string $title

Title information

log()

log(string  $message, integer  $logMode = \nre\core\Logger::LOGMODE_AUTO) 

Log an error.

Parameters

string $message

Error message to log

integer $logMode

Log mode (optional)

set()

set(string  $name, mixed  $data) 

Set data for the View.

Parameters

string $name

Key

mixed $data

Value

redirect()

redirect(string  $url) 

Redirect to the given URL.

Parameters

string $url

Relative URL

checkModels()

checkModels(string  $modelName) : boolean

Check if Models of this Controller are loaded and available.

Parameters

string $modelName

Arbitrary number of Models to check

Returns

boolean —

All given Models are loaded and available

getView()

getView() : \nre\core\View

Get the View of the Controller

Returns

\nre\core\View

View of the Controller

loadModels()

loadModels() 

Load the Models of this Controller.

Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException

loadView()

loadView(string  $layoutName, string  $action) 

Load the View of this Controller.

Parameters

string $layoutName

Name of the current Layout

string $action

Current Action

Throws

\nre\exceptions\ViewNotFoundException

checkPermission()

checkPermission(\nre\core\Request  $request, \nre\core\Response  $response) 

Check user permissions.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

Throws

\nre\exceptions\AccessDeniedException

getClassName()

getClassName(string  $controllerName) : string

Determine the classname for the given Controller name.

Parameters

string $controllerName

Controller name to get classname of

Returns

string —

Classname for the Controller name

loadComponents()

loadComponents() 

Load the Components of this Controller.

Throws

\nre\exceptions\ComponentNotValidException
\nre\exceptions\ComponentNotFoundException

renderTask()

renderTask(string  $questtypeClassname, array  $seminary, array  $questgroup, array  $quest, array  $character) : string

Render and handle the task of a Quest.

Parameters

string $questtypeClassname

Name of the class for the Questtype of a Quest

array $seminary

Seminary data

array $questgroup

Questgroup data

array $quest

Quest data

array $character

Character data

Returns

string —

Rendered output

renderTaskSubmission()

renderTaskSubmission(string  $questtypeClassname, array  $seminary, array  $questgroup, array  $quest, array  $character) : string

Render and handle a Character submission for a Quest.

Parameters

string $questtypeClassname

Name of the class for the Questtype of a Quest

array $seminary

Seminary data

array $questgroup

Questgroup data

array $quest

Quest data

array $character

Character data

Returns

string —

Rendered output

renderTaskEditing()

renderTaskEditing(string  $questtypeClassname, array  $seminary, array  $questgroup, array  $quest) : string

Render editing of a Quest.

Parameters

string $questtypeClassname

Name of the class for the Questtype of a Quest

array $seminary

Seminary data

array $questgroup

Questgroup data

array $quest

Quest data

Returns

string —

Rendered output

createQuesttypeResponse()

createQuesttypeResponse(string  $action,   $param1) : \nre\core\Response

Create a response for the Questtype rendering.

Parameters

string $action

Action to run

$param1

Returns

\nre\core\Response

Generated response

loadQuesttypeAgent()

loadQuesttypeAgent(string  $questtypeClassname, \nre\core\Request  $request, \nre\core\Response  $response) : \hhu\z\agents\QuesttypeAgent

Load and construct the QuesttypeAgent for a Questtype.

Parameters

string $questtypeClassname

Name of the class for the Questtype of a Quest

\nre\core\Request $request

Request

\nre\core\Response $response

Response

Returns

\hhu\z\agents\QuesttypeAgent

Questtype Agent

runQuesttypeAgent()

runQuesttypeAgent(\nre\core\Agent  $questtypeAgent, \nre\core\Request  $request, \nre\core\Response  $response) : string

Run and render the Agent for a QuesttypeAgent and return ist output.

Parameters

\nre\core\Agent $questtypeAgent

QuesttypeAgent to run and render

\nre\core\Request $request

Request

\nre\core\Response $response

Response

Returns

string —

Rendered output

sendSubmissionMail()

sendSubmissionMail(array  $seminary, array  $questgroup, array  $quest, array  $character) 

Send mail for new Character submission.

Parameters

array $seminary

Seminary which the Quest belongs to

array $questgroup

Questgroup of Quest

array $quest

Quest the answer has been submitted for

array $character

Character that send the submission

sendSubmissionApprovedMail()

sendSubmissionApprovedMail(array  $character, array  $seminary, array  $questgroup, array  $quest) 

Send mail for approval of a Character submission.

Parameters

array $character

Character of submission that has been approved

array $seminary

Seminary which the Quest belongs to

array $questgroup

Questgroup of Quest

array $quest

Quest the submission has been approved for