diff --git a/docs/_sidebar.md b/docs/_sidebar.md index cc1cda517..dc13a2973 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -85,6 +85,7 @@ - [Zip](/dev/submission-bundle/handlers/zip.md) - Recipes - [Export as word](/recipes/export-as-word.md) + - [File structure](/recipes/websites/file-structure.md) - [Hierarchy to JSON Netsed](/recipes/hierarchy-to-json-netsed.md) - [Store Data](/recipes/store-data.md) - [Postprocessing](/recipes/postprocessing.md) diff --git a/docs/recipes/websites/file-structure.md b/docs/recipes/websites/file-structure.md index 182afa8fc..62368695a 100644 --- a/docs/recipes/websites/file-structure.md +++ b/docs/recipes/websites/file-structure.md @@ -1,34 +1,28 @@ -# Synchronize a directory structure and publish into an S3 bucket - -First of all you must configure a [`directory`](directory.json) content type in an elasticms admin. - -Each document of that `directory` content type can contains a file structure. - -## Initialize a document - -Just click on `New Directory`and fill the Identifier field. `Demo` in this example. Not need to fill the `Structure` fields. +# File structure ## Push a local folder to ElasticMS The following command is available in all ElacticMS applications (Admin, Web and CLI) but required that your are logged in first (`ems:admin:login`). ```shell -php bin/console ems:file-structure:push demo ../../demo --term-field=identifier +php bin/console ems:file-structure:push ../../demo ``` +This command will upload all files present in the ../../demo folder an give you an hash as output. +That hash identify an ElasticMS Archive, it's a JSON containing the all files structure (with hash, filename, size and mimetype). ## Update a local folder from ElasticMS - ```shell -php bin/console ems:file-structure:pull demo ../../demo --term-field=identifier +php bin/console ems:file-structure:pull d3bb0298fd9a69743333fb25dbe6cdefdc834ff2 ../../demo ``` +Update the folder ../../demo by the content of the ElasticMS archive identified by the hash `d3bb0298fd9a69743333fb25dbe6cdefdc834ff2`. ## Publish a file structure to a S3 bucket -There is another command that allows you to publish a `directory` document, for a revision publish in some environment into a S3 bucket. +There is another command that allows you to publish an ElasticMS archive into a S3 bucket. ```shell -php bin/console ems:file-structure:publish demo website_preview website --term-field=identifier --s3-credential='{"version":"2006-03-01","credentials":{"key":"accesskey","secret":"secretkey"},"region":"us-east-1","endpoint":"http://localhost:9000","use_path_style_endpoint":true}' +php bin/console ems:file-structure:publish d3bb0298fd9a69743333fb25dbe6cdefdc834ff2 website --term-field=identifier --s3-credential='{"version":"2006-03-01","credentials":{"key":"accesskey","secret":"secretkey"},"region":"us-east-1","endpoint":"http://localhost:9000","use_path_style_endpoint":true}' ``` ## Publish your bucket as website