From ba186d96ff44a559fd26e8ccad89c120eff5d886 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Wed, 3 Oct 2012 10:33:07 +0200 Subject: [PATCH 01/52] WIP - first experiments with CreatePHP --- app/AppKernel.php | 1 + ...f.Bundle.SimpleCmsBundle.Document.Page.xml | 13 + app/config/config.yml | 14 +- app/config/routing.yml | 11 +- composer.json | 9 +- composer.lock | 287 ++++++++++++++++-- .../Resources/views/Cms/news_detail.html.twig | 13 +- 7 files changed, 309 insertions(+), 39 deletions(-) create mode 100644 app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml diff --git a/app/AppKernel.php b/app/AppKernel.php index 82f0611..87e522f 100755 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -26,6 +26,7 @@ public function registerBundles() new Symfony\Cmf\Bundle\ContentBundle\SymfonyCmfContentBundle(), new Symfony\Cmf\Bundle\CoreBundle\SymfonyCmfCoreBundle(), new Symfony\Cmf\Bundle\SimpleCmsBundle\SymfonyCmfSimpleCmsBundle(), + new Symfony\Cmf\Bundle\CreateBundle\SymfonyCmfCreateBundle(), // and the website specific bundle new Cmf\MainBundle\CmfMainBundle(), diff --git a/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml b/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml new file mode 100644 index 0000000..4fb683a --- /dev/null +++ b/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/app/config/config.yml b/app/config/config.yml index f33b780..2e4b0ba 100755 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -39,10 +39,11 @@ symfony_cmf_routing_extra: dynamic: enabled: true + symfony_cmf_simple_cms: routing: templates_by_class: - Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: SymfonyCmfSimpleCmsBundle:Page:index.html.twig + Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: SymfonyCmfSimpleCmsBundle:Page:index.html.twig use_sonata_admin: false knp_menu: @@ -67,4 +68,13 @@ fos_rest: rss: true html: true mime_types: - rss: 'application/rss+xml' \ No newline at end of file + rss: 'application/rss+xml' + +symfony_cmf_create: + phpcr_odm: true + #orm: my_document_manager + rdf_config_dirs: + - "%kernel.root_dir%/Resources/rdf-mappings" + base_path: /cms/routes + cms_path: /cms/simple + # stanbol_url: custom stanbol url, otherwise defaults to the demo install diff --git a/app/config/routing.yml b/app/config/routing.yml index 88e81bd..9f52819 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,4 +1,13 @@ # Internal routing configuration to handle ESI #_internal: # resource: "@FrameworkBundle/Resources/config/routing/internal.xml" -# prefix: /_internal \ No newline at end of file +# prefix: /_internal + + + +#TODO: use that import? +# + +#createjs: +# resource: “@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml” + diff --git a/composer.json b/composer.json index 2e88bdb..0402b58 100755 --- a/composer.json +++ b/composer.json @@ -18,18 +18,21 @@ "doctrine/doctrine-fixtures-bundle": "dev-master", "liip/functional-test-bundle": "dev-master", "lunetics/locale-bundle": "dev-master", - "liip/doctrine-cache-bundle": "dev-master" + "liip/doctrine-cache-bundle": "dev-master", + "symfony-cmf/create-bundle": "dev-master" }, "scripts": { "post-install-cmd": [ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", + "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::initSubmodules" ], "post-update-cmd": [ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", + "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::initSubmodules" ] }, "config": { diff --git a/composer.lock b/composer.lock index 7f35803..5905506 100644 --- a/composer.lock +++ b/composer.lock @@ -1,5 +1,5 @@ { - "hash": "66dc17ac4f00ae115cc98f6016631fb3", + "hash": "7050ad85308ffd4e8c9bc3ed56b45689", "packages": [ { "name": "doctrine/common", @@ -42,7 +42,8 @@ }, { "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" }, { "name": "Roman Borschel", @@ -55,7 +56,7 @@ { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "http://jmsyst.com", + "homepage": "https://github.com/schmittjoh", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -152,7 +153,8 @@ }, { "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" }, { "name": "Roman Borschel", @@ -361,12 +363,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/phpcr-odm", - "reference": "5b5c17d0dae087b20a151daaade9cb908eb38907" + "reference": "c62988dc103b35b7e2f2dcc50bd4e1acc64d14c1" }, "dist": { "type": "zip", - "url": "https://github.com/doctrine/phpcr-odm/zipball/5b5c17d0dae087b20a151daaade9cb908eb38907", - "reference": "5b5c17d0dae087b20a151daaade9cb908eb38907", + "url": "https://github.com/doctrine/phpcr-odm/zipball/c62988dc103b35b7e2f2dcc50bd4e1acc64d14c1", + "reference": "c62988dc103b35b7e2f2dcc50bd4e1acc64d14c1", "shasum": "" }, "require": { @@ -384,7 +386,7 @@ "jackalope/jackalope-jackrabbit": "1.0.*", "midgard/phpcr": ">=1.3" }, - "time": "1349096384", + "time": "1349179865", "bin": [ "bin/phpcr", "bin/phpcr.php" @@ -447,6 +449,7 @@ "php": ">=5.3.2", "symfony/http-foundation": ">=2.0,<2.3-dev" }, + "time": "1347135166", "type": "library", "extra": { "branch-alias": { @@ -476,8 +479,7 @@ "homepage": "http://friendsofsymfony.github.com", "keywords": [ "rest" - ], - "time": "1347135166" + ] }, { "name": "friendsofsymfony/rest-bundle", @@ -508,6 +510,7 @@ "suggest": { "sensio/framework-extra-bundle": "Add support for route annotations" }, + "time": "1348990701", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -542,8 +545,7 @@ "homepage": "http://friendsofsymfony.github.com", "keywords": [ "rest" - ], - "time": "1348990701" + ] }, { "name": "jackalope/jackalope", @@ -603,12 +605,12 @@ "source": { "type": "git", "url": "https://github.com/jackalope/jackalope-doctrine-dbal", - "reference": "b613ecfee17f12dd32c2f1a6767d679bb9d1c335" + "reference": "05ff9060cb9c3599150edd3ab67840220254febe" }, "dist": { "type": "zip", - "url": "https://github.com/jackalope/jackalope-doctrine-dbal/zipball/b613ecfee17f12dd32c2f1a6767d679bb9d1c335", - "reference": "b613ecfee17f12dd32c2f1a6767d679bb9d1c335", + "url": "https://github.com/jackalope/jackalope-doctrine-dbal/zipball/05ff9060cb9c3599150edd3ab67840220254febe", + "reference": "05ff9060cb9c3599150edd3ab67840220254febe", "shasum": "" }, "require": { @@ -626,7 +628,7 @@ "suggest": { "phpcr/phpcr-api-tests": "dev-master" }, - "time": "1348665534", + "time": "1349128829", "type": "library", "extra": { "branch-alias": { @@ -698,7 +700,7 @@ { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", + "homepage": "http://jmsyst.com", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -737,7 +739,7 @@ "twig/twig": ">=1.8,<2.0-dev", "doctrine/orm": ">=2.1,<2.4-dev" }, - "time": "2012-09-19 07:23:52", + "time": "2012-09-20 19:23:52", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -854,7 +856,7 @@ "knplabs/knp-menu": "1.1.*", "symfony/framework-bundle": ">=2.0,<2.2-dev" }, - "time": "2012-05-15 03:56:49", + "time": "2012-05-17 07:56:49", "type": "symfony-bundle", "installation-source": "dist", "autoload": { @@ -871,7 +873,7 @@ "email": "stof@notk.org" }, { - "name": "KnpLabs", + "name": "Knplabs", "homepage": "http://knplabs.com" }, { @@ -884,6 +886,72 @@ "menu" ] }, + { + "name": "kriswallsmith/assetic", + "version": "dev-master", + "source": { + "type": "git", + "url": "http://github.com/kriswallsmith/assetic.git", + "reference": "e22c5e07e672bb0cf43127e97e9368b53abf4aa8" + }, + "dist": { + "type": "zip", + "url": "https://github.com/kriswallsmith/assetic/zipball/e22c5e07e672bb0cf43127e97e9368b53abf4aa8", + "reference": "e22c5e07e672bb0cf43127e97e9368b53abf4aa8", + "shasum": "" + }, + "require": { + "symfony/process": ">=2.1.0,<2.3-dev", + "php": ">=5.3.1" + }, + "require-dev": { + "twig/twig": ">=1.6.0,<2.0", + "leafo/lessphp": "*", + "leafo/scssphp": "*", + "ptachoire/cssembed": "*", + "leafo/scssphp-compass": "*" + }, + "suggest": { + "twig/twig": "Assetic provides the integration with the Twig templating engine", + "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", + "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", + "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", + "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin" + }, + "time": "1349004759", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Assetic": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "description": "Asset Management for PHP", + "homepage": "https://github.com/kriswallsmith/assetic", + "keywords": [ + "assets", + "compression", + "minification" + ] + }, { "name": "liip/doctrine-cache-bundle", "version": "dev-master", @@ -1026,6 +1094,46 @@ "cookie" ] }, + { + "name": "midgard/createphp", + "version": "dev-master", + "source": { + "type": "git", + "url": "git://github.com/flack/createphp.git", + "reference": "99e27172c0de250d520363014d7fc6d79c25f193" + }, + "dist": { + "type": "zip", + "url": "https://github.com/flack/createphp/zipball/99e27172c0de250d520363014d7fc6d79c25f193", + "reference": "99e27172c0de250d520363014d7fc6d79c25f193", + "shasum": "" + }, + "require-dev": { + "twig/twig": ">=1.8,<2.0-dev" + }, + "time": "1348484091", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "Midgard\\CreatePHP": "src" + } + }, + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Andreas Flack", + "email": "flack@contentcontrol-berlin.de", + "homepage": "http://www.contentcontrol-berlin.de/" + } + ], + "description": "PHP adapter for Create.js", + "keywords": [ + "rdfa" + ] + }, { "name": "monolog/monolog", "version": "dev-master", @@ -1215,6 +1323,7 @@ "require": { "symfony/framework-bundle": "2.1.*" }, + "time": "1347340208", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1240,8 +1349,7 @@ "keywords": [ "distribution", "configuration" - ], - "time": "1347340208" + ] }, { "name": "symfony-cmf/content-bundle", @@ -1303,12 +1411,12 @@ "source": { "type": "git", "url": "git://github.com/symfony-cmf/CoreBundle.git", - "reference": "50a7e1308c0dbb52b276ac361a0433050e58e3ee" + "reference": "2170d201e7ebfb66d19811b7c6734a41deb48239" }, "dist": { "type": "zip", - "url": "https://github.com/symfony-cmf/CoreBundle/zipball/50a7e1308c0dbb52b276ac361a0433050e58e3ee", - "reference": "50a7e1308c0dbb52b276ac361a0433050e58e3ee", + "url": "https://github.com/symfony-cmf/CoreBundle/zipball/2170d201e7ebfb66d19811b7c6734a41deb48239", + "reference": "2170d201e7ebfb66d19811b7c6734a41deb48239", "shasum": "" }, "require": { @@ -1322,7 +1430,7 @@ "suggest": { "symfony/twig-bundle": ">2.0,<2.2-dev" }, - "time": "1349092134", + "time": "1349161204", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1350,6 +1458,59 @@ "Symfony CMF" ] }, + { + "name": "symfony-cmf/create-bundle", + "version": "dev-master", + "target-dir": "Symfony/Cmf/Bundle/CreateBundle", + "source": { + "type": "git", + "url": "https://github.com/symfony-cmf/CreateBundle.git", + "reference": "01738fd73d0ea221528df3a9dc9e48697b6c5cdf" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony-cmf/CreateBundle/zipball/01738fd73d0ea221528df3a9dc9e48697b6c5cdf", + "reference": "01738fd73d0ea221528df3a9dc9e48697b6c5cdf", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "friendsofsymfony/rest-bundle": "*", + "midgard/createphp": "dev-master", + "symfony/symfony": "2.1.*", + "symfony/assetic-bundle": "2.1.*" + }, + "suggest": { + "dms/dms-filter": "if you want to filter content on your fields" + }, + "time": "1349131269", + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Cmf\\Bundle\\CreateBundle": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Liip AG", + "homepage": "http://www.liip.ch/" + }, + { + "name": "Symfony CMF Community", + "homepage": "https://github.com/symfony-cmf/CreateBundle/contributors" + } + ], + "description": "Symfony Bundle for createphp and create.js. The easiest way to make any site editable and have semantic annotations with RDFa." + }, { "name": "symfony-cmf/menu-bundle", "version": "dev-master", @@ -1572,6 +1733,69 @@ "Symfony CMF" ] }, + { + "name": "symfony/assetic-bundle", + "version": "dev-master", + "target-dir": "Symfony/Bundle/AsseticBundle", + "source": { + "type": "git", + "url": "https://github.com/symfony/AsseticBundle", + "reference": "5ebcf72d9b2d7028ca8c9b71b464ccc81d4795d2" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/AsseticBundle/zipball/5ebcf72d9b2d7028ca8c9b71b464ccc81d4795d2", + "reference": "5ebcf72d9b2d7028ca8c9b71b464ccc81d4795d2", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "kriswallsmith/assetic": "1.1.*", + "symfony/framework-bundle": ">=2.1.0,<2.3-dev" + }, + "require-dev": { + "symfony/twig-bundle": ">=2.1.0,<2.3-dev", + "symfony/console": ">=2.1.0,<2.3-dev", + "symfony/class-loader": ">=2.1.0,<2.3-dev", + "symfony/yaml": ">=2.1.0,<2.3-dev", + "symfony/form": ">=2.1.0,<2.3-dev", + "symfony/dom-crawler": ">=2.1.0,<2.3-dev", + "symfony/css-selector": ">=2.1.0,<2.3-dev" + }, + "suggest": { + "symfony/twig-bundle": ">=2.1.0,<2.3-dev" + }, + "time": "1348938560", + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Bundle\\AsseticBundle": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "description": "Integrates Assetic into Symfony2", + "homepage": "https://github.com/symfony/AsseticBundle", + "keywords": [ + "assets", + "compression", + "minification" + ] + }, { "name": "symfony/monolog-bundle", "version": "dev-master", @@ -1633,12 +1857,12 @@ "source": { "type": "git", "url": "git://github.com/symfony/symfony.git", - "reference": "2f5a4d7dbca5e586ddf3ae409528ae456f45b0b4" + "reference": "49ca64824567b8018a5bb614f35e6da8622ccd1f" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/symfony/zipball/2f5a4d7dbca5e586ddf3ae409528ae456f45b0b4", - "reference": "2f5a4d7dbca5e586ddf3ae409528ae456f45b0b4", + "url": "https://github.com/symfony/symfony/zipball/49ca64824567b8018a5bb614f35e6da8622ccd1f", + "reference": "49ca64824567b8018a5bb614f35e6da8622ccd1f", "shasum": "" }, "require": { @@ -1687,7 +1911,7 @@ "propel/propel1": "dev-master", "monolog/monolog": "dev-master" }, - "time": "1349116845", + "time": "1349173376", "type": "library", "extra": { "branch-alias": { @@ -1827,6 +2051,7 @@ "doctrine/doctrine-fixtures-bundle": 20, "liip/functional-test-bundle": 20, "lunetics/locale-bundle": 20, - "liip/doctrine-cache-bundle": 20 + "liip/doctrine-cache-bundle": 20, + "symfony-cmf/create-bundle": 20 } } diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig index 3c7d28d..8e6a310 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig @@ -1,7 +1,9 @@ {% extends "CmfMainBundle::layout.html.twig" %} {% block content %} -
+ + +

