diff --git a/bundles/create/introduction.rst b/bundles/create/introduction.rst index 599130f9..28e6cdce 100644 --- a/bundles/create/introduction.rst +++ b/bundles/create/introduction.rst @@ -519,6 +519,62 @@ configure the ``cmf_create.object_mapper_service_id``. CreatePHP would support specific mappers per RDFa type. If you need that, dig into the CreatePHP and CreateBundle and do a pull request to enable this feature. +Workflows +--------- + +CreateJS uses a REST api for creating, loading and changing content. To delete content +the HTTP method DELETE is used. Since deleting might be a more complex operation +than just removing the content form the storage (e.g. getting approval by another +editor) there is no simple delete button in the user frontend. Instead, CreateJS and +CreatePHP use "workflows" to implement that. This bundle comes with a simple implementation +of a workflow to delete content. To enable the workflow set the config option 'delete' to true. + +.. configuration-block:: + + .. code-block:: yaml + + cmf_create: + persistence: + phpcr: + delete: true + + .. code-block:: xml + + + + + + + + + + + + .. code-block:: php + + $container->loadFromExtension('cmf_create', array( + 'persistence' => array( + 'phpcr' => array( + 'delete' => true, + ), + ), + )); + +This results in the delete workflow being registered with CreatePHP and CreateJS so that +you can now delete content from the frontend. + +.. note:: + + The provided workflow supports PHPCR persistence only. It deletes the currently selected + content once you confirmed deletion in the frontend. If the currently selected property is + a property of the page the whole page is deleted. + +In a more complex setup you need to create your own workflow instance, register it with CreatePHP +and implement your logic in the workflows run method. + +Currently the bundle only supports delete workflows but that will change in the future. .. _`create.js`: http://createjs.org .. _`hallo.js`: http://hallojs.org diff --git a/reference/configuration/create.rst b/reference/configuration/create.rst index acd10270..954fce4b 100644 --- a/reference/configuration/create.rst +++ b/reference/configuration/create.rst @@ -86,6 +86,7 @@ persistence configuration has the following configuration: model_class: ~ controller_class: Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController basepath: /cms/media + delete: false .. code-block:: xml @@ -96,6 +97,7 @@ persistence configuration has the following configuration: 'Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController', 'basepath' => '/cms/media', ), + 'delete' => false, ), ), )); @@ -153,6 +156,14 @@ provided by the MediaBundle. If you need different image handling, you can either overwrite ``model_class`` and/or the ``controller_class``. +delete +"""""" +**type**: ``boolean`` **default**: ``false`` + +Set delete to true to enable the simple delete workflow. This allows to directly +delete content from the frontend. Be careful, there are no special checks once you confirm deletion +your content is gone. + Metadata Handling ~~~~~~~~~~~~~~~~~