Skip to content

Commit

Permalink
Update outdated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Filips Alpe committed Jan 8, 2014
1 parent 925786f commit a2e1a4c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 38 deletions.
2 changes: 2 additions & 0 deletions bundles/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
* `CatalogBundle`_
* `DashboardBundle`_
* `FilterBundle`_
* `FlexibleEntityBundle`_
* `GridBundle`_
* `ImportExportBundle`_
* `InstallerBundle`_
Expand All @@ -15,6 +16,7 @@
.. _CatalogBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/CatalogBundle
.. _DashboardBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/DashboardBundle
.. _FilterBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/FilterBundle
.. _FlexibleEntityBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/FlexibleEntityBundle
.. _GridBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/GridBundle
.. _ImportExportBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/ImportExportBundle
.. _InstallerBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/InstallerBundle
Expand Down
22 changes: 11 additions & 11 deletions cookbook/custom_entity/creating_a_custom_entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ quite straightforward for any developer with Doctrine experience.
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Entity/Vendor.php
:language: php
:lines: 1-8,17-
:linenos:
:linenos:

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/doctrine/Vendor.orm.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/doctrine/Vendor.orm.yml
:linenos:
:linenos:

Also add parameters for your entity in the DIC :

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/entities.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/entities.yml
:lines: 1-2,4:
:linenos:
:linenos:

.. note::
We have added a code attribute in order to get a non technical unique key.
Expand All @@ -53,27 +53,27 @@ a datagrid manager must be defined:
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Datagrid/VendorDatagridManager.php
:language: php
:lines: 1-11,20-21,136
:linenos:
:linenos:


Defining the Service
....................
This datagrid manager will be declared as a service and configured to link it to our manufacturer entity.

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/datagrid.yml
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/grid.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/datagrid.yml
:linenos:
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/grid.yml
:linenos:


.. note::

