Magnolia 4.5 reached end of life on June 30, 2016. This branch is no longer supported, see End-of-life policy.
Each node in a JCR workspace has a type. The type defines the child nodes and properties that the node may or must have. Magnolia uses node types to define a custom content model whereas Jackrabbit enforces the constraints of that model at the repository level. See Apache Jackrabbit Node Types for more information. Magnolia does not use the Jackrabbit JcrConstants as they are not comprised of both prefixes and suffixes. This has query limitations, for example if a NodeType starts with MgnlNodeType.JCR_PREFIX
. Magnolia node types are registered by the
MgnlNodeType
Java class. Both prefixes and suffixes are defined.
Name | Syntax |
---|---|
nodeType |
|
mixin |
|
mgnl-properties |
|
jcr-properties |
|
Node type | Prefix/Syntax |
---|---|
base |
|
unstructured |
|
hierarchy node |
|
folder |
|
file |
|
resource |
|
metadata |
|
content |
|
content node |
|
page |
|
area |
|
component |
|
node data |
|
frozen node |
|
user |
|
role |
|
group |
|
system |
|
Node type | Prefix/Syntax |
---|---|
access control |
|
reference |
|
version |
|
lock |
|
deleted |
|
Node type | Prefix/Syntax |
---|---|
JCR primary type |
|
JCR frozen node |
|
JCR frozen primary type |
|
JCR data |
|
JCR content |
|
Magnolia supports the SQL and JCR-SQL2 query languages. Although deprecated, XPath remains available and will be supported for the foreseeable future.
Query tools are available at Tools > JCR Queries.
The Dump tool creates a repository dump:
The results are displayed in the Result box. A dump returns all nodes in the JCR that comply with the selected criteria. Here are a few sample results for the above dump.
/demo-project/about/jcr:uuid=f312fc16-8f66-451c-bdf0-a72913b74c2d /demo-project/about/jcr:primaryType=mgnl:page /demo-project/about/MetaData/mgnl:activatorid=superuser /demo-project/about/extras/jcr:ixinTypes=mix:lockable /demo-project/about/subsection-articles/hideInNav=false /demo-project/about/history/promos[mgnl:area]
The Query tool executes the results of a specific query:
The results are displayed in the Result box.
A few tips for writing and testing queries:
Here's a few sample queries in the SQL language. Apache.org has a handy translator tool that converts queries from SQL to XPath and vice versa. See the JCR Query cheat sheet on the wiki for more.
Workspace | Result | SQL query |
---|---|---|
website | All pages |
|
| Pages in the About section |
|
| Pages with "News" in the title |
|
| Pages with "News" in the title (case sensitive) |
|
| Pages that use a specific DMS image |
|
| Pages that link to a contact |
|
config | Component types |
|
users | User with email eric@example.com |
|
data | Data categories that have related categories |
|
dms | JPEG images in the DMS |
|