Skip to content

Commit b0f3f06

Browse files
committed
Tidied up command documentation
1 parent ee0d780 commit b0f3f06

27 files changed

+57
-424
lines changed

CHANGELOG.md

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

99
- [DoctrinePhpcrBundle] Shell must now be initiated in a different way in
1010
embedded mode. The DoctrinePhpcrBundle will need to be updated.
11+
- [node:shared:remove] Removed this command and integrated it into
12+
`node:remove` instead (`node:remove . --shared`)
1113

1214
### Bug fixes
1315

src/PHPCR/Shell/Console/Command/Phpcr/AccessControlPrivilegeListCommand.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ protected function configure()
3131
List the privileges of the current session or the node at the given path.
3232
3333
List the privileges for the object specified by <info>abs-path</info>
34-
argument. If <info>abs-path</info>
35-
is the absolute path of an accessible node then the specified object is
36-
that node. If <info>abs-path</info> is null then the specified object is the
37-
repository as a whole and the privileges in question are those that are
38-
not associated with any particular node. This includes such privileges
39-
as being able administer the node type registry, for example.
34+
argument.
4035
4136
By default the returned privileges are those for which
4237
AccessControlManagerInterface::hasPrivileges() would return true.

src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ protected function configure()
3030
node. As well, the corresponding lock token is removed from the set of
3131
lock tokens held by the current Session.
3232
33-
If the node does not currently hold a lock or holds a lock for which
34-
this Session is not the owner and is not a "lock-superuser", then a
35-
\PHPCR\Lock\LockException is thrown.
36-
37-
<b>Note:</b>
38-
However that the system may give permission to a non-owning session
39-
to unlock a lock. Typically such "lock-superuser" capability is intended
40-
to facilitate administrational clean-up of orphaned open-scoped locks.
41-
4233
Note that it is possible to unlock a node even if it is checked-in (the
4334
lock-related properties will be changed despite the checked-in status).
4435
HERE

