eZPublishCommunityProject  2013.9
eZ\Publish\Core\REST\Server\Controller\Content Class Reference

Content controller. More...

+ Inheritance diagram for eZ\Publish\Core\REST\Server\Controller\Content:
+ Collaboration diagram for eZ\Publish\Core\REST\Server\Controller\Content:

Public Member Functions

 copyContent ($contentId)
 Creates a new content object as copy under the given parent location given in the destination header. More...
 
 createContent ()
 Creates a new content draft assigned to the authenticated user. More...
 
 createDraftFromCurrentVersion ($contentId)
 The system creates a new draft version as a copy from the current version. More...
 
 createDraftFromVersion ($contentId, $versionNumber)
 The system creates a new draft version as a copy from the given version. More...
 
 createRelation ($contentId, $versionNumber)
 Creates a new relation of type COMMON for the given draft. More...
 
 createView ()
 Creates and executes a content view. More...
 
 deleteContent ($contentId)
 The content is deleted. More...
 
 deleteContentVersion ($contentId, $versionNumber)
 The version is deleted. More...
 
 loadContent ($contentId)
 Loads a content info, potentially with the current version embedded. More...
 
 loadContentInVersion ($contentId, $versionNumber)
 Loads a specific version of a given content object. More...
 
 loadContentVersions ($contentId)
 Returns a list of all versions of the content. More...
 
 loadVersionRelation ($contentId, $versionNumber, $relationId)
 Loads a relation for the given content object and version. More...
 
 loadVersionRelations ($contentId, $versionNumber)
 Loads the relations of the given version. More...
 
 publishVersion ($contentId, $versionNumber)
 The content version is published. More...
 
 redirectContent ()
 Loads a content info by remote ID. More...
 
 redirectCurrentVersion ($contentId)
 Loads a specific version of a given content object. More...
 
 redirectCurrentVersionRelations ($contentId)
 Redirects to the relations of the current version. More...
 
 removeRelation ($contentId, $versionNumber, $relationId)
 Deletes a relation of the given draft. More...
 
 updateContentMetadata ($contentId)
 Updates a content's metadata. More...
 
 updateVersion ($contentId, $versionNumber)
 A specific draft is updated. More...
 
- Public Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
 setContainer (Container $container)
 
 setInputDispatcher (InputDispatcher $inputDispatcher)
 
 setRepository (Repository $repository)
 
 setRequest (Request $request=null)
 
 setRequestParser (RequestParser $requestParser)
 
 setRouter (RouterInterface $router)
 

Additional Inherited Members

- Protected Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
 getMediaType ()
 Extracts the requested media type from $request. More...
 
- Protected Attributes inherited from eZ\Publish\Core\REST\Server\Controller
 $container
 
 $inputDispatcher
 
 $repository
 
 $request
 
 $requestParser
 
 $router
 

Detailed Description

Content controller.

Member Function Documentation

eZ\Publish\Core\REST\Server\Controller\Content::copyContent (   $contentId)

Creates a new content object as copy under the given parent location given in the destination header.

Parameters
$contentId
Returns
eZ\Publish\Core\REST\Server\Controller\Content::createContent ( )

Creates a new content draft assigned to the authenticated user.

If a different userId is given in the input it is assigned to the given user but this required special rights for the authenticated user (this is useful for content staging where the transfer process does not have to authenticate with the user which created the content object in the source server). The user has to publish the content if it should be visible.

Returns
eZ\Publish\Core\REST\Server\Controller\Content::createDraftFromCurrentVersion (   $contentId)

The system creates a new draft version as a copy from the current version.

Parameters
mixed$contentId
Exceptions
ForbiddenExceptionif the current version is already a draft
Returns
eZ\Publish\Core\REST\Server\Controller\Content::createDraftFromVersion (   $contentId,
  $versionNumber 
)

The system creates a new draft version as a copy from the given version.

Parameters
mixed$contentId
mixed$versionNumber
Returns
eZ\Publish\Core\REST\Server\Controller\Content::createRelation (   $contentId,
  $versionNumber 
)

Creates a new relation of type COMMON for the given draft.

Parameters
mixed$contentId
int$versionNumber
Exceptions
ForbiddenExceptionif version $versionNumber isn't a draft
ForbiddenExceptionif a relation to the same content already exists
Returns
eZ\Publish\Core\REST\Server\Controller\Content::createView ( )

Creates and executes a content view.

Returns
eZ\Publish\Core\REST\Server\Controller\Content::deleteContent (   $contentId)

The content is deleted.

If the content has locations (which is required in 4.x) on delete all locations assigned the content object are deleted via delete subtree.

Parameters
mixed$contentId
Returns
eZ\Publish\Core\REST\Server\Controller\Content::deleteContentVersion (   $contentId,
  $versionNumber 
)

The version is deleted.

Parameters
mixed$contentId
mixed$versionNumber
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns
eZ\Publish\Core\REST\Server\Controller\Content::loadContent (   $contentId)

Loads a content info, potentially with the current version embedded.

Parameters
mixed$contentId
Returns
eZ\Publish\Core\REST\Server\Controller\Content::loadContentInVersion (   $contentId,
  $versionNumber 
)

Loads a specific version of a given content object.

Parameters
mixed$contentId
int$versionNumber
Returns
eZ\Publish\Core\REST\Server\Controller\Content::loadContentVersions (   $contentId)

Returns a list of all versions of the content.

This method does not include fields and relations in the Version elements of the response.

Parameters
mixed$contentId
Returns
eZ\Publish\Core\REST\Server\Controller\Content::loadVersionRelation (   $contentId,
  $versionNumber,
  $relationId 
)

Loads a relation for the given content object and version.

Parameters
mixed$contentId
int$versionNumber
mixed$relationId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\Content::loadVersionRelations (   $contentId,
  $versionNumber 
)

Loads the relations of the given version.

Parameters
mixed$contentId
mixed$versionNumber
Returns
eZ\Publish\Core\REST\Server\Controller\Content::publishVersion (   $contentId,
  $versionNumber 
)

The content version is published.

Parameters
mixed$contentId
mixed$versionNumber
Exceptions
ForbiddenExceptionif version $versionNumber isn't a draft
Returns
eZ\Publish\Core\REST\Server\Controller\Content::redirectContent ( )

Loads a content info by remote ID.

Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\BadRequestException
Returns
eZ\Publish\Core\REST\Server\Controller\Content::redirectCurrentVersion (   $contentId)

Loads a specific version of a given content object.

Parameters
mixed$contentId
Returns
eZ\Publish\Core\REST\Server\Controller\Content::redirectCurrentVersionRelations (   $contentId)

Redirects to the relations of the current version.

Parameters
mixed$contentId
Returns
eZ\Publish\Core\REST\Server\Controller\Content::removeRelation (   $contentId,
  $versionNumber,
  $relationId 
)

Deletes a relation of the given draft.

Parameters
mixed$contentId
int$versionNumber
mixed$relationId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\Content::updateContentMetadata (   $contentId)

Updates a content's metadata.

Parameters
mixed$contentId
Returns
eZ\Publish\Core\REST\Server\Controller\Content::updateVersion (   $contentId,
  $versionNumber 
)

A specific draft is updated.

Parameters
mixed$contentId
mixed$versionNumber
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
\eZ\Publish\Core\REST\Server\Exceptions\BadRequestException
Returns

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