ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
ILIAS\StaticURL\Response\Factory Class Reference

Produces {. More...

+ Collaboration diagram for ILIAS\StaticURL\Response\Factory:

Public Member Functions

 __construct (private Context $context)
 
 cannot ()
 The Handler cannot process the given Request at all, e.g. More...
 
 cannotReach ()
 The target exists, but the CURRENT user has no permission to reach it. More...
 
 loginFirst ()
 Convenience: the Handler cannot serve the target with the current permissions. More...
 
 can (string $uri_path, bool $shift=false)
 The Handler successfully resolved the target. More...
 

Detailed Description

Produces {.

See also
Response} objects for {
\ILIAS\StaticURL\Handler\Handler} implementations. Each factory method documents how the {
\ILIAS\StaticURL\Handler\HandlerService} will react when the Handler returns that Response.
Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 31 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\StaticURL\Response\Factory::__construct ( private Context  $context)

Definition at line 33 of file Factory.php.

35 {
36 }

Member Function Documentation

◆ can()

ILIAS\StaticURL\Response\Factory::can ( string  $uri_path,
bool  $shift = false 
)

The Handler successfully resolved the target.

The HandlerService will redirect the user to the given URI path. Set $shift to true when the returned path is relative to the parent of the StaticURL base URI.

Definition at line 88 of file Factory.php.

88 : CanHandleWithURIPath
89 {
90 return new CanHandleWithURIPath($uri_path, $shift ? 1 : 0);
91 }

Referenced by ILIAS\Authentication\StaticUrlHandler\handle(), ILIAS\Badge\URL\StaticUrlHandler\handle(), ILIAS\PermanentLink\StaticURLHandler\handle(), ILIAS\Calendar\URL\CalendarStaticURLHandler\handle(), ILIAS\Certificate\StaticUrlHandler\handle(), ILIAS\Contact\URL\StaticUrlHandler\handle(), ILIAS\Exercise\PermanentLink\StaticURLHandler\handle(), ilFileStaticURLHandler\handle(), ILIAS\StaticURL\Shortlinks\Handler\handle(), ilKSDocumentationGotoLink\handle(), and ILIAS\Test\StaticURLHandler\handle().

+ Here is the caller graph for this function:

◆ cannot()

ILIAS\StaticURL\Response\Factory::cannot ( )

The Handler cannot process the given Request at all, e.g.

because the Request is malformed or references an unknown sub-target. This is a programmer/contract-level signal; it does NOT mean that the current user merely lacks permission (use {

See also
cannotReach()} or {
loginFirst()} for that).

The HandlerService will respond with HTTP 404.

Definition at line 47 of file Factory.php.

47 : CannotHandle
48 {
49 return new CannotHandle();
50 }

Referenced by ILIAS\Badge\URL\StaticUrlHandler\handle(), ILIAS\PermanentLink\StaticURLHandler\handle(), ILIAS\Certificate\StaticUrlHandler\handle(), ILIAS\Contact\URL\StaticUrlHandler\handle(), ILIAS\Exercise\PermanentLink\StaticURLHandler\handle(), ilFileStaticURLHandler\handle(), ILIAS\StaticURL\Handler\LegacyGotoHandler\handle(), and ILIAS\StaticURL\Shortlinks\Handler\handle().

+ Here is the caller graph for this function:

◆ cannotReach()

ILIAS\StaticURL\Response\Factory::cannotReach ( )

The target exists, but the CURRENT user has no permission to reach it.

If the {

See also
\ILIAS\StaticURL\Request\Request} carries a ReferenceId, the HandlerService walks up the repository tree and redirects to the first parent the user can read (and displays the course/group join message). If no readable parent is found, or no ReferenceId is given, the user is redirected to their Starting Point / Dashboard.

Definition at line 61 of file Factory.php.

61 : CannotReach
62 {
63 return new CannotReach();
64 }

Referenced by ILIAS\StaticURL\Response\Factory\loginFirst().

+ Here is the caller graph for this function:

◆ loginFirst()

ILIAS\StaticURL\Response\Factory::loginFirst ( )

Convenience: the Handler cannot serve the target with the current permissions.

If the user is ANONYMOUS, returns {

See also
MaybeCanHandlerAfterLogin} (the HandlerService redirects to login.php with the original target preserved). If the user is already LOGGED IN, returns {
CannotReach} (see {
cannotReach()} for the parent-fallback behaviour).

Definition at line 74 of file Factory.php.

74 : MaybeCanHandlerAfterLogin|CannotReach
75 {
76 if ($this->context->isUserLoggedIn()) {
77 return $this->cannotReach();
78 }
79
80 return new MaybeCanHandlerAfterLogin();
81 }
cannotReach()
The target exists, but the CURRENT user has no permission to reach it.
Definition: Factory.php:61

References ILIAS\StaticURL\Response\Factory\cannotReach().

Referenced by ILIAS\Badge\URL\StaticUrlHandler\handle(), ILIAS\PermanentLink\StaticURLHandler\handle(), ILIAS\Certificate\StaticUrlHandler\handle(), ILIAS\Contact\URL\StaticUrlHandler\handle(), ILIAS\Exercise\PermanentLink\StaticURLHandler\handle(), and ilFileStaticURLHandler\handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: