Skip to content

Commit 798aece

Browse files
committed
Merge pull request #132 from phpcr/show_prop_size
Show prop size and primary node type + super-type
2 parents c4808e3 + 42e6e11 commit 798aece

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

CHANGELOG.md

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

2020
### Enhancements
2121

22+
- [node:list] Show primary node type and super-types
23+
- [node:list] Show property length
2224
- [autocomplete] Autocomplete now includes command names
2325
- [references] Show UUIDs when listing reference properties
2426
- [import/export] Renamed session import and export to `session:import` &

features/all/phpcr_node_list.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,23 @@ Feature: List properites and chidren of current nodeA
9292
Then the command should not fail
9393
And I should see the following:
9494
"""
95-
/tests_general_base/index.txt
95+
/tests_general_base/index.txt [nt:file] > nt:hierarchyNode
9696
+-------------+-----------------+--+
9797
| jcr:content | nt:unstructured | |
9898
+-------------+-----------------+--+
99-
/tests_general_base/idExample
99+
/tests_general_base/idExample [nt:file] > nt:hierarchyNode
100100
+--------------+-----------------+--+
101101
| jcr:content/ | nt:unstructured | |
102102
+--------------+-----------------+--+
103-
/tests_general_base/numberPropertyNode
103+
/tests_general_base/numberPropertyNode [nt:file] > nt:hierarchyNode
104104
+-------------+-----------------+--+
105105
| jcr:content | nt:unstructured | |
106106
+-------------+-----------------+--+
107-
/tests_general_base/NumberPropertyNodeToCompare1
107+
/tests_general_base/NumberPropertyNodeToCompare1 [nt:file] > nt:hierarchyNode
108108
+-------------+-----------------+--+
109109
| jcr:content | nt:unstructured | |
110110
+-------------+-----------------+--+
111-
/tests_general_base/NumberPropertyNodeToCompare2
111+
/tests_general_base/NumberPropertyNodeToCompare2 [nt:file] > nt:hierarchyNode
112112
+-------------+-----------------+--+
113113
| jcr:content | nt:unstructured | |
114114
+-------------+-----------------+--+

features/all/phpcr_version_restore.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ Feature: Restore a version
2121
And I execute the "ls" command
2222
Then I should see the following:
2323
"""
24-
| foo | STRING | inital
24+
| foo | STRING (9) | initalbar
2525
"""

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ public function execute(InputInterface $input, OutputInterface $output)
100100
$this->renderNode($node, $table, array(), $filter);
101101

102102
if ($table->getNumberOfRows() > 0) {
103-
$output->writeln('<path>' . $node->getPath() . '</path>');
103+
$output->writeln(sprintf('<path>%s</path> [%s] > %s',
104+
$node->getPath(),
105+
$node->getPrimaryNodeType()->getName(),
106+
implode(', ', $node->getPrimaryNodeType()->getDeclaredSupertypeNames())
107+
));
104108
$table->render($output);
105109
}
106110
}
@@ -224,7 +228,11 @@ private function renderProperties($currentNode, $table, $spacers, $filter = null
224228

225229
$table->addRow(array(
226230
'<property>' . implode('', $spacers). $name . '</property>',
227-
'<property-type>' . $this->formatter->getPropertyTypeName($property->getType()) . '</property-type>',
231+
sprintf(
232+
'<property-type>%s (%s)</property-type>',
233+
$this->formatter->getPropertyTypeName($property->getType()),
234+
implode(',', (array) $property->getLength())
235+
),
228236
$valueCell,
229237
));
230238
}

0 commit comments

Comments
 (0)