-
Notifications
You must be signed in to change notification settings - Fork 19
UI Improvements
dantleech edited this page Jan 9, 2014
·
1 revision
This document aims to suggest a plan for refactoring the output formatting of the various PHPCR Commands.
I propose that we add a "format" option to all outputish commands, with values such as full
, short
,
tabular
, tree
, etc.
(or SELECT statements in phpcr-shell
)
SELECT * FROM "nt:unstructured" AS a LEFT OUTER JOIN "nt:unstructured" AS n ON a.username = b.username WHERE a.username="lsmith";
+----+-------+----------+-------------+
| # | Score | a | b |
+----+-------+----------+-------------+
| 0 | 7 | /lsmith | /lsmith |
| 1 | 3 | /lsmith | /dantleech |
+----+-------+----------+-------------+
2 rows in set (0.02 sec)
(this is the current output for phpcr-shell
:
| Row: #0 Score: 7
| Sel: a Path: /lsmith UID: none
+-----------------+--------+----------+-----------------------------------+
| Name | Type | Multiple | Value |
+-----------------+--------+----------+-----------------------------------+
| numbers | Long | yes | [0] 3 |
| | | | [1] 1 |
| | | | [2] 2 |
| phpcr:class | String | no | Doctrine\Tests\Models\CMS\CmsUser |
| username | String | no | lsmith |
| jcr:primaryType | Name | no | nt:unstructured |
+-----------------+--------+----------+-----------------------------------+
| Sel: b Path: /lsmith UID: none
+-----------------+--------+----------+-----------------------------------+
| Name | Type | Multiple | Value |
+-----------------+--------+----------+-----------------------------------+
| numbers | Long | yes | [0] 3 |
| | | | [1] 1 |
| | | | [2] 2 |
| phpcr:class | String | no | Doctrine\Tests\Models\CMS\CmsUser |
| username | String | no | lsmith |
| jcr:primaryType | Name | no | nt:unstructured |
+-----------------+--------+----------+-----------------------------------+
1 rows in set (0.02 sec)
$ php phpcr phpcr:node-type:list
+-----------------+----------------+---------------------+
| Node Type | Supertypes | Subtypes |
+-----------------+----------------+---------------------+
| nt:unstructured | [0] nt:base | [0] nt:my-node-type |
| | | [1] node-type-x |
| nt:unstructured | [0] nt:base | [0] nt:my-node-type |
+-----------------+----------------+---------------------+
Output to include node definitions
+-----------------+-----------------+--------------------------+
| Path | Type | UUID |
+-----------------+-----------------+--------------------------+
| [root] | nt:base | 1234-1234-1234-1234-1234 |
| cms | nt:unstructured | 1234-1234-1234-1234-1234 |
| | foobar | nt:unstructured | 1234-1234-1234-1234-1234 |
| | barfoo | nt:unstructured | 1234-1234-1234-1234-1234 |
| smc | nt:unstructured | none |
| some | nt:unstructured | 1234-1234-1234-1234-1234 |
| | here | nt:unstructured | 1234-1234-1234-1234-1234 |
| | there | nt:unstructured | 1234-1234-1234-1234-1234 |
| thing | nt:unstructured | none |
+-----------------+-----------------+--------------------------+
As existing, but maybe we can improve the value formatting:
/
foobar:
- jcr:primaryType = nt:unstructured
barfoo:
- phpcr = foo
- jcr:primaryType = nt:unstructured
lsmith:
- numbers = Array( [0] => 3 [1] => 1 [2] => 2)
- phpcr:class = Doctrine\Tests\Models\CMS\CmsUser
- username = lsmith
- jcr:primaryType = nt:unstructured
Reuse the same display logic as "SELECT|workspace:query"
$ php phpcr:node:show /foobar
+-----------------+--------+----------+-----------------------------------+
| Name | Type | Multiple | Value |
+-----------------+--------+----------+-----------------------------------+
| numbers | Long | yes | [0] 3 |
| | | | [1] 1 |
| | | | [2] 2 |
| phpcr:class | String | no | Doctrine\Tests\Models\CMS\CmsUser |
| username | String | no | lsmith |
| jcr:primaryType | Name | no | nt:unstructured |
+-----------------+--------+----------+-----------------------------------+