From 9773838467f8b377479be0a016d0e469346cd4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ebn=C3=B6ther?= Date: Tue, 16 Mar 2010 10:13:15 +0100 Subject: [PATCH] Added PHPCR from FLOW3 --- lib/PHPCR/AccessDeniedException.php | 35 + lib/PHPCR/BinaryInterface.php | 87 ++ lib/PHPCR/ContentHandlerInterface.php | 35 + lib/PHPCR/CredentialsInterface.php | 37 + lib/PHPCR/GuestCredentials.php | 37 + lib/PHPCR/ImportUUIDBehaviourInterface.php | 63 ++ lib/PHPCR/InvalidItemStateException.php | 39 + .../InvalidLifecycleTransitionException.php | 35 + lib/PHPCR/InvalidSerializedDataException.php | 36 + lib/PHPCR/ItemExistsException.php | 36 + lib/PHPCR/ItemInterface.php | 241 ++++++ lib/PHPCR/ItemNotFoundException.php | 36 + lib/PHPCR/ItemVisitorInterface.php | 57 ++ lib/PHPCR/Lock/LockException.php | 73 ++ lib/PHPCR/Lock/LockInterface.php | 141 +++ lib/PHPCR/Lock/LockManagerInterface.php | 192 +++++ lib/PHPCR/LoginException.php | 36 + lib/PHPCR/MergeException.php | 35 + lib/PHPCR/NamespaceException.php | 36 + lib/PHPCR/NamespaceRegistryInterface.php | 196 +++++ lib/PHPCR/NoSuchWorkspaceException.php | 36 + lib/PHPCR/NodeInterface.php | 745 ++++++++++++++++ lib/PHPCR/NodeIteratorInterface.php | 46 + .../NodeType/ConstraintViolationException.php | 37 + .../InvalidNodeTypeDefinitionException.php | 36 + .../NodeType/ItemDefinitionInterface.php | 153 ++++ .../NodeType/NoSuchNodeTypeException.php | 35 + .../NodeType/NodeDefinitionInterface.php | 117 +++ .../NodeDefinitionTemplateInterface.php | 114 +++ .../NodeType/NodeTypeDefinitionInterface.php | 163 ++++ .../NodeType/NodeTypeExistsException.php | 36 + lib/PHPCR/NodeType/NodeTypeInterface.php | 456 ++++++++++ .../NodeType/NodeTypeIteratorInterface.php | 45 + .../NodeType/NodeTypeManagerInterface.php | 184 ++++ .../NodeType/NodeTypeTemplateInterface.php | 130 +++ .../NodeType/PropertyDefinitionInterface.php | 293 +++++++ .../PropertyDefinitionTemplateInterface.php | 152 ++++ lib/PHPCR/Observation/EventInterface.php | 189 +++++ .../Observation/EventIteratorInterface.php | 46 + .../Observation/EventJournalInterface.php | 48 ++ .../Observation/EventListenerInterface.php | 49 ++ .../EventListenerIteratorInterface.php | 46 + .../ObservationManagerInterface.php | 150 ++++ lib/PHPCR/PathNotFoundException.php | 36 + lib/PHPCR/PropertyInterface.php | 704 +++++++++++++++ lib/PHPCR/PropertyIteratorInterface.php | 46 + lib/PHPCR/PropertyType.php | 349 ++++++++ lib/PHPCR/Query/InvalidQueryException.php | 35 + lib/PHPCR/Query/QOM/AndInterface.php | 55 ++ .../Query/QOM/BindVariableValueInterface.php | 44 + lib/PHPCR/Query/QOM/ChildNodeInterface.php | 57 ++ .../QOM/ChildNodeJoinConditionInterface.php | 56 ++ lib/PHPCR/Query/QOM/ColumnInterface.php | 68 ++ lib/PHPCR/Query/QOM/ComparisonInterface.php | 101 +++ lib/PHPCR/Query/QOM/ConstraintInterface.php | 37 + .../Query/QOM/DescendantNodeInterface.php | 59 ++ .../DescendantNodeJoinConditionInterface.php | 58 ++ .../Query/QOM/DynamicOperandInterface.php | 34 + .../Query/QOM/EquiJoinConditionInterface.php | 74 ++ .../Query/QOM/FullTextSearchInterface.php | 99 +++ .../QOM/FullTextSearchScoreInterface.php | 51 ++ .../Query/QOM/JoinConditionInterface.php | 35 + lib/PHPCR/Query/QOM/JoinInterface.php | 67 ++ lib/PHPCR/Query/QOM/LengthInterface.php | 49 ++ lib/PHPCR/Query/QOM/LiteralInterface.php | 44 + lib/PHPCR/Query/QOM/LowerCaseInterface.php | 50 ++ .../Query/QOM/NodeLocalNameInterface.php | 44 + lib/PHPCR/Query/QOM/NodeNameInterface.php | 44 + lib/PHPCR/Query/QOM/NotInterface.php | 46 + lib/PHPCR/Query/QOM/OperandInterface.php | 35 + lib/PHPCR/Query/QOM/OrInterface.php | 57 ++ lib/PHPCR/Query/QOM/OrderingInterface.php | 70 ++ .../Query/QOM/PropertyExistenceInterface.php | 55 ++ .../Query/QOM/PropertyValueInterface.php | 60 ++ .../QueryObjectModelConstantsInterface.php | 108 +++ .../QOM/QueryObjectModelFactoryInterface.php | 505 +++++++++++ .../Query/QOM/QueryObjectModelInterface.php | 94 ++ lib/PHPCR/Query/QOM/SameNodeInterface.php | 56 ++ .../QOM/SameNodeJoinConditionInterface.php | 76 ++ lib/PHPCR/Query/QOM/SelectorInterface.php | 61 ++ lib/PHPCR/Query/QOM/SourceInterface.php | 35 + .../Query/QOM/StaticOperandInterface.php | 36 + lib/PHPCR/Query/QOM/UpperCaseInterface.php | 50 ++ lib/PHPCR/Query/QueryInterface.php | 160 ++++ lib/PHPCR/Query/QueryManagerInterface.php | 87 ++ lib/PHPCR/Query/QueryResultInterface.php | 74 ++ lib/PHPCR/Query/RowInterface.php | 99 +++ lib/PHPCR/Query/RowIteratorInterface.php | 46 + lib/PHPCR/RangeIteratorInterface.php | 74 ++ lib/PHPCR/ReferentialIntegrityException.php | 35 + lib/PHPCR/RepositoryException.php | 36 + lib/PHPCR/RepositoryFactoryInterface.php | 70 ++ lib/PHPCR/RepositoryInterface.php | 546 ++++++++++++ lib/PHPCR/Retention/HoldInterface.php | 58 ++ .../Retention/RetentionManagerInterface.php | 131 +++ .../Retention/RetentionPolicyInterface.php | 44 + .../Security/AccessControlEntryInterface.php | 54 ++ lib/PHPCR/Security/AccessControlException.php | 35 + .../Security/AccessControlListInterface.php | 90 ++ .../AccessControlManagerInterface.php | 201 +++++ .../Security/AccessControlPolicyInterface.php | 38 + .../AccessControlPolicyIteratorInterface.php | 46 + .../NamedAccessControlPolicyInterface.php | 48 ++ lib/PHPCR/Security/PrivilegeInterface.php | 222 +++++ lib/PHPCR/SessionInterface.php | 800 ++++++++++++++++++ lib/PHPCR/SimpleCredentials.php | 155 ++++ ...nsupportedRepositoryOperationException.php | 35 + lib/PHPCR/Util/TraversingItemVisitor.php | 190 +++++ lib/PHPCR/ValueFactoryInterface.php | 77 ++ lib/PHPCR/ValueFormatException.php | 38 + lib/PHPCR/ValueInterface.php | 152 ++++ .../Version/ActivityViolationException.php | 41 + .../Version/LabelExistsVersionException.php | 37 + lib/PHPCR/Version/OnParentVersionAction.php | 197 +++++ lib/PHPCR/Version/VersionException.php | 36 + lib/PHPCR/Version/VersionHistoryInterface.php | 248 ++++++ lib/PHPCR/Version/VersionInterface.php | 121 +++ .../Version/VersionIteratorInterface.php | 46 + lib/PHPCR/Version/VersionManagerInterface.php | 532 ++++++++++++ lib/PHPCR/WorkspaceInterface.php | 578 +++++++++++++ 120 files changed, 13906 insertions(+) create mode 100644 lib/PHPCR/AccessDeniedException.php create mode 100644 lib/PHPCR/BinaryInterface.php create mode 100644 lib/PHPCR/ContentHandlerInterface.php create mode 100644 lib/PHPCR/CredentialsInterface.php create mode 100644 lib/PHPCR/GuestCredentials.php create mode 100644 lib/PHPCR/ImportUUIDBehaviourInterface.php create mode 100644 lib/PHPCR/InvalidItemStateException.php create mode 100644 lib/PHPCR/InvalidLifecycleTransitionException.php create mode 100644 lib/PHPCR/InvalidSerializedDataException.php create mode 100644 lib/PHPCR/ItemExistsException.php create mode 100644 lib/PHPCR/ItemInterface.php create mode 100644 lib/PHPCR/ItemNotFoundException.php create mode 100644 lib/PHPCR/ItemVisitorInterface.php create mode 100644 lib/PHPCR/Lock/LockException.php create mode 100644 lib/PHPCR/Lock/LockInterface.php create mode 100644 lib/PHPCR/Lock/LockManagerInterface.php create mode 100644 lib/PHPCR/LoginException.php create mode 100644 lib/PHPCR/MergeException.php create mode 100644 lib/PHPCR/NamespaceException.php create mode 100644 lib/PHPCR/NamespaceRegistryInterface.php create mode 100644 lib/PHPCR/NoSuchWorkspaceException.php create mode 100644 lib/PHPCR/NodeInterface.php create mode 100644 lib/PHPCR/NodeIteratorInterface.php create mode 100644 lib/PHPCR/NodeType/ConstraintViolationException.php create mode 100644 lib/PHPCR/NodeType/InvalidNodeTypeDefinitionException.php create mode 100644 lib/PHPCR/NodeType/ItemDefinitionInterface.php create mode 100644 lib/PHPCR/NodeType/NoSuchNodeTypeException.php create mode 100644 lib/PHPCR/NodeType/NodeDefinitionInterface.php create mode 100644 lib/PHPCR/NodeType/NodeDefinitionTemplateInterface.php create mode 100644 lib/PHPCR/NodeType/NodeTypeDefinitionInterface.php create mode 100644 lib/PHPCR/NodeType/NodeTypeExistsException.php create mode 100644 lib/PHPCR/NodeType/NodeTypeInterface.php create mode 100644 lib/PHPCR/NodeType/NodeTypeIteratorInterface.php create mode 100644 lib/PHPCR/NodeType/NodeTypeManagerInterface.php create mode 100644 lib/PHPCR/NodeType/NodeTypeTemplateInterface.php create mode 100644 lib/PHPCR/NodeType/PropertyDefinitionInterface.php create mode 100644 lib/PHPCR/NodeType/PropertyDefinitionTemplateInterface.php create mode 100644 lib/PHPCR/Observation/EventInterface.php create mode 100644 lib/PHPCR/Observation/EventIteratorInterface.php create mode 100644 lib/PHPCR/Observation/EventJournalInterface.php create mode 100644 lib/PHPCR/Observation/EventListenerInterface.php create mode 100644 lib/PHPCR/Observation/EventListenerIteratorInterface.php create mode 100644 lib/PHPCR/Observation/ObservationManagerInterface.php create mode 100644 lib/PHPCR/PathNotFoundException.php create mode 100644 lib/PHPCR/PropertyInterface.php create mode 100644 lib/PHPCR/PropertyIteratorInterface.php create mode 100644 lib/PHPCR/PropertyType.php create mode 100644 lib/PHPCR/Query/InvalidQueryException.php create mode 100644 lib/PHPCR/Query/QOM/AndInterface.php create mode 100644 lib/PHPCR/Query/QOM/BindVariableValueInterface.php create mode 100644 lib/PHPCR/Query/QOM/ChildNodeInterface.php create mode 100644 lib/PHPCR/Query/QOM/ChildNodeJoinConditionInterface.php create mode 100644 lib/PHPCR/Query/QOM/ColumnInterface.php create mode 100644 lib/PHPCR/Query/QOM/ComparisonInterface.php create mode 100644 lib/PHPCR/Query/QOM/ConstraintInterface.php create mode 100644 lib/PHPCR/Query/QOM/DescendantNodeInterface.php create mode 100644 lib/PHPCR/Query/QOM/DescendantNodeJoinConditionInterface.php create mode 100644 lib/PHPCR/Query/QOM/DynamicOperandInterface.php create mode 100644 lib/PHPCR/Query/QOM/EquiJoinConditionInterface.php create mode 100644 lib/PHPCR/Query/QOM/FullTextSearchInterface.php create mode 100644 lib/PHPCR/Query/QOM/FullTextSearchScoreInterface.php create mode 100644 lib/PHPCR/Query/QOM/JoinConditionInterface.php create mode 100644 lib/PHPCR/Query/QOM/JoinInterface.php create mode 100644 lib/PHPCR/Query/QOM/LengthInterface.php create mode 100644 lib/PHPCR/Query/QOM/LiteralInterface.php create mode 100644 lib/PHPCR/Query/QOM/LowerCaseInterface.php create mode 100644 lib/PHPCR/Query/QOM/NodeLocalNameInterface.php create mode 100644 lib/PHPCR/Query/QOM/NodeNameInterface.php create mode 100644 lib/PHPCR/Query/QOM/NotInterface.php create mode 100644 lib/PHPCR/Query/QOM/OperandInterface.php create mode 100644 lib/PHPCR/Query/QOM/OrInterface.php create mode 100644 lib/PHPCR/Query/QOM/OrderingInterface.php create mode 100644 lib/PHPCR/Query/QOM/PropertyExistenceInterface.php create mode 100644 lib/PHPCR/Query/QOM/PropertyValueInterface.php create mode 100644 lib/PHPCR/Query/QOM/QueryObjectModelConstantsInterface.php create mode 100644 lib/PHPCR/Query/QOM/QueryObjectModelFactoryInterface.php create mode 100644 lib/PHPCR/Query/QOM/QueryObjectModelInterface.php create mode 100644 lib/PHPCR/Query/QOM/SameNodeInterface.php create mode 100644 lib/PHPCR/Query/QOM/SameNodeJoinConditionInterface.php create mode 100644 lib/PHPCR/Query/QOM/SelectorInterface.php create mode 100644 lib/PHPCR/Query/QOM/SourceInterface.php create mode 100644 lib/PHPCR/Query/QOM/StaticOperandInterface.php create mode 100644 lib/PHPCR/Query/QOM/UpperCaseInterface.php create mode 100644 lib/PHPCR/Query/QueryInterface.php create mode 100644 lib/PHPCR/Query/QueryManagerInterface.php create mode 100644 lib/PHPCR/Query/QueryResultInterface.php create mode 100644 lib/PHPCR/Query/RowInterface.php create mode 100644 lib/PHPCR/Query/RowIteratorInterface.php create mode 100644 lib/PHPCR/RangeIteratorInterface.php create mode 100644 lib/PHPCR/ReferentialIntegrityException.php create mode 100644 lib/PHPCR/RepositoryException.php create mode 100644 lib/PHPCR/RepositoryFactoryInterface.php create mode 100644 lib/PHPCR/RepositoryInterface.php create mode 100644 lib/PHPCR/Retention/HoldInterface.php create mode 100644 lib/PHPCR/Retention/RetentionManagerInterface.php create mode 100644 lib/PHPCR/Retention/RetentionPolicyInterface.php create mode 100644 lib/PHPCR/Security/AccessControlEntryInterface.php create mode 100644 lib/PHPCR/Security/AccessControlException.php create mode 100644 lib/PHPCR/Security/AccessControlListInterface.php create mode 100644 lib/PHPCR/Security/AccessControlManagerInterface.php create mode 100644 lib/PHPCR/Security/AccessControlPolicyInterface.php create mode 100644 lib/PHPCR/Security/AccessControlPolicyIteratorInterface.php create mode 100644 lib/PHPCR/Security/NamedAccessControlPolicyInterface.php create mode 100644 lib/PHPCR/Security/PrivilegeInterface.php create mode 100644 lib/PHPCR/SessionInterface.php create mode 100644 lib/PHPCR/SimpleCredentials.php create mode 100644 lib/PHPCR/UnsupportedRepositoryOperationException.php create mode 100644 lib/PHPCR/Util/TraversingItemVisitor.php create mode 100644 lib/PHPCR/ValueFactoryInterface.php create mode 100644 lib/PHPCR/ValueFormatException.php create mode 100644 lib/PHPCR/ValueInterface.php create mode 100644 lib/PHPCR/Version/ActivityViolationException.php create mode 100644 lib/PHPCR/Version/LabelExistsVersionException.php create mode 100644 lib/PHPCR/Version/OnParentVersionAction.php create mode 100644 lib/PHPCR/Version/VersionException.php create mode 100644 lib/PHPCR/Version/VersionHistoryInterface.php create mode 100644 lib/PHPCR/Version/VersionInterface.php create mode 100644 lib/PHPCR/Version/VersionIteratorInterface.php create mode 100644 lib/PHPCR/Version/VersionManagerInterface.php create mode 100644 lib/PHPCR/WorkspaceInterface.php diff --git a/lib/PHPCR/AccessDeniedException.php b/lib/PHPCR/AccessDeniedException.php new file mode 100644 index 00000000..15333e50 --- /dev/null +++ b/lib/PHPCR/AccessDeniedException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/BinaryInterface.php b/lib/PHPCR/BinaryInterface.php new file mode 100644 index 00000000..cdae14a7 --- /dev/null +++ b/lib/PHPCR/BinaryInterface.php @@ -0,0 +1,87 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ContentHandlerInterface.php b/lib/PHPCR/ContentHandlerInterface.php new file mode 100644 index 00000000..1aa50e0d --- /dev/null +++ b/lib/PHPCR/ContentHandlerInterface.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/CredentialsInterface.php b/lib/PHPCR/CredentialsInterface.php new file mode 100644 index 00000000..c69456c6 --- /dev/null +++ b/lib/PHPCR/CredentialsInterface.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/lib/PHPCR/GuestCredentials.php b/lib/PHPCR/GuestCredentials.php new file mode 100644 index 00000000..d0509b86 --- /dev/null +++ b/lib/PHPCR/GuestCredentials.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ImportUUIDBehaviourInterface.php b/lib/PHPCR/ImportUUIDBehaviourInterface.php new file mode 100644 index 00000000..9e39baad --- /dev/null +++ b/lib/PHPCR/ImportUUIDBehaviourInterface.php @@ -0,0 +1,63 @@ +importXML(), Session->importXML(), + * Workspace->getImportContentHandler() and + * Session->getImportContentHandler(). + * * + * @version $Id$ + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later + * @license http://opensource.org/licenses/bsd-license.php Simplified BSD License + * @api + */ +interface PHPCR_ImportUUIDBehaviourInterface { + + /** + * When importing remove existing item upon collision. + * @api + */ + const IMPORT_UUID_COLLISION_REMOVE_EXISTING = 1; + + /** + * When importing replace existing item upon collision. + * @api + */ + const IMPORT_UUID_COLLISION_REPLACE_EXISTING = 2; + + /** + * When importing throw exception upon collision. + * @api + */ + const IMPORT_UUID_COLLISION_THROW = 3; + + /** + * When importing create new UUIDs. + * @api + */ + const IMPORT_UUID_CREATE_NEW = 0; + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/InvalidItemStateException.php b/lib/PHPCR/InvalidItemStateException.php new file mode 100644 index 00000000..9ef58347 --- /dev/null +++ b/lib/PHPCR/InvalidItemStateException.php @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/lib/PHPCR/InvalidLifecycleTransitionException.php b/lib/PHPCR/InvalidLifecycleTransitionException.php new file mode 100644 index 00000000..b2e74832 --- /dev/null +++ b/lib/PHPCR/InvalidLifecycleTransitionException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/InvalidSerializedDataException.php b/lib/PHPCR/InvalidSerializedDataException.php new file mode 100644 index 00000000..42ca57da --- /dev/null +++ b/lib/PHPCR/InvalidSerializedDataException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ItemExistsException.php b/lib/PHPCR/ItemExistsException.php new file mode 100644 index 00000000..11d1ca01 --- /dev/null +++ b/lib/PHPCR/ItemExistsException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ItemInterface.php b/lib/PHPCR/ItemInterface.php new file mode 100644 index 00000000..9d1dabba --- /dev/null +++ b/lib/PHPCR/ItemInterface.php @@ -0,0 +1,241 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ItemNotFoundException.php b/lib/PHPCR/ItemNotFoundException.php new file mode 100644 index 00000000..331e71bc --- /dev/null +++ b/lib/PHPCR/ItemNotFoundException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ItemVisitorInterface.php b/lib/PHPCR/ItemVisitorInterface.php new file mode 100644 index 00000000..63cd3c1a --- /dev/null +++ b/lib/PHPCR/ItemVisitorInterface.php @@ -0,0 +1,57 @@ +accept(ItemVisitor) the appropriate visit method is + * automatically called, depending on whether the Item in question is a Node + * or a Property. Different implementations of this interface can be written + * for different purposes. It is, for example, possible for the visit(Node) + * method to call accept on the children of the passed node and thus recurse + * through the tree performing some operation on each Item. + * + * @version $Id$ + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later + * @license http://opensource.org/licenses/bsd-license.php Simplified BSD License + * @api + */ +interface PHPCR_ItemVisitorInterface { + + /** + * This method is called when the ItemVisitor is passed to the accept method + * of a Node or Property. If this method throws an exception the visiting + * process is aborted. + * + * Note: you need to distinguish between Node and Property objects being + * visited in your implementation. + * + * @param PHPCR_ItemInterface $item a node or property accepting this visitor + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function visit(PHPCR_ItemInterface $item); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Lock/LockException.php b/lib/PHPCR/Lock/LockException.php new file mode 100644 index 00000000..bba17427 --- /dev/null +++ b/lib/PHPCR/Lock/LockException.php @@ -0,0 +1,73 @@ + + * @api + */ + public function __construct($message, $code, $failureNodePath = NULL) { + parent::construct($message, $code); + $this->failureNodePath = $failureNodePath; + } + + /** + * Returns the absolute path of the node that caused the error or NULL + * if the implementation chooses not to, or cannot, return a path. + * + * @return string path of the node that caused the error + * @author Karsten Dambekalns + * @api + */ + public function getFailureNodePath() { + return $this->failureNodePath; + } + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Lock/LockInterface.php b/lib/PHPCR/Lock/LockInterface.php new file mode 100644 index 00000000..f6580d16 --- /dev/null +++ b/lib/PHPCR/Lock/LockInterface.php @@ -0,0 +1,141 @@ +lock()), + * an implementation-dependent string identifying the user who either + * created the lock or who is bound to the session holding the lock, or + * NULL if none of these are available. + * + * The lock owner's identity is only provided for informational purposes. + * It does not govern who can perform an unlock or make changes to the + * locked nodes; that depends entirely upon who the token holder is. + * + * @return string a user ID + * @api + */ + public function getLockOwner(); + + /** + * Returns true if this is a deep lock; false otherwise. + * + * @return boolean + * @api + */ + public function isDeep(); + + /** + * Returns the lock holding node. Note that N.getLock().getNode() (where N + * is a locked node) will only return N if N is the lock holder. If N is in + * the subgraph of the lock holder, H, then this call will return H. + * + * @return PHPCR_NodeInterface a Node + * @api + */ + public function getNode(); + + /** + * May return the lock token for this lock. If this lock is open-scoped and + * the current session either holds the lock token for this lock, or the + * repository chooses to expose the lock token to the current session, + * then this method will return that lock token. Otherwise this method will + * return null. + * + * @return string + * @api + */ + public function getLockToken(); + + /** + * Returns the number of seconds remaining until this locks times out. If + * the lock has already timed out, a negative value is returned. If the + * number of seconds remaining is infinite or unknown, PHP_INT_MAX is + * returned. + * + * @return integer the number of seconds remaining until this lock times out. + * @throws PHPCR_RepositoryException if the timeout is infinite or unknown + * @api + */ + public function getSecondsRemaining(); + + /** + * Returns true if this Lock object represents a lock that is currently in + * effect. If this lock has been unlocked either explicitly or due to an + * implementation-specific limitation (like a timeout) then it returns false. + * Note that this method is intended for those cases where one is holding a + * Lock Java object and wants to find out whether the lock (the JCR-level + * entity that is attached to the lockable node) that this object originally + * represented still exists. For example, a timeout or explicit unlock will + * remove a lock from a node but the Lock Java object corresponding to that + * lock may still exist, and in that case its isLive method will return false. + * + * @return boolean + * @throws RepositoryException if an error occurs + * @api + */ + public function isLive(); + + /** + * Returns true if this is a session-scoped lock and the scope is bound to the + * current session. Returns false otherwise. + * + * @return boolean + * @api + */ + public function isSessionScoped(); + + /** + * Returns true if the current session is the owner of this lock, either because + * it is session-scoped and bound to this session or open-scoped and this session + * currently holds the token for this lock. Returns false otherwise. + * + * @return boolean + * @api + */ + public function isLockOwningSession(); + + /** + * If this lock's time-to-live is governed by a timer, this method resets that + * timer so that the lock does not timeout and expire. If this lock's time-to-live + * is not governed by a timer, then this method has no effect. + * + * @throws PHPCR_Lock_LockException if this Session does not hold the correct lock token for this lock. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function refresh(); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Lock/LockManagerInterface.php b/lib/PHPCR/Lock/LockManagerInterface.php new file mode 100644 index 00000000..49155f8f --- /dev/null +++ b/lib/PHPCR/Lock/LockManagerInterface.php @@ -0,0 +1,192 @@ + \ No newline at end of file diff --git a/lib/PHPCR/LoginException.php b/lib/PHPCR/LoginException.php new file mode 100644 index 00000000..48c435b3 --- /dev/null +++ b/lib/PHPCR/LoginException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/MergeException.php b/lib/PHPCR/MergeException.php new file mode 100644 index 00000000..d262036c --- /dev/null +++ b/lib/PHPCR/MergeException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NamespaceException.php b/lib/PHPCR/NamespaceException.php new file mode 100644 index 00000000..c8e89bde --- /dev/null +++ b/lib/PHPCR/NamespaceException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NamespaceRegistryInterface.php b/lib/PHPCR/NamespaceRegistryInterface.php new file mode 100644 index 00000000..e7667a39 --- /dev/null +++ b/lib/PHPCR/NamespaceRegistryInterface.php @@ -0,0 +1,196 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NoSuchWorkspaceException.php b/lib/PHPCR/NoSuchWorkspaceException.php new file mode 100644 index 00000000..cf9b95dc --- /dev/null +++ b/lib/PHPCR/NoSuchWorkspaceException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeInterface.php b/lib/PHPCR/NodeInterface.php new file mode 100644 index 00000000..1b8a3d6d --- /dev/null +++ b/lib/PHPCR/NodeInterface.php @@ -0,0 +1,745 @@ +getNodes("jcr:* | myapp:report | my doc") + * would return a NodeIterator holding all accessible child nodes of N that + * are either called 'myapp:report', begin with the prefix 'jcr:' or are + * called 'my doc'. + * + * The substrings within the pattern that are delimited by "|" characters + * and which may contain wildcard characters ("*") are called "globs". + * + * Note that leading and trailing whitespace around a glob is ignored, but + * whitespace within a disjunct forms part of the pattern to be matched. + * + *If $filter is an array: + * Gets all child nodes of this node accessible through the current + * Session that match one or more of the $filter strings in the passed + * array. + * + * A glob may be a full name or a partial name with one or more wildcard + * characters ("*"). For example, + * N->getNodes(array("jcr:*", "myapp:report", "my doc")) + * would return a NodeIterator holding all accessible child nodes of N that + * are either called 'myapp:report', begin with the prefix 'jcr:' or are + * called 'my doc'. + * + * Note that unlike in the case of the getNodes() leading and + * trailing whitespace around a glob is not ignored. + * + * + * The pattern is matched against the names (not the paths) of the immediate + * child nodes of this node. + * + * If this node has no accessible matching child nodes, then an empty + * iterator is returned. + * + * The same reacquisition semantics apply as with getNode($relPath). + * + * @param string|array $filter a name pattern or an array of globbing strings. + * @return PHPCR_NodeIteratorInterface a NodeIterator over all (matching) child Nodes + * @throws PHPCR_RepositoryException If an unexpected error occurs. + * @api + */ + public function getNodes($filter = NULL); + + /** + * Returns the property at relPath relative to this node. The same + * reacquisition semantics apply as with getNode(String). + * + * @param string $relPath The relative path of the property to retrieve. + * @return PHPCR_PropertyInterface The property at relPath. + * @throws PHPCR_PathNotFoundException if no property exists at the specified path or if the current Session does not have read access to the specified property. + * @throws PHPCR_RepositoryException If another error occurs. + * @api + */ + public function getProperty($relPath); + + /** + * If $filter is a string: + * Gets all properties of this node accessible through the current Session + * that match namePattern (if no pattern is given, all accessible properties + * are returned). Does not include child nodes of this node. The pattern may + * be a full name or a partial name with one or more wildcard characters ("*"), + * or a disjunction (using the "|" character to represent logical OR) of + * these. For example, + * N.getProperties("jcr:* | myapp:name | my doc") + * would return a PropertyIterator holding all accessible properties of N + * that are either called 'myapp:name', begin with the prefix 'jcr:' or are + * called 'my doc'. + * + * The substrings within the pattern that are delimited by "|" characters + * and which may contain wildcard characters ("*") are called globs. + * + * Note that leading and trailing whitespace around a glob is ignored, but + * whitespace within a disjunct forms part of the pattern to be matched. + * + * If $filter is an array: + * Gets all properties of this node accessible through the current + * Session that match one or more of the $filter strings in the passed array. + * + * A glob may be a full name or a partial name with one or more wildcard + * characters ("*"). For example, + * N->getProperties(array("jcr:*", "myapp:report", "my doc")) + * would return a PropertyIterator holding all accessible properties of N + * that are either called 'myapp:report', begin with the prefix 'jcr:' or + * are called 'my doc'. + * + * Note that unlike in the case of getProperties() leading and + * trailing whitespace around a glob is not ignored. + * + * + * The pattern is matched against the names (not the paths) of the immediate + * child properties of this node. + * + * If this node has no accessible matching properties, then an empty iterator + * is returned. + * + * The same reacquisition semantics apply as with getNode(String). + * + * @param string|array $filter a name pattern + * @return PHPCR_PropertyIteratorInterface a PropertyIterator + * @throws PHPCR_RepositoryException If an unexpected error occurs. + * @api + */ + public function getProperties($filter = NULL); + + /** + * Returns the primary child item of this node. The primary node type of this + * node may specify one child item (child node or property) of this node as + * the primary child item. This method returns that item. + * + * In cases where the primary child item specifies the name of a set same-name + * sibling child nodes, the node returned will be the one among the same-name + * siblings with index [1]. + * + * The same reacquisition semantics apply as with getNode(String). + * + * @return PHPCR_ItemInterface the primary child item. + * @throws PHPCR_ItemNotFoundException if this node does not have a primary child item, either because none is declared in the node type or because a declared primary item is not present on this node instance, or because none accessible through the current Session + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getPrimaryItem(); + + /** + * Returns the identifier of this node. Applies to both referenceable and + * non-referenceable nodes. + * + * @return string the identifier of this node + * @throws PHPCR_RepositoryException If an error occurs. + * @api + */ + public function getIdentifier(); + + /** + * This method returns the index of this node within the ordered set of its + * same-name sibling nodes. This index is the one used to address same-name + * siblings using the square-bracket notation, e.g., /a[3]/b[4]. Note that + * the index always starts at 1 (not 0), for compatibility with XPath. As a + * result, for nodes that do not have same-name-siblings, this method will + * always return 1. + * + * @return integer The index of this node within the ordered set of its same-name sibling nodes. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getIndex(); + + /** + * This method returns all REFERENCE properties that refer to this node, have + * the specified name and that are accessible through the current Session. + * If the name parameter is null then all referring REFERENCES are returned + * regardless of name. + * + * Some implementations may only return properties that have been persisted. + * Some may return both properties that have been persisted and those that + * have been dispatched but not persisted (for example, those saved within a + * transaction but not yet committed) while others implementations may + * return these two categories of property as well as properties that are + * still pending and not yet dispatched. + * + * In implementations that support versioning, this method does not return + * properties that are part of the frozen state of a version in version storage. + * + * If this node has no referring properties with the specified name, an empty + * iterator is returned. + * + * @param string $name name of referring REFERENCE properties to be returned; if null then all referring REFERENCEs are returned + * @return PHPCR_PropertyIteratorInterface A PropertyIterator. + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getReferences($name = NULL); + + /** + * This method returns all WEAKREFERENCE properties that refer to this node, + * have the specified name and that are accessible through the current Session. + * If the name parameter is null then all referring WEAKREFERENCE are returned + * regardless of name. + * + * Some level 2 implementations may only return properties that have been + * saved (in a transactional setting this includes both those properties that + * have been saved but not yet committed, as well as properties that have + * been committed). Other level 2 implementations may additionally return + * properties that have been added within the current Session but are not yet + * saved. + * + * In implementations that support versioning, this method does not return + * properties that are part of the frozen state of a version in version storage. + * + * If this node has no referring properties with the specified name, an empty + * iterator is returned. + * + * @param string $name name of referring WEAKREFERENCE properties to be returned; if null then all referring WEAKREFERENCEs are returned + * @return PHPCR_PropertyIteratorInterface A PropertyIterator. + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getWeakReferences($name = NULL); + + /** + * Indicates whether a node exists at relPath Returns true if a node accessible + * through the current Session exists at relPath and false otherwise. + * + * @param string $relPath The path of a (possible) node. + * @return boolean true if a node exists at relPath; false otherwise. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function hasNode($relPath); + + /** + * Indicates whether a property exists at relPath Returns true if a property + * accessible through the current Session exists at relPath and false otherwise. + * + * @param string $relPath The path of a (possible) property. + * @return boolean true if a property exists at relPath; false otherwise. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function hasProperty($relPath); + + /** + * Indicates whether this node has child nodes. Returns true if this node has + * one or more child nodes accessible through the current Session; false otherwise. + * + * @return boolean true if this node has one or more child nodes; false otherwise. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function hasNodes(); + + /** + * Indicates whether this node has properties. Returns true if this node has + * one or more properties accessible through the current Session; false otherwise. + * + * @return boolean true if this node has one or more properties; false otherwise. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function hasProperties(); + + /** + * Returns the primary node type in effect for this node. Which NodeType is + * returned when this method is called on the root node of a workspace is up + * to the implementation. + * + * @return PHPCR_NodeType_NodeTypeInterface a NodeType object. + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getPrimaryNodeType(); + + /** + * Returns an array of NodeType objects representing the mixin node types in + * effect for this node. This includes only those mixin types explicitly + * assigned to this node. It does not include mixin types inherited through + * the addition of supertypes to the primary type hierarchy or through the + * addition of supertypes to the type hierarchy of any of the declared mixin + * types. + * + * @return array of PHPCR_NodeType_NodeTypeInterface objects. + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getMixinNodeTypes(); + + /** + * Returns true if this node is of the specified primary node type or mixin + * type, or a subtype thereof. Returns false otherwise. + * This method respects the effective node type of the node. + * + * @param string $nodeTypeName the name of a node type. + * @return boolean true if this node is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise. + * @throws PHPCR_RepositoryException If an error occurs. + * @api + */ + public function isNodeType($nodeTypeName); + + /** + * Changes the primary node type of this node to nodeTypeName. Also immediately + * changes this node's jcr:primaryType property appropriately. Semantically, + * the new node type may take effect immediately or on dispatch but must take + * effect on persist. + * Whichever behavior is adopted it must be the same as the behavior adopted + * for addMixin() (see below) and the behavior that occurs when a node is + * first created. + * + * @param string $nodeTypeName the name of the new node type. + * @return void + * @throws PHPCR_ConstraintViolationException If the specified primary node type creates a type conflict and this implementation performs this validation immediately. + * @throws PHPCR_NodeType_NoSuchNodeTypeException If the specified nodeTypeName is not recognized and this implementation performs this validation immediately. + * @throws PHPCR_Version_VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. + * @throws PHPCR_Lock_LockException if a lock prevents the change of the primary node type and this implementation performs this validation immediately. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function setPrimaryType($nodeTypeName); + + /** + * Adds the mixin node type named $mixinName to this node. If this node is already + * of type $mixinName (either due to a previously added mixin or due to its + * primary type, through inheritance) then this method has no effect. + * Otherwise $mixinName is added to this node's jcr:mixinTypes property. + * + * Semantically, the new node type may take effect immediately, on disptahc + * or on persist. The behavior is adopted must be the same as the behavior + * adopted for setPrimaryType(java.lang.String) and the behavior that occurs + * when a node is first created. + * + * A ConstraintViolationException is thrown either immediately or on save if + * a conflict with another assigned mixin or the primary node type or for an + * implementation-specific reason. Implementations may differ on when this + * validation is done. + * + * In some implementations it may only be possible to add mixin types before + * a a node is persisted for the first time. I such cases any later calls to + * $addMixin will throw a ConstraintViolationException either immediately, + * on dispatch or on persist. + * + * @param string $mixinName the name of the mixin node type to be added + * @return void + * @throws PHPCR_NodeType_NoSuchNodeTypeException If the specified mixinName is not recognized and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_ConstraintViolationException If the specified mixin node type is prevented from being assigned. + * @throws PHPCR_Version_VersionException if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.. + * @throws PHPCR_Lock_LockException if a lock prevents the addition of the mixin and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function addMixin($mixinName); + + /** + * Removes the specified mixin node type from this node and removes mixinName + * from this node's jcr:mixinTypes property. Both the semantic change in + * effective node type and the persistence of the change to the jcr:mixinTypes + * property occur on persist. + * + * @param string $mixinName the name of the mixin node type to be removed. + * @return void + * @throws PHPCR_NodeType_NoSuchNodeTypeException if the specified mixinName is not currently assigned to this node and this implementation performs this validation immediately. + * @throws PHPCR_ConstraintViolationException if the specified mixin node type is prevented from being removed and this implementation performs this validation immediately. + * @throws PHPCR_Version_VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. + * @throws PHPCR_Lock_LockException if a lock prevents the removal of the mixin and this implementation performs this validation immediately. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function removeMixin($mixinName); + + /** + * Returns true if the specified mixin node type called $mixinName can be + * added to this node. Returns false otherwise. A result of false must be + * returned in each of the following cases: + * * The mixin's definition conflicts with an existing primary or mixin node + * type of this node. + * * This node is versionable and checked-in or is non-versionable and its + * nearest versionable ancestor is checked-in. + * * This node is protected (as defined in this node's NodeDefinition, found + * in the node type of this node's parent). + * * An access control restriction would prevent the addition of the mixin. + * * A lock would prevent the addition of the mixin. + * * An implementation-specific restriction would prevent the addition of the mixin. + * + * @param string $mixinName The name of the mixin to be tested. + * @return boolean true if the specified mixin node type, mixinName, can be added to this node; false otherwise. + * @throws PHPCR_NodeType_NoSuchNodeTypeException if the specified mixin node type name is not recognized. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function canAddMixin($mixinName); + + /** + * Returns the node definition that applies to this node. In some cases there + * may appear to be more than one definition that could apply to this node. + * However, it is assumed that upon creation of this node, a single particular + * definition was used and it is that definition that this method returns. + * How this governing definition is selected upon node creation from among + * others which may have been applicable is an implementation issue and is + * not covered by this specification. The NodeDefinition returned when this + * method is called on the root node of a workspace is also up to the + * implementation. + * + * @return PHPCR_NodeType_NodeDefinitionInterface a NodeDefinition object. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getDefinition(); + + /** + * If this node does have a corresponding node in the workspace srcWorkspace, + * then this replaces this node and its subgraph with a clone of the + * corresponding node and its subgraph. + * If this node does not have a corresponding node in the workspace srcWorkspace, + * then the update method has no effect. + * + * If the update succeeds the changes made are persisted immediately, there + * is no need to call save. + * + * Note that update does not respect the checked-in status of nodes. An update + * may change a node even if it is currently checked-in (This fact is only + * relevant in an implementation that supports versioning). + * + * @param string $srcWorkspace the name of the source workspace. + * @return void + * @throws PHPCR_NoSuchWorkspaceException if srcWorkspace does not exist. + * @throws PHPCR_InvalidItemStateException if this Session (not necessarily this Node) has pending unsaved changes. + * @throws PHPCR_AccessDeniedException if the current session does not have sufficient access to perform the operation. + * @throws PHPCR_Lock_LockException if a lock prevents the update. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function update($srcWorkspace); + + /** + * Returns the absolute path of the node in the specified workspace that + * corresponds to this node. + * + * @param string $workspaceName the name of the workspace. + * @return string the absolute path to the corresponding node. + * @throws PHPCR_ItemNotFoundException if no corresponding node is found. + * @throws PHPCR_NoSuchWorkspaceException if the workspace is unknown. + * @throws PHPCR_AccessDeniedException if the current session has insufficient access capabilities to perform this operation. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getCorrespondingNodePath($workspaceName); + + /** + * Returns an iterator over all nodes that are in the shared set of this node. + * If this node is not shared then the returned iterator contains only this node. + * + * @return PHPCR_NodeIteratorInterface a NodeIterator + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getSharedSet(); + + /** + * Removes this node and every other node in the shared set of this node. + * + * This removal must be done atomically, i.e., if one of the nodes cannot be + * removed, the method throws the exception Node#remove() would have thrown + * in that case, and none of the nodes are removed. + * + * If this node is not shared this method removes only this node. + * + * @return void + * @throws PHPCR_Version_VersionException if the parent node of this item is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately. + * @throws PHPCR_Lock_LockException if a lock prevents the removal of this item and this implementation performs this validation immediately. + * @throws PHPCR_NodeType_ConstraintViolationException if removing the specified item would violate a node type or implementation-specific constraint and this implementation performs this validation immediately. + * @throws PHPCR_RepositoryException if another error occurs. + * @see removeShare() + * @see Item::remove() + * @see SessionInterface::removeItem + * @api + */ + public function removeSharedSet(); + + /** + * Removes this node, but does not remove any other node in the shared set + * of this node. + * + * @return void + * @throws PHPCR_Version_VersionException if the parent node of this item is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_Lock_LockException if a lock prevents the removal of this item and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_NodeType_ConstraintViolationException if removing the specified item would violate a node type or implementation-specific constraint and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_RepositoryException if this node cannot be removed without removing another node in the shared set of this node or another error occurs. + * @see removeSharedSet() + * @see Item::remove() + * @see SessionInterface::removeItem + * @api + */ + public function removeShare(); + + /** + * Returns FALSE if this node is currently in the checked-in state (either + * due to its own status as a versionable node or due to the effect of + * a versionable node being checked in above it). Otherwise this method + * returns TRUE. This includes the case where the repository does not + * support versioning (and therefore all nodes are always "checked-out", + * by default). + * + * @return boolean + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function isCheckedOut(); + + /** + * Returns TRUE if this node is locked either as a result of a lock held + * by this node or by a deep lock on a node above this node; + * otherwise returns FALSE. This includes the case where a repository does + * not support locking (in which case all nodes are "unlocked" by default). + * + * @return boolean. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function isLocked(); + + /** + * Causes the lifecycle state of this node to undergo the specified transition. + * This method may change the value of the jcr:currentLifecycleState property, + * in most cases it is expected that the implementation will change the value + * to that of the passed transition parameter, though this is an + * implementation-specific issue. If the jcr:currentLifecycleState property + * is changed the change is persisted immediately, there is no need to call + * save. + * + * @param string $transition a state transition + * @return void + * @throws PHPCR_UnsupportedRepositoryOperationException if this implementation does not support lifecycle actions or if this node does not have the mix:lifecycle mixin. + * @throws PHPCR_InvalidLifecycleTransitionException if the lifecycle transition is not successful. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function followLifecycleTransition($transition); + + /** + * Returns the list of valid state transitions for this node. + * + * @return array a string array. + * @throws PHPCR_UnsupportedRepositoryOperationException if this implementation does not support lifecycle actions or if this node does not have the mix:lifecycle mixin. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getAllowedLifecycleTransitions(); +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/NodeIteratorInterface.php b/lib/PHPCR/NodeIteratorInterface.php new file mode 100644 index 00000000..9cc2d7fa --- /dev/null +++ b/lib/PHPCR/NodeIteratorInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/ConstraintViolationException.php b/lib/PHPCR/NodeType/ConstraintViolationException.php new file mode 100644 index 00000000..5e26a405 --- /dev/null +++ b/lib/PHPCR/NodeType/ConstraintViolationException.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/InvalidNodeTypeDefinitionException.php b/lib/PHPCR/NodeType/InvalidNodeTypeDefinitionException.php new file mode 100644 index 00000000..f4e2e945 --- /dev/null +++ b/lib/PHPCR/NodeType/InvalidNodeTypeDefinitionException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/ItemDefinitionInterface.php b/lib/PHPCR/NodeType/ItemDefinitionInterface.php new file mode 100644 index 00000000..7f616423 --- /dev/null +++ b/lib/PHPCR/NodeType/ItemDefinitionInterface.php @@ -0,0 +1,153 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NoSuchNodeTypeException.php b/lib/PHPCR/NodeType/NoSuchNodeTypeException.php new file mode 100644 index 00000000..1a72eb31 --- /dev/null +++ b/lib/PHPCR/NodeType/NoSuchNodeTypeException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeDefinitionInterface.php b/lib/PHPCR/NodeType/NodeDefinitionInterface.php new file mode 100644 index 00000000..404b946b --- /dev/null +++ b/lib/PHPCR/NodeType/NodeDefinitionInterface.php @@ -0,0 +1,117 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeDefinitionTemplateInterface.php b/lib/PHPCR/NodeType/NodeDefinitionTemplateInterface.php new file mode 100644 index 00000000..7c03dac4 --- /dev/null +++ b/lib/PHPCR/NodeType/NodeDefinitionTemplateInterface.php @@ -0,0 +1,114 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeTypeDefinitionInterface.php b/lib/PHPCR/NodeType/NodeTypeDefinitionInterface.php new file mode 100644 index 00000000..2120fdc7 --- /dev/null +++ b/lib/PHPCR/NodeType/NodeTypeDefinitionInterface.php @@ -0,0 +1,163 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeTypeExistsException.php b/lib/PHPCR/NodeType/NodeTypeExistsException.php new file mode 100644 index 00000000..20e4a41a --- /dev/null +++ b/lib/PHPCR/NodeType/NodeTypeExistsException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeTypeInterface.php b/lib/PHPCR/NodeType/NodeTypeInterface.php new file mode 100644 index 00000000..aa7de31b --- /dev/null +++ b/lib/PHPCR/NodeType/NodeTypeInterface.php @@ -0,0 +1,456 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeTypeIteratorInterface.php b/lib/PHPCR/NodeType/NodeTypeIteratorInterface.php new file mode 100644 index 00000000..48121d03 --- /dev/null +++ b/lib/PHPCR/NodeType/NodeTypeIteratorInterface.php @@ -0,0 +1,45 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeTypeManagerInterface.php b/lib/PHPCR/NodeType/NodeTypeManagerInterface.php new file mode 100644 index 00000000..d54d3cb1 --- /dev/null +++ b/lib/PHPCR/NodeType/NodeTypeManagerInterface.php @@ -0,0 +1,184 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/NodeTypeTemplateInterface.php b/lib/PHPCR/NodeType/NodeTypeTemplateInterface.php new file mode 100644 index 00000000..ed3fadd0 --- /dev/null +++ b/lib/PHPCR/NodeType/NodeTypeTemplateInterface.php @@ -0,0 +1,130 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/PropertyDefinitionInterface.php b/lib/PHPCR/NodeType/PropertyDefinitionInterface.php new file mode 100644 index 00000000..3342bd35 --- /dev/null +++ b/lib/PHPCR/NodeType/PropertyDefinitionInterface.php @@ -0,0 +1,293 @@ + \ No newline at end of file diff --git a/lib/PHPCR/NodeType/PropertyDefinitionTemplateInterface.php b/lib/PHPCR/NodeType/PropertyDefinitionTemplateInterface.php new file mode 100644 index 00000000..69c2d112 --- /dev/null +++ b/lib/PHPCR/NodeType/PropertyDefinitionTemplateInterface.php @@ -0,0 +1,152 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Observation/EventInterface.php b/lib/PHPCR/Observation/EventInterface.php new file mode 100644 index 00000000..14a61a7d --- /dev/null +++ b/lib/PHPCR/Observation/EventInterface.php @@ -0,0 +1,189 @@ +move() or WorkspaceInterface->move() then the + * returned array has keys srcAbsPath and destAbsPath with values + * corresponding to the parameters passed to the move() method. + * If the method that caused this event was a NodeInterface.orderBefore() + * then the returned aray has keys srcChildRelPath and destChildRelPath + * with values corresponding to the parameters passed to the orderBefore() + * method. + * @api + */ + const NODE_MOVED = 0x20; + + /** + * If event bundling is supported, this event is used to indicate a + * bundle boundary within the event journal. + * getPath() returns NULL. + * getIdentifier() returns NULL. + * getInfo() returns an empty array. + * @api + */ + const PERSIST = 0x40; + + /** + * Returns the type of this event: a constant defined by this interface. + * One of: + * NODE_ADDED + * NODE_REMOVED + * PROPERTY_ADDED + * PROPERTY_REMOVED + * PROPERTY_CHANGED + * NODE_MOVED + * PERSIST + * + * @return integer the type of this event. + * @api + */ + public function getType(); + + /** + * Returns the absolute path associated with this event or NULL if this + * event has no associated identifier. The meaning of the associated path + * depends upon the type of the event. + * See event type constants above. + * + * @return string the absolute path associated with this event or NULL. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getPath(); + + /** + * Returns the user ID connected with this event. This is the string returned + * by Session.getUserID() of the session that caused the event. + * + * @return string the user ID. + * @api + */ + public function getUserID(); + + /** + * Returns the identifier associated with this event or null if this event + * has no associated identifier. The meaning of the associated identifier + * depends upon the type of the event. + * See event type constants above. + * + * @return string the identifier associated with this event or NULL. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getIdentifier(); + + /** + * Returns the information map associated with this event. + * The meaning of the map depends upon the type of the event. + * See event type constants above. + * + * @return array an array containing parameter information for instances of a NODE_MOVED event. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getInfo(); + + /** + * Returns the user data set through ObservationManager.setUserData() on the + * ObservationManager bound to the Session that caused the event. + * + * @return the user data string. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getUserData(); + + /** + * Returns the date when the change was persisted that caused this event. + * The date is represented as a millisecond value that is an offset from the + * Epoch, January 1, 1970 00:00:00.000 GMT (Gregorian). The granularity of + * the returned value is implementation dependent. + * + * @return integer the date when the change was persisted that caused this event (milliseconds since epoch). + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getDate(); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Observation/EventIteratorInterface.php b/lib/PHPCR/Observation/EventIteratorInterface.php new file mode 100644 index 00000000..a9bca594 --- /dev/null +++ b/lib/PHPCR/Observation/EventIteratorInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Observation/EventJournalInterface.php b/lib/PHPCR/Observation/EventJournalInterface.php new file mode 100644 index 00000000..1333bc9f --- /dev/null +++ b/lib/PHPCR/Observation/EventJournalInterface.php @@ -0,0 +1,48 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Observation/EventListenerInterface.php b/lib/PHPCR/Observation/EventListenerInterface.php new file mode 100644 index 00000000..3e8596a1 --- /dev/null +++ b/lib/PHPCR/Observation/EventListenerInterface.php @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Observation/EventListenerIteratorInterface.php b/lib/PHPCR/Observation/EventListenerIteratorInterface.php new file mode 100644 index 00000000..87516092 --- /dev/null +++ b/lib/PHPCR/Observation/EventListenerIteratorInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Observation/ObservationManagerInterface.php b/lib/PHPCR/Observation/ObservationManagerInterface.php new file mode 100644 index 00000000..ac8974c9 --- /dev/null +++ b/lib/PHPCR/Observation/ObservationManagerInterface.php @@ -0,0 +1,150 @@ +boolean. + * @param array $uuid array of identifiers. + * @param array $nodeTypeName array of node type names. + * @return PHPCR_Observation_EventJournalInterface an EventJournal (or NULL). + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getEventJournal($eventTypes = NULL, $absPath = NULL, $isDeep = NULL, array $uuid = NULL, array $nodeTypeName = NULL); + +} +?> \ No newline at end of file diff --git a/lib/PHPCR/PathNotFoundException.php b/lib/PHPCR/PathNotFoundException.php new file mode 100644 index 00000000..6bacbc72 --- /dev/null +++ b/lib/PHPCR/PathNotFoundException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/PropertyInterface.php b/lib/PHPCR/PropertyInterface.php new file mode 100644 index 00000000..5f119b82 --- /dev/null +++ b/lib/PHPCR/PropertyInterface.php @@ -0,0 +1,704 @@ +save + * to dispatch the change. + * + * For Node objects as value: + * Sets this REFERENCE OR WEAKREFERENCE property to refer to the specified + * node. If this property is not of type REFERENCE or WEAKREFERENCE or the + * specified node is not referenceable then a ValueFormatException is thrown. + * + * If value is an array: + * If this property is not multi-valued then a ValueFormatException is + * thrown immediately. + * + * Note: the Java API defines this method with multiple differing signatures. + * + * @param mixed $value The value to set + * @return void + * @throws PHPCR_ValueFormatException if the type or format of the specified value is incompatible with the type of this property. + * @throws PHPCR_Version_VersionException if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately. + * @throws PHPCR_Lock_LockException if a lock prevents the setting of the value and this implementation performs this validation immediately. + * @throws PHPCR_ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function setValue($value); + + /** + * Returns the value of this property as a Value object. + * + * The object returned is a copy of the stored value and is immutable. + * + * @return PHPCR_ValueInterface the value + * @throws PHPCR_ValueFormatException if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getValue(); + + /** + * Returns an array of all the values of this property. Used to access + * multi-value properties. If the property is single-valued, this method + * throws a ValueFormatException. The array returned is a copy of the + * stored values, so changes to it are not reflected in internal storage. + * + * @return array of PHPCR_ValueInterface + * @throws PHPCR_ValueFormatException if the property is single-valued. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getValues(); + + /** + * Returns a String representation of the value of this property. A + * shortcut for Property.getValue().getString(). See Value. + * + * @return string A string representation of the value of this property. + * @throws PHPCR_ValueFormatException if conversion to a String is not possible or if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getString(); + + /** + * Returns a Binary representation of the value of this property. A + * shortcut for Property.getValue().getBinary(). See Value. + * + * @return PHPCR_BinaryInterface A Binary representation of the value of this property. + * @throws PHPCR_ValueFormatException if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getBinary(); + + /** + * Returns an integer representation of the value of this property. A shortcut + * for Property.getValue().getLong(). See Value. + * + * @return integer An integer representation of the value of this property. + * @throws PHPCR_ValueFormatException if conversion to a long is not possible or if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getLong(); + + /** + * Returns a double representation of the value of this property. A + * shortcut for Property.getValue().getDouble(). See Value. + * + * @return float A float representation of the value of this property. + * @throws PHPCR_ValueFormatException if conversion to a double is not possible or if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getDouble(); + + /** + * Returns a BigDecimal representation of the value of this property. A + * shortcut for Property.getValue().getDecimal(). See Value. + * + * @return float A float representation of the value of this property. + * @throws PHPCR_ValueFormatException if conversion to a BigDecimal is not possible or if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getDecimal(); + + /** + * Returns a DateTime representation of the value of this property. A + * shortcut for Property.getValue().getDate(). See Value. + * + * @return DateTime A date representation of the value of this property. + * @throws PHPCR_ValueFormatException if conversion to a string is not possible or if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getDate(); + + /** + * Returns a boolean representation of the value of this property. A + * shortcut for Property.getValue().getBoolean(). See Value. + * + * @return boolean A boolean representation of the value of this property. + * @throws PHPCR_ValueFormatException if conversion to a boolean is not possible or if the property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getBoolean(); + + /** + * If this property is of type REFERENCE, WEAKREFERENCE or PATH (or + * convertible to one of these types) this method returns the Node to + * which this property refers. + * If this property is of type PATH and it contains a relative path, it is + * interpreted relative to the parent node of this property. For example "." + * refers to the parent node itself, ".." to the parent of the parent node + * and "foo" to a sibling node of this property. + * + * @return PHPCR_NodeInterface the referenced Node + * @throws PHPCR_ValueFormatException if this property cannot be converted to a referring type (REFERENCE, WEAKREFERENCE or PATH), if the property is multi-valued or if this property is a referring type but is currently part of the frozen state of a version in version storage. + * @throws PHPCR_ItemNotFoundException If this property is of type PATH or WEAKREFERENCE and no target node accessible by the current Session exists in this workspace. Note that this applies even if the property is a PATH and a property exists at the specified location. To dereference to a target property (as opposed to a target node), the method Property.getProperty is used. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getNode(); + + /** + * If this property is of type PATH (or convertible to this type) this + * method returns the Property to which this property refers. + * If this property contains a relative path, it is interpreted relative + * to the parent node of this property. Therefore, when resolving such a + * relative path, the segment "." refers to the parent node itself, ".." to + * the parent of the parent node and "foo" to a sibling property of this + * property or this property itself. + * + * For example, if this property is located at /a/b/c and it has a value of + * "../d" then this method will return the property at /a/d if such exists. + * + * @return PHPCR_PropertyInterface the referenced property + * @throws PHPCR_ValueFormatException if this property cannot be converted to a PATH, if the property is multi-valued or if this property is a referring type but is currently part of the frozen state of a version in version storage. + * @throws PHPCR_ItemNotFoundException If no property accessible by the current Session exists in this workspace at the specified path. Note that this applies even if a node exists at the specified location. To dereference to a target node, the method Property.getNode is used. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getProperty(); + + /** + * Returns the length of the value of this property. + * + * For a BINARY property, getLength returns the number of bytes. + * For other property types, getLength returns the same value that would be + * returned by calling strlen() on the value when it has been converted to a + * STRING according to standard JCR propety type conversion. + * + * Returns -1 if the implementation cannot determine the length. + * + * @return integer an integer. + * @throws PHPCR_ValueFormatException if this property is multi-valued. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getLength(); + + /** + * Returns an array holding the lengths of the values of this (multi-value) + * property in bytes where each is individually calculated as described in + * getLength(). + * + * @return array an array of lengths (integers) + * @throws PHPCR_ValueFormatException if this property is single-valued. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getLengths(); + + /** + * Returns the property definition that applies to this property. In some + * cases there may appear to be more than one definition that could apply + * to this node. However, it is assumed that upon creation or change of + * this property, a single particular definition is chosen by the + * implementation. It is that definition that this method returns. How this + * governing definition is selected upon property creation or change from + * among others which may have been applicable is an implementation issue + * and is not covered by this specification. + * + * @return PHPCR_NodeType_PropertyDefinitionInterface a PropertyDefinition object. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getDefinition(); + + /** + * Returns the type of this Property. One of: + * * PropertyType.STRING + * * PropertyType.BINARY + * * PropertyType.DATE + * * PropertyType.DOUBLE + * * PropertyType.LONG + * * PropertyType.BOOLEAN + * * PropertyType.NAME + * * PropertyType.PATH + * * PropertyType.REFERENCE + * * PropertyType.WEAKREFERENCE + * * PropertyType.URI + * + * The type returned is that which was set at property creation. Note that + * for some property p, the type returned by p.getType() will differ from + * the type returned by p.getDefinition.getRequiredType() only in the case + * where the latter returns UNDEFINED. The type of a property instance is + * never UNDEFINED (it must always have some actual type). + * + * @return integer an int + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getType(); + + /** + * Returns TRUE if this property is multi-valued and FALSE if this property + * is single-valued. + * + * @return boolean TRUE if this property is multi-valued; FALSE otherwise. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function isMultiple(); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/PropertyIteratorInterface.php b/lib/PHPCR/PropertyIteratorInterface.php new file mode 100644 index 00000000..2fb8a0fd --- /dev/null +++ b/lib/PHPCR/PropertyIteratorInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/PropertyType.php b/lib/PHPCR/PropertyType.php new file mode 100644 index 00000000..959a7b88 --- /dev/null +++ b/lib/PHPCR/PropertyType.php @@ -0,0 +1,349 @@ + + */ + private function __construct() {} + + /** + * Returns the name of the specified type, as used in serialization. + * + * @param integer $type type the property type + * @return string name of the specified type + * @author Sebastian Kurfürst + * @author Karsten Dambekalns + * @api + */ + static public function nameFromValue($type) { + switch (intval($type)) { + case self::UNDEFINED : + return self::TYPENAME_UNDEFINED; + break; + case self::STRING : + return self::TYPENAME_STRING; + break; + case self::BINARY : + return self::TYPENAME_BINARY; + break; + case self::BOOLEAN : + return self::TYPENAME_BOOLEAN; + break; + case self::LONG : + return self::TYPENAME_LONG; + break; + case self::DOUBLE : + return self::TYPENAME_DOUBLE; + break; + case self::DECIMAL : + return self::TYPENAME_DECIMAL; + break; + case self::DATE : + return self::TYPENAME_DATE; + break; + case self::NAME : + return self::TYPENAME_NAME; + break; + case self::PATH : + return self::TYPENAME_PATH; + break; + case self::REFERENCE : + return self::TYPENAME_REFERENCE; + break; + case self::WEAKREFERENCE : + return self::TYPENAME_WEAKREFERENCE; + break; + case self::URI : + return self::TYPENAME_URI; + break; + default: + throw new InvalidArgumentException('Unknown type (' . $type . ') given.', 1257170231); + } + } + + + /** + * Returns the numeric constant value of the type with the specified name. + * + * @param string $name The name of the property type + * @return int The numeric constant value + * @author Sebastian Kurfürst + * @author Karsten Dambekalns + * @api + */ + static public function valueFromName($name) { + switch ($name) { + case self::TYPENAME_UNDEFINED : + return self::UNDEFINED; + break; + case self::TYPENAME_STRING : + return self::STRING; + break; + case self::TYPENAME_BINARY : + return self::BINARY; + break; + case self::TYPENAME_LONG : + return self::LONG; + break; + case self::TYPENAME_DOUBLE : + return self::DOUBLE; + break; + case self::TYPENAME_DECIMAL : + return self::DECIMAL; + break; + case self::TYPENAME_DATE : + return self::DATE; + break; + case self::TYPENAME_BOOLEAN : + return self::BOOLEAN; + break; + case self::TYPENAME_NAME : + return self::NAME; + break; + case self::TYPENAME_PATH : + return self::PATH; + break; + case self::TYPENAME_REFERENCE : + return self::REFERENCE; + break; + case self::TYPENAME_WEAKREFERENCE : + return self::WEAKREFERENCE; + break; + case self::TYPENAME_URI : + return self::URI; + break; + default: + throw new InvalidArgumentException('Unknown name (' . $name . ') given.', 1257170232); + } + } + + /** + * Returns the numeric constant value of the type for the given PHP type + * name as returned by gettype(). + * + * Note: this is an addition not defined in JSR-283. + * + * @param string $type + * @return integer + * @author Karsten Dambekalns + * @api + */ + static public function valueFromType($type) { + switch (strtolower($type)) { + case 'string': + return self::STRING; + break; + case 'bool': + case 'boolean': + return self::BOOLEAN; + break; + case 'int': + case 'integer': + return self::LONG; + break; + case 'float': + case 'double': + return self::DOUBLE; + break; + case 'datetime': + return self::DATE; + break; + default: + return self::UNDEFINED; + } + } +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Query/InvalidQueryException.php b/lib/PHPCR/Query/InvalidQueryException.php new file mode 100644 index 00000000..ad3d86b4 --- /dev/null +++ b/lib/PHPCR/Query/InvalidQueryException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/AndInterface.php b/lib/PHPCR/Query/QOM/AndInterface.php new file mode 100644 index 00000000..e3c1f36b --- /dev/null +++ b/lib/PHPCR/Query/QOM/AndInterface.php @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/BindVariableValueInterface.php b/lib/PHPCR/Query/QOM/BindVariableValueInterface.php new file mode 100644 index 00000000..5d435379 --- /dev/null +++ b/lib/PHPCR/Query/QOM/BindVariableValueInterface.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/ChildNodeInterface.php b/lib/PHPCR/Query/QOM/ChildNodeInterface.php new file mode 100644 index 00000000..f29d8669 --- /dev/null +++ b/lib/PHPCR/Query/QOM/ChildNodeInterface.php @@ -0,0 +1,57 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/ChildNodeJoinConditionInterface.php b/lib/PHPCR/Query/QOM/ChildNodeJoinConditionInterface.php new file mode 100644 index 00000000..9f05eb5d --- /dev/null +++ b/lib/PHPCR/Query/QOM/ChildNodeJoinConditionInterface.php @@ -0,0 +1,56 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/ColumnInterface.php b/lib/PHPCR/Query/QOM/ColumnInterface.php new file mode 100644 index 00000000..0df6be40 --- /dev/null +++ b/lib/PHPCR/Query/QOM/ColumnInterface.php @@ -0,0 +1,68 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/ComparisonInterface.php b/lib/PHPCR/Query/QOM/ComparisonInterface.php new file mode 100644 index 00000000..91f39bc9 --- /dev/null +++ b/lib/PHPCR/Query/QOM/ComparisonInterface.php @@ -0,0 +1,101 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/ConstraintInterface.php b/lib/PHPCR/Query/QOM/ConstraintInterface.php new file mode 100644 index 00000000..4455c20c --- /dev/null +++ b/lib/PHPCR/Query/QOM/ConstraintInterface.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/DescendantNodeInterface.php b/lib/PHPCR/Query/QOM/DescendantNodeInterface.php new file mode 100644 index 00000000..544c8b9e --- /dev/null +++ b/lib/PHPCR/Query/QOM/DescendantNodeInterface.php @@ -0,0 +1,59 @@ + n + * would return true for some non-negative integer n, where selectorNode is the + * node for the specified selector. + * + * @version $Id$ + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later + * @license http://opensource.org/licenses/bsd-license.php Simplified BSD License + * @api + */ +interface PHPCR_Query_QOM_DescendantNodeInterface extends PHPCR_Query_QOM_ConstraintInterface { + + /** + * Gets the name of the selector against which to apply this constraint. + * + * @return string the selector name; non-null + * @api + */ + public function getSelectorName(); + + /** + * Gets the absolute path. + * + * @return string the path; non-null + * @api + */ + public function getAncestorPath(); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/DescendantNodeJoinConditionInterface.php b/lib/PHPCR/Query/QOM/DescendantNodeJoinConditionInterface.php new file mode 100644 index 00000000..5a22b13c --- /dev/null +++ b/lib/PHPCR/Query/QOM/DescendantNodeJoinConditionInterface.php @@ -0,0 +1,58 @@ + n + * would return true some some non-negative integer n, where descendantSelectorNode + * is the node for descendantSelector and ancestorSelectorNode is the node for + * ancestorSelector. + * + * @version $Id$ + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later + * @license http://opensource.org/licenses/bsd-license.php Simplified BSD License + * @api + */ +interface PHPCR_Query_QOM_DescendantNodeJoinConditionInterface extends PHPCR_Query_QOM_JoinConditionInterface { + + /** + * Gets the name of the descendant selector. + * + * @return string the selector name; non-null + * @api + */ + public function getDescendantSelectorName(); + + /** + * Gets the name of the ancestor selector. + * + * @return string the selector name; non-null + * @api + */ + public function getAncestorSelectorName(); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/DynamicOperandInterface.php b/lib/PHPCR/Query/QOM/DynamicOperandInterface.php new file mode 100644 index 00000000..b8315c4a --- /dev/null +++ b/lib/PHPCR/Query/QOM/DynamicOperandInterface.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/EquiJoinConditionInterface.php b/lib/PHPCR/Query/QOM/EquiJoinConditionInterface.php new file mode 100644 index 00000000..9ec55121 --- /dev/null +++ b/lib/PHPCR/Query/QOM/EquiJoinConditionInterface.php @@ -0,0 +1,74 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/FullTextSearchInterface.php b/lib/PHPCR/Query/QOM/FullTextSearchInterface.php new file mode 100644 index 00000000..7bb0a027 --- /dev/null +++ b/lib/PHPCR/Query/QOM/FullTextSearchInterface.php @@ -0,0 +1,99 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/FullTextSearchScoreInterface.php b/lib/PHPCR/Query/QOM/FullTextSearchScoreInterface.php new file mode 100644 index 00000000..2b70084a --- /dev/null +++ b/lib/PHPCR/Query/QOM/FullTextSearchScoreInterface.php @@ -0,0 +1,51 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/JoinConditionInterface.php b/lib/PHPCR/Query/QOM/JoinConditionInterface.php new file mode 100644 index 00000000..77dcbb31 --- /dev/null +++ b/lib/PHPCR/Query/QOM/JoinConditionInterface.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/JoinInterface.php b/lib/PHPCR/Query/QOM/JoinInterface.php new file mode 100644 index 00000000..5d8ff60e --- /dev/null +++ b/lib/PHPCR/Query/QOM/JoinInterface.php @@ -0,0 +1,67 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/LengthInterface.php b/lib/PHPCR/Query/QOM/LengthInterface.php new file mode 100644 index 00000000..082831b0 --- /dev/null +++ b/lib/PHPCR/Query/QOM/LengthInterface.php @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/LiteralInterface.php b/lib/PHPCR/Query/QOM/LiteralInterface.php new file mode 100644 index 00000000..c6a3c98a --- /dev/null +++ b/lib/PHPCR/Query/QOM/LiteralInterface.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/LowerCaseInterface.php b/lib/PHPCR/Query/QOM/LowerCaseInterface.php new file mode 100644 index 00000000..5076d9ca --- /dev/null +++ b/lib/PHPCR/Query/QOM/LowerCaseInterface.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/NodeLocalNameInterface.php b/lib/PHPCR/Query/QOM/NodeLocalNameInterface.php new file mode 100644 index 00000000..87412d6b --- /dev/null +++ b/lib/PHPCR/Query/QOM/NodeLocalNameInterface.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/NodeNameInterface.php b/lib/PHPCR/Query/QOM/NodeNameInterface.php new file mode 100644 index 00000000..da41ba16 --- /dev/null +++ b/lib/PHPCR/Query/QOM/NodeNameInterface.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/NotInterface.php b/lib/PHPCR/Query/QOM/NotInterface.php new file mode 100644 index 00000000..09294c41 --- /dev/null +++ b/lib/PHPCR/Query/QOM/NotInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/OperandInterface.php b/lib/PHPCR/Query/QOM/OperandInterface.php new file mode 100644 index 00000000..eeccceca --- /dev/null +++ b/lib/PHPCR/Query/QOM/OperandInterface.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/OrInterface.php b/lib/PHPCR/Query/QOM/OrInterface.php new file mode 100644 index 00000000..e5acccbb --- /dev/null +++ b/lib/PHPCR/Query/QOM/OrInterface.php @@ -0,0 +1,57 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/OrderingInterface.php b/lib/PHPCR/Query/QOM/OrderingInterface.php new file mode 100644 index 00000000..46560d66 --- /dev/null +++ b/lib/PHPCR/Query/QOM/OrderingInterface.php @@ -0,0 +1,70 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/PropertyExistenceInterface.php b/lib/PHPCR/Query/QOM/PropertyExistenceInterface.php new file mode 100644 index 00000000..77740324 --- /dev/null +++ b/lib/PHPCR/Query/QOM/PropertyExistenceInterface.php @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/PropertyValueInterface.php b/lib/PHPCR/Query/QOM/PropertyValueInterface.php new file mode 100644 index 00000000..b395b1dc --- /dev/null +++ b/lib/PHPCR/Query/QOM/PropertyValueInterface.php @@ -0,0 +1,60 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/QueryObjectModelConstantsInterface.php b/lib/PHPCR/Query/QOM/QueryObjectModelConstantsInterface.php new file mode 100644 index 00000000..a41f6569 --- /dev/null +++ b/lib/PHPCR/Query/QOM/QueryObjectModelConstantsInterface.php @@ -0,0 +1,108 @@ +' comparison operator. + * @api + */ + const JCR_OPERATOR_GREATER_THAN = '{http://www.jcp.org/jcr/1.0}operatorGreaterThan'; + + /** + * The '>=' comparison operator. + * @api + */ + const JCR_OPERATOR_GREATER_THAN_OR_EQUAL_TO = '{http://www.jcp.org/jcr/1.0}operatorGreaterThanOrEqualTo'; + + /** + * The 'like' comparison operator. + * @api + */ + const JCR_OPERATOR_LIKE = '{http://www.jcp.org/jcr/1.0}operatorLike'; + + /** + * Ascending order. + * @api + */ + const JCR_ORDER_ASCENDING = '{http://www.jcp.org/jcr/1.0}orderAscending'; + + /** + * Descending order. + * @api + */ + const JCR_ORDER_DESCENDING = '{http://www.jcp.org/jcr/1.0}orderDescending'; + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/QueryObjectModelFactoryInterface.php b/lib/PHPCR/Query/QOM/QueryObjectModelFactoryInterface.php new file mode 100644 index 00000000..58f94521 --- /dev/null +++ b/lib/PHPCR/Query/QOM/QueryObjectModelFactoryInterface.php @@ -0,0 +1,505 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/QueryObjectModelInterface.php b/lib/PHPCR/Query/QOM/QueryObjectModelInterface.php new file mode 100644 index 00000000..65a6bef0 --- /dev/null +++ b/lib/PHPCR/Query/QOM/QueryObjectModelInterface.php @@ -0,0 +1,94 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/SameNodeInterface.php b/lib/PHPCR/Query/QOM/SameNodeInterface.php new file mode 100644 index 00000000..38fc1e71 --- /dev/null +++ b/lib/PHPCR/Query/QOM/SameNodeInterface.php @@ -0,0 +1,56 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/SameNodeJoinConditionInterface.php b/lib/PHPCR/Query/QOM/SameNodeJoinConditionInterface.php new file mode 100644 index 00000000..8fdd2eb2 --- /dev/null +++ b/lib/PHPCR/Query/QOM/SameNodeJoinConditionInterface.php @@ -0,0 +1,76 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/SelectorInterface.php b/lib/PHPCR/Query/QOM/SelectorInterface.php new file mode 100644 index 00000000..d3619e58 --- /dev/null +++ b/lib/PHPCR/Query/QOM/SelectorInterface.php @@ -0,0 +1,61 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/SourceInterface.php b/lib/PHPCR/Query/QOM/SourceInterface.php new file mode 100644 index 00000000..b314bbf2 --- /dev/null +++ b/lib/PHPCR/Query/QOM/SourceInterface.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/StaticOperandInterface.php b/lib/PHPCR/Query/QOM/StaticOperandInterface.php new file mode 100644 index 00000000..4cbc1346 --- /dev/null +++ b/lib/PHPCR/Query/QOM/StaticOperandInterface.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QOM/UpperCaseInterface.php b/lib/PHPCR/Query/QOM/UpperCaseInterface.php new file mode 100644 index 00000000..46af2ddd --- /dev/null +++ b/lib/PHPCR/Query/QOM/UpperCaseInterface.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QueryInterface.php b/lib/PHPCR/Query/QueryInterface.php new file mode 100644 index 00000000..05cd91e3 --- /dev/null +++ b/lib/PHPCR/Query/QueryInterface.php @@ -0,0 +1,160 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QueryManagerInterface.php b/lib/PHPCR/Query/QueryManagerInterface.php new file mode 100644 index 00000000..7e0de9a7 --- /dev/null +++ b/lib/PHPCR/Query/QueryManagerInterface.php @@ -0,0 +1,87 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/QueryResultInterface.php b/lib/PHPCR/Query/QueryResultInterface.php new file mode 100644 index 00000000..34f34cfc --- /dev/null +++ b/lib/PHPCR/Query/QueryResultInterface.php @@ -0,0 +1,74 @@ +execute(). + * + * @version $Id$ + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later + * @license http://opensource.org/licenses/bsd-license.php Simplified BSD License + * @api + */ +interface PHPCR_Query_QueryResultInterface { + + /** + * Returns an array of all the column names in the table view of this result set. + * + * @return array array holding the column names. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getColumnNames(); + + /** + * Returns an iterator over the Rows of the result table. The rows are + * returned according to the ordering specified in the query. + * + * @return PHPCR_Query_RowIteratorInterface a RowIterator + * @throws PHPCR_RepositoryException if this call is the second time either getRows() or getNodes() has been called on the same QueryResult object or if another error occurs. + * @api + */ + public function getRows(); + + /** + * Returns an iterator over all nodes that match the query. The nodes are + * returned according to the ordering specified in the query. + * + * @return PHPCR_NodeIteratorInterface a NodeIterator + * @throws PHPCR_RepositoryException if the query contains more than one selector, if this call is the second time either getRows() or getNodes() has been called on the same QueryResult object or if another error occurs. + * @api + */ + public function getNodes(); + + /** + * Returns an array of all the selector names that were used in the query + * that created this result. If the query did not have a selector name then + * an empty array is returned. + * + * @return array a String array holding the selector names. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getSelectorNames(); +} +?> \ No newline at end of file diff --git a/lib/PHPCR/Query/RowInterface.php b/lib/PHPCR/Query/RowInterface.php new file mode 100644 index 00000000..19adc8d2 --- /dev/null +++ b/lib/PHPCR/Query/RowInterface.php @@ -0,0 +1,99 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Query/RowIteratorInterface.php b/lib/PHPCR/Query/RowIteratorInterface.php new file mode 100644 index 00000000..025ea92c --- /dev/null +++ b/lib/PHPCR/Query/RowIteratorInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/RangeIteratorInterface.php b/lib/PHPCR/RangeIteratorInterface.php new file mode 100644 index 00000000..145734cf --- /dev/null +++ b/lib/PHPCR/RangeIteratorInterface.php @@ -0,0 +1,74 @@ +getNodes()->getSize() returns the + * number of child nodes of $n visible through the current Session. + * + * In some implementations precise information about the number of elements may + * not be available. In such cases this method must return -1. API clients will + * then be able to use RangeIterator->getNumberRemaining() to get an + * estimate on the number of elements. + * + * @return integer + * @api + */ + public function getSize(); + + /** + * Returns the current position within the iterator. The number + * returned is the 0-based index of the next element in the iterator, + * i.e. the one that will be returned on the subsequent next() call. + * + * Note that this method does not check if there is a next element, + * i.e. an empty iterator will always return 0. + * + * @return integer + * @api + */ + public function getPosition(); + +} +?> \ No newline at end of file diff --git a/lib/PHPCR/ReferentialIntegrityException.php b/lib/PHPCR/ReferentialIntegrityException.php new file mode 100644 index 00000000..fadf0243 --- /dev/null +++ b/lib/PHPCR/ReferentialIntegrityException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/RepositoryException.php b/lib/PHPCR/RepositoryException.php new file mode 100644 index 00000000..f70f7821 --- /dev/null +++ b/lib/PHPCR/RepositoryException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/RepositoryFactoryInterface.php b/lib/PHPCR/RepositoryFactoryInterface.php new file mode 100644 index 00000000..f4e9dd8c --- /dev/null +++ b/lib/PHPCR/RepositoryFactoryInterface.php @@ -0,0 +1,70 @@ + 'vendor://localhost:9999/myrepo'); + * $repo = PHPCR_RepositoryFactory::getRepository($parameters); + * + * Get a default repository available in this environment: + * $repo = PHPCR_RepositoryFactory::getRepository(); + * + * @version $Id$ + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later + * @license http://opensource.org/licenses/bsd-license.php Simplified BSD License + * @api + */ +interface PHPCR_RepositoryFactoryInterface { + + /** + * Attempts to establish a connection to a repository using the given + * parameters. + * + * Parameters are passed in an array of key/value pairs. The keys are not + * specified by JCR and are implementation specific. + * However, vendors should use keys that are namespace qualified in the + * Java package style to distinguish their key names. For example + * an address parameter might be com.vendor.address. + * + * The implementation must return NULL if it does not understand + * the given parameters. The implementation may also return null if a default + * repository instance is requested (indicated by null parameters) and this + * factory is not able to identify a default repository. An implementation + * should throw an RepositoryException if it is the right factory but has + * trouble connecting to the repository. + * + * @param array|NULL $parameters string key/value pairs as repository arguments or NULL if a client wishes to connect to a default repository. + * @return PHPCR_RepositoryInterface a repository instance or NULL if this implementation does not understand the passed parameters + * @throws PHPCR_RepositoryException if no suitable repository is found or another error occurs. + * @api + */ + public function getRepository(array $parameters = NULL); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/RepositoryInterface.php b/lib/PHPCR/RepositoryInterface.php new file mode 100644 index 00000000..1994dc5e --- /dev/null +++ b/lib/PHPCR/RepositoryInterface.php @@ -0,0 +1,546 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Retention/HoldInterface.php b/lib/PHPCR/Retention/HoldInterface.php new file mode 100644 index 00000000..1714f8a1 --- /dev/null +++ b/lib/PHPCR/Retention/HoldInterface.php @@ -0,0 +1,58 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Retention/RetentionManagerInterface.php b/lib/PHPCR/Retention/RetentionManagerInterface.php new file mode 100644 index 00000000..a2326812 --- /dev/null +++ b/lib/PHPCR/Retention/RetentionManagerInterface.php @@ -0,0 +1,131 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Retention/RetentionPolicyInterface.php b/lib/PHPCR/Retention/RetentionPolicyInterface.php new file mode 100644 index 00000000..f87f3109 --- /dev/null +++ b/lib/PHPCR/Retention/RetentionPolicyInterface.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Security/AccessControlEntryInterface.php b/lib/PHPCR/Security/AccessControlEntryInterface.php new file mode 100644 index 00000000..3ec7e9ea --- /dev/null +++ b/lib/PHPCR/Security/AccessControlEntryInterface.php @@ -0,0 +1,54 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Security/AccessControlException.php b/lib/PHPCR/Security/AccessControlException.php new file mode 100644 index 00000000..c041c86d --- /dev/null +++ b/lib/PHPCR/Security/AccessControlException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Security/AccessControlListInterface.php b/lib/PHPCR/Security/AccessControlListInterface.php new file mode 100644 index 00000000..8973c5c1 --- /dev/null +++ b/lib/PHPCR/Security/AccessControlListInterface.php @@ -0,0 +1,90 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Security/AccessControlManagerInterface.php b/lib/PHPCR/Security/AccessControlManagerInterface.php new file mode 100644 index 00000000..a83d3545 --- /dev/null +++ b/lib/PHPCR/Security/AccessControlManagerInterface.php @@ -0,0 +1,201 @@ +policy was acquired through + * acm.getPolicies(absPath) then that policy object (usually after being + * altered) replaces its former version on the node at $absPath. + * + * This is session-write method and therefore the access control policy + * is only dispatched on save and will only take effect upon + * persist. + * + * @param string $absPath - an absolute path. + * @param PHPCR_Security_AccessControlPolicyInterface $policy - the AccessControlPolicy to be applied. + * @return void + * @throws PHPCR_PathNotFoundException if no node at absPath exists or the session does not have sufficent access to retrieve a node at that location. + * @throws PHPCR_Security_AccessControlException if the policy is not applicable. + * @throws PHPCR_AccessDeniedException if the session lacks MODIFY_ACCESS_CONTROL privilege for the absPath node. + * @throws PHPCR_Lock_LockException if a lock applies at the node at absPath and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_Version_VersionException if the node at absPath is read-only due to a checked-in node and this implementation performs this validation immediately. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function setPolicy($absPath, PHPCR_Security_AccessControlPolicyInterface $policy); + + /** + * Removes the specified AccessControlPolicy from the node at $absPath. + * + * An AccessControlPolicy can only be removed if it was bound to the specified + * node through this API before. The effect of the removal only takes place + * upon Session.save(). Note, that an implementation default or any other + * effective AccessControlPolicy that has not been applied to the node before + * may never be removed using this method. + * + * @param string $absPath - an absolute path. + * @param PHPCR_Security_AccessControlPolicyInterface $policy - the policy to be removed. + * @return void + * @throws PHPCR_PathNotFoundException if no node at absPath exists or the session does not have sufficent access to retrieve a node at that location. + * @throws PHPCR_Security_AccessControlException if no policy exists. + * @throws PHPCR_AccessDeniedException if the session lacks MODIFY_ACCESS_CONTROL privilege for the absPath node. + * @throws PHPCR_Lock_LockException if a lock applies at the node at absPath and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_Version_VersionException if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function removePolicy($absPath, PHPCR_Security_AccessControlPolicyInterface $policy); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Security/AccessControlPolicyInterface.php b/lib/PHPCR/Security/AccessControlPolicyInterface.php new file mode 100644 index 00000000..6cdfb890 --- /dev/null +++ b/lib/PHPCR/Security/AccessControlPolicyInterface.php @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Security/AccessControlPolicyIteratorInterface.php b/lib/PHPCR/Security/AccessControlPolicyIteratorInterface.php new file mode 100644 index 00000000..fdc9646c --- /dev/null +++ b/lib/PHPCR/Security/AccessControlPolicyIteratorInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Security/NamedAccessControlPolicyInterface.php b/lib/PHPCR/Security/NamedAccessControlPolicyInterface.php new file mode 100644 index 00000000..2b3578f8 --- /dev/null +++ b/lib/PHPCR/Security/NamedAccessControlPolicyInterface.php @@ -0,0 +1,48 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Security/PrivilegeInterface.php b/lib/PHPCR/Security/PrivilegeInterface.php new file mode 100644 index 00000000..3271130a --- /dev/null +++ b/lib/PHPCR/Security/PrivilegeInterface.php @@ -0,0 +1,222 @@ + \ No newline at end of file diff --git a/lib/PHPCR/SessionInterface.php b/lib/PHPCR/SessionInterface.php new file mode 100644 index 00000000..bbababfe --- /dev/null +++ b/lib/PHPCR/SessionInterface.php @@ -0,0 +1,800 @@ + element + * will have no content). Note that in the case of multi-value BINARY properties, + * the number of values in the property will be reflected in the serialized output, + * though they will all be empty. If $skipBinary is false then the actual value(s) + * of each BINARY property is recorded using Base64 encoding. + * + * If $noRecurse is true then only the node at $absPath and its properties, but not + * its child nodes, are serialized. If $noRecurse is false then the entire subgraph + * rooted at $absPath is serialized. + * + * If the user lacks read access to some subsection of the specified tree, that + * section simply does not get serialized, since, from the user's point of view, + * it is not there. + * + * The serialized output will reflect the state of the current workspace as + * modified by the state of this Session. This means that pending changes + * (regardless of whether they are valid according to node type constraints) + * and all namespace mappings in the namespace registry, as modified by the + * current session-mappings, are reflected in the output. + * + * The output XML will be encoded in UTF-8. + * + * @param string $absPath The path of the root of the subgraph to be serialized. This must be the path to a node, not a property + * @param string $out The URI to which the XML serialization of the subgraph will be output. + * @param boolean $skipBinary A boolean governing whether binary properties are to be serialized. + * @param boolean $noRecurse A boolean governing whether the subgraph at absPath is to be recursed. + * @return void + * @throws PHPCR_PathNotFoundException if no node exists at absPath. + * @throws RuntimeException if an error during an I/O operation occurs. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function exportSystemView($absPath, $out, $skipBinary, $noRecurse); + + /** + * Serializes the node (and if $noRecurse is false, the whole subgraph) at + * $absPath as an XML stream and outputs it to the supplied URI. The + * resulting XML is in the document view form. Note that $absPath must be + * the path of a node, not a property. + * + * If $skipBinary is true then any properties of PropertyType.BINARY will be serialized as if + * they are empty. That is, the existence of the property will be serialized, but its content + * will not appear in the serialized output (the value of the attribute will be empty). If + * $skipBinary is false then the actual value(s) of each BINARY property is recorded using + * Base64 encoding. + * + * If $noRecurse is true then only the node at $absPath and its properties, but not its + * child nodes, are serialized. If $noRecurse is false then the entire subgraph rooted at + * $absPath is serialized. + * + * If the user lacks read access to some subsection of the specified tree, that section + * simply does not get serialized, since, from the user's point of view, it is not there. + * + * The serialized output will reflect the state of the current workspace as modified by + * the state of this Session. This means that pending changes (regardless of whether they + * are valid according to node type constraints) and all namespace mappings in the + * namespace registry, as modified by the current session-mappings, are reflected in + * the output. + * + * The output XML will be encoded in UTF-8. + * + * @param string $absPath The path of the root of the subgraph to be serialized. This must be the path to a node, not a property + * @param string $out The URI to which the XML serialization of the subgraph will be output. + * @param boolean $skipBinary A boolean governing whether binary properties are to be serialized. + * @param boolean $noRecurse A boolean governing whether the subgraph at absPath is to be recursed. + * @return void + * @throws PHPCR_PathNotFoundException if no node exists at absPath. + * @throws RuntimeException if an error during an I/O operation occurs. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function exportDocumentView($absPath, $out, $skipBinary, $noRecurse); + + /** + * Within the scope of this Session, this method maps uri to prefix. The + * remapping only affects operations done through this Session. To clear + * all remappings, the client must acquire a new Session. + * All local mappings already present in the Session that include either + * the specified prefix or the specified uri are removed and the new mapping + * is added. + * + * @param string $prefix a string + * @param string $uri a string + * @return void + * @throws PHPCR_NamespaceException if an attempt is made to map a namespace URI to a prefix beginning with the characters "xml" (in any combination of case) or if an attempt is made to map either the empty prefix or the empty namespace (i.e., if either $prefix or $uri are the empty string). + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function setNamespacePrefix($prefix, $uri); + + /** + * Returns all prefixes currently mapped to URIs in this Session. + * + * @return array a string array + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getNamespacePrefixes(); + + /** + * Returns the URI to which the given prefix is mapped as currently set in + * this Session. + * + * @param string $prefix a string + * @return string a string + * @throws PHPCR_NamespaceException if the specified prefix is unknown. + * @throws PHPCR_RepositoryException if another error occurs + * @api + */ + public function getNamespaceURI($prefix); + + /** + * Returns the prefix to which the given uri is mapped as currently set in + * this Session. + * + * @param string $uri a string + * @return string a string + * @throws PHPCR_NamespaceException if the specified uri is unknown. + * @throws PHPCR_RepositoryException - if another error occurs + * @api + */ + public function getNamespacePrefix($uri); + + /** + * Releases all resources associated with this Session. This method should + * be called when a Session is no longer needed. + * + * @return void + * @api + */ + public function logout(); + + /** + * Returns true if this Session object is usable by the client. Otherwise, + * returns false. + * A usable Session is one that is neither logged-out, timed-out nor in + * any other way disconnected from the repository. + * + * @return boolean true if this Session is usable, false otherwise. + * @api + */ + public function isLive(); + + /** + * Returns the access control manager for this Session. + * + * @return PHPCR_Security_AccessControlManager the access control manager for this Session + * @throws PHPCR_UnsupportedRepositoryOperationException if access control is not supported. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getAccessControlManager(); + + /** + * Returns the retention and hold manager for this Session. + * + * @return PHPCR_Retention_RetentionManagerInterface the retention manager for this Session. + * @throws PHPCR_UnsupportedRepositoryOperationException if retention and hold are not supported. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function getRetentionManager(); + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/SimpleCredentials.php b/lib/PHPCR/SimpleCredentials.php new file mode 100644 index 00000000..864a3765 --- /dev/null +++ b/lib/PHPCR/SimpleCredentials.php @@ -0,0 +1,155 @@ + + * @api + */ + public function __construct($userID, $password) { + $this->userID = $userID; + $this->password = $password; + } + + /** + * Returns the user password. + * + * @return string the password + * @author Karsten Dambekalns + * @api + */ + public function getPassword() { + return $this->password; + } + + /** + * Returns the user ID. + * + * @return string the user ID. + * @author Karsten Dambekalns + * @api + */ + public function getUserID() { + return $this->userID; + } + + /** + * Stores an attribute in this credentials instance. + * + * @param string $name the name of the attribute + * @param mixed $value the value to be stored + * @return void + * @author Karsten Dambekalns + * @api + */ + public function setAttribute($name, $value) { + if ($name === NULL) { + throw new InvalidArgumentException('$name cannot be null', 1212580046); + } + + // null value is the same as removeAttribute() + if ($value === NULL) { + $this->removeAttribute($name); + } else { + $this->attributes[$name] = $value; + } + } + + /** + * Returns the value of the named attribute, or NULL if no attribute of the + * given name exists. + * + * @param string $name the name of the attribute + * @return mixed the value of the attribute, or NULL if the attribute does not exist + * @author Karsten Dambekalns + * @api + */ + public function getAttribute($name) { + if (isset($this->attributes[$name])) { + return $this->attributes[$name]; + } else { + return NULL; + } + } + + /** + * Removes an attribute from this credentials instance. + * + * @param string $name the name of the attribute to remove + * @return void + * @author Karsten Dambekalns + * @api + */ + public function removeAttribute($name) { + if (isset($this->attributes[$name])) { + unset($this->attributes[$name]); + } + } + + /** + * Returns the names of the attributes available to this + * credentials instance. This method returns an empty array + * if the credentials instance has no attributes available to it. + * + * @return array a string array containing the names of the stored attributes + * @author Karsten Dambekalns + * @api + */ + public function getAttributeNames() { + return array_keys($this->attributes); + } + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/UnsupportedRepositoryOperationException.php b/lib/PHPCR/UnsupportedRepositoryOperationException.php new file mode 100644 index 00000000..a05690a8 --- /dev/null +++ b/lib/PHPCR/UnsupportedRepositoryOperationException.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Util/TraversingItemVisitor.php b/lib/PHPCR/Util/TraversingItemVisitor.php new file mode 100644 index 00000000..b1cfa6a2 --- /dev/null +++ b/lib/PHPCR/Util/TraversingItemVisitor.php @@ -0,0 +1,190 @@ + + * @author Day Management AG, Switzerland + * @api + */ + public function TraversingItemVisitor($breadthFirst = FALSE, $maxLevel = -1) { + $this->breadthFirst = $breadthFirst; + $this->maxLevel = $maxLevel; + + if ($this->breadthFirst === TRUE) { + $this->currentQueue = new SplQueue(); + $this->nextQueue = new SplQueue(); + } + $this->currentLevel = 0; + } + + /** + * Implement this method to add behavior performed before an Item is visited. + * + * @param PHPCR_ItemInterface $item the Item that is accepting this visitor. + * @param integer $level hierarchy level of this node (the root node starts at level 0). + * @return void + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + protected abstract function entering(PHPCR_ItemInterface $item, $level); + + /** + * Implement this method to add behavior performed after an Item is visited. + * + * @param PHPCR_ItemInterface $item the Item that is accepting this visitor. + * @param integer $level hierarchy level of this property (the root node starts at level 0). + * @return void + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + protected abstract function leaving(PHPCR_ItemInterface $item, $level); + + /** + * Called when the Visitor is passed to an Item. + * It calls TraversingItemVisitor.entering(ItemInterface, int) followed by + * TraversingItemVisitor.leaving(ItemInterface, int). Implement these + * abstract methods to specify behavior on 'arrival at' and 'after leaving' + * the $item. + * + * If this method throws, the visiting process is aborted. + * + * @param PHPCR_ItemInterface $item the Node or Property that is accepting this visitor. + * @return void + * @throws PHPCR_RepositoryException if an error occurs. + * @author Karsten Dambekalns + * @author Day Management AG, Switzerland + * @api + */ + public function visit(PHPCR_ItemInterface $item) { + if ($item instanceof PHPCR_PropertyInterface) { + $this->entering($item); + $this->leaving($item); + } else { + try { + if ($this->breadthFirst === FALSE) { + // depth-first traversal + $this->entering($item, $this->currentLevel); + if ($this->maxLevel == -1 || $this->currentLevel < $this->maxLevel) { + $this->currentLevel++; + $propertyIterator = $item->getProperties(); + while ($propertyIterator->hasNext()) { + $propertyIterator->nextProperty()->accept($this); + } + $nodeIterator = $item->getNodes(); + while ($nodeIterator->hasNext()) { + $nodeIterator->nextNode()->accept($this); + } + $this->currentLevel--; + } + $this->leaving($item, $this->currentLevel); + } else { + // breadth-first traversal + $this->entering($item, $this->currentLevel); + $this->leaving($item, $this->currentLevel); + + if ($this->maxLevel == -1 || $this->currentLevel < $this->maxLevel) { + $propertyIterator = $item->getProperties(); + while ($propertyIterator->hasNext()) { + $this->nextQueue->enqueue($propertyIterator->nextProperty()); + } + $nodeIterator = $item->getNodes(); + while ($nodeIterator->hasNext()) { + $this->nextQueue->enqueue($nodeIterator->nextNode()); + } + } + + while (!$this->currentQueue->isEmpty() || !$this->nextQueue->isEmpty()) { + if ($this->currentQueue->isEmpty()) { + $this->currentLevel++; + $this->currentQueue = $this->nextQueue; + $this->nextQueue = new SplQueue(); + } + $item = $this->currentQueue->dequeue(); + $item->accept($this); + } + $this->currentLevel = 0; + } + } catch (PHPCR_RepositoryException $exception) { + $this->currentLevel = 0; + throw $exception; + } + } + } + +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/ValueFactoryInterface.php b/lib/PHPCR/ValueFactoryInterface.php new file mode 100644 index 00000000..93f624e0 --- /dev/null +++ b/lib/PHPCR/ValueFactoryInterface.php @@ -0,0 +1,77 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ValueFormatException.php b/lib/PHPCR/ValueFormatException.php new file mode 100644 index 00000000..942e91fd --- /dev/null +++ b/lib/PHPCR/ValueFormatException.php @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/lib/PHPCR/ValueInterface.php b/lib/PHPCR/ValueInterface.php new file mode 100644 index 00000000..cd0b6650 --- /dev/null +++ b/lib/PHPCR/ValueInterface.php @@ -0,0 +1,152 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Version/ActivityViolationException.php b/lib/PHPCR/Version/ActivityViolationException.php new file mode 100644 index 00000000..a049bf54 --- /dev/null +++ b/lib/PHPCR/Version/ActivityViolationException.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Version/LabelExistsVersionException.php b/lib/PHPCR/Version/LabelExistsVersionException.php new file mode 100644 index 00000000..58b13788 --- /dev/null +++ b/lib/PHPCR/Version/LabelExistsVersionException.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Version/OnParentVersionAction.php b/lib/PHPCR/Version/OnParentVersionAction.php new file mode 100644 index 00000000..a85dc0a6 --- /dev/null +++ b/lib/PHPCR/Version/OnParentVersionAction.php @@ -0,0 +1,197 @@ + + */ + private function __construct() {} + + /** + * Returns the name of the specified action, as used in serialization. + * + * @param integer $action the on-version action + * @return string the name of the specified action + * @author Karsten Dambekalns + * @api + */ + static public function nameFromValue($action) { + switch (intval($action)) { + case self::COPY : + return self::ACTIONNAME_COPY; + break; + case self::VERSION : + return self::ACTIONNAME_VERSION; + break; + case self::INITIALIZE : + return self::ACTIONNAME_INITIALIZE; + break; + case self::COMPUTE : + return self::ACTIONNAME_COMPUTE; + break; + case self::IGNORE : + return self::ACTIONNAME_IGNORE; + break; + case self::ABORT : + return self::ACTIONNAME_ABORT; + break; + default: + throw new InvalidArgumentException('Unknown action (' . $action . ') given.', 1257170242); + } + } + + /** + * Returns the numeric constant value of the on-version action with the + * specified name. + * + * @param string $name the name of the on-version action + * @return int the numeric constant value + * @author Karsten Dambekalns + * @api + */ + static public function valueFromName($name) { + switch ($name) { + case self::ACTIONNAME_COPY : + return self::COPY; + break; + case self::ACTIONNAME_VERSION : + return self::VERSION; + break; + case self::ACTIONNAME_INITIALIZE : + return self::INITIALIZE; + break; + case self::ACTIONNAME_COMPUTE : + return self::COMPUTE; + break; + case self::ACTIONNAME_IGNORE : + return self::IGNORE; + break; + case self::ACTIONNAME_ABORT : + return self::ABORT; + break; + default: + throw new InvalidArgumentException('Unknown name (' . $name . ') given.', 1257170243); + } + } +} + +?> \ No newline at end of file diff --git a/lib/PHPCR/Version/VersionException.php b/lib/PHPCR/Version/VersionException.php new file mode 100644 index 00000000..41cf4047 --- /dev/null +++ b/lib/PHPCR/Version/VersionException.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Version/VersionHistoryInterface.php b/lib/PHPCR/Version/VersionHistoryInterface.php new file mode 100644 index 00000000..a808eb40 --- /dev/null +++ b/lib/PHPCR/Version/VersionHistoryInterface.php @@ -0,0 +1,248 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Version/VersionInterface.php b/lib/PHPCR/Version/VersionInterface.php new file mode 100644 index 00000000..56b6a8fb --- /dev/null +++ b/lib/PHPCR/Version/VersionInterface.php @@ -0,0 +1,121 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Version/VersionIteratorInterface.php b/lib/PHPCR/Version/VersionIteratorInterface.php new file mode 100644 index 00000000..d30bd110 --- /dev/null +++ b/lib/PHPCR/Version/VersionIteratorInterface.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/lib/PHPCR/Version/VersionManagerInterface.php b/lib/PHPCR/Version/VersionManagerInterface.php new file mode 100644 index 00000000..1229345b --- /dev/null +++ b/lib/PHPCR/Version/VersionManagerInterface.php @@ -0,0 +1,532 @@ + \ No newline at end of file diff --git a/lib/PHPCR/WorkspaceInterface.php b/lib/PHPCR/WorkspaceInterface.php new file mode 100644 index 00000000..19a19d49 --- /dev/null +++ b/lib/PHPCR/WorkspaceInterface.php @@ -0,0 +1,578 @@ +login. + * + * @return string the name of this workspace. + * @api + */ + public function getName(); + + /** + * This method copies the subgraph rooted at, and including, the node at + * $srcWorkspace (if given) and $srcAbsPath to the new location in this + * Workspace at $destAbsPath. + * + * This is a workspace-write operation and therefore dispatches changes + * immediately and does not require a save. + * + * When a node N is copied to a path location where no node currently + * exists, a new node N' is created at that location. + * The subgraph rooted at and including N' (call it S') is created and is + * identical to the subgraph rooted at and including N (call it S) with the + * following exceptions: + * * Every node in S' is given a new and distinct identifier + * - or if $srcWorkspace is given - + * Every referenceable node in S' is given a new and distinct identifier + * while every non-referenceable node in S' may be given a new and + * distinct identifier. + * * The repository may automatically drop any mixin node type T present on + * any node M in S. Dropping a mixin node type in this context means that + * while M remains unchanged, its copy M' will lack the mixin T and any + * child nodes and properties defined by T that are present on M. For + * example, a node M that is mix:versionable may be copied such that the + * resulting node M' will be a copy of N except that M' will not be + * mix:versionable and will not have any of the properties defined by + * mix:versionable. In order for a mixin node type to be dropped it must + * be listed by name in the jcr:mixinTypes property of M. The resulting + * jcr:mixinTypes property of M' will reflect any change. + * * If a node M in S is referenceable and its mix:referenceable mixin is + * not dropped on copy, then the resulting jcr:uuid property of M' will + * reflect the new identifier assigned to M'. + * * Each REFERENCE or WEAKEREFERENCE property R in S is copied to its new + * location R' in S'. If R references a node M within S then the value of + * R' will be the identifier of M', the new copy of M, thus preserving the + * reference within the subgraph. + * + * When a node N is copied to a location where a node N' already exists, the + * repository may either immediately throw an ItemExistsException or attempt + * to update the node N' by selectively replacing part of its subgraph with + * a copy of the relevant part of the subgraph of N. If the node types of N + * and N' are compatible, the implementation supports update-on-copy for + * these node types and no other errors occur, then the copy will succeed. + * Otherwise an ItemExistsException is thrown. + * + * Which node types can be updated on copy and the details of any such + * updates are implementation-dependent. For example, some implementations + * may support update-on-copy for mix:versionable nodes. In such a case the + * versioning-related properties of the target node would remain unchanged + * (jcr:uuid, jcr:versionHistory, etc.) while the substantive content part + * of the subgraph would be replaced with that of the source node. + * + * The $destAbsPath provided must not have an index on its final element. If + * it does then a RepositoryException is thrown. Strictly speaking, the + * $destAbsPath parameter is actually an absolute path to the parent node of + * the new location, appended with the new name desired for the copied node. + * It does not specify a position within the child node ordering. If ordering + * is supported by the node type of the parent node of the new location, then + * the new copy of the node is appended to the end of the child node list. + * + * This method cannot be used to copy an individual property by itself. It + * copies an entire node and its subgraph (including, of course, any + * properties contained therein). + * + * @param string $srcAbsPath the path of the node to be copied. + * @param string $destAbsPath the location to which the node at srcAbsPath is to be copied in this workspace. + * @param string $srcWorkspace the name of the workspace from which the copy is to be made. + * @return void + * @throws PHPCR_NoSuchWorkspaceException if srcWorkspace does not exist or if the current Session does not have permission to access it. + * @throws PHPCR_ConstraintViolationException if the operation would violate a node-type or other implementation-specific constraint + * @throws PHPCR_Version_VersionException if the parent node of destAbsPath is read-only due to a checked-in node. + * @throws PHPCR_AccessDeniedException if the current session does have access srcWorkspace but otherwise does not have sufficient access to complete the operation. + * @throws PHPCR_PathNotFoundException if the node at srcAbsPath in srcWorkspace or the parent of destAbsPath in this workspace does not exist. + * @throws PHPCR_ItemExistsException if a node already exists at destAbsPath and either same-name siblings are not allowed or update on copy is not supported for the nodes involved. + * @throws PHPCR_Lock_LockException if a lock prevents the copy. + * @throws PHPCR_RepositoryException if the last element of destAbsPath has an index or if another error occurs. + * @api + */ + public function copy($srcAbsPath, $destAbsPath, $srcWorkspace = NULL); + + /** + * Clones the subgraph at the node srcAbsPath in srcWorkspace to the new + * location at destAbsPath in this workspace. + * Unlike the signature of copy that copies between workspaces, this method + * does not assign new identifiers to the newly cloned nodes but preserves + * the identifiers of their respective source nodes. This applies to both + * referenceable and non-referenceable nodes. + * + * In some implementations there may be cases where preservation of a + * non-referenceable identifier is not possible, due to how non-referenceable + * identifiers are constructed in that implementation. In such a case this + * method will throw a RepositoryException. + * + * If removeExisting is true and an existing node in this workspace (the + * destination workspace) has the same identifier as a node being cloned + * from srcWorkspace, then the incoming node takes precedence, and the + * existing node (and its subgraph) is removed. If removeExisting is false + * then an identifier collision causes this method to throw a + * ItemExistsException and no changes are made. + * + * If successful, the change is persisted immediately, there is no need + * to call save. + * + * The destAbsPath provided must not have an index on its final element. + * If it does then a RepositoryException is thrown. + * If ordering is supported by the node type of the parent node of the new + * location, then the new clone of the node is appended to the end of the + * child node list. + * + * This method cannot be used to clone just an individual property; it + * clones a node and its subgraph. + * + * @param string $srcWorkspace - The name of the workspace from which the node is to be copied. + * @param string $srcAbsPath - the path of the node to be copied in srcWorkspace. + * @param string $destAbsPath - the location to which the node at srcAbsPath is to be copied in this workspace. + * @param boolean $removeExisting - if false then this method throws an ItemExistsException on identifier conflict with an incoming node. If true then a identifier conflict is resolved by removing the existing node from its location in this workspace and cloning (copying in) the one from srcWorkspace. + * @return void + * @throws PHPCR_NoSuchWorkspaceException if destWorkspace does not exist. + * @throws PHPCR_ConstraintViolationException if the operation would violate a node-type or other implementation-specific constraint. + * @throws PHPCR_Version_VersionException if the parent node of destAbsPath is read-only due to a checked-in node. This exception will also be thrown if removeExisting is true, and an identifier conflict occurs that would require the moving and/or altering of a node that is checked-in. + * @throws PHPCR_AccessDeniedException if the current session does not have sufficient access to complete the operation. + * @throws PHPCR_PathNotFoundException if the node at srcAbsPath in srcWorkspace or the parent of destAbsPath in this workspace does not exist. + * @throws PHPCR_ItemExistsException if a node already exists at destAbsPath and same-name siblings are not allowed or if removeExisting is false and an identifier conflict occurs. + * @throws PHPCR_Lock_LockException if a lock prevents the clone. + * @throws PHPCR_RepositoryException if the last element of destAbsPath has an index or if another error occurs. + * @api + */ + public function klone($srcWorkspace, $srcAbsPath, $destAbsPath, $removeExisting); + + /** + * Moves the node at srcAbsPath (and its entire subgraph) to the new location + * at destAbsPath. + * If successful, the change is persisted immediately, there is no need to + * call save. Note that this is in contrast to + * Session->move($srcAbsPath, $destAbsPath) which operates within the transient + * space and hence requires a save. + * + * The identifiers of referenceable nodes must not be changed by a move. The + * identifiers of non-referenceable nodes may change. + * + * The destAbsPath provided must not have an index on its final element. If + * it does then a RepositoryException is thrown. Strictly speaking, the + * destAbsPath parameter is actually an absolute path to the parent node of + * the new location, appended with the new name desired for the moved node. + * It does not specify a position within the child node ordering. If ordering + * is supported by the node type of the parent node of the new location, then + * the newly moved node is appended to the end of the child node list. + * + * This method cannot be used to move just an individual property by itself. + * It moves an entire node and its subgraph (including, of course, any + * properties contained therein). + * + * The identifiers of referenceable nodes must not be changed by a move. The + * identifiers of non-referenceable nodes may change. + * + * @param string $srcAbsPath the path of the node to be moved. + * @param string $destAbsPath the location to which the node at srcAbsPath is to be moved. + * @return void + * @throws PHPCR_ConstraintViolationException if the operation would violate a node-type or other implementation-specific constraint + * @throws PHPCR_Version_VersionException if the parent node of destAbsPath is read-only due to a checked-in node. + * @throws PHPCR_AccessDeniedException if the current session (i.e. the session that was used to acquire this Workspace object) does not have sufficient access rights to complete the operation. + * @throws PHPCR_PathNotFoundException if the node at srcAbsPath or the parent of destAbsPath does not exist. + * @throws PHPCR_ItemExistsException if a node already exists at destAbsPath and same-name siblings are not allowed. + * @throws PHPCR_Lock_LockException if a lock prevents the move. + * @throws PHPCR_RepositoryException if the last element of destAbsPath has an index or if another error occurs. + * @api + */ + public function move($srcAbsPath, $destAbsPath); + + /** + * Returns the LockManager object, through which locking methods are accessed. + * + * @return PHPCR_Lock_LockManagerInterface + * @throws PHPCR_UnsupportedRepositoryOperationException if the implementation does not support locking. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getLockManager(); + + /** + * Returns the QueryManager object, through search methods are accessed. + * + * @return PHPCR_Query_QueryManagerInterface the QueryManager object. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getQueryManager(); + + /** + * Returns the NamespaceRegistry object, which is used to access the mapping + * between prefixes and namespaces. In level 2 repositories the NamespaceRegistry + * can also be used to change the namespace mappings. + * + * @return PHPCR_NamespaceRegistryInterface the NamespaceRegistry. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getNamespaceRegistry(); + + /** + * Returns the NodeTypeManager through which node type information can be queried. + * There is one node type registry per repository, therefore the NodeTypeManager + * is not workspace-specific; it provides introspection methods for the global, + * repository-wide set of available node types. In repositories that support it, + * the NodeTypeManager can also be used to register new node types. + * + * @return PHPCR_NodeType_NodeTypeManagerInterface a NodeTypeManager object. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getNodeTypeManager(); + + /** + * Returns the ObservationManager object. + * + * @return PHPCR_Observation_ObservationManagerInterface an ObservationManager object. + * @throws PHPCR::PHPCR_UnsupportedRepositoryOperationException if the implementation does not support observation. + * @throws PHPCR::PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getObservationManager(); + + /** + * Returns the VersionManager object. + * + * @return PHPCR_Version_VersionManagerInterface a VersionManager object. + * @throws PHPCR_UnsupportedRepositoryOperationException if the implementation does not support versioning. + * @throws PHPCR_RepositoryException if an error occurs. + * @api + */ + public function getVersionManager(); + + /** + * Returns a string array containing the names of all workspaces in this + * repository that are accessible to this user, given the Credentials that + * were used to get the Session to which this Workspace is tied. + * In order to access one of the listed workspaces, the user performs + * another Repository.login, specifying the name of the desired workspace, + * and receives a new Session object. + * + * @return array string array of names of accessible workspaces. + * @throws PHPCR_RepositoryException if an error occurs + * @api + */ + public function getAccessibleWorkspaceNames(); + + /** + * Returns an PHPCR_ContentHandlerInterface which can be used to push SAX events + * into the repository. If the incoming XML stream (in the form of SAX events) + * does not appear to be a JCR system view XML document then it is interpreted + * as a document view XML document. + * The incoming XML is deserialized into a subgraph of items immediately below + * the node at parentAbsPath. + * + * This method simply returns the ContentHandler without altering the state of + * the repository; the actual deserialization is done through the methods of + * the ContentHandler. Invalid XML data will cause the ContentHandler to throw + * a SAXException. + * + * As SAX events are fed into the ContentHandler, changes are made directly at + * the workspace level, without going through the Session. As a result, there + * is not need to call save. The advantage of this direct-to-workspace method + * is that a large import will not result in a large cache of pending nodes in + * the Session. The disadvantage is that structures that violate node type + * constraints cannot be imported, fixed and then saved. Instead, a constraint + * violation will cause the ContentHandler to throw a SAXException. + * See Session.getImportContentHandler for a version of this method that does go + * through the Session. + * + * The flag uuidBehavior governs how the identifiers of incoming (deserialized) + * nodes are handled. There are four options: + * + * * ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW: Incoming nodes are assigned newly + * created identifiers upon addition to the workspace. As a result identifier + * collisions never occur. + * * ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING: If an incoming node + * has the same identifier as a node already existing in the workspace, then the + * already existing node (and its subgraph) is removed from wherever it may be in + * the workspace before the incoming node is added. Note that this can result in + * nodes "disappearing" from locations in the workspace that are remote from the + * location to which the incoming subgraph is being written. + * * ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING: If an incoming node + * has the same identifier as a node already existing in the workspace then the + * already existing node is replaced by the incoming node in the same position as + * the existing node. Note that this may result in the incoming subgraph being + * disaggregated and "spread around" to different locations in the workspace. In + * the most extreme case this behavior may result in no node at all being added as + * child of parentAbsPath. This will occur if the topmost element of the incoming + * XML has the same identifier as an existing node elsewhere in the workspace. + * * ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW: If an incoming node has the same + * identifier as a node already existing in the workspace then a SAXException is + * thrown by the returned ContentHandler during deserialization. + * A SAXException will be thrown by the returned ContentHandler during deserialization + * if the top-most element of the incoming XML would deserialize to a node with the same + * name as an existing child of parentAbsPath and that child does not allow same-name + * siblings. + * A SAXException will also be thrown by the returned ContentHandler during + * deserialization if uuidBehavior is set to IMPORT_UUID_COLLISION_REMOVE_EXISTING + * and an incoming node has the same identifier as the node at parentAbsPath or + * one of its ancestors. + * + * @param string $parentAbsPath the absolute path of a node under which (as child) the imported subgraph will be built. + * @param integer $uuidBehavior a four-value flag that governs how incoming identifiers are handled. + * @return an PHPCR_ContentHandlerInterface whose methods may be called to feed SAX events into the deserializer. + * @throws PHPCR_PathNotFoundException if no node exists at $parentAbsPath. + * @throws PHPCR_ConstraintViolationException if the new subgraph cannot be added to the node at $parentAbsPath due to node-type or other implementation-specific constraints, and this can be determined before the first SAX event is sent. Unlike Session#getImportContentHandler, this method also enforces node type constraints by throwing SAXExceptions during deserialization. However, which node type constraints are enforced depends upon whether node type information in the imported data is respected, and this is an implementation-specific issue. + * @throws PHPCR_Version_VersionException if the node at $parentAbsPath is read-only due to a checked-in node. + * @throws PHPCR_Lock_LockException if a lock prevents the addition of the subgraph. + * @throws PHPCR_AccessDeniedException if the session associated with this Workspace object does not have sufficient access to perform the import. + * @throws PHPCR_RepositoryException if another error occurs. + * @todo Decide on a return type that fits the PHP world + * @api + */ + public function getImportContentHandler($parentAbsPath, $uuidBehavior); + + /** + * Deserializes an XML document and adds the resulting item subgraph as a + * child of the node at $parentAbsPath. + * If the incoming XML does not appear to be a JCR system view XML document + * then it is interpreted as a document view XML document. + * + * Changes are made directly at the workspace level, without going through + * the Session. As a result, there is not need to call save. The advantage + * of this direct-to-workspace method is that a large import will not result + * in a large cache of pending nodes in the Session. The disadvantage is + * that invalid data cannot be imported, fixed and then saved. Instead, + * invalid data will cause this method to throw an InvalidSerializedDataException. + * See Session.importXML for a version of this method that does go through + * the Session. + * + * The flag $uuidBehavior governs how the identifiers of incoming (deserialized) + * nodes are handled. There are four options: + * + * * ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW: Incoming nodes are assigned newly + * created identifiers upon addition to the workspace. As a result identifier + * collisions never occur. + * * ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING: If an incoming node + * has the same identifier as a node already existing in the workspace then the + * already existing node (and its subgraph) is removed from wherever it may be + * in the workspace before the incoming node is added. Note that this can result + * in nodes "disappearing" from locations in the workspace that are remote from + * the location to which the incoming subgraph is being written. If an incoming + * node has the same identifier as the existing root node of this workspace then + * * ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING: If an incoming node + * has the same identifier as a node already existing in the workspace then the + * already existing node is replaced by the incoming node in the same position as + * the existing node. Note that this may result in the incoming subgraph being + * disaggregated and "spread around" to different locations in the workspace. In + * the most extreme edge case this behavior may result in no node at all being + * added as child of parentAbsPath. This will occur if the topmost element of the + * incoming XML has the same identifier as an existing node elsewhere in the + * workspace. + * * ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW: If an incoming node has the + * same identifier as a node already existing in the workspace then an + * ItemExistsException is thrown. + * + * @param string $parentAbsPath the absolute path of the node below which the deserialized subgraph is added. + * @param string $in An URI from which the XML to be deserialized is read. + * @param integer $uuidBehavior a four-value flag that governs how incoming identifiers are handled. + * @return void + * @throws RuntimeException if an error during an I/O operation occurs. + * @throws PHPCR_PathNotFoundException if no node exists at parentAbsPath. + * @throws PHPCR_ConstraintViolationException if node-type or other implementation-specific constraints prevent the addition of the subgraph or if uuidBehavior is set to IMPORT_UUID_COLLISION_REMOVE_EXISTING and an incoming node has the same identifier as the node at parentAbsPath or one of its ancestors. + * @throws PHPCR_Version_VersionException if the node at parentAbsPath is read-only due to a checked-in node. + * @throws PHPCR_InvalidSerializedDataException if incoming stream is not a valid XML document. + * @throws PHPCR_ItemExistsException if the top-most element of the incoming XML would deserialize to a node with the same name as an existing child of parentAbsPath and that child does not allow same-name siblings, or if a uuidBehavior is set to IMPORT_UUID_COLLISION_THROW and an identifier collision occurs. + * @throws PHPCR_Lock_LockException if a lock prevents the addition of the subgraph. + * @throws PHPCR_AccessDeniedException if the session associated with this Workspace object does not have sufficient access to perform the import. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function importXML($parentAbsPath, $in, $uuidBehavior); + + /** + * Creates a new Workspace with the specified name. The new workspace is + * empty, meaning it contains only root node. + * + * If srcWorkspace is given: + * Creates a new Workspace with the specified name initialized with a + * clone of the content of the workspace srcWorkspace. Semantically, + * this method is equivalent to creating a new workspace and manually + * cloning srcWorkspace to it; however, this method may assist some + * implementations in optimizing subsequent Node.update and Node.merge + * calls between the new workspace and its source. + * + * The new workspace can be accessed through a login specifying its name. + * + * @param string $name A String, the name of the new workspace. + * @param string $srcWorkspace The name of the workspace from which the new workspace is to be cloned. + * @return void + * @throws PHPCR_AccessDeniedException if the session through which this Workspace object was acquired does not have sufficient access to create the new workspace. + * @throws PHPCR_UnsupportedRepositoryOperationException if the repository does not support the creation of workspaces. + * @throws PHPCR_NoSuchWorkspaceException if $srcWorkspace does not exist. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function createWorkspace($name, $srcWorkspace = NULL); + + /** + * Deletes the workspace with the specified name from the repository, + * deleting all content within it. + * + * @param string $name A String, the name of the workspace to be deleted. + * @return void + * @throws PHPCR_AccessDeniedException if the session through which this Workspace object was acquired does not have sufficient access to remove the workspace. + * @throws PHPCR_UnsupportedRepositoryOperationException if the repository does not support the removal of workspaces. + * @throws PHPCR_NoSuchWorkspaceException if $name does not exist. + * @throws PHPCR_RepositoryException if another error occurs. + * @api + */ + public function deleteWorkspace($name); + +} + +?> \ No newline at end of file