Beta version

class DocumentsController extends RozierApp

Class DocumentsController

Constants

AJAX_TOKEN_INTENTION

SCHEMA_TOKEN_INTENTION

FONT_TOKEN_INTENTION

DEFAULT_ITEM_PER_PAGE

Methods

Request
getRequest()

Shortcut to return the request service.

setContainer(Container $container)

No description

Container
getContainer()

No description

mixed
getService(string|null $key = null)

Get mixed object from Dependency Injection container.

mixed
get(string $serviceName)

Return a service from container.

bool
has(string $serviceName)

Returns true if the service is defined.

AuthorizationChecker
getAuthorizationChecker()

Alias for $this->container['securityAuthorizationChecker'].

TokenStorageInterface
getTokenStorage()

Alias for $this->container['securityTokenStorage'].

EntityManager
em()

Alias for $this->container['em'].

Translator
getTranslator()

No description

Twig_Environment
getTwig()

No description

string
generateUrl(string|NodesSources $route, mixed $parameters = array(), int $referenceType = Router::ABSOLUTE_PATH)

Wrap $this->container['urlGenerator']->generate

RedirectResponse
redirect(string $url, integer $status = Response::HTTP_FOUND)

Returns a RedirectResponse to the given URL.

static string
getCalledClass()

No description

validateAccessForRole(string $role)

Validate a request against a given ROLE_* and throws an AccessDeniedException exception.

RedirectResponse
removeTrailingSlashAction(Request $request)

Custom route for redirecting routes with a trailing slash.

string
renderView(string $view, array $parameters = array())

Returns a rendered view.

Response
render(string $view, array $parameters = array(), Response $response = null, string $namespace = '')

Return a Response from a template string with its rendering assignation.

JsonResponse
renderJson(array $data = array(), int $httpStatus = JsonResponse::HTTP_OK)

No description

createEntityListManager(mixed $entity, array $criteria = array(), array $ordering = array())

Creates and returns an EntityListManager instance.

createContactFormManager()

Create and return a ContactFormManager to build and send contact form by email.

createEmailManager()

Create and return a EmailManager to build and send emails.

static string
getThemeName()

No description

static string
getThemeAuthor()

No description

static string
getThemeCopyright()

No description

static string
getThemeDir()

No description

static string
getThemeMainClassName()

No description

static string
getThemeMainClass()

No description

static string
getThemeRequire()

No description

static boolean
isBackendTheme()

No description

__init()

Initialize controller with its twig environment.

static FileLocator
getFileLocator()

Return a file locator with theme Resource folder.

static RouteCollection
getRoutes()

No description

static RouteCollection
getBackendRoutes()

These routes are used to extend Roadiz back-office.

static string
getThemeFolder()

Return theme root folder.

static string
getResourcesFolder()

Return theme Resource folder according to main theme class inheriting AppController.

static string
getViewsFolder()

No description

static string
getTranslationsFolder()

No description

string
getStaticResourcesUrl()

No description

$this
prepareBaseAssignation()

Prepare base informations to be rendered in twig templates.

from RozierApp
Response
throw404(string $message = '')

Return a Response with default backend 404 error page.

getTheme()

Return the current Theme

static 
setupDependencyInjection(Container $container)

Append objects to the global dependency injection container.

from RozierApp
publishConfirmMessage(Request $request, string $msg, NodesSources $source = null)

Publish a confirm message in Session flash bag and logger interface.

publishErrorMessage(Request $request, string $msg, NodesSources $source = null)

Publish an error message in Session flash bag and logger interface.

validateNodeAccessForRole(string $role, integer|null $nodeId = null, boolean|false $includeChroot = false)

Validate a request against a given ROLE_* and check chroot and newsletter type/accces and throws an AccessDeniedException exception.

Response
maintenanceAction(Request $request)

Generate a simple view to inform visitors that website is currently unavailable.

RedirectResponse|Response
indexAction(Request $request, null $folderId = null)

No description

Response
cssAction(Request $request)

No description

from RozierApp
JsonResponse|Response
adjustAction(Request $request, $documentId)

No description

Response
editAction(Request $request, int $documentId)

No description

Response
previewAction(Request $request, int $documentId)

No description

Response
deleteAction(Request $request, int $documentId)

Return an deletion form for requested document.

Response
bulkDeleteAction(Request $request)

Return an deletion form for multiple docs.

Response
bulkDownloadAction(Request $request)

Return an deletion form for multiple docs.

Response
embedAction(Request $request, int $folderId = null)

Embed external document page.

Response
randomAction(Request $request, int $folderId = null)

Get random external document page.

Response
downloadAction(Request $request, int $documentId)

Download document file.

Response
uploadAction(Request $request, int $folderId = null, string $_format = 'html')

No description

Response
usageAction(Request $request, int $documentId)

Return a node list using this document.

randomDocument(int $folderId = null)

Download a random document.

Response
unusedAction(Request $request)

See unused documents.

Details

in Controller at line 72
Request getRequest()

Shortcut to return the request service.

Return Value

Request

in Controller at line 83
ContainerAwareInterface setContainer(Container $container)

Parameters

Container $container

Return Value

ContainerAwareInterface

in Controller at line 92
Container getContainer()

Return Value

Container

in Controller at line 106
mixed getService(string|null $key = null)

Get mixed object from Dependency Injection container.

Alias for $this->container[$key]

Parameters

string|null $key

Return Value

mixed

in Controller at line 114
mixed get(string $serviceName)

Return a service from container.

Parameters

string $serviceName

Return Value

mixed

in Controller at line 122
bool has(string $serviceName)

Returns true if the service is defined.

Parameters

string $serviceName

Return Value

bool true if the service is defined, false otherwise

in Controller at line 132
AuthorizationChecker getAuthorizationChecker()

Alias for $this->container['securityAuthorizationChecker'].

Return Value

AuthorizationChecker

in Controller at line 142
TokenStorageInterface getTokenStorage()

Alias for $this->container['securityTokenStorage'].

Return Value

TokenStorageInterface

in Controller at line 152
EntityManager em()

Alias for $this->container['em'].

Return Value

EntityManager

in Controller at line 160
Translator getTranslator()

Return Value

Translator

in Controller at line 168
Twig_Environment getTwig()

Return Value

Twig_Environment

in Controller at line 182
string generateUrl(string|NodesSources $route, mixed $parameters = array(), int $referenceType = Router::ABSOLUTE_PATH)

Wrap $this->container['urlGenerator']->generate

Parameters

string|NodesSources $route
mixed $parameters
int $referenceType

Return Value

string

in Controller at line 195
RedirectResponse redirect(string $url, integer $status = Response::HTTP_FOUND)

Returns a RedirectResponse to the given URL.

Parameters

string $url
integer $status

Return Value

RedirectResponse

in Controller at line 203
static string getCalledClass()

Return Value

string

in Controller at line 220
validateAccessForRole(string $role)

Validate a request against a given ROLE_* and throws an AccessDeniedException exception.

Parameters

string $role

Exceptions

AccessDeniedException

in Controller at line 234
RedirectResponse removeTrailingSlashAction(Request $request)

Custom route for redirecting routes with a trailing slash.

Parameters

Request $request

Return Value

RedirectResponse

in Controller at line 294
string renderView(string $view, array $parameters = array())

Returns a rendered view.

Parameters

string $view
array $parameters

Return Value

string

in AppController at line 285
Response render(string $view, array $parameters = array(), Response $response = null, string $namespace = '')

Return a Response from a template string with its rendering assignation.

Parameters

string $view Template file path
array $parameters Twig assignation array
Response $response Optional Response object to customize response parameters
string $namespace Twig loader namespace

Return Value

Response

Exceptions

Twig_Error_Runtime

in Controller at line 346
JsonResponse renderJson(array $data = array(), int $httpStatus = JsonResponse::HTTP_OK)

Parameters

array $data
int $httpStatus

Return Value

JsonResponse

in Controller at line 435
EntityListManager createEntityListManager(mixed $entity, array $criteria = array(), array $ordering = array())

Creates and returns an EntityListManager instance.

Parameters

mixed $entity Entity class path
array $criteria
array $ordering

Return Value

EntityListManager

in Controller at line 452
ContactFormManager createContactFormManager()

Create and return a ContactFormManager to build and send contact form by email.

Return Value

ContactFormManager

in Controller at line 462
EmailManager createEmailManager()

Create and return a EmailManager to build and send emails.

Return Value

EmailManager

in AppController at line 73
static string getThemeName()

Return Value

string

in AppController at line 87
static string getThemeAuthor()

Return Value

string

in AppController at line 101
static string getThemeCopyright()

Return Value

string

in AppController at line 116
static string getThemeDir()

Return Value

string

in AppController at line 124
static string getThemeMainClassName()

Return Value

string Main theme class name

in AppController at line 132
static string getThemeMainClass()

Return Value

string Main theme class (FQN class with namespace)

in AppController at line 149
static string getThemeRequire()

Return Value

string

in AppController at line 163
static boolean isBackendTheme()

Return Value

boolean

in AppController at line 183
__init()

Initialize controller with its twig environment.

in AppController at line 194
static FileLocator getFileLocator()

Return a file locator with theme Resource folder.

Return Value

FileLocator

in AppController at line 207
static RouteCollection getRoutes()

Return Value

RouteCollection

in AppController at line 219
static RouteCollection getBackendRoutes()

These routes are used to extend Roadiz back-office.

Return Value

RouteCollection

in AppController at line 236
static string getThemeFolder()

Return theme root folder.

Return Value

string

in AppController at line 251
static string getResourcesFolder()

Return theme Resource folder according to main theme class inheriting AppController.

Uses \ReflectionClass to resolve final theme class folder whether it’s located in project folder or in vendor folder.

Return Value

string

in AppController at line 258
static string getViewsFolder()

Return Value

string

in AppController at line 265
static string getTranslationsFolder()

Return Value

string

in AppController at line 272
string getStaticResourcesUrl()

Return Value

string

in RozierApp at line 68
$this prepareBaseAssignation()

Prepare base informations to be rendered in twig templates.

Available contents

  • request: Main request object
  • head
    • ajax: boolean
    • cmsVersion
    • cmsVersionNumber
    • cmsBuild
    • devMode: boolean
    • baseUrl
    • filesUrl
    • resourcesUrl
    • absoluteResourcesUrl
    • staticDomainName
    • ajaxToken
    • fontToken
    • universalAnalyticsId
    • useCdn
  • session
    • messages
    • id
    • user
  • securityAuthorizationChecker

Return Value

$this

in AppController at line 395
Response throw404(string $message = '')

Return a Response with default backend 404 error page.

Parameters

string $message Additionnal message to describe 404 error.

Return Value

Response

in AppController at line 412
Theme getTheme()

Return the current Theme

Return Value

Theme

in RozierApp at line 173
static setupDependencyInjection(Container $container)

Append objects to the global dependency injection container.

Parameters

Container $container

in AppController at line 531
publishConfirmMessage(Request $request, string $msg, NodesSources $source = null)

Publish a confirm message in Session flash bag and logger interface.

Parameters

Request $request
string $msg
NodesSources $source

in AppController at line 544
publishErrorMessage(Request $request, string $msg, NodesSources $source = null)

Publish an error message in Session flash bag and logger interface.

Parameters

Request $request
string $msg
NodesSources $source

in AppController at line 560
validateNodeAccessForRole(string $role, integer|null $nodeId = null, boolean|false $includeChroot = false)

Validate a request against a given ROLE_* and check chroot and newsletter type/accces and throws an AccessDeniedException exception.

Parameters

string $role
integer|null $nodeId
boolean|false $includeChroot

Exceptions

AccessDeniedException

in AppController at line 601
Response maintenanceAction(Request $request)

Generate a simple view to inform visitors that website is currently unavailable.

Parameters

Request $request

Return Value

Response

at line 80
RedirectResponse|Response indexAction(Request $request, null $folderId = null)

Parameters

Request $request
null $folderId

Return Value

RedirectResponse|Response $response

Exceptions

Twig_Error_Runtime

in RozierApp at line 153
Response cssAction(Request $request)

Parameters

Request $request

Return Value

Response $response

at line 156
JsonResponse|Response adjustAction(Request $request, $documentId)

Parameters

Request $request
$documentId

Return Value

JsonResponse|Response

at line 249
Response editAction(Request $request, int $documentId)

Parameters

Request $request
int $documentId

Return Value

Response

at line 330
Response previewAction(Request $request, int $documentId)

Parameters

Request $request
int $documentId

Return Value

Response

at line 373
Response deleteAction(Request $request, int $documentId)

Return an deletion form for requested document.

Parameters

Request $request
int $documentId

Return Value

Response

at line 422
Response bulkDeleteAction(Request $request)

Return an deletion form for multiple docs.

Parameters

Request $request

Return Value

Response

at line 472
Response bulkDownloadAction(Request $request)

Return an deletion form for multiple docs.

Parameters

Request $request

Return Value

Response

at line 521
Response embedAction(Request $request, int $folderId = null)

Embed external document page.

Parameters

Request $request
int $folderId

Return Value

Response

Exceptions

Twig_Error_Runtime

at line 576
Response randomAction(Request $request, int $folderId = null)

Get random external document page.

Parameters

Request $request
int $folderId

Return Value

Response

at line 612
Response downloadAction(Request $request, int $documentId)

Download document file.

Parameters

Request $request
int $documentId

Return Value

Response

at line 634
Response uploadAction(Request $request, int $folderId = null, string $_format = 'html')

Parameters

Request $request
int $folderId
string $_format

Return Value

Response

at line 734
Response usageAction(Request $request, int $documentId)

Return a node list using this document.

Parameters

Request $request
int $documentId

Return Value

Response

at line 1180
Document randomDocument(int $folderId = null)

Download a random document.

Parameters

int $folderId

Return Value

Document

Exceptions

Exception
EntityAlreadyExistsException

at line 1319
Response unusedAction(Request $request)

See unused documents.

Parameters

Request $request

Return Value

Response