src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class NodeCloneCommand extends BasePhpcrCommand
2121
protected function configure()
2222
{
2323
$this->setName('node:clone');
24-
$this->setDescription('Clone a node');
24+
$this->setDescription('Clone a node (immediate)');
2525
$this->addArgument('srcPath', InputArgument::REQUIRED, 'Path to source node');
2626
$this->addArgument('destPath', InputArgument::REQUIRED, 'Path to destination node');
2727
$this->addArgument('srcWorkspace', InputArgument::OPTIONAL, 'If specified, copy from this workspace');
@@ -31,15 +31,9 @@ protected function configure()
3131
<info>srcWorkspace</info> to the new location at <info>destAbsPath</info> in
3232
the current workspace.
3333
34-
Unlike the signature of copy that copies between workspaces, this method does
35-
not assign new identifiers to the newly cloned nodes but preserves the
36-
identifiers of their respective source nodes. This applies to both
37-
referenceable and non-referenceable nodes.
38-
39-
In some implementations there may be cases where preservation of a
40-
non-referenceable identifier is not possible, due to how non-referenceable
41-
identifiers are constructed in that implementation. In such a case this method
42-
will throw a RepositoryException.
34+
This method does not assign new identifiers to the newly cloned nodes but
35+
preserves the identifiers of their respective source nodes. This applies to
36+
both referenceable and non-referenceable nodes.
4337
4438
If the <info>--remove-existing</info> option is set and an existing node in
4539
this workspace (the destination workspace) has the same identifier as a node

src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class NodeCopyCommand extends BasePhpcrCommand
2020
protected function configure()
2121
{
2222
$this->setName('node:copy');
23-
$this->setDescription('Copy a node');
23+
$this->setDescription('Copy a node (immediate)');
2424
$this->addArgument('srcPath', InputArgument::REQUIRED, 'Path to source node');
2525
$this->addArgument('destPath', InputArgument::REQUIRED, 'Path to destination node');
2626
$this->addArgument('srcWorkspace', InputArgument::OPTIONAL, 'If specified, copy from this workspace');
@@ -33,61 +33,6 @@ protected function configure()
3333
3434
This is a workspace-write operation and therefore dispatches changes
3535
immediately and does not require a save.
36-
37-
When a node N is copied to a path location where no node currently
38-
exists, a new node N' is created at that location.
39-
The subgraph rooted at and including N' (call it S') is created and is
40-
identical to the subgraph rooted at and including N (call it S) with the
41-
following exceptions:
42-
- Every node in S' is given a new and distinct identifier
43-
- or, if <info>srcWorkspace</info> is given -
44-
Every referenceable node in S' is given a new and distinct identifier
45-
while every non-referenceable node in S' may be given a new and
46-
distinct identifier.
47-
- The repository may automatically drop any mixin node type T present on
48-
any node M in S. Dropping a mixin node type in this context means that
49-
while M remains unchanged, its copy M' will lack the mixin T and any
50-
child nodes and properties defined by T that are present on M. For
51-
example, a node M that is mix:versionable may be copied such that the
52-
resulting node M' will be a copy of N except that M' will not be
53-
mix:versionable and will not have any of the properties defined by
54-
mix:versionable. In order for a mixin node type to be dropped it must
55-
be listed by name in the jcr:mixinTypes property of M. The resulting
56-
jcr:mixinTypes property of M' will reflect any change.
57-
- If a node M in S is referenceable and its mix:referenceable mixin is
58-
not dropped on copy, then the resulting jcr:uuid property of M' will
59-
reflect the new identifier assigned to M'.
60-
- Each REFERENCE or WEAKEREFERENCE property R in S is copied to its new
61-
location R' in S'. If R references a node M within S then the value of
62-
R' will be the identifier of M', the new copy of M, thus preserving the
63-
reference within the subgraph.
64-
65-
When a node N is copied to a location where a node N' already exists, the
66-
repository may either immediately throw an ItemExistsException or attempt
67-
to update the node N' by selectively replacing part of its subgraph with
68-
a copy of the relevant part of the subgraph of N. If the node types of N
69-
and N' are compatible, the implementation supports update-on-copy for
70-
these node types and no other errors occur, then the copy will succeed.
71-
Otherwise an ItemExistsException is thrown.
72-
73-
Which node types can be updated on copy and the details of any such
74-
updates are implementation-dependent. For example, some implementations
75-
may support update-on-copy for mix:versionable nodes. In such a case the
76-
versioning-related properties of the target node would remain unchanged
77-
(jcr:uuid, jcr:versionHistory, etc.) while the substantive content part
78-
of the subgraph would be replaced with that of the source node.
79-
80-
The <info>destAbsPath</info> provided must not have an index on its final element. If
81-
it does then a RepositoryException is thrown. Strictly speaking, the
82-
<info>destAbsPath</info> parameter is actually an absolute path to the parent node of
83-
the new location, appended with the new name desired for the copied node.
84-
It does not specify a position within the child node ordering. If ordering
85-
is supported by the node type of the parent node of the new location, then
86-
the new copy of the node is appended to the end of the child node list.
87-
88-
This method cannot be used to copy an individual property by itself. It
89-
copies an entire node and its subgraph (including, of course, any
90-
properties contained therein).
9136
HERE
9237
);
9338
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@ protected function configure()
3535
If ordering is supported by the node type of the parent node of the new
3636
node then the new node is appended to the end of the child node list.
3737
38-
If <info>primaryNodeTypeName</info> is specified, this type will be used (or a
39-
ConstraintViolationException thrown if this child type is not allowed).
38+
If <info>primaryNodeTypeName</info> is specified, this type will be used.
39+
4040
Otherwise the new node's primary node type will be determined by the
41-
child node definitions in the node types of its parent. This may occur
42-
either immediately, on dispatch (save, whether within or without
43-
transactions) or on persist (save without transactions, commit within
44-
a transaction), depending on the implementation.
41+
child node definitions in the node types of its parent.
4542
HERE
4643
);
4744
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinAddCommand.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ protected function configure()
3030
added mixin or due to its primary type, through inheritance) then this
3131
method has no effect. Otherwise <info>mixinName</info> is added to this node's
3232
jcr:mixinTypes property.
33-
34-
Semantically, the new node type may take effect immediately, on dispatch
35-
or on persist. The behavior is adopted must be the same as the behavior
36-
adopted for NodeInterface::setPrimaryType() and the behavior that
37-
occurs when a node is first created.
38-
39-
A ConstraintViolationException is thrown either immediately or on save
40-
if a conflict with another assigned mixin or the primary node type
41-
occurs or for an implementation-specific reason. Implementations may
42-
differ on when this validation is done.
43-
44-
In some implementations it may only be possible to add mixin types
45-
before a a node is persisted for the first time. In such cases any
46-
later calls to <info>addMixin</info> will throw a ConstraintViolationException
47-
either immediately, on dispatch or on persist.
4833
HERE
4934
);
5035
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,6 @@ protected function configure()
3030
3131
This is a session-write command and therefor requires a save to dispatch
3232
the change.
33-
34-
The identifiers of referenceable nodes must not be changed by a move.
35-
The identifiers of non-referenceable nodes may change.
36-
37-
A ConstraintViolationException is thrown either immediately, on dispatch
38-
or on persist, if performing this operation would violate a node type or
39-
implementation-specific constraint. Implementations may differ on when
40-
this validation is performed.
41-
42-
As well, a ConstraintViolationException will be thrown on persist if an
43-
attempt is made to separately save either the source or destination
44-
node.
45-
46-
Note that this behaviour differs from that of workspace::move
47-
, which is a workspace-write command and therefore immediately dispatches
48-
changes.
49-
50-
The <info>destPath</info> provided must not have an index on its final element. If
51-
ordering is supported by the node type of the parent node of the new
52-
location, then the newly moved node is appended to the end of the child
53-
node list.
54-
55-
This command cannot be used to move an individual property by itself. It
56-
moves an entire node and its subgraph.
5733
HERE
5834
);
5935
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeOrderBeforeCommand.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,15 @@ protected function configure()
2525
$this->addArgument('srcChildRelPath', InputArgument::REQUIRED, 'The relative path to the child node to be moved in the ordering');
2626
$this->addArgument('destChildRelPath', InputArgument::REQUIRED, 'The relative path to the child before which the node srcChildRelPath will be placed');
2727
$this->setHelp(<<<HERE
28-
If this node supports child node ordering, this method inserts the child
29-
node at <info>srcChildRelPath</info> into the child node list at the position
30-
immediately before <info>destChildRelPath</info>
28+
This command is used to change the order of a child node relative to the current node.
3129
32-
To place the node <info>srcChildRelPath</info> at the end of the list, a
33-
destChildRelPath of null is used.
30+
For example, given that the node <path>/foobar</path> has the children <node>child2</node> and
31+
<node>child4</node> then:
3432
35-
Note that (apart from the case where <info>destChildRelPath</info> is null) both of
36-
these arguments must be relative paths of depth one, in other words they
37-
are the names of the child nodes, possibly suffixed with an index.
33+
PHPCRSH> cd foobar
34+
PHPCRSH> node-order . child4 child2
3835
39-
If <info>srcChildRelPath</info> and <info>destChildRelPath</info> are the same, then no change is
40-
made.
41-
42-
This is session-write method, meaning that a change made by this method
43-
is dispatched on save.
36+
Will reorder "child4" before "child2".
4437
HERE
4538
);
4639
}

src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyRemoveCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function configure()
2424
$this->setDescription('Remove the property at the given absolute path');
2525
$this->addArgument('absPath', InputArgument::REQUIRED, 'Absolute path to property');
2626
$this->setHelp(<<<HERE
27-
Remove the property from the current session at the given absolute path
27+
Remove the property from the current session at the given path
2828
HERE
2929
);
3030
}

0 commit comments

Comments
 (0)