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.ItemsAn 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 NodesIn 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
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.PathsThelocation 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
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