From 110d030cc3e5f0f0e407bd926f5f05649e8286ef Mon Sep 17 00:00:00 2001 From: Luca Rath-Heel Date: Tue, 14 Jul 2020 15:27:15 +0200 Subject: [PATCH 1/5] Add flex recipe for SuluArticleBundle --- .../2.0/config/packages/ongr_elasticsearch.yaml | 8 ++++++++ .../2.0/config/packages/sulu_article.yaml | 16 ++++++++++++++++ .../2.0/config/routes/sulu_article_admin.yaml | 4 ++++ sulu/article-bundle/2.0/manifest.json | 16 ++++++++++++++++ sulu/article-bundle/2.0/post-install.txt | 11 +++++++++++ 5 files changed, 55 insertions(+) create mode 100644 sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml create mode 100644 sulu/article-bundle/2.0/config/packages/sulu_article.yaml create mode 100644 sulu/article-bundle/2.0/config/routes/sulu_article_admin.yaml create mode 100644 sulu/article-bundle/2.0/manifest.json create mode 100644 sulu/article-bundle/2.0/post-install.txt diff --git a/sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml b/sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml new file mode 100644 index 00000000..635ed98c --- /dev/null +++ b/sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml @@ -0,0 +1,8 @@ +ongr_elasticsearch: + analysis: + tokenizer: + pathTokenizer: + type: path_hierarchy + analyzer: + pathAnalyzer: + tokenizer: pathTokenizer diff --git a/sulu/article-bundle/2.0/config/packages/sulu_article.yaml b/sulu/article-bundle/2.0/config/packages/sulu_article.yaml new file mode 100644 index 00000000..d5b2eeb0 --- /dev/null +++ b/sulu/article-bundle/2.0/config/packages/sulu_article.yaml @@ -0,0 +1,16 @@ +sulu_article: + index_name: '%env(resolve:ELASTICSEARCH_INDEX)%' + hosts: + - '%env(resolve:ELASTICSEARCH_HOST)%' + +sulu_route: + mappings: + Sulu\Bundle\ArticleBundle\Document\ArticleDocument: + generator: schema + options: + route_schema: /articles/{object.getTitle()} + Sulu\Bundle\ArticleBundle\Document\ArticlePageDocument: + generator: article_page + options: + route_schema: {translator.trans("page")}-{object.getPageNumber()} + parent: {object.getParent().getRoutePath()} diff --git a/sulu/article-bundle/2.0/config/routes/sulu_article_admin.yaml b/sulu/article-bundle/2.0/config/routes/sulu_article_admin.yaml new file mode 100644 index 00000000..2fb93645 --- /dev/null +++ b/sulu/article-bundle/2.0/config/routes/sulu_article_admin.yaml @@ -0,0 +1,4 @@ +sulu_article_api: + resource: '@SuluArticleBundle/Resources/config/routing_api.yml' + type: rest + prefix: /admin/api diff --git a/sulu/article-bundle/2.0/manifest.json b/sulu/article-bundle/2.0/manifest.json new file mode 100644 index 00000000..f3b28e94 --- /dev/null +++ b/sulu/article-bundle/2.0/manifest.json @@ -0,0 +1,16 @@ +{ + "bundles": { + "Sulu\\Bundle\\ArticleBundle\\SuluArticleBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "copy-from-package": { + "Resources/doc/default.xml": "%CONFIG_DIR%/templates/articles/default.xml", + "Resources/doc/default.html.twig": "templates/articles/default.xml" + }, + "env": { + "ELASTICSEARCH_HOST": "127.0.0.1:9200", + "ELASTICSEARCH_INDEX": "" + } +} diff --git a/sulu/article-bundle/2.0/post-install.txt b/sulu/article-bundle/2.0/post-install.txt new file mode 100644 index 00000000..bfe4e617 --- /dev/null +++ b/sulu/article-bundle/2.0/post-install.txt @@ -0,0 +1,11 @@ + + What's next? + + + * The SuluArticleBundle is almost ready: + 1. Configure elasticsearch host and index in the .env file. + 2. Initialize PHPCR by running php bin/console sulu:document:init. + 3. Create the elasticsearch indices by running php bin/console ongr:es:index:create and php bin/console ongr:es:index:create --manager live. + 4. Make sure your user has all the necessary permissions for the SuluArticleBundle. + + * Read the documentation at https://github.com/sulu/SuluArticleBundle/blob/master/Resources/doc/README.md From 93e5b36eb494b2511fe85c0963f811fa4abb8a43 Mon Sep 17 00:00:00 2001 From: Luca Rath-Heel Date: Tue, 14 Jul 2020 15:47:32 +0200 Subject: [PATCH 2/5] fix ci --- sulu/article-bundle/2.0/config/packages/sulu_article.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sulu/article-bundle/2.0/config/packages/sulu_article.yaml b/sulu/article-bundle/2.0/config/packages/sulu_article.yaml index d5b2eeb0..9e05c220 100644 --- a/sulu/article-bundle/2.0/config/packages/sulu_article.yaml +++ b/sulu/article-bundle/2.0/config/packages/sulu_article.yaml @@ -8,9 +8,9 @@ sulu_route: Sulu\Bundle\ArticleBundle\Document\ArticleDocument: generator: schema options: - route_schema: /articles/{object.getTitle()} + route_schema: '/articles/{object.getTitle()}' Sulu\Bundle\ArticleBundle\Document\ArticlePageDocument: generator: article_page options: - route_schema: {translator.trans("page")}-{object.getPageNumber()} - parent: {object.getParent().getRoutePath()} + route_schema: '{translator.trans("page")}-{object.getPageNumber()}' + parent: '{object.getParent().getRoutePath()}' From 052281ce2bfff6945981e95d2a809afc01b19b73 Mon Sep 17 00:00:00 2001 From: Luca Rath-Heel Date: Sun, 19 Jul 2020 11:26:12 +0200 Subject: [PATCH 3/5] Delete ongr_elasticsearch.yaml --- .../2.0/config/packages/ongr_elasticsearch.yaml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml diff --git a/sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml b/sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml deleted file mode 100644 index 635ed98c..00000000 --- a/sulu/article-bundle/2.0/config/packages/ongr_elasticsearch.yaml +++ /dev/null @@ -1,8 +0,0 @@ -ongr_elasticsearch: - analysis: - tokenizer: - pathTokenizer: - type: path_hierarchy - analyzer: - pathAnalyzer: - tokenizer: pathTokenizer From d73a183117fb730957083bf87375cad745190f77 Mon Sep 17 00:00:00 2001 From: Luca Rath-Heel Date: Mon, 20 Jul 2020 09:47:35 +0200 Subject: [PATCH 4/5] Update manifest.json --- sulu/article-bundle/2.0/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sulu/article-bundle/2.0/manifest.json b/sulu/article-bundle/2.0/manifest.json index f3b28e94..08ad8ca1 100644 --- a/sulu/article-bundle/2.0/manifest.json +++ b/sulu/article-bundle/2.0/manifest.json @@ -11,6 +11,6 @@ }, "env": { "ELASTICSEARCH_HOST": "127.0.0.1:9200", - "ELASTICSEARCH_INDEX": "" + "ELASTICSEARCH_INDEX": "su_articles" } } From 97d81d108e9b54e59d0c821c0bbf6debc4f8bcd2 Mon Sep 17 00:00:00 2001 From: Luca Rath-Heel Date: Mon, 24 Aug 2020 11:26:44 +0200 Subject: [PATCH 5/5] Fix review --- .../2.0/config/packages/sulu_article.yaml | 12 ++++++++++++ sulu/article-bundle/2.0/manifest.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sulu/article-bundle/2.0/config/packages/sulu_article.yaml b/sulu/article-bundle/2.0/config/packages/sulu_article.yaml index 9e05c220..c9b17ed0 100644 --- a/sulu/article-bundle/2.0/config/packages/sulu_article.yaml +++ b/sulu/article-bundle/2.0/config/packages/sulu_article.yaml @@ -2,6 +2,9 @@ sulu_article: index_name: '%env(resolve:ELASTICSEARCH_INDEX)%' hosts: - '%env(resolve:ELASTICSEARCH_HOST)%' + types: + article: + translation_key: "sulu_article.article" sulu_route: mappings: @@ -14,3 +17,12 @@ sulu_route: options: route_schema: '{translator.trans("page")}-{object.getPageNumber()}' parent: '{object.getParent().getRoutePath()}' + +ongr_elasticsearch: + analysis: + tokenizer: + pathTokenizer: + type: path_hierarchy + analyzer: + pathAnalyzer: + tokenizer: pathTokenizer diff --git a/sulu/article-bundle/2.0/manifest.json b/sulu/article-bundle/2.0/manifest.json index 08ad8ca1..a340517d 100644 --- a/sulu/article-bundle/2.0/manifest.json +++ b/sulu/article-bundle/2.0/manifest.json @@ -7,7 +7,7 @@ }, "copy-from-package": { "Resources/doc/default.xml": "%CONFIG_DIR%/templates/articles/default.xml", - "Resources/doc/default.html.twig": "templates/articles/default.xml" + "Resources/doc/default.html.twig": "templates/articles/default.html.twig" }, "env": { "ELASTICSEARCH_HOST": "127.0.0.1:9200",