jcr Overview

1.persistent Workspace

A JCR repositoryis composed of one or more persistent workspaces,each consisting of a directed acyclic graph of items where the edges represent the parent-child relation.

2.Items

An item is either a node or a property. Anode can have zero or more child items. A property cannot have child items butcan hold zero or more values.

The nodes of a workspace form the structureof the stored data while the actual content is stored in the values of theproperties.

Each workspace contains at least one item,the root node. The root node is theonly item in the workspace without a parent node; all other items have at leastone parent.

3.shared  Nodes

In thesimplest case, a workspace is a treeof items. However, strictly speaking, the more general term graph should be used to cover thosecases where a repository supports the optional shareable nodes feature, which allows an item to have more than oneparent

4.Names
Thename of the root node of a workspace is always ““ (the empty string). Everyother item in a workspace has a name, which must be a  JCR name

5.Same-Names-siblings

Inthe simplest case, every child item of a given parent has a unique name.However, child nodes with identical names can only occur if a repository supportssame-name siblings。Additionally,some repositories may support a node and sibling property having the same name 

However, two sibling properties can neverhave the same name.

To distinguish sibling nodes with the samename an integer index, starting at 1,  isused. A node with no same-name siblings has an implicit index of 1 and a nodename without an index is understood to have an index of 1.

5.Paths

Thelocation of an item in the workspace graph can be described by the path fromthe root node to that item. The path consists of the name (and index in casesof same-name siblings) of each interceding node in order from root to targetitem, much like a file system path. Relative paths can also be used to describethe location of one item with respect to another

6.Identifiers

Inaddition to a path, every node also has an identifier. In some implementations,the identifier may be independent of the path and provide an identity to thenode that is stable across moves within the workspace. In simpler repositoriesthe identifier may be implemented as a reflection of the path and therefore notprovide any additional semantics

7.Property Types

Propertiescan be either single or multi-valued. Each value has one of the 12 possibletypes,These types include familiar data storage typessuch as strings, numbers, booleans, binaries and dates, as well as types thathold pointers to other nodes in the workspace.


8 Repository Diagram


Theabove diagram depicts a repository Rwith workspaces W 0, W1 andW 2. The item graph of W 1 contains a root node with child nodes A, Band C. Ahas a property D of type STRING and a child node E,which in turn has a property I oftype BINARY. Bhas the properties F (aLONG) and G (aBOOLEAN). Chas a property H of type DOUBLE

9 Node Types

Everynode has a type. A node’s type The names, types and other attributes of itschild items. Node types can be used to define complex storage objectsconsisting of multiple subnodes and properties, possibly many layers deep

10 sessions 

A userconnects to a repository by passing a set of credentials and the name of theworkspace that the user wishes to access. The repository returns a session which binds the user to therequested persistent workspace with a level of authorization determined by thatuser's credentials. A session is always bound to exactly one persistent workspace,though a single persistent workspace may be bound to multiple sessions.


11 current  session and Workspace

Through a session, the user can access,read and write the nodes and properties of the bound workspace, to the extentallowed by that user's authorization and the capabilities of the repository.Any object acquired, directly, or indirectly through a chain of intercedingobjects, from a particular session, is said to be within the scope of thatsession and any method called on such object is also within the scope of thesame session.

In the context of discussing a particular objector method call, the session within whose scope that object or method call lies isreferred to as the current session,and the workspace to which that session is bound is referred to as the current workspace
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值