Anchor | ||||
---|---|---|---|---|
|
Info |
---|
Beginning in version R28, XperienCentral no longer uses the Apache Jackrabbit JCR indexing solution by default. This topic is only relevant to users of XperienCentral versions R27 and lower or if you configure XperienCentral to use Apache Jackrabbit. See The XperienCentral JCR Index for more information. |
The JCR browser is a tool to explore a for exploring the Java Content Repository (JCR) . The tool used by XperienCentral to store website data. It allows you to browse through the repository by expanding or /collapsing sub trees . With JCR tree items, you in the same way as with File Explorer in Microsoft Windows. You can perform the following operations on JCR tree items:
- With nodes Nodes - you can create, move and delete.
- With properties Properties - you can create, edit and delete.
Due to node type definitions, the JCR browser cannot perform any operation all operations on any every node. If you try to create an improper child node or property, the JCR browser will give a constraint return an error. In addition, the JCR browser enables you to create and perform queriesAdditonally, you can perform queries on the JCR tree. With queries you can search for specific content and read it. The JCR browser supports the XPath and SQL syntaxes.
Info |
---|
See also Xpath JCR Sample Queries. |
Warning |
---|
Some of the actions you can perform in the JCR Browser, such as deleting nodes and/or their attributes or properties could have an adverse affect on your website. Be especially careful when performing such actions. |
In This Topic
Table of Contents | ||
---|---|---|
|
...
Introduction to JCR
Expand | ||
---|---|---|
| ||
A Java Content Repository (JCR) is a database with a standardized Java Application Programming Interface (API). A JCR allows different applications to access one centralized database. Other technologies that are comparable to JCR are : JDBC, Hibernate and WebDAV. Contrary to Unlike relational databases, a JCR has a hierarchical tree structure. The tree consists of nodes and properties. The properties are the leaves of the tree and represent the actual pieces of database content. A property is of one of the following types: string, binary, date, a number type, boolean, name, path or reference. In addition, a node has contains attributes that are related to the node itself. Examples are: , for example the name of the node, its path in the tree, its depth in the tree and its type. SoTherefore, a node has attributes and a node it contains properties. Notice that the The organization of the repository into a tree structure of the repository is seen from the interface point of view. is done by the JCR Browser: Internally the content may be stored in a relational database. However, for the outside world it acts as a tree-structured database. Node TypesEvery node has one primary node type. The primary node type defines the properties and child nodes that a node it is allowed or required to have. Every node has a special property called Multi-value PropertiesIn some cases, a property may have more than one value. A property that may have more than one value is referred to as a multi-value property. The property definition determines whether a particular property is a multi-value property. Standardized by JCPJCR has been standardized by the Java Community Process (JCP) in JSR 170 (API version 1.0) and JSR 283 (API version 2.0). Depending on the API version and compliance level, a JCR may support the following:
|
...
...
Using the XperienCentral JCR Browser
To start and use the JCR browser, do the following:
...
Browser, follow these steps:
- Navigate to Configuration > JCR Browser.
- Select the [JCR Browser] tab and then the [JCR Tree] sub tab.
- Browse through the tree by expanding or collapsing node sub trees in the "JCR Repository" section.. To expand a node, click ‘ + ’ (plus) and to collapse it click ‘–’ – (minus).
- To select a node, click on its icon or name. The attributes of the selected node and the properties it contains, are shown at the right.
Display Tree Property
Basically, in In the tree view for each node the ‘Name’ attribute of the , the name of each node is listedshown. However, in certain cases the actual node name may be irrelevant and is not what you like to see. For is different from what is shown in the tree view. In these cases, you can view a property need to look at the attributes to see the actual name of the node instead of its name. The property name is given by the ‘Display tree property’ shown in the "Display tree property" field. By default it is set to wm:name
. This means that for each node the tree viewer tries to find a wm:name
property. If the a property is present, the value of this property will be shown. If not, the actual node name will be shown.
For example: when you execute the XPath query ‘//element(*, wo:global)
’, the result may be a node that is labeled as follows:
- If the ‘Display "Display tree property’ property" field is empty, you may get ‘751b14124e9caf40ed6c7822d6de’see something similar to
751b14124e9caf40ed6c7822d6de
. If you expand the tree, you may get a see something likewo:edit
for the child node ‘wo:edit’. - If the ‘Display "Display tree property’ property" field is set to
wm:name
, you may get ‘global’see something likeglobal
. If you expand the tree, you may get a see something likeedit
for the child node ‘edit’.
Sort by Name
Check ‘Sort by name’ Select "Sort by name" to view the nodes in the tree in alphabetical order.
Node Attributes
When you select a node, the following attributes are shown in the "Node Attributes" section:
Attribute | Description |
---|---|
Name | The name of the node. |
Value (primary item) | This attribute is not used in XperienCentral. It is "undefined" for all nodes. |
Path | The path the node belongs to. This is relative to the depth 1 parent mode of the current node. The root node is not shown in the path. |
UUID | The hexadecimal identifier of the node, 1b8c88d37f0000020084433d3af4941f , for example. |
Depth | The depth of the node relative to the root node. The first depth is 1. The depth of the root node is 0 and is the only node with this value. |
Primary node type | The node's type. See http://jackrabbit.apache.org/jcr/node-types.html for an explanation of the possible node types. |
Node Properties
When you select a node, the following attributes are shown in the "Node Properties" section:
Property | Description |
---|---|
Name | The name of the node. |
Type | This attribute is not used in XperienCentral. It is "undefined" for all nodes. |
Value | The path the node belongs to. This is relative to the depth 1 parent mode of the current node. The root node is not shown in the path. |
DeleteUUID | The hexadecimal identifier of the node, 1b8c88d37f0000020084433d3af4941f , for example. |
Depth | The depth of the node relative to the root node. The first depth is 1. The depth of the root node is 0 and is the only node with this value. |
Primary node type | The node's type. See http://jackrabbit.apache.org/jcr/node-types.html for an explanation of the possible node types. |
Following a Tree Reference
If a property is a reference in the JCR tree, its value is shown as a link. Click on the link to navigate to the referenced node in the JCR tree. For example:
...
Operations with Nodes
Creating a Node
To create a new node, follow these steps:
- Select the node in for which the new (sub) node is to will be created.
- Press the [Add node] button. The ‘Create node’ dialog is added to the screen.
From the pull-down menu, select the node type to be created"Create node" section appears: - Select the node type to create from the "Node type" drop-down list.
- Enter the node name.
- Press the Click [Create node] button. The node is added as a child to the currently selected node in the JCR tree.
Moving a Node
To move a node, follow these steps:
- Select the node to be moved.
- Press the Click [Cut] buttonin the "Actions" section.
- Select the destination node.
- Press theClick [Paste] buttonin the "Actions" section. The node, including its properties and subtrees is , are moved to the destination.
Deleting a Node
To delete a node, follow these steps:
- Select the node to be deleted.
- In the ‘Actions’ dialog, press theClick [Delete] buttonin the "Actions" section. You are prompted to confirm the action.
- Press Click [OK]. The node, including its properties and subtrees is , are deleted.
...
Operations with Node Properties
Creating a Property
To create a new property for a node, follow these steps:
- Select the node in for which the property is to be created.
- Press the [Add property] button. The ‘Add property’ dialog is added to the screen"Add property" section appears.
- From the pull-down menu, select the definition of the property to be created.
- Enter the name of the property.
- From the pull-down menu, select the type of the property to be created.
- To define a multi-value property, check ‘Multiple’ (see also: Multi-value properties)select "Multiple". The [Add value] button will be addedappears.
- Enter the (first) value of the property.
- Press the [Add] button. The property is added.
- In the case of a For multi-value property: to add an other value (instance)properties, enter the other next value and press then click [Add value]. The other value is added.
Editing a Property
...
To edit a node property, follow these steps:
- Click [Edit] next to the property you want to edit. The "Edit property" section appears.
- Make the desired changes.
- Press [Set]. The property is changed.
By pressing clicking [Add value] instead of [Set] you create a new instance of the property.
Deleting a Property
...
To delete a node property, follow these steps:
- Select the "Delete" checkbox next to the property to be deleted.
- Press theClick [Delete]button. You are prompted to confirm.
- Press Click [OK]. The property is deleted.
...
...
Executing JCR Queries
By way of example, the JCR browser is provided with a list of preprogrammed pre-programmed XPath and SQL queries. To this list, you can add your own queries. Your queries are saved and you can edit them afterwardsat a later time. To execute a query, you just select one from the list, make some adaptations if you like modify it and then execute it.
Creating or Editing a Query
- Select the JCR Queries tab.
- From the Queries pull-down menu, select ‘New query’, or an existing query. Notice that you cannot edit preprogrammed queries.
- Enter or change the name of the query.
- Select the query syntax type ‘Xpath’ or ‘SQL’"Xpath" or "SQL".
- Enter or change the actual query. See also: Query examples: SQL versus XPath)Press
- Click [Apply] to save the query on the list.
Query Examples: SQL Versus XPath
SQL | XPath |
---|---|
SELECT * FROM nt:base | //* |
SELECT * FROM my:type | //element(*, my:type) |
SELECT my:title FROM my:type | //element(*, my:type)/@my:title |
SELECT my:title, my:text FROM my:type | //element(*, my:type)/ (@my:title | @my:text) |
SELECT * FROM my:type WHERE jcr:path LIKE '/nodes[%]/%' | /jcr:root/nodes// element(*, my:type) |
SELECT * FROM my:type WHERE my:title='JSR 170' | //element(*, my:type) [@my:title = 'JSR 170'] |
SELECT * FROM my:type WHERE my:title <> 'JSR 170' | //element(*, my:type) [@my:title != 'JSR 170'] |
SELECT * FROM my:type WHERE my:title = 'JSR 170' AND my:author = 'David' | //element(*, my:type) [@my:title = 'JSR 170' and @my:author = 'David'] |
SELECT * FROM my:type WHERE NOT (my:title = 'JSR 170') | //element(*, my:type) [not(@my:title = 'JSR 170')] |
SELECT * FROM my:type WHERE my:title IS NOT NULL | //element(*, my:type) [@my:title] |
SELECT * FROM my:type WHERE my:title IS NULL | //element(*, my:type) [not(@my:title)] |
SELECT * FROM my:type WHERE my:title LIKE 'JSR 170%' | //element(*, my:type) [jcr:like(@my:title, 'JSR 170%')] |
SELECT * FROM my:type WHERE CONTAINS(*, 'JSR 170') | //element(*, my:type) [jcr:contains(., 'JSR 170')] |
SELECT * FROM my:type WHERE jcr:path LIKE'/some[%]/nodes[%]' | /jcr:root/some/ element(nodes, my:type) |
SELECT * FROM my:type WHERE jcr:path = '/some/nodes' | /jcr:root/some[1]/element(nodes, my:type)[1] |
SELECT * FROM my:type WHERE jcr:path LIKE '/some[%]/nodes[%]/%' AND NOT jcr:path LIKE '/some[%]/nodes[%]/%/%' | /jcr:root/some/nodes/ element(*, my:type) |
SELECT * FROM my:type WHERE jcr:path LIKE '/some/nodes/%' AND NOT jcr:path LIKE '/some/nodes/%/%' | /jcr:root/some[1]/nodes[1]/ element(*, my:type) |
SELECT * FROM my:type WHERE jcr:path LIKE '/some[%]/nodes[%]/%' | /jcr:root/some/nodes// element(*, my:type) |
SELECT * FROM my:type WHERE jcr:path LIKE '/some/nodes/%' | /jcr:root/some[1]/nodes[1]// element(*, my:type) |
SELECT * FROM my:type WHERE jcr:path LIKE '/some[%]/nodes[%]' OR jcr:path LIKE '/some[%]/nodes[%]/%' | /jcr:root/some/nodes// element(*, my:type) |
SELECT * FROM my:type WHERE jcr:path = '/some/nodes' OR jcr:path LIKE '/some/nodes/%' | /jcr:root/some[1]/nodes[1]// element(*, my:type) |
Deleting a Query from the List
- Select the JCR Queries tab.
- From the Queries pull-down menu, select the query you want to delete. Notice that you cannot delete preprogrammed pre-programmed queries.
- Press Click [Delete query]. The query is removed from the list.
...
- Select the JCR Browser tab.
- Press the Click [More] button. The ‘Query execution’ dialog is added to the screen"Query execution" section appears.
- From the pull-down menu, select the Select the query, for instance ‘MyNodeTypes XPath’.If desired, adapt "MyNodeTypes XPath", from the drop-down list.
- Modify the query to your needs.
- Press the Click [Execute query] button. The results appear on the Query results tab.