Click here to load reader

jcr-spec

  • View
    92

  • Download
    4

Embed Size (px)

Text of jcr-spec

Content Repository for Java Technology API 2.0

SpecificationJCR 2.0 Specification Java Specification Request (JSR) 283 10 August 2009

1

1 PREFACE1.1 1.2 1.3 1.4 1.5 1.6 Previous Versions Coverage Typographical Conventions System Requirements License Acknowledgements

66 6 7 7 7 10

2 INTRODUCTION 3 REPOSITORY MODEL3.1 Overview 3.2 Names 3.3 Identifiers 3.4 Paths 3.5 Namespace Mapping 3.6 Properties 3.7 Node Types 3.8 Referenceable Nodes 3.9 Shareable Nodes Model 3.10 Corresponding Nodes 3.11 System Node 3.12 Unfiled Content 3.13 Versioning Model

12 1313 16 20 20 27 29 38 59 61 64 66 67 67

4 CONNECTING4.1 4.2 4.3 4.4 4.5 Repository Object Login Impersonate Session Workspace

8383 84 85 85 86

5 READING5.1 Direct Access 5.2 Traversal Access 5.3 Query Access 5.4 Relationship among Access Modes 5.5 Effect of Access Denial on Read 5.6 Item Information 5.7 Node Identifier 5.8 Node Index 5.9 Iterators 5.10 Reading Properties 5.11 Namespace Mapping

8888 90 92 92 92 93 94 94 94 95 99

6 QUERY6.1 Optional Joins 6.2 Introduction to the Abstract Query Model 6.3 Equality and Comparison 6.4 Query Validity 6.5 Search Scope 6.6 Notations 6.7 Abstract Query Model and Language Bindings 6.8 QueryManager 6.9 Query Object 6.10 Literal Values 6.11 QueryResult 6.12 Query Scope

100100 101 102 102 103 103 105 135 135 138 138 140

2

7 EXPORT7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.1 8.2 8.3 8.4 8.5 8.6 Exporting a Subgraph System View Document View Escaping of Names Escaping of Values Export API Export Scope Encoding NodeTypeManager Object NodeType Object ItemDefinition Object PropertyDefinition Object NodeDefinition Object Node Type Information for Existing Nodes

142142 142 144 146 147 148 149 149

8 NODE TYPE DISCOVERY

150150 150 152 153 154 155

9 PERMISSIONS AND CAPABILITIES9.1 Permissions 9.2 Capabilities

157157 158

10 WRITING10.1 Types of Write Methods 10.2 Core Write Methods 10.3 Session and Workspace Objects 10.4 Adding Nodes and Setting Properties 10.5 Selecting the Applicable Item Definition 10.6 Moving Nodes 10.7 Copying Nodes 10.8 Cloning and Updating Nodes 10.9 Removing Nodes and Properties 10.10 Node Type Assignment 10.11 Saving 10.12 Namespace Registration

159159 161 161 163 166 166 167 168 169 170 172 175

11 IMPORT11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 Importing Document View Import System View Respecting Property Semantics Determining Node Types Determining Property Types Event-Based Import Methods Stream-Based Import Methods Identifier Handling Importing jcr:root Event Model Scope of Event Reporting The Event Object Event Bundling Asynchronous Observation Journaled Observation Importing Content Exceptions

177177 178 179 179 179 180 181 181 182

12 OBSERVATION

184184 184 185 187 187 190 191 191

13 WORKSPACE MANAGEMENT13.1 Creation and Deletion of Workspaces

192192

3

14 SHAREABLE NODES14.1 Creation of Shared Nodes 14.2 Shared Set 14.3 Removing Shared Nodes 14.4 Transient Layer 14.5 Copy 14.6 Share Cycles 14.7 Export 14.8 Import 14.9 Observation 14.10 Locking 14.11 Node Type Constraints 14.12 Versioning 14.13 Restore 14.14 IsSame 14.15 RemoveMixin 14.16 Query

193193 193 194 194 194 195 195 195 195 195 195 196 196 196 196 197

15 VERSIONING15.1 Creating a Versionable Node 15.2 Check-In: Creating a Version 15.3 Check-Out 15.4 Version Labels 15.5 Searching Version Histories 15.6 Retrieving Version Storage Nodes 15.7 Restoring a Version 15.8 Removing a Version 15.9 Merge 15.10 Serialization of Version Storage 15.11 Versioning within a Transaction 15.12 Activities 15.13 Configurations and Baselines

198198 202 205 206 208 208 208 212 212 217 217 217 221

16 ACCESS CONTROL MANAGEMENT16.1 16.2 16.3 16.4 16.5 16.6 Access Control Manager Privilege Discovery Access Control Policies Named Access Control Policies Access Control Lists Privileges Permissions and Capabilities

225225 225 229 232 233 234

17 LOCKING17.1 Lockable 17.2 Shallow and Deep Locks 17.3 Lock Owner 17.4 Placing and Removing a Lock 17.5 Lock Token 17.6 Session-Scoped and Open-Scoped Locks 17.7 Effect of a Lock 17.8 Timing Out 17.9 Locks and Persistence 17.10 Locks and Transactions 17.11 LockManager Object 17.12 Lock Object 17.13 LockException

