Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions bundles/create/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

<?xml version="1.0" charset="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services">
<config xmlns="http://cmf.symfony.com/schema/dic/create">
<persistence>
<phpcr
delete="true"
>
</phpcr>
</persistence>
</config>
</container>

.. 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users don't like a section with text only. What do you think of adding an example of the config setting here?

.. 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
Expand Down
11 changes: 11 additions & 0 deletions reference/configuration/create.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -96,6 +97,7 @@ persistence configuration has the following configuration:
<phpcr
enabled="false"
manager-name="null"
delete="false"
>
<image
enabled="false"
Expand All @@ -121,6 +123,7 @@ persistence configuration has the following configuration:
'controller_class' => 'Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController',
'basepath' => '/cms/media',
),
'delete' => false,
),
),
));
Expand Down Expand Up @@ -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
~~~~~~~~~~~~~~~~~

Expand Down