{"action":"created","comment":{"url":"https://api.github.com/repos/sulu/sulu/pulls/comments/86522073","pull_request_review_id":7177118,"id":86522073,"diff_hunk":"@@ -0,0 +1,571 @@\n+<?php\n+\n+/*\n+ * This file is part of Sulu.\n+ *\n+ * (c) MASSIVE ART WebServices GmbH\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+namespace Sulu\\Component\\Content\\Export;\n+\n+use Sulu\\Bundle\\ContentBundle\\Document\\BasePageDocument;\n+use Sulu\\Bundle\\DocumentManagerBundle\\Bridge\\DocumentInspector;\n+use Sulu\\Component\\Content\\Compat\\StructureManagerInterface;\n+use Sulu\\Component\\Content\\Document\\Structure\\PropertyValue;\n+use Sulu\\Component\\Content\\Extension\\ExportExtensionInterface;\n+use Sulu\\Component\\Content\\Extension\\ExtensionManagerInterface;\n+use Sulu\\Component\\Content\\Metadata\\BlockMetadata;\n+use Sulu\\Component\\Content\\Metadata\\PropertyMetadata;\n+use Sulu\\Component\\DocumentManager\\DocumentManager;\n+use Symfony\\Component\\Console\\Helper\\ProgressBar;\n+use Symfony\\Component\\Templating\\EngineInterface;\n+\n+class Webspace implements WebspaceInterface\n+{\n+    /**\n+     * @var EngineInterface\n+     */\n+    protected $templating;\n+\n+    /**\n+     * @var DocumentManager\n+     */\n+    protected $documentManager;\n+\n+    /**\n+     * @var EngineInterface\n+     */\n+    protected $documentInspector;\n+\n+    /**\n+     * @var StructureManagerInterface\n+     */\n+    protected $structureManager;\n+\n+    /**\n+     * @var ExtensionManagerInterface\n+     */\n+    protected $extensionManager;\n+\n+    /**\n+     * @var ContentExportManagerInterface\n+     */\n+    protected $contentExportManager;\n+\n+    /**\n+     * @var string[]\n+     */\n+    protected $formatFilePaths;\n+\n+    /**\n+     * @param EngineInterface $templating\n+     * @param DocumentManager $documentManager\n+     * @param DocumentInspector $documentInspector\n+     * @param StructureManagerInterface $structureManager\n+     * @param ExtensionManagerInterface $extensionManager\n+     * @param ContentExportManagerInterface $contentExportManager\n+     * @param array $formatFilePaths\n+     */\n+    public function __construct(\n+        EngineInterface $templating,\n+        DocumentManager $documentManager,\n+        DocumentInspector $documentInspector,\n+        StructureManagerInterface $structureManager,\n+        ExtensionManagerInterface $extensionManager,\n+        ContentExportManagerInterface $contentExportManager,\n+        array $formatFilePaths\n+    ) {\n+        $this->templating = $templating;\n+        $this->documentManager = $documentManager;\n+        $this->documentInspector = $documentInspector;\n+        $this->structureManager = $structureManager;\n+        $this->extensionManager = $extensionManager;\n+        $this->contentExportManager = $contentExportManager;\n+        $this->formatFilePaths = $formatFilePaths;\n+    }\n+\n+    /**\n+     * @param string $webspaceKey\n+     * @param string $locale\n+     * @param string $output\n+     * @param string $format\n+     * @param string $uuid\n+     * @param array $nodes\n+     * @param array $ignoredNodes\n+     *\n+     * @return string\n+     *\n+     * @throws \\Exception\n+     */\n+    public function export(\n+        $webspaceKey,\n+        $locale,\n+        $output,\n+        $format = '1.2.xliff',\n+        $uuid = null,\n+        $nodes = null,\n+        $ignoredNodes = null\n+    ) {\n+        if (!$webspaceKey || !$locale) {\n+            throw new \\Exception(sprintf('Invalid parameters for export \"%s (%s)\"', $webspaceKey, $locale));\n+        }\n+\n+        return $this->templating->render(\n+            $this->getTemplate($format),\n+            $this->getExportData($webspaceKey, $locale, $output, $format, $uuid, $nodes, $ignoredNodes)\n+        );\n+    }\n+\n+    /**\n+     * @param string $webspaceKey\n+     * @param string $locale\n+     * @param string $output\n+     * @param string $format\n+     * @param string $uuid\n+     * @param array $nodes\n+     * @param array $ignoredNodes\n+     *\n+     * @return array\n+     */\n+    public function getExportData(\n+        $webspaceKey,\n+        $locale,\n+        $output,\n+        $format = '1.2.xliff',\n+        $uuid = null,\n+        $nodes = null,\n+        $ignoredNodes = null\n+    ) {\n+        /** @var \\Sulu\\Bundle\\ContentBundle\\Document\\PageDocument[] $documents */\n+        $documents = $this->getDocuments($webspaceKey, $locale, $uuid, $nodes, $ignoredNodes);\n+        /** @var \\Sulu\\Bundle\\ContentBundle\\Document\\PageDocument[] $loadedDocuments */","path":"src/Sulu/Component/Content/Export/Webspace.php","position":144,"original_position":144,"commit_id":"a0644bae6d967ca02baa50eaef1b9b91e44a2ede","original_commit_id":"a0644bae6d967ca02baa50eaef1b9b91e44a2ede","user":{"login":"dominikmatt","id":3023954,"avatar_url":"https://avatars.githubusercontent.com/u/3023954?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikmatt","html_url":"https://github.com/dominikmatt","followers_url":"https://api.github.com/users/dominikmatt/followers","following_url":"https://api.github.com/users/dominikmatt/following{/other_user}","gists_url":"https://api.github.com/users/dominikmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikmatt/subscriptions","organizations_url":"https://api.github.com/users/dominikmatt/orgs","repos_url":"https://api.github.com/users/dominikmatt/repos","events_url":"https://api.github.com/users/dominikmatt/events{/privacy}","received_events_url":"https://api.github.com/users/dominikmatt/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-11-04T10:46:07Z","updated_at":"2016-11-04T10:46:07Z","html_url":"https://github.com/sulu/sulu/pull/2705#discussion_r86522073","pull_request_url":"https://api.github.com/repos/sulu/sulu/pulls/2705","_links":{"self":{"href":"https://api.github.com/repos/sulu/sulu/pulls/comments/86522073"},"html":{"href":"https://github.com/sulu/sulu/pull/2705#discussion_r86522073"},"pull_request":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2705"}}},"pull_request":{"url":"https://api.github.com/repos/sulu/sulu/pulls/2705","id":79531575,"html_url":"https://github.com/sulu/sulu/pull/2705","diff_url":"https://github.com/sulu/sulu/pull/2705.diff","patch_url":"https://github.com/sulu/sulu/pull/2705.patch","issue_url":"https://api.github.com/repos/sulu/sulu/issues/2705","number":2705,"state":"open","locked":false,"title":"Import text of webspace as XLIFF","user":{"login":"dominikmatt","id":3023954,"avatar_url":"https://avatars.githubusercontent.com/u/3023954?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikmatt","html_url":"https://github.com/dominikmatt","followers_url":"https://api.github.com/users/dominikmatt/followers","following_url":"https://api.github.com/users/dominikmatt/following{/other_user}","gists_url":"https://api.github.com/users/dominikmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikmatt/subscriptions","organizations_url":"https://api.github.com/users/dominikmatt/orgs","repos_url":"https://api.github.com/users/dominikmatt/repos","events_url":"https://api.github.com/users/dominikmatt/events{/privacy}","received_events_url":"https://api.github.com/users/dominikmatt/received_events","type":"User","site_admin":false},"body":"Ref-PR: https://github.com/sulu/sulu/pull/1758\n\n| Q | A |\n| --- | --- |\n| Bug fix? | no |\n| New feature? | yes |\n| BC breaks? | New **ContentTypeExportInterface** and **ContentTypeImportInterface** functions |\n| Deprecations? | no |\n| Fixed tickets | part of #1686 |\n| Related issues/PRs | #1686 #1758 |\n| Documentation PR | sulu/sulu-docs#242 |\n#### To Do\n- [x] Create a documentation PR\n- [x] Implement tests\n#### Commands\n\n```\napp/console sulu:webspaces:import export_en.xliff -w sulu_lo -l en -o true\n# or only specific page\napp/console sulu:webspaces:import export_en.xliff -w sulu_lo -l en -o true -u f7df9533-daa0-45b3-ab52-54ca30991bc5\n```\n","created_at":"2016-08-01T08:30:45Z","updated_at":"2016-11-04T10:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e60790b388e9be2bb41d151e1d45b1b3389ffe35","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sulu/sulu/pulls/2705/commits","review_comments_url":"https://api.github.com/repos/sulu/sulu/pulls/2705/comments","review_comment_url":"https://api.github.com/repos/sulu/sulu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sulu/sulu/issues/2705/comments","statuses_url":"https://api.github.com/repos/sulu/sulu/statuses/a0644bae6d967ca02baa50eaef1b9b91e44a2ede","head":{"label":"dominikmatt:feature/webspace-import","ref":"feature/webspace-import","sha":"a0644bae6d967ca02baa50eaef1b9b91e44a2ede","user":{"login":"dominikmatt","id":3023954,"avatar_url":"https://avatars.githubusercontent.com/u/3023954?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikmatt","html_url":"https://github.com/dominikmatt","followers_url":"https://api.github.com/users/dominikmatt/followers","following_url":"https://api.github.com/users/dominikmatt/following{/other_user}","gists_url":"https://api.github.com/users/dominikmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikmatt/subscriptions","organizations_url":"https://api.github.com/users/dominikmatt/orgs","repos_url":"https://api.github.com/users/dominikmatt/repos","events_url":"https://api.github.com/users/dominikmatt/events{/privacy}","received_events_url":"https://api.github.com/users/dominikmatt/received_events","type":"User","site_admin":false},"repo":{"id":57208031,"name":"sulu","full_name":"dominikmatt/sulu","owner":{"login":"dominikmatt","id":3023954,"avatar_url":"https://avatars.githubusercontent.com/u/3023954?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikmatt","html_url":"https://github.com/dominikmatt","followers_url":"https://api.github.com/users/dominikmatt/followers","following_url":"https://api.github.com/users/dominikmatt/following{/other_user}","gists_url":"https://api.github.com/users/dominikmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikmatt/subscriptions","organizations_url":"https://api.github.com/users/dominikmatt/orgs","repos_url":"https://api.github.com/users/dominikmatt/repos","events_url":"https://api.github.com/users/dominikmatt/events{/privacy}","received_events_url":"https://api.github.com/users/dominikmatt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dominikmatt/sulu","description":"Sulu core bundles & components","fork":true,"url":"https://api.github.com/repos/dominikmatt/sulu","forks_url":"https://api.github.com/repos/dominikmatt/sulu/forks","keys_url":"https://api.github.com/repos/dominikmatt/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dominikmatt/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dominikmatt/sulu/teams","hooks_url":"https://api.github.com/repos/dominikmatt/sulu/hooks","issue_events_url":"https://api.github.com/repos/dominikmatt/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/dominikmatt/sulu/events","assignees_url":"https://api.github.com/repos/dominikmatt/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/dominikmatt/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/dominikmatt/sulu/tags","blobs_url":"https://api.github.com/repos/dominikmatt/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dominikmatt/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dominikmatt/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/dominikmatt/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dominikmatt/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/dominikmatt/sulu/languages","stargazers_url":"https://api.github.com/repos/dominikmatt/sulu/stargazers","contributors_url":"https://api.github.com/repos/dominikmatt/sulu/contributors","subscribers_url":"https://api.github.com/repos/dominikmatt/sulu/subscribers","subscription_url":"https://api.github.com/repos/dominikmatt/sulu/subscription","commits_url":"https://api.github.com/repos/dominikmatt/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/dominikmatt/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/dominikmatt/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/dominikmatt/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/dominikmatt/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/dominikmatt/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dominikmatt/sulu/merges","archive_url":"https://api.github.com/repos/dominikmatt/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dominikmatt/sulu/downloads","issues_url":"https://api.github.com/repos/dominikmatt/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/dominikmatt/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/dominikmatt/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/dominikmatt/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dominikmatt/sulu/labels{/name}","releases_url":"https://api.github.com/repos/dominikmatt/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/dominikmatt/sulu/deployments","created_at":"2016-04-27T11:26:20Z","updated_at":"2016-04-27T11:26:27Z","pushed_at":"2016-10-27T13:41:50Z","git_url":"git://github.com/dominikmatt/sulu.git","ssh_url":"git@github.com:dominikmatt/sulu.git","clone_url":"https://github.com/dominikmatt/sulu.git","svn_url":"https://github.com/dominikmatt/sulu","homepage":"sulu.io","size":84237,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"sulu:develop","ref":"develop","sha":"0347371c5f6abd23ee7b2e337c74c814f7c7cf6c","user":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"repo":{"id":13678015,"name":"sulu","full_name":"sulu/sulu","owner":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu/sulu","description":"Sulu core bundles & components","fork":false,"url":"https://api.github.com/repos/sulu/sulu","forks_url":"https://api.github.com/repos/sulu/sulu/forks","keys_url":"https://api.github.com/repos/sulu/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu/sulu/teams","hooks_url":"https://api.github.com/repos/sulu/sulu/hooks","issue_events_url":"https://api.github.com/repos/sulu/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/sulu/sulu/events","assignees_url":"https://api.github.com/repos/sulu/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/sulu/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/sulu/sulu/tags","blobs_url":"https://api.github.com/repos/sulu/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu/sulu/languages","stargazers_url":"https://api.github.com/repos/sulu/sulu/stargazers","contributors_url":"https://api.github.com/repos/sulu/sulu/contributors","subscribers_url":"https://api.github.com/repos/sulu/sulu/subscribers","subscription_url":"https://api.github.com/repos/sulu/sulu/subscription","commits_url":"https://api.github.com/repos/sulu/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/sulu/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu/sulu/merges","archive_url":"https://api.github.com/repos/sulu/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu/sulu/downloads","issues_url":"https://api.github.com/repos/sulu/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/sulu/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu/sulu/labels{/name}","releases_url":"https://api.github.com/repos/sulu/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/sulu/sulu/deployments","created_at":"2013-10-18T12:57:02Z","updated_at":"2016-10-28T06:39:55Z","pushed_at":"2016-11-04T10:31:01Z","git_url":"git://github.com/sulu/sulu.git","ssh_url":"git@github.com:sulu/sulu.git","clone_url":"https://github.com/sulu/sulu.git","svn_url":"https://github.com/sulu/sulu","homepage":"sulu.io","size":95608,"stargazers_count":151,"watchers_count":151,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":441,"forks":62,"open_issues":441,"watchers":151,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2705"},"html":{"href":"https://github.com/sulu/sulu/pull/2705"},"issue":{"href":"https://api.github.com/repos/sulu/sulu/issues/2705"},"comments":{"href":"https://api.github.com/repos/sulu/sulu/issues/2705/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2705/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu/sulu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2705/commits"},"statuses":{"href":"https://api.github.com/repos/sulu/sulu/statuses/a0644bae6d967ca02baa50eaef1b9b91e44a2ede"}}}}
{"actor":{"display_login":"dominikmatt"}}