{{ page.title }}

Date: {{ page.publishStartDate| date('Y-m-d') }}
@@ -17,4 +19,11 @@ {% endif %}
-{% endblock %} +

TEST

+

+ {% createphp page as="rdf" %} + {{ rdf|raw }} + {% endcreatephp %} +

+ +{% endblock %} \ No newline at end of file From ef85a24f000e8dbe86e2f452bd7c4968756deb3f Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Wed, 3 Oct 2012 11:46:40 +0200 Subject: [PATCH 02/52] use of CreatePHP in templates --- ...ndle.SimpleCmsBundle.Document.Page___.xml} | 0 .../Resources/views/Cms/news_detail.html.twig | 32 ++++++++----------- .../views/Cms/news_overview.html.twig | 26 ++++++++------- 3 files changed, 29 insertions(+), 29 deletions(-) rename app/Resources/rdf-mappings/{Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml => Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page___.xml} (100%) diff --git a/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml b/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page___.xml similarity index 100% rename from app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml rename to app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page___.xml diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig index 8e6a310..78772ee 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig @@ -2,28 +2,24 @@ {% block content %} +{% createphp page as="rdf" %} +
-
-

{{ page.title }}

+

{{ createphp_content( rdf.title ) }}

+
Date: {{ page.publishStartDate| date('Y-m-d') }}
+

{{ createphp_content( rdf.body|raw ) }}

-
Date: {{ page.publishStartDate| date('Y-m-d') }}
-

{{ page.body|raw }}

+ {% set prev = cmf_prev(page) %} + {% if prev %} + prev + {% endif %} - {% set prev = cmf_prev(page) %} - {% if prev %} - prev - {% endif %} - {% set next = cmf_next(page) %} - {% if next %} + {% set next = cmf_next(page) %} + {% if next %} next - {% endif %} -
+ {% endif %} -

TEST

-

- {% createphp page as="rdf" %} - {{ rdf|raw }} - {% endcreatephp %} -

+
+{% endcreatephp %} {% endblock %} \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index 63df359..f2ff8ed 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -1,19 +1,23 @@ {% extends "CmfMainBundle::layout.html.twig" %} {% block content %} -
-

{{ page.title }}

-
-
{{ page.body|raw }}
+ {% createphp page as="rdf" %} +
-
    - {% for news in cmf_children(page)|reverse %} -
  • {{ news.title }} ({{ news.publishStartDate | date('Y-m-d') }})
  • - {% endfor %} -
+

{{ createphp_content( rdf.title ) }}

+

{{ createphp_content( rdf.body|raw ) }}