Your bundle must declare an extension to load this datagrid.yml file
Your bundle must declare an extension to load this grid.yml file
(see http://symfony.com/doc/current/cookbook/bundles/extension.html for more information)

The ProductDatagridManager and AssociationProductDatagridManager also have to be overriden by changing the
parameters containing the name of their classes.

NB: the grid bundle and related customizations will change with the PIM RC-1

Defining the Fields which are Used in the Grid
Expand Down Expand Up @@ -163,7 +163,7 @@ Creating the Form Type for this Entity
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Form/Type/VendorType.php
:language: php
:lines: 1-8,17-
:linenos:
:linenos:


Creating the CRUD
Expand All @@ -174,7 +174,7 @@ A complete CRUD can be easily obtained by defining a service for its configurati
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/custom_entities.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/custom_entities.yml
:linenos:
:linenos:

From this point a working grid screen is visible at ``/app_dev.php/enrich/vendor``.

Expand Down
26 changes: 13 additions & 13 deletions cookbook/custom_entity/creating_an_attribute_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ We need to copy and paste the whole class, and add the following lines:
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Entity/ProductValue.php
:language: php
:lines: 1-4,23-24,311-337
:linenos:
:linenos:

You will also need to copy and adapt the mapping for the entity:

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/doctrine/ProductValue.orm.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/doctrine/ProductValue.orm.yml
:lines: 1-3,63,86-92
:linenos:
:linenos:

.. note::
We are thinking about ways to avoid the copy paste of the full product value class, but we do not have
Expand All @@ -39,15 +39,15 @@ Configure the parameter for the ProductValue class :
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/entities.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/entities.yml
:linenos:
:linenos:


Configuring the FlexibleEntity Manager that is responsible for managing product:

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/flexibleentity.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/flexibleentity.yml
:linenos:
:linenos:



Expand All @@ -65,15 +65,15 @@ Creating the Attribute Type
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/AttributeType/VendorType.php
:language: php
:lines: 1-6,14-
:linenos:
:linenos:

The following configuration must be loaded by your bundle extension:


.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/attribute_types.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/attribute_types.yml
:linenos:
:linenos:


Creating a filter type
Expand All @@ -84,28 +84,28 @@ To create a filter, extend the ChoiceFilter class:
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Filter/ORM/VendorFilter.php
:language: php
:lines: 1-7,15-
:linenos:
:linenos:


The filter has to be added in your DIC:

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/orm_filter_types.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/orm_filter_types.yml
:linenos:
:linenos:

In the current version, the ProductDatagridManager and AssociationProductDatagridManager have to be overridden. The same
modifications have to be done in both the classes:

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Datagrid/ProductDatagridManager.php
:language: php
:lines: 1-7,15-
:linenos:
:linenos:

.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/datagrid.yml
.. literalinclude:: ../../src/Pim/Bundle/IcecatDemoBundle/Resources/config/grid.yml
:language: yaml
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/datagrid.yml
:linenos:
:prepend: # /src/Pim/Bundle/IcecatDemoBundle/Resources/config/grid.yml
:linenos:

.. note::
This last step will not be needed in future versions of the PIM.
Expand All @@ -123,6 +123,6 @@ if the product has values for your attribute :

.. literalinclude:: ../../src/Acme/Bundle/CatalogBundle/Validator/ConstraintGuesser/CustomConstraintGuesser.php
:language: php
:linenos:
:linenos:

The validator for the created custom constraint will be supplied the value of the attribute.
18 changes: 7 additions & 11 deletions cookbook/form_customization/add_a_new_tab_to_product_edit_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ To override these templates, you need to create 2 new files:
:linenos:

{# _navbar.html.twig #}
{% set form_tabs=["Attributes"] %}
{% set form_tabs=['Attributes'] %}

{% if resource_granted("pim_catalog_product_categories_view") %}
{% if resource_granted('pim_catalog_product_categories_view') %}
{% set form_tabs = form_tabs|merge(['Categories']) %}
{% endif %}

{% if associations is not empty and resource_granted("pim_catalog_product_categories_view") %}
{% if resource_granted('pim_catalog_associations_view') %}
{% set form_tabs = form_tabs|merge(['Associations']) %}
{% endif %}

Expand All @@ -44,25 +44,21 @@ To override these templates, you need to create 2 new files:
<div class="tab-pane active" id="attributes">
{% include 'PimCatalogBundle:Product:_attributes.html.twig' %}
</div>

{% if resource_granted("pim_catalog_product_categories_view") %}
<div class="tab-pane" id="categories">
{% include 'PimCatalogBundle:Product:_associateCategories.html.twig' %}
</div>
{% endif %}

{% if associations is not empty and resource_granted("pim_catalog_product_associations_view") %}
<div class="tab-pane" id="associations">
{% include 'PimCatalogBundle:Product:_associations.html.twig' %}
{% if resource_granted("pim_catalog_associations_view") %}
<div class="tab-pane" id="associations" data-url="{{ path('pim_catalog_associations', { id: product.id }) }}">
</div>
{% endif %}

<div class="tab-pane" id="completeness">
{% include 'PimCatalogBundle:Product:_completeness.html.twig' %}
<div class="tab-pane" id="completeness" data-url="{{ path('pim_catalog_product_completeness', { id: product.id }) }}">
</div>

<div class="tab-pane" id="history">
<div id="history-grid"></div>
<div class="tab-pane" id="history" data-url="{{ path('pim_catalog_product_history', { id: product.id }) }}">
</div>

<!-- Custom content -->
Expand Down
2 changes: 1 addition & 1 deletion cookbook/mass_edition/register_a_new_mass_edit_action.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ After the class is created, you must register it as a service in the DIC with th
acme_demo_bundle.mass_edit_action.capitalize_values:-
class: Acme\Bundle\DemoBundle\MassEditAction\CapitalizeValues
tags:
- { name: 'pim_catalog.mass_edit_action', alias: 'capitalize-values' }
- { name: pim_catalog.mass_edit_action, alias: capitalize-values }
.. code-block:: xml
Expand Down
2 changes: 2 additions & 0 deletions cookbook/product/manipulate-product.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Prerequisites
The Akeneo PIM project introduces a service to help you manage your product entities.
This part of the application extends the `FlexibleEntityBundle`_.

.. _FlexibleEntityBundle: https://github.com/akeneo/pim-community-dev/tree/master/src/Pim/Bundle/FlexibleEntityBundle

As stated above, the product manager is a service you can get from the symfony container:

.. code-block:: php
Expand Down
1 change: 0 additions & 1 deletion cookbook/setup_data/customize_installer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Then edit the files, for example, to declare your own channels:
.. code-block:: yaml
my_channel:
code: my_channel
label: My Channel
locales:
- en_US
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function load(array $configs, ContainerBuilder $container)

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('attribute_types.yml');
$loader->load('datagrid.yml');
$loader->load('grid.yml');
$loader->load('custom_entities.yml');
$loader->load('form_types.yml');
$loader->load('orm_filter_types.yml');
Expand Down

0 comments on commit a2e1a4c

Please sign in to comment.