236236 236 236 237 238 238 238 239 239 239 240 243 244

18 LIFECYCLE MANAGEMENT18.1 mix:lifecycle 18.2 Node Methods

245245 245

4

19 NODE TYPE MANAGEMENT19.1 19.2 19.3 19.4 NodeTypeDefinition NodeTypeManager Node Type Registration Restrictions Templates

246246 246 248 248

20 RETENTION AND HOLD20.1 Retention Manager 20.2 Placing a Hold 20.3 Effect of a Hold 20.4 Getting the Holds present on a Node 20.5 Removing a Hold 20.6 Hold Object 20.7 Setting a Retention Policy 20.8 Getting a Retention Policy 20.9 Effect of a Retention Policy 20.10 RetentionPolicy object 20.11 Removing a Retention Policy

250250 250 251 251 251 251 251 251 251 252 252

21 TRANSACTIONS21.1 21.2 21.3 21.4 22.1 22.2 22.3 22.4 22.5 23.1 23.2 23.3 23.4 23.5 23.6 24.1 24.2 24.3 24.4 Container Managed Transactions: Sample Request Flow User Managed Transactions: Sample Code Save vs. Commit Single Session Across Multiple Transactions Scope of Same-Name Siblings Addressing Same-Name Siblings by Path Reading and Writing Same-Name Siblings Properties Cannot Have Same-Name Siblings Effect of Access Denial on Read of Same-Name Siblings Scope of Orderable Child Nodes Ordering Child Nodes Adding a New Child Node Orderable Same-Name Siblings Non-orderable Child Nodes Properties are Never Orderable Definition of Support Repository Descriptors Node Type-Related Features Implementation Issues

253254 254 255 255

22 SAME-NAME SIBLINGS

257257 257 258 259 259

23 ORDERABLE CHILD NODES

260260 260 261 261 261 261

24 REPOSITORY COMPLIANCE

262262 262 268 269

25 APPENDIX25.1 Treatment of Identifiers 25.2 Compact Node Type Definition Notation

270270 271

5

1 PrefaceThe Content Repository API for Java Technology Specification, Version 2.0 (JCR 2.0 Specification) consists of a normative part and a non-normative part. The normative part consists of: This document, excluding the appendix. The source code of javax.jcr and its subpackages. The Javadoc reference.

In case of a conflict this document takes precedence over the source code and the source code takes precedence over the Javadoc. The non-normative part consists of: The appendix of this document. The jar file of javax.jcr and its subpackages.

The JCR 2.0 Specification was created and released through the Java Community Process (JCP) under Java Specification Request 283 (JSR 283).

1.1 Previous VersionsThe Content Repository for Java Technology API Specification, Version 1.0 (JCR 1.0 Specification) was created and released through the Java Community Process (JCP) under Java Specification Request 170 (JSR 170).

1.2 CoverageThis document describes the abstract repository model and Java API of JCR. The API is described from a high-level, functional perspective. Consult the accompanying Javadoc for full information on signature variants and exceptions.

1.2.1 Classes and InterfacesUnless otherwise indicated, all Java classes and interfaces mentioned are in the package javax.jcr and its subpackages. Non-JCR classes mentioned are always fully qualified. The only exception is java.lang.String, which is used throughout and written simply as String.

1.2.2 Null ParametersWhen describing JCR API methods, this specification and the Javadoc assume that all parameters passed are non-null, unless otherwise stated. If null is passed as parameter and its behavior is not explicitly described in this specification or in the Javadoc, then the behavior of the method in that case is implementation-specific.

6

1.3 Typographical ConventionsA monospaced font is used for JCR names and paths, and all instances of machine-readable text (Java code, XML, grammars, JCR-SQL2 examples, URIs, etc.).

1.3.1 String Literals in Syntactic GrammarsFormal grammars are used at various places in the specification to define the syntax of string-based entities such as names, paths, search languages and other notations. When a string literal appears as a terminal symbol within a grammar, each character literal in that string corresponds to exactly one Unicode code point. The intended code point of such a character literal must be determined only by reference to the Unicode Basic Latin code chart1 and no other part of the Unicode character set. Any code point outside the Basic Latin set cannot be the intended code point of such a character literal, even if the grapheme of the code point superficially resembles that of the character literal. For example, in the following production (excerpted from 3.2.2 Local Names). InvalidChar ::= '/' | ':' | '[' | ']' | '|' | '*' The code points indicated by the character literals are, respectively, U+002F (/), U+003A (:), U+005B ([), U+005D (]), U+007C (|) and U+002A (*).

1.4 System RequirementsThe JCR 2.0 requires Java Runtime Environment (JRE) 1.4 or greater.

1.5 LicenseDay Management AG (Licensor) is willing to license this specification to you ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT (Agreement). Please read the terms and conditions of this Agreement carefully. Content Repository for Java Technology API 2.0 Specification (Specification) Status: FCS Release: 10 August 2009 Copyright 2009 Day Management AG Barfuesserplatz 6, 4001 Basel, Switzerland. All rights reserved.

1

See http://unicode.org/charts/PDF/U0000.pdf. 7

NOTIC

Search related