+ + - - \ No newline at end of file diff --git a/composer.lock b/composer.lock index 5905506..5fc0d73 100644 --- a/composer.lock +++ b/composer.lock @@ -181,12 +181,12 @@ "source": { "type": "git", "url": "git://github.com/doctrine/DoctrineBundle.git", - "reference": "db818ceec46d05fed4f944b957f82a4ab5197e27" + "reference": "64deb4921926f482976414895fe549a6b4c604bb" }, "dist": { "type": "zip", - "url": "https://github.com/doctrine/DoctrineBundle/zipball/db818ceec46d05fed4f944b957f82a4ab5197e27", - "reference": "db818ceec46d05fed4f944b957f82a4ab5197e27", + "url": "https://github.com/doctrine/DoctrineBundle/zipball/64deb4921926f482976414895fe549a6b4c604bb", + "reference": "64deb4921926f482976414895fe549a6b4c604bb", "shasum": "" }, "require": { @@ -203,7 +203,7 @@ "suggest": { "doctrine/orm": "The Doctrine ORM integration is optional in the bundle." }, - "time": "1348828243", + "time": "1349217332", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1047,12 +1047,12 @@ "source": { "type": "git", "url": "https://github.com/lunetics/LocaleBundle", - "reference": "fff389afecb07c8c2ad0717d9cc936077101a60b" + "reference": "7f9ae16f90a0888e640c1f40f093954465753364" }, "dist": { "type": "zip", - "url": "https://github.com/lunetics/LocaleBundle/zipball/fff389afecb07c8c2ad0717d9cc936077101a60b", - "reference": "fff389afecb07c8c2ad0717d9cc936077101a60b", + "url": "https://github.com/lunetics/LocaleBundle/zipball/7f9ae16f90a0888e640c1f40f093954465753364", + "reference": "7f9ae16f90a0888e640c1f40f093954465753364", "shasum": "" }, "require": { @@ -1062,7 +1062,7 @@ "symfony/yaml": "2.1.*", "symfony/locale": "2.1.*" }, - "time": "1346024588", + "time": "1349250213", "type": "symfony-bundle", "installation-source": "source", "autoload": { @@ -1857,12 +1857,12 @@ "source": { "type": "git", "url": "git://github.com/symfony/symfony.git", - "reference": "49ca64824567b8018a5bb614f35e6da8622ccd1f" + "reference": "566ad10f675ae39a7260b99bd1da1c5e986cef69" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/symfony/zipball/49ca64824567b8018a5bb614f35e6da8622ccd1f", - "reference": "49ca64824567b8018a5bb614f35e6da8622ccd1f", + "url": "https://github.com/symfony/symfony/zipball/566ad10f675ae39a7260b99bd1da1c5e986cef69", + "reference": "566ad10f675ae39a7260b99bd1da1c5e986cef69", "shasum": "" }, "require": { @@ -1911,7 +1911,7 @@ "propel/propel1": "dev-master", "monolog/monolog": "dev-master" }, - "time": "1349173376", + "time": "1349203503", "type": "library", "extra": { "branch-alias": { @@ -2041,7 +2041,9 @@ ] } ], - "packages-dev": null, + "packages-dev": [ + + ], "aliases": [ ], diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index f2ff8ed..21cc382 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -2,13 +2,13 @@ {% block content %} - {% createphp page as="rdf" %} -
+{% createphp page as="rdf" %} +
-

{{ createphp_content( rdf.title ) }}

-

{{ createphp_content( rdf.body|raw ) }}

+

{{ createphp_content( rdf.title ) }}

+

{{ createphp_content( rdf.body|raw ) }}

-
    {% for news in cmf_children(page)|reverse %}
  • diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index c65e6d0..9d31330 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -8,7 +8,6 @@ {% block includes %} - + {# + {{ createphp_attributes( rdf.children ) }} + #}
      - {% for news in cmf_children(page)|reverse %} + {% for news in page.children|reverse %}
    • {{ news.title }} ({{ news.publishStartDate | date('Y-m-d') }})
    • {% endfor %}
    -
- {% endcreatephp %} +{% endcreatephp %} {% endblock %} \ No newline at end of file From 122ba74695abfac5dfa1474ff780ede457279b75 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 4 Oct 2012 13:33:16 +0200 Subject: [PATCH 05/52] WIP adding create.js and collections --- app/config/routing.yml | 11 ++++------- src/Cmf/MainBundle/DataFixtures/static/page.yml | 2 +- src/Cmf/MainBundle/Document/NewsCollection.php | 9 --------- .../Cmf.MainBundle.Document.NewsCollection.xml | 1 - .../Resources/views/Cms/news_overview.html.twig | 17 ++++++++++------- .../MainBundle/Resources/views/layout.html.twig | 3 ++- 6 files changed, 17 insertions(+), 26 deletions(-) diff --git a/app/config/routing.yml b/app/config/routing.yml index 9f52819..d95fcda 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -3,11 +3,8 @@ # resource: "@FrameworkBundle/Resources/config/routing/internal.xml" # prefix: /_internal - - -#TODO: use that import? -# - -#createjs: -# resource: “@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml” +create: + resource: "@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml" +create_iamge: + resource: "@SymfonyCmfCreateBundle/Resources/config/routing/image.xml" diff --git a/src/Cmf/MainBundle/DataFixtures/static/page.yml b/src/Cmf/MainBundle/DataFixtures/static/page.yml index abca122..c7623cd 100644 --- a/src/Cmf/MainBundle/DataFixtures/static/page.yml +++ b/src/Cmf/MainBundle/DataFixtures/static/page.yml @@ -88,7 +88,7 @@ static: news: name: "news" title: "News" - class: "Cmf\MainBundle\Document\NewsCollection" + class: "Cmf\\MainBundle\\Document\\NewsCollection" formats: [html, rss] template: CmfMainBundle:Cms:news_overview.{_format}.twig content: The latest news about the Symfony CMF: diff --git a/src/Cmf/MainBundle/Document/NewsCollection.php b/src/Cmf/MainBundle/Document/NewsCollection.php index 0bf9c97..6d62ac5 100644 --- a/src/Cmf/MainBundle/Document/NewsCollection.php +++ b/src/Cmf/MainBundle/Document/NewsCollection.php @@ -17,13 +17,4 @@ */ class NewsCollection extends Page { - /** - * @PHPCRODM\Children - */ - private $children; - - public function getChildren() - { - return $this->children; - } } diff --git a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml index f77d1cc..fd916e2 100644 --- a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml +++ b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml @@ -7,7 +7,6 @@ - diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index 966fa43..9e476b1 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -3,23 +3,26 @@ {% block content %} {% createphp page as="rdf" %} + +

{{ createphp_content( rdf.title ) }}

{{ createphp_content( rdf.body|raw ) }}

- {# - {{ createphp_attributes( rdf.children ) }} - #} -
+ {% endcreatephp %} {% endblock %} \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index 9d31330..f997d99 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -13,6 +13,7 @@ {% endblock %} + {% include "SymfonyCmfCreateBundle::includecssfiles.html.twig" %} @@ -39,7 +40,7 @@
- +{% render "symfony_cmf_create.jsloader.controller:includeJSFilesAction" %} From ef8ad9219ce5acb5bb77398874416a1ed787f6f0 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 4 Oct 2012 13:52:13 +0200 Subject: [PATCH 06/52] make fos restbundle handle json for the REST controller --- app/config/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/config/config.yml b/app/config/config.yml index 551b51f..80128bc 100755 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -64,6 +64,7 @@ fos_rest: view: formats: rss: true + json: true templating_formats: rss: true html: true From 9f276aa7c6040f7cc4daf51afcc37bc25dc01ce9 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Thu, 11 Oct 2012 11:19:24 +0200 Subject: [PATCH 07/52] new test for collection handling --- app/tests/CreateJsTest.php | 124 ++++++++++++++++++ src/Cmf/MainBundle/Document/NewsDetail.php | 0 .../Cmf.MainBundle.Document.NewsDetail.xml | 14 ++ 3 files changed, 138 insertions(+) create mode 100644 app/tests/CreateJsTest.php create mode 100644 src/Cmf/MainBundle/Document/NewsDetail.php create mode 100644 src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml diff --git a/app/tests/CreateJsTest.php b/app/tests/CreateJsTest.php new file mode 100644 index 0000000..2c413cc --- /dev/null +++ b/app/tests/CreateJsTest.php @@ -0,0 +1,124 @@ +createClient(); + + //prepare the POST request + $partOfKey = ''; + $partOf = ''; + + $titleKey = ''; + $title = 'news title from testAddNews'; + + $contentKey = ''; + $content = 'some new content'; + + $subjectKey = '@subject'; + $subject = '_:bnode47'; + + $typeKey = '@type'; + $type = ''; + + $client->request('POST', '/en/symfony-cmf/create/document/_:bnode47', + array( + $partOfKey => array($partOf), + $titleKey => $title, + $contentKey => $content, + $subjectKey => $subject, + $typeKey => $type + )); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + //get the created page and check if everything is contained in the page + $crawler = $client->request('GET', '/news/news-title-from-testAddNews'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $this->assertCount(1, $crawler->filter(sprintf('h2:contains("%s")', $title))); + $this->assertCount(1, $crawler->filter(sprintf('p:contains("%s")', $content))); + $this->assertCount(1, $crawler->filter(sprintf('div.subtitle:contains("%s")', 'Date: ' . date('Y-m-d')))); + } + + public function testUpdateNews() + { + $client = $this->createClient(); + + //prepare the PUT request + $titleKey = ''; + $title = 'updated title from testUpdateNews'; + + $contentKey = ''; + $content = 'some updated content'; + + $subjectKey = '@subject'; + $subject = ''; + + $typeKey = '@type'; + $type = 'request('PUT', '/en/symfony-cmf/create/document/cms/simple/news/symfony-cmf-website-update', + array( + $titleKey => $title, + $contentKey => $content, + $subjectKey => $subject, + $typeKey => $type + ) + ); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + //get the updated page and check if data has been updated + $crawler = $client->request('GET', '/news/symfony-cmf-website-update'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertCount(1, $crawler->filter(sprintf('h2:contains("%s")', $title))); + $this->assertCount(1, $crawler->filter(sprintf('p:contains("%s")', $content))); + } + + + public function testRestServiceWithPost() + { + //prepare the post request + $partOfKey = ''; + $partOf = ''; + + $titleKey = ''; + $title = 'updated title from testRestService'; + + $contentKey = ''; + $content = 'updated content
'; + + $subjectKey = '@subject'; + $subject = ''; + + $typeKey = '@type'; + $type = ''; + + $request = array( + $partOfKey => array($partOf), + $titleKey => $title, + $contentKey => $content, + $subjectKey => $subject, + $typeKey => array($type) + ); + + $restService = $this->getContainer()->get('symfony_cmf_create.rest.handler'); + + $typeFactory = $this->getContainer()->get('symfony_cmf_create.rdf_type_factory'); + + $classType = $typeFactory->getType('Cmf\\MainBundle\\Document\\NewsCollection'); + + $result = $restService->run($request, $classType, null, RestService::HTTP_POST); + + $this->assertEquals($title, $result['']); + $this->assertEquals($content, $result['']); + } +} diff --git a/src/Cmf/MainBundle/Document/NewsDetail.php b/src/Cmf/MainBundle/Document/NewsDetail.php new file mode 100644 index 0000000..e69de29 diff --git a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml new file mode 100644 index 0000000..8637dca --- /dev/null +++ b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file From cb3625ab2a1de9c4dad1f7cd3cbdadae24ee9ab2 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Thu, 11 Oct 2012 11:20:22 +0200 Subject: [PATCH 08/52] creation of news with CreateJs --- app/config/config.yml | 3 +++ app/config/routing.yml | 2 +- src/Cmf/MainBundle/DataFixtures/static/page.yml | 12 ++++++------ src/Cmf/MainBundle/Document/NewsCollection.php | 6 ------ src/Cmf/MainBundle/Document/NewsDetail.php | 14 ++++++++++++++ .../Cmf.MainBundle.Document.NewsCollection.xml | 2 +- .../Cmf.MainBundle.Document.NewsDetail.xml | 3 --- .../Resources/views/Cms/news_overview.html.twig | 2 -- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index 80128bc..4850cf9 100755 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -43,6 +43,7 @@ symfony_cmf_routing_extra: symfony_cmf_simple_cms: routing: templates_by_class: + Cmf\MainBundle\Document\NewsDetail: CmfMainBundle:Cms:news_detail.html.twig Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: SymfonyCmfSimpleCmsBundle:Page:index.html.twig use_sonata_admin: false @@ -73,3 +74,5 @@ fos_rest: symfony_cmf_create: phpcr_odm: true + map: + http://rdfs.org/sioc/ns#Post: Cmf\MainBundle\Document\NewsDetail diff --git a/app/config/routing.yml b/app/config/routing.yml index d95fcda..e5fd6e1 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -5,6 +5,6 @@ create: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml" -create_iamge: +create_image: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/image.xml" diff --git a/src/Cmf/MainBundle/DataFixtures/static/page.yml b/src/Cmf/MainBundle/DataFixtures/static/page.yml index c7623cd..beb6b01 100644 --- a/src/Cmf/MainBundle/DataFixtures/static/page.yml +++ b/src/Cmf/MainBundle/DataFixtures/static/page.yml @@ -98,7 +98,7 @@ static: parent: "/news" title: "Symfony CMF featured on symfony.com" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-06-05" content: | David wrote a blog post @@ -112,7 +112,7 @@ static: parent: "/news" title: "Symfony CMF sandbox now running with multiple different PHPCR implementations" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-06-12" content: | One of the fundamental ideas of PHPCR is that there can be multiple implementations that @@ -132,7 +132,7 @@ static: parent: "/news" title: "Jackalope Doctrine DBAL now compatible with PostgreSQL and SQLite" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-07-19" content: | Thanks to the work of cryptocompress the Jackalope @@ -149,7 +149,7 @@ static: parent: "/news" title: "Symfony CMF at the Create.js hackathon in Berlin" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-07-21" content: | The Symfony CMF has featured integration with create.js and VIE for inline editing for quite sometime @@ -164,7 +164,7 @@ static: parent: "/news" title: "Symfony CMF docs and standard edition" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-08-01" content: | We have finally setup our documentation on readthedocs.org. @@ -179,7 +179,7 @@ static: parent: "/news" title: "Symfony CMF website update" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-09-29" content: | In an effort to eat our own dog food, we have finally updated diff --git a/src/Cmf/MainBundle/Document/NewsCollection.php b/src/Cmf/MainBundle/Document/NewsCollection.php index 6d62ac5..a5a77cc 100644 --- a/src/Cmf/MainBundle/Document/NewsCollection.php +++ b/src/Cmf/MainBundle/Document/NewsCollection.php @@ -4,14 +4,8 @@ use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM; -use Symfony\Component\Validator\Constraints as Assert; - use Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page; -use Symfony\Cmf\Component\Routing\RouteAwareInterface; -use Symfony\Cmf\Bundle\RoutingExtraBundle\Document\Route; -use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishWorkflowInterface; - /** * @PHPCRODM\Document */ diff --git a/src/Cmf/MainBundle/Document/NewsDetail.php b/src/Cmf/MainBundle/Document/NewsDetail.php index e69de29..9e6745e 100644 --- a/src/Cmf/MainBundle/Document/NewsDetail.php +++ b/src/Cmf/MainBundle/Document/NewsDetail.php @@ -0,0 +1,14 @@ + - + \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml index 8637dca..99884e8 100644 --- a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml +++ b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml @@ -7,8 +7,5 @@ - - - \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index 9e476b1..c0a1335 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -10,8 +10,6 @@

{{ createphp_content( rdf.title ) }}

{{ createphp_content( rdf.body|raw ) }}

- -
    {% for news in page.children|reverse %} {% createphp news %} From b2fe5844928495f291d7a371e9f05b1de5962725 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Thu, 11 Oct 2012 16:50:02 +0200 Subject: [PATCH 09/52] show content when adding a news --- src/Cmf/MainBundle/Resources/public/css/style.css | 2 ++ .../Resources/views/Cms/news_overview.html.twig | 14 +++++++++++++- .../MainBundle/Resources/views/layout.html.twig | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Cmf/MainBundle/Resources/public/css/style.css b/src/Cmf/MainBundle/Resources/public/css/style.css index ef45d1a..1f55d12 100644 --- a/src/Cmf/MainBundle/Resources/public/css/style.css +++ b/src/Cmf/MainBundle/Resources/public/css/style.css @@ -507,3 +507,5 @@ ol.commentlist { } .subtitle { margin-left: 15px; } + +div.newscontent { display: none; } diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index c0a1335..a0e9ee5 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -15,12 +15,24 @@ {% createphp news %}
  • {{ createphp_content(news_rdf.title) }} ({{ news.publishStartDate | date('Y-m-d') }}) -
    +
    {{ createphp_content(news_rdf.body) }}
  • {% endcreatephp %} {% endfor %}
{% endcreatephp %} +
+ +{% block customjs %} + +{% endblock %} {% endblock %} \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index f997d99..8a861ee 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -41,6 +41,12 @@
{% render "symfony_cmf_create.jsloader.controller:includeJSFilesAction" %} + + +{% block customjs %} +{% endblock %} + + From aef278caebb9576659e4ce7b800f500a27ee36f0 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Wed, 3 Oct 2012 10:33:07 +0200 Subject: [PATCH 10/52] WIP - first experiments with CreatePHP --- app/AppKernel.php | 1 + ...ny.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml | 13 +++++++++++++ app/config/config.yml | 14 ++++++++++++-- app/config/routing.yml | 11 ++++++++++- composer.json | 9 ++++++--- .../Resources/views/Cms/news_detail.html.twig | 13 +++++++++++-- 6 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml diff --git a/app/AppKernel.php b/app/AppKernel.php index 82f0611..87e522f 100755 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -26,6 +26,7 @@ public function registerBundles() new Symfony\Cmf\Bundle\ContentBundle\SymfonyCmfContentBundle(), new Symfony\Cmf\Bundle\CoreBundle\SymfonyCmfCoreBundle(), new Symfony\Cmf\Bundle\SimpleCmsBundle\SymfonyCmfSimpleCmsBundle(), + new Symfony\Cmf\Bundle\CreateBundle\SymfonyCmfCreateBundle(), // and the website specific bundle new Cmf\MainBundle\CmfMainBundle(), diff --git a/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml b/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml new file mode 100644 index 0000000..4fb683a --- /dev/null +++ b/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/app/config/config.yml b/app/config/config.yml index f33b780..2e4b0ba 100755 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -39,10 +39,11 @@ symfony_cmf_routing_extra: dynamic: enabled: true + symfony_cmf_simple_cms: routing: templates_by_class: - Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: SymfonyCmfSimpleCmsBundle:Page:index.html.twig + Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: SymfonyCmfSimpleCmsBundle:Page:index.html.twig use_sonata_admin: false knp_menu: @@ -67,4 +68,13 @@ fos_rest: rss: true html: true mime_types: - rss: 'application/rss+xml' \ No newline at end of file + rss: 'application/rss+xml' + +symfony_cmf_create: + phpcr_odm: true + #orm: my_document_manager + rdf_config_dirs: + - "%kernel.root_dir%/Resources/rdf-mappings" + base_path: /cms/routes + cms_path: /cms/simple + # stanbol_url: custom stanbol url, otherwise defaults to the demo install diff --git a/app/config/routing.yml b/app/config/routing.yml index 88e81bd..9f52819 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,4 +1,13 @@ # Internal routing configuration to handle ESI #_internal: # resource: "@FrameworkBundle/Resources/config/routing/internal.xml" -# prefix: /_internal \ No newline at end of file +# prefix: /_internal + + + +#TODO: use that import? +# + +#createjs: +# resource: “@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml” + diff --git a/composer.json b/composer.json index 2e88bdb..0402b58 100755 --- a/composer.json +++ b/composer.json @@ -18,18 +18,21 @@ "doctrine/doctrine-fixtures-bundle": "dev-master", "liip/functional-test-bundle": "dev-master", "lunetics/locale-bundle": "dev-master", - "liip/doctrine-cache-bundle": "dev-master" + "liip/doctrine-cache-bundle": "dev-master", + "symfony-cmf/create-bundle": "dev-master" }, "scripts": { "post-install-cmd": [ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", + "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::initSubmodules" ], "post-update-cmd": [ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", + "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::initSubmodules" ] }, "config": { diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig index 3c7d28d..8e6a310 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig @@ -1,7 +1,9 @@ {% extends "CmfMainBundle::layout.html.twig" %} {% block content %} -
+ + +

{{ page.title }}

Date: {{ page.publishStartDate| date('Y-m-d') }}
@@ -17,4 +19,11 @@ {% endif %}
-{% endblock %} +

TEST

+

+ {% createphp page as="rdf" %} + {{ rdf|raw }} + {% endcreatephp %} +

+ +{% endblock %} \ No newline at end of file From f32197149c3476adbaf75f1c3640eb558a379c6c Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Wed, 3 Oct 2012 11:46:40 +0200 Subject: [PATCH 11/52] use of CreatePHP in templates --- ...ndle.SimpleCmsBundle.Document.Page___.xml} | 0 .../Resources/views/Cms/news_detail.html.twig | 32 ++++++++----------- .../views/Cms/news_overview.html.twig | 26 ++++++++------- 3 files changed, 29 insertions(+), 29 deletions(-) rename app/Resources/rdf-mappings/{Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml => Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page___.xml} (100%) diff --git a/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml b/app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page___.xml similarity index 100% rename from app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page.xml rename to app/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Document.Page___.xml diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig index 8e6a310..78772ee 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_detail.html.twig @@ -2,28 +2,24 @@ {% block content %} +{% createphp page as="rdf" %} +
-
-

{{ page.title }}

+

{{ createphp_content( rdf.title ) }}

+
Date: {{ page.publishStartDate| date('Y-m-d') }}
+

{{ createphp_content( rdf.body|raw ) }}

-
Date: {{ page.publishStartDate| date('Y-m-d') }}
-

{{ page.body|raw }}

+ {% set prev = cmf_prev(page) %} + {% if prev %} + prev + {% endif %} - {% set prev = cmf_prev(page) %} - {% if prev %} - prev - {% endif %} - {% set next = cmf_next(page) %} - {% if next %} + {% set next = cmf_next(page) %} + {% if next %} next - {% endif %} -
+ {% endif %} -

TEST

-

- {% createphp page as="rdf" %} - {{ rdf|raw }} - {% endcreatephp %} -

+
+{% endcreatephp %} {% endblock %} \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index 63df359..f2ff8ed 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -1,19 +1,23 @@ {% extends "CmfMainBundle::layout.html.twig" %} {% block content %} -
-

{{ page.title }}

-
-
{{ page.body|raw }}
+ {% createphp page as="rdf" %} +
-
    - {% for news in cmf_children(page)|reverse %} -
  • {{ news.title }} ({{ news.publishStartDate | date('Y-m-d') }})
  • - {% endfor %} -
+

{{ createphp_content( rdf.title ) }}

+

{{ createphp_content( rdf.body|raw ) }}

+ + - - \ No newline at end of file diff --git a/composer.lock b/composer.lock index 5242097..5fc0d73 100644 --- a/composer.lock +++ b/composer.lock @@ -1,5 +1,5 @@ { - "hash": "66dc17ac4f00ae115cc98f6016631fb3", + "hash": "7050ad85308ffd4e8c9bc3ed56b45689", "packages": [ { "name": "doctrine/common", @@ -42,7 +42,8 @@ }, { "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" }, { "name": "Roman Borschel", @@ -55,7 +56,7 @@ { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "http://jmsyst.com", + "homepage": "https://github.com/schmittjoh", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -116,19 +117,19 @@ "source": { "type": "git", "url": "https://github.com/doctrine/dbal", - "reference": "219d96a1592e9e23087eb6861b4f8233d06c6463" + "reference": "fdc866a37959e43620e4f7ec519dc7dd8e30fc5b" }, "dist": { "type": "zip", - "url": "https://github.com/doctrine/dbal/zipball/219d96a1592e9e23087eb6861b4f8233d06c6463", - "reference": "219d96a1592e9e23087eb6861b4f8233d06c6463", + "url": "https://github.com/doctrine/dbal/zipball/fdc866a37959e43620e4f7ec519dc7dd8e30fc5b", + "reference": "fdc866a37959e43620e4f7ec519dc7dd8e30fc5b", "shasum": "" }, "require": { "php": ">=5.3.2", "doctrine/common": "2.3.*" }, - "time": "1349518912", + "time": "1348120597", "type": "library", "extra": { "branch-alias": { @@ -180,12 +181,12 @@ "source": { "type": "git", "url": "git://github.com/doctrine/DoctrineBundle.git", - "reference": "75e0ac4a4be04bfa39b282f8ebccd3ef4c8ebe32" + "reference": "64deb4921926f482976414895fe549a6b4c604bb" }, "dist": { "type": "zip", - "url": "https://github.com/doctrine/DoctrineBundle/zipball/75e0ac4a4be04bfa39b282f8ebccd3ef4c8ebe32", - "reference": "75e0ac4a4be04bfa39b282f8ebccd3ef4c8ebe32", + "url": "https://github.com/doctrine/DoctrineBundle/zipball/64deb4921926f482976414895fe549a6b4c604bb", + "reference": "64deb4921926f482976414895fe549a6b4c604bb", "shasum": "" }, "require": { @@ -202,7 +203,7 @@ "suggest": { "doctrine/orm": "The Doctrine ORM integration is optional in the bundle." }, - "time": "1349890948", + "time": "1349217332", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -248,21 +249,21 @@ "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", - "reference": "1e2c7af26f9f7ac9110d47cee8133d700fb99ae1" + "reference": "186d605aa6b592bd577e07e0e9a2c420b02b2492" }, "dist": { "type": "zip", - "url": "https://github.com/doctrine/DoctrineFixturesBundle/zipball/1e2c7af26f9f7ac9110d47cee8133d700fb99ae1", - "reference": "1e2c7af26f9f7ac9110d47cee8133d700fb99ae1", + "url": "https://github.com/doctrine/DoctrineFixturesBundle/zipball/186d605aa6b592bd577e07e0e9a2c420b02b2492", + "reference": "186d605aa6b592bd577e07e0e9a2c420b02b2492", "shasum": "" }, "require": { "php": ">=5.3.2", "doctrine/data-fixtures": "*", - "doctrine/doctrine-bundle": "1.0.*", - "symfony/doctrine-bridge": ">=2.1.0,<2.3-dev" + "symfony/doctrine-bridge": "2.1.*", + "doctrine/doctrine-bundle": "1.0.*" }, - "time": "1349789605", + "time": "1345465418", "type": "symfony-bundle", "installation-source": "source", "autoload": { @@ -301,12 +302,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/DoctrinePHPCRBundle", - "reference": "9ff404ce9dbf978b3f4912dbd950be4b6c5cd8d2" + "reference": "5947d66cfcb84a306835118bda3c7b81d4a7a8aa" }, "dist": { "type": "zip", - "url": "https://github.com/doctrine/DoctrinePHPCRBundle/zipball/9ff404ce9dbf978b3f4912dbd950be4b6c5cd8d2", - "reference": "9ff404ce9dbf978b3f4912dbd950be4b6c5cd8d2", + "url": "https://github.com/doctrine/DoctrinePHPCRBundle/zipball/5947d66cfcb84a306835118bda3c7b81d4a7a8aa", + "reference": "5947d66cfcb84a306835118bda3c7b81d4a7a8aa", "shasum": "" }, "require": { @@ -321,7 +322,7 @@ "doctrine/data-fixtures": "if you want to use the fixture loading", "doctrine/phpcr-odm": "if you want to use the odm as well. require version 1.0.*" }, - "time": "1349968429", + "time": "1348080726", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -362,12 +363,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/phpcr-odm", - "reference": "a7acec04dd68781f8fea901bc3b13b5e02c3a195" + "reference": "c62988dc103b35b7e2f2dcc50bd4e1acc64d14c1" }, "dist": { "type": "zip", - "url": "https://github.com/doctrine/phpcr-odm/zipball/a7acec04dd68781f8fea901bc3b13b5e02c3a195", - "reference": "a7acec04dd68781f8fea901bc3b13b5e02c3a195", + "url": "https://github.com/doctrine/phpcr-odm/zipball/c62988dc103b35b7e2f2dcc50bd4e1acc64d14c1", + "reference": "c62988dc103b35b7e2f2dcc50bd4e1acc64d14c1", "shasum": "" }, "require": { @@ -385,7 +386,7 @@ "jackalope/jackalope-jackrabbit": "1.0.*", "midgard/phpcr": ">=1.3" }, - "time": "1349882009", + "time": "1349179865", "bin": [ "bin/phpcr", "bin/phpcr.php" @@ -448,6 +449,7 @@ "php": ">=5.3.2", "symfony/http-foundation": ">=2.0,<2.3-dev" }, + "time": "1347135166", "type": "library", "extra": { "branch-alias": { @@ -477,8 +479,7 @@ "homepage": "http://friendsofsymfony.github.com", "keywords": [ "rest" - ], - "time": "1347135166" + ] }, { "name": "friendsofsymfony/rest-bundle", @@ -487,12 +488,12 @@ "source": { "type": "git", "url": "https://github.com/FriendsOfSymfony/FOSRestBundle", - "reference": "4ca094f3832ce99bce3c42295206fbe361a598f6" + "reference": "28a9cc0bc2be5cebd07e1fe47fe7a946d85fbb34" }, "dist": { "type": "zip", - "url": "https://github.com/FriendsOfSymfony/FOSRestBundle/zipball/4ca094f3832ce99bce3c42295206fbe361a598f6", - "reference": "4ca094f3832ce99bce3c42295206fbe361a598f6", + "url": "https://github.com/FriendsOfSymfony/FOSRestBundle/zipball/28a9cc0bc2be5cebd07e1fe47fe7a946d85fbb34", + "reference": "28a9cc0bc2be5cebd07e1fe47fe7a946d85fbb34", "shasum": "" }, "require": { @@ -509,7 +510,7 @@ "suggest": { "sensio/framework-extra-bundle": "Add support for route annotations" }, - "time": "1349887290", + "time": "1348990701", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -552,12 +553,12 @@ "source": { "type": "git", "url": "https://github.com/jackalope/jackalope", - "reference": "0c97951fa34d65c5c501d8e17e3eba2432a85643" + "reference": "6887b39542dcf8d70999f298338d5e80e465eb50" }, "dist": { "type": "zip", - "url": "https://github.com/jackalope/jackalope/zipball/0c97951fa34d65c5c501d8e17e3eba2432a85643", - "reference": "0c97951fa34d65c5c501d8e17e3eba2432a85643", + "url": "https://github.com/jackalope/jackalope/zipball/6887b39542dcf8d70999f298338d5e80e465eb50", + "reference": "6887b39542dcf8d70999f298338d5e80e465eb50", "shasum": "" }, "require": { @@ -570,7 +571,7 @@ "provide": { "phpcr/phpcr-implementation": "2.1.0-beta4" }, - "time": "1349905078", + "time": "1348049868", "type": "library", "extra": { "branch-alias": { @@ -604,12 +605,12 @@ "source": { "type": "git", "url": "https://github.com/jackalope/jackalope-doctrine-dbal", - "reference": "dc256459f5f514c4127a8b941ed20727ea60279d" + "reference": "05ff9060cb9c3599150edd3ab67840220254febe" }, "dist": { "type": "zip", - "url": "https://github.com/jackalope/jackalope-doctrine-dbal/zipball/dc256459f5f514c4127a8b941ed20727ea60279d", - "reference": "dc256459f5f514c4127a8b941ed20727ea60279d", + "url": "https://github.com/jackalope/jackalope-doctrine-dbal/zipball/05ff9060cb9c3599150edd3ab67840220254febe", + "reference": "05ff9060cb9c3599150edd3ab67840220254febe", "shasum": "" }, "require": { @@ -627,7 +628,7 @@ "suggest": { "phpcr/phpcr-api-tests": "dev-master" }, - "time": "1349707265", + "time": "1349128829", "type": "library", "extra": { "branch-alias": { @@ -699,7 +700,7 @@ { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", + "homepage": "http://jmsyst.com", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -738,7 +739,7 @@ "twig/twig": ">=1.8,<2.0-dev", "doctrine/orm": ">=2.1,<2.4-dev" }, - "time": "2012-09-19 07:23:52", + "time": "2012-09-20 19:23:52", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -855,7 +856,7 @@ "knplabs/knp-menu": "1.1.*", "symfony/framework-bundle": ">=2.0,<2.2-dev" }, - "time": "2012-05-15 03:56:49", + "time": "2012-05-17 07:56:49", "type": "symfony-bundle", "installation-source": "dist", "autoload": { @@ -872,7 +873,7 @@ "email": "stof@notk.org" }, { - "name": "KnpLabs", + "name": "Knplabs", "homepage": "http://knplabs.com" }, { @@ -885,6 +886,72 @@ "menu" ] }, + { + "name": "kriswallsmith/assetic", + "version": "dev-master", + "source": { + "type": "git", + "url": "http://github.com/kriswallsmith/assetic.git", + "reference": "e22c5e07e672bb0cf43127e97e9368b53abf4aa8" + }, + "dist": { + "type": "zip", + "url": "https://github.com/kriswallsmith/assetic/zipball/e22c5e07e672bb0cf43127e97e9368b53abf4aa8", + "reference": "e22c5e07e672bb0cf43127e97e9368b53abf4aa8", + "shasum": "" + }, + "require": { + "symfony/process": ">=2.1.0,<2.3-dev", + "php": ">=5.3.1" + }, + "require-dev": { + "twig/twig": ">=1.6.0,<2.0", + "leafo/lessphp": "*", + "leafo/scssphp": "*", + "ptachoire/cssembed": "*", + "leafo/scssphp-compass": "*" + }, + "suggest": { + "twig/twig": "Assetic provides the integration with the Twig templating engine", + "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", + "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", + "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", + "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin" + }, + "time": "1349004759", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Assetic": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "description": "Asset Management for PHP", + "homepage": "https://github.com/kriswallsmith/assetic", + "keywords": [ + "assets", + "compression", + "minification" + ] + }, { "name": "liip/doctrine-cache-bundle", "version": "dev-master", @@ -980,12 +1047,12 @@ "source": { "type": "git", "url": "https://github.com/lunetics/LocaleBundle", - "reference": "5703a028128e4eca8c78d1d323ccc963ca946187" + "reference": "7f9ae16f90a0888e640c1f40f093954465753364" }, "dist": { "type": "zip", - "url": "https://github.com/lunetics/LocaleBundle/zipball/5703a028128e4eca8c78d1d323ccc963ca946187", - "reference": "5703a028128e4eca8c78d1d323ccc963ca946187", + "url": "https://github.com/lunetics/LocaleBundle/zipball/7f9ae16f90a0888e640c1f40f093954465753364", + "reference": "7f9ae16f90a0888e640c1f40f093954465753364", "shasum": "" }, "require": { @@ -995,7 +1062,7 @@ "symfony/yaml": "2.1.*", "symfony/locale": "2.1.*" }, - "time": "1349894869", + "time": "1349250213", "type": "symfony-bundle", "installation-source": "source", "autoload": { @@ -1027,6 +1094,46 @@ "cookie" ] }, + { + "name": "midgard/createphp", + "version": "dev-master", + "source": { + "type": "git", + "url": "git://github.com/flack/createphp.git", + "reference": "99e27172c0de250d520363014d7fc6d79c25f193" + }, + "dist": { + "type": "zip", + "url": "https://github.com/flack/createphp/zipball/99e27172c0de250d520363014d7fc6d79c25f193", + "reference": "99e27172c0de250d520363014d7fc6d79c25f193", + "shasum": "" + }, + "require-dev": { + "twig/twig": ">=1.8,<2.0-dev" + }, + "time": "1348484091", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "Midgard\\CreatePHP": "src" + } + }, + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Andreas Flack", + "email": "flack@contentcontrol-berlin.de", + "homepage": "http://www.contentcontrol-berlin.de/" + } + ], + "description": "PHP adapter for Create.js", + "keywords": [ + "rdfa" + ] + }, { "name": "monolog/monolog", "version": "dev-master", @@ -1216,6 +1323,7 @@ "require": { "symfony/framework-bundle": "2.1.*" }, + "time": "1347340208", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1241,8 +1349,7 @@ "keywords": [ "distribution", "configuration" - ], - "time": "1347340208" + ] }, { "name": "symfony-cmf/content-bundle", @@ -1251,12 +1358,12 @@ "source": { "type": "git", "url": "git://github.com/symfony-cmf/ContentBundle.git", - "reference": "e0edaecd809b33c70842ff83cd54b55249097139" + "reference": "7b0c242ef453bd408aa3cceac9366d5ed538f09b" }, "dist": { "type": "zip", - "url": "https://github.com/symfony-cmf/ContentBundle/zipball/e0edaecd809b33c70842ff83cd54b55249097139", - "reference": "e0edaecd809b33c70842ff83cd54b55249097139", + "url": "https://github.com/symfony-cmf/ContentBundle/zipball/7b0c242ef453bd408aa3cceac9366d5ed538f09b", + "reference": "7b0c242ef453bd408aa3cceac9366d5ed538f09b", "shasum": "" }, "require": { @@ -1269,7 +1376,7 @@ "suggest": { "friendsofsymfony/rest-bundle": "Improved handling for different output formats" }, - "time": "1349332412", + "time": "1349092324", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1304,12 +1411,12 @@ "source": { "type": "git", "url": "git://github.com/symfony-cmf/CoreBundle.git", - "reference": "1208707bbf412412ace5d6cde02107c73f75aec7" + "reference": "2170d201e7ebfb66d19811b7c6734a41deb48239" }, "dist": { "type": "zip", - "url": "https://github.com/symfony-cmf/CoreBundle/zipball/1208707bbf412412ace5d6cde02107c73f75aec7", - "reference": "1208707bbf412412ace5d6cde02107c73f75aec7", + "url": "https://github.com/symfony-cmf/CoreBundle/zipball/2170d201e7ebfb66d19811b7c6734a41deb48239", + "reference": "2170d201e7ebfb66d19811b7c6734a41deb48239", "shasum": "" }, "require": { @@ -1323,7 +1430,7 @@ "suggest": { "symfony/twig-bundle": ">2.0,<2.2-dev" }, - "time": "1349809066", + "time": "1349161204", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1351,6 +1458,59 @@ "Symfony CMF" ] }, + { + "name": "symfony-cmf/create-bundle", + "version": "dev-master", + "target-dir": "Symfony/Cmf/Bundle/CreateBundle", + "source": { + "type": "git", + "url": "https://github.com/symfony-cmf/CreateBundle.git", + "reference": "01738fd73d0ea221528df3a9dc9e48697b6c5cdf" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony-cmf/CreateBundle/zipball/01738fd73d0ea221528df3a9dc9e48697b6c5cdf", + "reference": "01738fd73d0ea221528df3a9dc9e48697b6c5cdf", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "friendsofsymfony/rest-bundle": "*", + "midgard/createphp": "dev-master", + "symfony/symfony": "2.1.*", + "symfony/assetic-bundle": "2.1.*" + }, + "suggest": { + "dms/dms-filter": "if you want to filter content on your fields" + }, + "time": "1349131269", + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Cmf\\Bundle\\CreateBundle": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Liip AG", + "homepage": "http://www.liip.ch/" + }, + { + "name": "Symfony CMF Community", + "homepage": "https://github.com/symfony-cmf/CreateBundle/contributors" + } + ], + "description": "Symfony Bundle for createphp and create.js. The easiest way to make any site editable and have semantic annotations with RDFa." + }, { "name": "symfony-cmf/menu-bundle", "version": "dev-master", @@ -1358,12 +1518,12 @@ "source": { "type": "git", "url": "git://github.com/symfony-cmf/MenuBundle.git", - "reference": "c9013a354fe6b03dc5cd346d5541ec347bafd39a" + "reference": "185b431af0ec5f85b5c8d9eede9b999c635b979a" }, "dist": { "type": "zip", - "url": "https://github.com/symfony-cmf/MenuBundle/zipball/c9013a354fe6b03dc5cd346d5541ec347bafd39a", - "reference": "c9013a354fe6b03dc5cd346d5541ec347bafd39a", + "url": "https://github.com/symfony-cmf/MenuBundle/zipball/185b431af0ec5f85b5c8d9eede9b999c635b979a", + "reference": "185b431af0ec5f85b5c8d9eede9b999c635b979a", "shasum": "" }, "require": { @@ -1379,7 +1539,7 @@ "suggest": { "sonata-project/doctrine-phpcr-admin-bundle": "if you want to have editing capabilities" }, - "time": "1349968851", + "time": "1348922886", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1464,12 +1624,12 @@ "source": { "type": "git", "url": "git://github.com/symfony-cmf/RoutingExtraBundle.git", - "reference": "c4730dac67089e2a441290a1b9ff09fd7a648636" + "reference": "d2be6e523fb27cce4defa71f8ee5d57acf5197c3" }, "dist": { "type": "zip", - "url": "https://github.com/symfony-cmf/RoutingExtraBundle/zipball/c4730dac67089e2a441290a1b9ff09fd7a648636", - "reference": "c4730dac67089e2a441290a1b9ff09fd7a648636", + "url": "https://github.com/symfony-cmf/RoutingExtraBundle/zipball/d2be6e523fb27cce4defa71f8ee5d57acf5197c3", + "reference": "d2be6e523fb27cce4defa71f8ee5d57acf5197c3", "shasum": "" }, "require": { @@ -1488,7 +1648,7 @@ "jackalope/jackalope-doctrine-dbal": "1.0.*", "doctrine/doctrine-bundle": "1.0.*" }, - "time": "1349906524", + "time": "1349126461", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1524,12 +1684,12 @@ "source": { "type": "git", "url": "git://github.com/symfony-cmf/SimpleCmsBundle.git", - "reference": "6cfb9e0b7aadbe6c9ed32342ead8cdce3a2ff677" + "reference": "8cf8bc671d8009bc6d0a17ba35c2f548b86ab09c" }, "dist": { "type": "zip", - "url": "https://github.com/symfony-cmf/SimpleCmsBundle/zipball/6cfb9e0b7aadbe6c9ed32342ead8cdce3a2ff677", - "reference": "6cfb9e0b7aadbe6c9ed32342ead8cdce3a2ff677", + "url": "https://github.com/symfony-cmf/SimpleCmsBundle/zipball/8cf8bc671d8009bc6d0a17ba35c2f548b86ab09c", + "reference": "8cf8bc671d8009bc6d0a17ba35c2f548b86ab09c", "shasum": "" }, "require": { @@ -1542,10 +1702,9 @@ }, "suggest": { "symfony-cmf/menu-bundle": "1.0.*", - "symfony-cmf/create-bundle": "1.0.*", - "sonata-project/doctrine-phpcr-admin-bundle": "1.0.*" + "symfony-cmf/create-bundle": "1.0.*" }, - "time": "1349902767", + "time": "1349123076", "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1574,6 +1733,69 @@ "Symfony CMF" ] }, + { + "name": "symfony/assetic-bundle", + "version": "dev-master", + "target-dir": "Symfony/Bundle/AsseticBundle", + "source": { + "type": "git", + "url": "https://github.com/symfony/AsseticBundle", + "reference": "5ebcf72d9b2d7028ca8c9b71b464ccc81d4795d2" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/AsseticBundle/zipball/5ebcf72d9b2d7028ca8c9b71b464ccc81d4795d2", + "reference": "5ebcf72d9b2d7028ca8c9b71b464ccc81d4795d2", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "kriswallsmith/assetic": "1.1.*", + "symfony/framework-bundle": ">=2.1.0,<2.3-dev" + }, + "require-dev": { + "symfony/twig-bundle": ">=2.1.0,<2.3-dev", + "symfony/console": ">=2.1.0,<2.3-dev", + "symfony/class-loader": ">=2.1.0,<2.3-dev", + "symfony/yaml": ">=2.1.0,<2.3-dev", + "symfony/form": ">=2.1.0,<2.3-dev", + "symfony/dom-crawler": ">=2.1.0,<2.3-dev", + "symfony/css-selector": ">=2.1.0,<2.3-dev" + }, + "suggest": { + "symfony/twig-bundle": ">=2.1.0,<2.3-dev" + }, + "time": "1348938560", + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Bundle\\AsseticBundle": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "description": "Integrates Assetic into Symfony2", + "homepage": "https://github.com/symfony/AsseticBundle", + "keywords": [ + "assets", + "compression", + "minification" + ] + }, { "name": "symfony/monolog-bundle", "version": "dev-master", @@ -1635,12 +1857,12 @@ "source": { "type": "git", "url": "git://github.com/symfony/symfony.git", - "reference": "854015265c24a7524d95d4ee57c59f2836d60dc1" + "reference": "566ad10f675ae39a7260b99bd1da1c5e986cef69" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/symfony/zipball/854015265c24a7524d95d4ee57c59f2836d60dc1", - "reference": "854015265c24a7524d95d4ee57c59f2836d60dc1", + "url": "https://github.com/symfony/symfony/zipball/566ad10f675ae39a7260b99bd1da1c5e986cef69", + "reference": "566ad10f675ae39a7260b99bd1da1c5e986cef69", "shasum": "" }, "require": { @@ -1689,7 +1911,7 @@ "propel/propel1": "dev-master", "monolog/monolog": "dev-master" }, - "time": "1349963062", + "time": "1349203503", "type": "library", "extra": { "branch-alias": { @@ -1728,18 +1950,18 @@ "source": { "type": "git", "url": "https://github.com/fabpot/Twig-extensions", - "reference": "dcdff02fbac1282e6b8f4d0558cc7e9580105688" + "reference": "f904575642b1213db69b4a98f08397e722ba1cae" }, "dist": { "type": "zip", - "url": "https://github.com/fabpot/Twig-extensions/zipball/dcdff02fbac1282e6b8f4d0558cc7e9580105688", - "reference": "dcdff02fbac1282e6b8f4d0558cc7e9580105688", + "url": "https://github.com/fabpot/Twig-extensions/zipball/f904575642b1213db69b4a98f08397e722ba1cae", + "reference": "f904575642b1213db69b4a98f08397e722ba1cae", "shasum": "" }, "require": { "twig/twig": "1.*" }, - "time": "1349889206", + "time": "1346770278", "type": "library", "extra": { "branch-alias": { @@ -1775,18 +1997,18 @@ "source": { "type": "git", "url": "git://github.com/fabpot/Twig.git", - "reference": "347bc81d6ed8e2bb793236aa9917c7e83f81c2b3" + "reference": "120cde3fa54c31047edf1cd003752ca119dec9a8" }, "dist": { "type": "zip", - "url": "https://github.com/fabpot/Twig/zipball/347bc81d6ed8e2bb793236aa9917c7e83f81c2b3", - "reference": "347bc81d6ed8e2bb793236aa9917c7e83f81c2b3", + "url": "https://github.com/fabpot/Twig/zipball/120cde3fa54c31047edf1cd003752ca119dec9a8", + "reference": "120cde3fa54c31047edf1cd003752ca119dec9a8", "shasum": "" }, "require": { "php": ">=5.2.4" }, - "time": "1349702400", + "time": "1348936415", "type": "library", "extra": { "branch-alias": { @@ -1819,7 +2041,9 @@ ] } ], - "packages-dev": null, + "packages-dev": [ + + ], "aliases": [ ], @@ -1829,6 +2053,7 @@ "doctrine/doctrine-fixtures-bundle": 20, "liip/functional-test-bundle": 20, "lunetics/locale-bundle": 20, - "liip/doctrine-cache-bundle": 20 + "liip/doctrine-cache-bundle": 20, + "symfony-cmf/create-bundle": 20 } } diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index f2ff8ed..21cc382 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -2,13 +2,13 @@ {% block content %} - {% createphp page as="rdf" %} -
+{% createphp page as="rdf" %} +
-

{{ createphp_content( rdf.title ) }}

-

{{ createphp_content( rdf.body|raw ) }}

+

{{ createphp_content( rdf.title ) }}

+

{{ createphp_content( rdf.body|raw ) }}

-
    {% for news in cmf_children(page)|reverse %}
  • diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index 719566b..8d9fb50 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -8,7 +8,6 @@ {% block includes %} - + {# + {{ createphp_attributes( rdf.children ) }} + #}
      - {% for news in cmf_children(page)|reverse %} + {% for news in page.children|reverse %}
    • {{ news.title }} ({{ news.publishStartDate | date('Y-m-d') }})
    • {% endfor %}
    -
- {% endcreatephp %} +{% endcreatephp %} {% endblock %} \ No newline at end of file From 234b50a114b66e71b42758c0fc5bd1d8e5b70cec Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 4 Oct 2012 13:33:16 +0200 Subject: [PATCH 14/52] WIP adding create.js and collections --- app/config/routing.yml | 11 ++++------- src/Cmf/MainBundle/Document/NewsCollection.php | 9 --------- src/Cmf/MainBundle/Resources/data/page.yml | 2 +- .../Cmf.MainBundle.Document.NewsCollection.xml | 1 - .../Resources/views/Cms/news_overview.html.twig | 17 ++++++++++------- .../MainBundle/Resources/views/layout.html.twig | 3 ++- 6 files changed, 17 insertions(+), 26 deletions(-) diff --git a/app/config/routing.yml b/app/config/routing.yml index 9f52819..d95fcda 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -3,11 +3,8 @@ # resource: "@FrameworkBundle/Resources/config/routing/internal.xml" # prefix: /_internal - - -#TODO: use that import? -# - -#createjs: -# resource: “@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml” +create: + resource: "@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml" +create_iamge: + resource: "@SymfonyCmfCreateBundle/Resources/config/routing/image.xml" diff --git a/src/Cmf/MainBundle/Document/NewsCollection.php b/src/Cmf/MainBundle/Document/NewsCollection.php index 0bf9c97..6d62ac5 100644 --- a/src/Cmf/MainBundle/Document/NewsCollection.php +++ b/src/Cmf/MainBundle/Document/NewsCollection.php @@ -17,13 +17,4 @@ */ class NewsCollection extends Page { - /** - * @PHPCRODM\Children - */ - private $children; - - public function getChildren() - { - return $this->children; - } } diff --git a/src/Cmf/MainBundle/Resources/data/page.yml b/src/Cmf/MainBundle/Resources/data/page.yml index f6d79dc..a02bca4 100644 --- a/src/Cmf/MainBundle/Resources/data/page.yml +++ b/src/Cmf/MainBundle/Resources/data/page.yml @@ -88,7 +88,7 @@ static: news: name: "news" title: "News" - class: "Cmf\MainBundle\Document\NewsCollection" + class: "Cmf\\MainBundle\\Document\\NewsCollection" formats: [html, rss] template: CmfMainBundle:Cms:news_overview.{_format}.twig options: diff --git a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml index f77d1cc..fd916e2 100644 --- a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml +++ b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml @@ -7,7 +7,6 @@ - diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index 966fa43..9e476b1 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -3,23 +3,26 @@ {% block content %} {% createphp page as="rdf" %} + +

{{ createphp_content( rdf.title ) }}

{{ createphp_content( rdf.body|raw ) }}

- {# - {{ createphp_attributes( rdf.children ) }} - #} -
+ {% endcreatephp %} {% endblock %} \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index 8d9fb50..904491f 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -13,6 +13,7 @@ {% endblock %} + {% include "SymfonyCmfCreateBundle::includecssfiles.html.twig" %} @@ -39,7 +40,7 @@
- +{% render "symfony_cmf_create.jsloader.controller:includeJSFilesAction" %} From d2482db51c39f5cadf4d7d3028d084e16942f1ef Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 4 Oct 2012 13:52:13 +0200 Subject: [PATCH 15/52] make fos restbundle handle json for the REST controller --- app/config/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/config/config.yml b/app/config/config.yml index 551b51f..80128bc 100755 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -64,6 +64,7 @@ fos_rest: view: formats: rss: true + json: true templating_formats: rss: true html: true From 13ae14b09c5c035742f7127a8779cc8aa798bb6c Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Thu, 11 Oct 2012 11:19:24 +0200 Subject: [PATCH 16/52] new test for collection handling --- app/tests/CreateJsTest.php | 124 ++++++++++++++++++ src/Cmf/MainBundle/Document/NewsDetail.php | 0 .../Cmf.MainBundle.Document.NewsDetail.xml | 14 ++ 3 files changed, 138 insertions(+) create mode 100644 app/tests/CreateJsTest.php create mode 100644 src/Cmf/MainBundle/Document/NewsDetail.php create mode 100644 src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml diff --git a/app/tests/CreateJsTest.php b/app/tests/CreateJsTest.php new file mode 100644 index 0000000..2c413cc --- /dev/null +++ b/app/tests/CreateJsTest.php @@ -0,0 +1,124 @@ +createClient(); + + //prepare the POST request + $partOfKey = ''; + $partOf = ''; + + $titleKey = ''; + $title = 'news title from testAddNews'; + + $contentKey = ''; + $content = 'some new content'; + + $subjectKey = '@subject'; + $subject = '_:bnode47'; + + $typeKey = '@type'; + $type = ''; + + $client->request('POST', '/en/symfony-cmf/create/document/_:bnode47', + array( + $partOfKey => array($partOf), + $titleKey => $title, + $contentKey => $content, + $subjectKey => $subject, + $typeKey => $type + )); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + //get the created page and check if everything is contained in the page + $crawler = $client->request('GET', '/news/news-title-from-testAddNews'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $this->assertCount(1, $crawler->filter(sprintf('h2:contains("%s")', $title))); + $this->assertCount(1, $crawler->filter(sprintf('p:contains("%s")', $content))); + $this->assertCount(1, $crawler->filter(sprintf('div.subtitle:contains("%s")', 'Date: ' . date('Y-m-d')))); + } + + public function testUpdateNews() + { + $client = $this->createClient(); + + //prepare the PUT request + $titleKey = ''; + $title = 'updated title from testUpdateNews'; + + $contentKey = ''; + $content = 'some updated content'; + + $subjectKey = '@subject'; + $subject = ''; + + $typeKey = '@type'; + $type = 'request('PUT', '/en/symfony-cmf/create/document/cms/simple/news/symfony-cmf-website-update', + array( + $titleKey => $title, + $contentKey => $content, + $subjectKey => $subject, + $typeKey => $type + ) + ); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + //get the updated page and check if data has been updated + $crawler = $client->request('GET', '/news/symfony-cmf-website-update'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertCount(1, $crawler->filter(sprintf('h2:contains("%s")', $title))); + $this->assertCount(1, $crawler->filter(sprintf('p:contains("%s")', $content))); + } + + + public function testRestServiceWithPost() + { + //prepare the post request + $partOfKey = ''; + $partOf = ''; + + $titleKey = ''; + $title = 'updated title from testRestService'; + + $contentKey = ''; + $content = 'updated content
'; + + $subjectKey = '@subject'; + $subject = ''; + + $typeKey = '@type'; + $type = ''; + + $request = array( + $partOfKey => array($partOf), + $titleKey => $title, + $contentKey => $content, + $subjectKey => $subject, + $typeKey => array($type) + ); + + $restService = $this->getContainer()->get('symfony_cmf_create.rest.handler'); + + $typeFactory = $this->getContainer()->get('symfony_cmf_create.rdf_type_factory'); + + $classType = $typeFactory->getType('Cmf\\MainBundle\\Document\\NewsCollection'); + + $result = $restService->run($request, $classType, null, RestService::HTTP_POST); + + $this->assertEquals($title, $result['']); + $this->assertEquals($content, $result['']); + } +} diff --git a/src/Cmf/MainBundle/Document/NewsDetail.php b/src/Cmf/MainBundle/Document/NewsDetail.php new file mode 100644 index 0000000..e69de29 diff --git a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml new file mode 100644 index 0000000..8637dca --- /dev/null +++ b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file From 8bf34fac446a10876fc48d8cc91c8a69273c1718 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Thu, 11 Oct 2012 11:20:22 +0200 Subject: [PATCH 17/52] creation of news with CreateJs --- app/config/config.yml | 3 +++ app/config/routing.yml | 2 +- src/Cmf/MainBundle/Document/NewsCollection.php | 6 ------ src/Cmf/MainBundle/Document/NewsDetail.php | 14 ++++++++++++++ src/Cmf/MainBundle/Resources/data/page.yml | 12 ++++++------ .../Cmf.MainBundle.Document.NewsCollection.xml | 2 +- .../Cmf.MainBundle.Document.NewsDetail.xml | 3 --- .../Resources/views/Cms/news_overview.html.twig | 2 -- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index 80128bc..4850cf9 100755 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -43,6 +43,7 @@ symfony_cmf_routing_extra: symfony_cmf_simple_cms: routing: templates_by_class: + Cmf\MainBundle\Document\NewsDetail: CmfMainBundle:Cms:news_detail.html.twig Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: SymfonyCmfSimpleCmsBundle:Page:index.html.twig use_sonata_admin: false @@ -73,3 +74,5 @@ fos_rest: symfony_cmf_create: phpcr_odm: true + map: + http://rdfs.org/sioc/ns#Post: Cmf\MainBundle\Document\NewsDetail diff --git a/app/config/routing.yml b/app/config/routing.yml index d95fcda..e5fd6e1 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -5,6 +5,6 @@ create: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml" -create_iamge: +create_image: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/image.xml" diff --git a/src/Cmf/MainBundle/Document/NewsCollection.php b/src/Cmf/MainBundle/Document/NewsCollection.php index 6d62ac5..a5a77cc 100644 --- a/src/Cmf/MainBundle/Document/NewsCollection.php +++ b/src/Cmf/MainBundle/Document/NewsCollection.php @@ -4,14 +4,8 @@ use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM; -use Symfony\Component\Validator\Constraints as Assert; - use Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page; -use Symfony\Cmf\Component\Routing\RouteAwareInterface; -use Symfony\Cmf\Bundle\RoutingExtraBundle\Document\Route; -use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishWorkflowInterface; - /** * @PHPCRODM\Document */ diff --git a/src/Cmf/MainBundle/Document/NewsDetail.php b/src/Cmf/MainBundle/Document/NewsDetail.php index e69de29..9e6745e 100644 --- a/src/Cmf/MainBundle/Document/NewsDetail.php +++ b/src/Cmf/MainBundle/Document/NewsDetail.php @@ -0,0 +1,14 @@ +blog post @@ -115,7 +115,7 @@ static: parent: "/news" title: "Symfony CMF sandbox now running with multiple different PHPCR implementations" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-06-12" content: | One of the fundamental ideas of PHPCR is that there can be multiple implementations that @@ -135,7 +135,7 @@ static: parent: "/news" title: "Jackalope Doctrine DBAL now compatible with PostgreSQL and SQLite" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-07-19" content: | Thanks to the work of cryptocompress the Jackalope @@ -152,7 +152,7 @@ static: parent: "/news" title: "Symfony CMF at the Create.js hackathon in Berlin" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-07-21" content: | The Symfony CMF has featured integration with create.js and VIE for inline editing for quite sometime @@ -167,7 +167,7 @@ static: parent: "/news" title: "Symfony CMF docs and standard edition" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-08-01" content: | We have finally setup our documentation on readthedocs.org. @@ -182,7 +182,7 @@ static: parent: "/news" title: "Symfony CMF website update" label: false - template: CmfMainBundle:Cms:news_detail.html.twig + class: "Cmf\\MainBundle\\Document\\NewsDetail" publish_start_date: "2012-09-29" content: | In an effort to eat our own dog food, we have finally updated diff --git a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml index fd916e2..6c9a47b 100644 --- a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml +++ b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsCollection.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml index 8637dca..99884e8 100644 --- a/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml +++ b/src/Cmf/MainBundle/Resources/rdf-mappings/Cmf.MainBundle.Document.NewsDetail.xml @@ -7,8 +7,5 @@ - - - \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index 9e476b1..c0a1335 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -10,8 +10,6 @@

{{ createphp_content( rdf.title ) }}

{{ createphp_content( rdf.body|raw ) }}

- -
    {% for news in page.children|reverse %} {% createphp news %} From a919fd742bb5e56118c93d727d914bb74073cc25 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Thu, 11 Oct 2012 16:50:02 +0200 Subject: [PATCH 18/52] show content when adding a news --- src/Cmf/MainBundle/Resources/public/css/style.css | 2 ++ .../Resources/views/Cms/news_overview.html.twig | 14 +++++++++++++- .../MainBundle/Resources/views/layout.html.twig | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Cmf/MainBundle/Resources/public/css/style.css b/src/Cmf/MainBundle/Resources/public/css/style.css index ef45d1a..1f55d12 100644 --- a/src/Cmf/MainBundle/Resources/public/css/style.css +++ b/src/Cmf/MainBundle/Resources/public/css/style.css @@ -507,3 +507,5 @@ ol.commentlist { } .subtitle { margin-left: 15px; } + +div.newscontent { display: none; } diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index c0a1335..a0e9ee5 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -15,12 +15,24 @@ {% createphp news %}
  • {{ createphp_content(news_rdf.title) }} ({{ news.publishStartDate | date('Y-m-d') }}) -
    +
    {{ createphp_content(news_rdf.body) }}
  • {% endcreatephp %} {% endfor %}
{% endcreatephp %} +
+ +{% block customjs %} + +{% endblock %} {% endblock %} \ No newline at end of file diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index 904491f..b15045e 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -41,6 +41,12 @@
{% render "symfony_cmf_create.jsloader.controller:includeJSFilesAction" %} + + +{% block customjs %} +{% endblock %} + + From d99d14f2595402528c0c15ebc2cb9e80fc06c045 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Fri, 12 Oct 2012 16:49:52 +0200 Subject: [PATCH 19/52] use CreateJs event to show the news content on edit --- .../Resources/views/Cms/news_overview.html.twig | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig index a0e9ee5..8397877 100644 --- a/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig +++ b/src/Cmf/MainBundle/Resources/views/Cms/news_overview.html.twig @@ -26,12 +26,17 @@ {% block customjs %} {% endblock %} From d40573d1838748d578f359ecaa8effc064af7247 Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Tue, 16 Oct 2012 18:11:00 +0200 Subject: [PATCH 20/52] wip integration of a login to edit the content --- app/AppKernel.php | 1 + app/config/config.yml | 1 + app/config/routing.yml | 1 - app/config/security.yml | 22 +++++++++++++++++++ .../Resources/views/layout.html.twig | 11 ++++++---- 5 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 app/config/security.yml diff --git a/app/AppKernel.php b/app/AppKernel.php index aeffad2..0f7d7a6 100755 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -13,6 +13,7 @@ public function registerBundles() new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), + new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(), new Knp\Bundle\MenuBundle\KnpMenuBundle(), diff --git a/app/config/config.yml b/app/config/config.yml index 4850cf9..9b29524 100755 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -1,5 +1,6 @@ imports: - { resource: parameters.yml } + - { resource: security.yml } framework: #esi: ~ diff --git a/app/config/routing.yml b/app/config/routing.yml index e5fd6e1..f41e370 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -7,4 +7,3 @@ create: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml" create_image: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/image.xml" - diff --git a/app/config/security.yml b/app/config/security.yml new file mode 100644 index 0000000..786bbbc --- /dev/null +++ b/app/config/security.yml @@ -0,0 +1,22 @@ +security: + firewalls: + secured_area: + pattern: ^/ + anonymous: ~ + http_basic: + realm: "Acess to the content editing of the website" + + access_control: + - { path: ^/news, roles: ROLE_EDITOR } + + providers: + my_chain_provider: + chain: + providers: [my_memory_provider] + my_memory_provider: + memory: + users: + editor: { password: dummy, roles: 'ROLE_EDITOR' } + + encoders: + Symfony\Component\Security\Core\User\User: plaintext diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index b15045e..e2b32f4 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -13,7 +13,10 @@ {% endblock %} - {% include "SymfonyCmfCreateBundle::includecssfiles.html.twig" %} + {% if is_granted('ROLE_EDITOR') %} + {% include "SymfonyCmfCreateBundle::includecssfiles.html.twig" %} + {% endif %} + @@ -40,13 +43,13 @@
-{% render "symfony_cmf_create.jsloader.controller:includeJSFilesAction" %} - +{% if is_granted('ROLE_EDITOR') %} + {% render "symfony_cmf_create.jsloader.controller:includeJSFilesAction" %} +{% endif %} {% block customjs %} {% endblock %} - From f9ef4aa28d0d1ff87c0017c13819118281b3d92c Mon Sep 17 00:00:00 2001 From: Adrien Nicolet Date: Wed, 17 Oct 2012 17:01:02 +0200 Subject: [PATCH 21/52] finalization of to edit the content --- app/config/routing.yml | 10 ++++++++++ app/config/security.yml | 6 +++++- .../MainBundle/Resources/public/css/style.css | 20 +++++++++++++++++++ .../Resources/views/layout.html.twig | 7 +++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/config/routing.yml b/app/config/routing.yml index f41e370..1c65cd5 100755 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -7,3 +7,13 @@ create: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml" create_image: resource: "@SymfonyCmfCreateBundle/Resources/config/routing/image.xml" + +_logout: + pattern: /logout + +_logout: + pattern: /login + defaults: + _controller: FrameworkBundle:Redirect:urlRedirect + path: / + permanent: true diff --git a/app/config/security.yml b/app/config/security.yml index 786bbbc..198801d 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -5,9 +5,13 @@ security: anonymous: ~ http_basic: realm: "Acess to the content editing of the website" + logout: + path: /logout + target: / + invalidate_session: true access_control: - - { path: ^/news, roles: ROLE_EDITOR } + - { path: ^/login, roles: ROLE_EDITOR } providers: my_chain_provider: diff --git a/src/Cmf/MainBundle/Resources/public/css/style.css b/src/Cmf/MainBundle/Resources/public/css/style.css index 1f55d12..d8682d9 100644 --- a/src/Cmf/MainBundle/Resources/public/css/style.css +++ b/src/Cmf/MainBundle/Resources/public/css/style.css @@ -250,6 +250,26 @@ input.button { color: #fff; } + +/* login-info */ +#login-info { + position: absolute; + margin: 0; + padding: 10px 15px 8px 15px; + background: #333; + font-family: 'Trebuchet MS', Arial, Sans-serif; + color: #FFF; + + bottom: 0px; right: 70px +} +#login-info p { + margin: 0; padding: 0; +} +#login-info a { + font-weight: bold; + color: #fff; +} + /* Navigation */ #nav { clear: both; diff --git a/src/Cmf/MainBundle/Resources/views/layout.html.twig b/src/Cmf/MainBundle/Resources/views/layout.html.twig index e2b32f4..c4f08fc 100755 --- a/src/Cmf/MainBundle/Resources/views/layout.html.twig +++ b/src/Cmf/MainBundle/Resources/views/layout.html.twig @@ -28,6 +28,13 @@ + + {% if is_granted('ROLE_EDITOR') %} +
+

Logged in as: {{ app.user.username }} - Logout

+
+ {% endif %} +