Skip to content

Commit edd05d2

Browse files
committed
Merge pull request #121 from phpcr/renamed_session_export_impot
Renamed session import/export commands
2 parents 3b4823c + 024c9b8 commit edd05d2

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ dev-master
55
----------
66

77
- [references] Show UUIDs when listing reference properties
8+
- [import/export] Renamed session import and export to `session:import` &
9+
`session:export`
810
- [transport] Added transport layer for experimental Jackalope FS implementation
911
- [misc] Wildcard (single asterisk) support in paths
1012
- [node] Added wilcard support to applicable node commands, including "node:list", "node:remove" and "node:property:show"

features/all/phpcr_session_export_view.feature renamed to features/all/phpcr_session_export.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
Feature: Export the repository to an XML file
22
In order to export the repository (or part of the repository) to an XML file
33
As a user that is logged into the shell
4-
I want to be able to "session:export:view" command to export the repository to an XML file.
4+
I want to be able to "session:export" command to export the repository to an XML file.
55

66
Background:
77
Given that I am logged in as "testuser"
88
And the file "foobar.xml" does not exist
99
And the "session_data.xml" fixtures are loaded
1010

1111
Scenario: Export the root
12-
Given I execute the "session:export:view / foobar.xml" command
12+
Given I execute the "session:export / foobar.xml" command
1313
Then the command should not fail
1414
And the file "foobar.xml" should exist
1515
And the xpath count "/sv:node" is "1" in file "foobar.xml"
1616
And the xpath count "/sv:node/sv:node" is "1" in file "foobar.xml"
1717

1818
Scenario: Export a subtree
19-
Given I execute the "session:export:view /tests_general_base foobar.xml" command
19+
Given I execute the "session:export /tests_general_base foobar.xml" command
2020
Then the file "foobar.xml" should exist
2121
And the command should not fail
2222

2323
Scenario: Export with an invalid path
24-
Given I execute the "session:export:view cms foobar.xml" command
24+
Given I execute the "session:export cms foobar.xml" command
2525
Then the command should fail
2626
And the output should contain:
2727
"""
@@ -30,26 +30,26 @@ Feature: Export the repository to an XML file
3030

3131
Scenario: Export to an existing file (should overwrite as --no-interaction is specified)
3232
Given the file "foobar.xml" exists
33-
And I execute the "session:export:view /tests_general_base foobar.xml --no-interaction" command
33+
And I execute the "session:export /tests_general_base foobar.xml --no-interaction" command
3434
Then the command should not fail
3535

3636
Scenario: Export non recursive
37-
Given I execute the "session:export:view /tests_general_base foobar.xml --no-recurse" command
37+
Given I execute the "session:export /tests_general_base foobar.xml --no-recurse" command
3838
Then the command should not fail
3939
And the file "foobar.xml" should exist
4040
And the xpath count "/sv:node" is "1" in file "foobar.xml"
4141
And the xpath count "/sv:node/sv:node" is "0" in file "foobar.xml"
4242

4343
Scenario: Export and skip binaries
44-
Given I execute the "session:export:view / foobar.xml --skip-binary" command
44+
Given I execute the "session:export / foobar.xml --skip-binary" command
4545
Then the command should not fail
4646

4747
Scenario: Export the document view
48-
Given I execute the "session:export:view / foobar.xml --document" command
48+
Given I execute the "session:export / foobar.xml --document" command
4949
Then the command should not fail
5050

5151
Scenario: Export the document view in pretty way
52-
Given I execute the "session:export:view / foobar.xml --pretty" command
52+
Given I execute the "session:export / foobar.xml --pretty" command
5353
Then the command should not fail
5454
And the file "foobar.xml" should exist
5555
And the xpath count "/sv:node" is "1" in file "foobar.xml"

src/PHPCR/Shell/Console/Application/ShellApplication.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ protected function registerPhpcrCommands()
108108
// phpcr commands
109109
$this->add(new CommandPhpcr\AccessControlPrivilegeListCommand());
110110
$this->add(new CommandPhpcr\RepositoryDescriptorListCommand());
111-
$this->add(new CommandPhpcr\SessionExportViewCommand());
111+
$this->add(new CommandPhpcr\SessionExportCommand());
112112
$this->add(new CommandPhpcr\SessionImpersonateCommand());
113-
$this->add(new CommandPhpcr\SessionImportXMLCommand());
113+
$this->add(new CommandPhpcr\SessionImportCommand());
114114
$this->add(new CommandPhpcr\SessionInfoCommand());
115115
$this->add(new CommandPhpcr\SessionNamespaceListCommand());
116116
$this->add(new CommandPhpcr\SessionNamespaceSetCommand());

src/PHPCR/Shell/Console/Command/Phpcr/SessionExportViewCommand.php renamed to src/PHPCR/Shell/Console/Command/Phpcr/SessionExportCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
use Symfony\Component\Console\Input\InputOption;
1010
use PHPCR\Util\PathHelper;
1111

12-
class SessionExportViewCommand extends BasePhpcrCommand
12+
class SessionExportCommand extends BasePhpcrCommand
1313
{
1414
protected function configure()
1515
{
16-
$this->setName('session:export:view');
17-
$this->setDescription('Export the system view');
16+
$this->setName('session:export');
17+
$this->setDescription('Export the to XML');
1818
$this->addArgument('absPath', InputArgument::REQUIRED, 'Path of node to export');
1919
$this->addArgument('file', InputArgument::REQUIRED, 'File to export to');
2020
$this->addOption('no-recurse', null, InputOption::VALUE_NONE, 'Do not recurse');

src/PHPCR/Shell/Console/Command/Phpcr/SessionImportXMLCommand.php renamed to src/PHPCR/Shell/Console/Command/Phpcr/SessionImportCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\Console\Input\InputOption;
1010
use PHPCR\Util\PathHelper;
1111

12-
class SessionImportXMLCommand extends BasePhpcrCommand
12+
class SessionImportCommand extends BasePhpcrCommand
1313
{
1414
protected $uuidBehaviors = array(
1515
'create-new',
@@ -20,10 +20,10 @@ class SessionImportXMLCommand extends BasePhpcrCommand
2020

2121
protected function configure()
2222
{
23-
$this->setName('session:import-xml');
23+
$this->setName('session:import');
2424
$this->setDescription('Import content from an XML file');
2525
$this->addArgument('parentAbsPath', InputArgument::REQUIRED, 'Path of node to export');
26-
$this->addArgument('file', InputArgument::REQUIRED, 'File to export to');
26+
$this->addArgument('file', InputArgument::REQUIRED, 'File to import from');
2727
$this->addOption('uuid-behavior', null, InputOption::VALUE_REQUIRED, 'UUID behavior', 'create-new');
2828
$this->setHelp(<<<HERE
2929
Deserializes an XML document and adds the resulting item subgraph as a

0 commit comments

Comments
 (0)