From 47cf41699485109d3272df374cb0a45123396545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Ja=CC=88ger?= Date: Wed, 13 Aug 2014 21:48:02 +0200 Subject: [PATCH 1/3] document delete workflow --- bundles/create/introduction.rst | 22 ++++++++++++++++++++++ reference/configuration/create.rst | 10 ++++++++++ 2 files changed, 32 insertions(+) diff --git a/bundles/create/introduction.rst b/bundles/create/introduction.rst index 599130f9..d37fc830 100644 --- a/bundles/create/introduction.rst +++ b/bundles/create/introduction.rst @@ -519,6 +519,28 @@ 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 +--------- + +create.js 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 create.js 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. +This results in the delete workflow being registered with CreatePHP and create.js 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..0ebe50ac 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,13 @@ provided by the MediaBundle. If you need different image handling, you can either overwrite ``model_class`` and/or the ``controller_class``. +delete +"""""" + +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 ~~~~~~~~~~~~~~~~~ From 69475c69ce348f6b68aea6fb31b2fe0be0b23a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Ja=CC=88ger?= Date: Wed, 13 Aug 2014 22:06:17 +0200 Subject: [PATCH 2/3] remove trailing blanks --- bundles/create/introduction.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bundles/create/introduction.rst b/bundles/create/introduction.rst index d37fc830..044e3046 100644 --- a/bundles/create/introduction.rst +++ b/bundles/create/introduction.rst @@ -523,9 +523,9 @@ Workflows --------- create.js 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 create.js and +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 create.js 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. This results in the delete workflow being registered with CreatePHP and create.js so that @@ -537,7 +537,7 @@ you can now delete content from the frontend. 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 +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. From 5038f0f2a6031a328dbe9dd95324c482f3f478ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Ja=CC=88ger?= Date: Wed, 13 Aug 2014 22:30:53 +0200 Subject: [PATCH 3/3] made proposed changes --- bundles/create/introduction.rst | 40 +++++++++++++++++++++++++++--- reference/configuration/create.rst | 1 + 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/bundles/create/introduction.rst b/bundles/create/introduction.rst index 044e3046..28e6cdce 100644 --- a/bundles/create/introduction.rst +++ b/bundles/create/introduction.rst @@ -522,13 +522,47 @@ into the CreatePHP and CreateBundle and do a pull request to enable this feature Workflows --------- -create.js uses a REST api for creating, loading and changing content. To delete content +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 create.js and +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. -This results in the delete workflow being registered with CreatePHP and create.js so that + +.. 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:: diff --git a/reference/configuration/create.rst b/reference/configuration/create.rst index 0ebe50ac..954fce4b 100644 --- a/reference/configuration/create.rst +++ b/reference/configuration/create.rst @@ -158,6 +158,7 @@ If you need different image handling, you can either overwrite 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