You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2005/07/03 13:58:39 UTC

svn commit: r208906 [3/5] - in /incubator/jackrabbit/trunk/contrib/phpcr: ./ PHPCR/ PHPCR/lock/ PHPCR/nodetype/ PHPCR/observation/ PHPCR/query/ PHPCR/util/ PHPCR/version/

Added: incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SAXException.php
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SAXException.php?rev=208906&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SAXException.php (added)
+++ incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SAXException.php Sun Jul  3 04:58:33 2005
@@ -0,0 +1,29 @@
+<?php
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * @author Markus Nix <mn...@mayflower.de>
+ * @package phpcr
+ */
+class SAXException extends Exception
+{
+}
+
+?>
\ No newline at end of file

Added: incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Session.php
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Session.php?rev=208906&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Session.php (added)
+++ incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Session.php Sun Jul  3 04:58:33 2005
@@ -0,0 +1,715 @@
+<?php
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once 'PHPCR/Repository.php';
+require_once 'PHPCR/Workspace.php';
+require_once 'PHPCR/Session.php';
+require_once 'PHPCR/Credentials.php';
+require_once 'PHPCR/LoginException.php';
+require_once 'PHPCR/RepositoryException.php';
+require_once 'PHPCR/Node.php';
+require_once 'PHPCR/Item.php';
+require_once 'PHPCR/ItemNotFoundException.php';
+require_once 'PHPCR/PathNotFoundException.php';
+require_once 'PHPCR/ItemExistsException.php';
+require_once 'PHPCR/PathNotFoundException.php';
+require_once 'PHPCR/version/VersionException.php';
+require_once 'PHPCR/nodetype/ConstraintViolationException.php';
+require_once 'PHPCR/lock/LockException.php';
+require_once 'PHPCR/AccessDeniedException.php';
+require_once 'PHPCR/InvalidItemStateException.php';
+require_once 'PHPCR/IOException.php';
+require_once 'PHPCR/InvalidSerializedDataException.php';
+require_once 'PHPCR/SAXException.php';
+require_once 'PHPCR/NamespaceException.php';
+
+
+/**
+ * The <code>Session</code> object provides read and (in level 2) write access to the content of a
+ * particular workspace in the repository.
+ * <p/>
+ * The <code>Session</code> object is returned by {@link Repository#login}.
+ * It encapsulates both the authorization settings of a particular user (as specified by the
+ * passed <code>Credentials</code>)and a binding to the workspace specified by the
+ * <code>workspaceName</code> passed on <code>login</code>.
+ * <p/>
+ * Each <code>Session</code> object is associated one-to-one with a <code>Workspace</code> object.
+ * The <code>Workspace</code> object represents a "view" of an actual repository workspace entity
+ * as seen through the authorization settings of its associated <code>Session</code>.
+ *
+ * @author Markus Nix <mn...@mayflower.de>
+ * @package phpcr
+ */
+interface Session
+{
+    /**
+     * Returns the <code>Repository</code> object through which this session was
+     * acquired.
+     *
+     * @return a <code>{@link Repository}</code> object.
+     */
+    public function getRepository();
+
+    /**
+     * Gets the user ID that was used to acquire this session. This method is free to return an
+     * "anonymous user id" or <code>null</code> if the <code>Credentials</code> used to acquire this session happens not
+     * to have provided a real user ID (for example,  if instead of <code>SimpleCredentials</code> some other
+     * implementation of <code>Credentials</code> was used).
+     *
+     * @return the user id from the credentials used to acquire this session.
+     */
+    public function getUserID();
+
+    /**
+     * Returns the value of the named attribute as an <code>Object</code>, or <code>null</code> if no attribute of the
+     * given name exists. See {@link Session#getAttributeNames}.
+     *
+     * @param name the name of an attribute passed in the credentials used to acquire this session.
+     *
+     * @return the value of the attribute.
+     */
+    public function getAttribute( $name );
+
+   /**
+    * Returns the names of the attributes set in this session as a result of the <code>Credentials</code> that were
+    * used to acquire it. Not all <code>Credentials</code> implementations will contain attributes (though, for example,
+    * <code>SimpleCredentials</code> does allow for them). This method returns an empty array if the
+    * <code>Credentials</code> instance used to acquire this <code>Session</code> did not provide attributes.
+    *
+    * @return A string array containing the names of all attributes passed in the credentials used to acquire this session.
+    */
+    public function getAttributeNames();
+
+    /**
+     * 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 true if this Session is usable, false otherwise.
+     */
+    public function isLive();
+
+    /**
+     * This method returns a ValueFactory that is used to create Value
+     * objects for use in setting of repository properties.
+     *
+     * If writing to the repository is not supported (because this is
+     * a level 1-only implementation, for example) an
+     * UnsupportedRepositoryOperationException will be thrown.
+     *
+     * @return a <code>{@link ValueFactory}</code> object
+     * @throws UnsupportedRepositoryOperationException if writing to the
+     * repository is not supported.
+     * @throws RepositoryException if another error occurs
+     */
+    public function getValueFactory();
+
+    /**
+     * Returns the <code>Workspace</code> attached to this <code>Session</code>.
+     *
+     * @return a <code>{@link Workspace}</code> object.
+     */
+    public function getWorkspace();
+
+    /**
+     * Returns a new session in accordance with the specified (new) Credentials.
+     * Allows the current user to "impersonate" another using incomplete
+     * credentials (perhaps including a user name but no password, for example),
+     * assuming that their original session gives them that permission.
+     * <p/>
+     * The new <code>Session</code> is tied to a new <code>Workspace</code> instance.
+     * In other words, <code>Workspace</code> instances are not re-used. However,
+     * the <code>Workspace</code> instance returned represents the same actual
+     * persistent workspace entity in the repository as is represented by the
+     * <code>Workspace</code> object tied to this <code>Session</code>.
+     * <p/>
+     * Throws a <code>LoginException</code> if the current session does not have
+     * sufficient rights.
+     *
+     * @param credentials A <code>Credentials</code> object
+     * @return a <code>Session</code> object
+     * @throws LoginException if the current session does not have
+     * sufficient rights.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function impersonate( Credentials $credentials );
+
+    /**
+     * Returns the root node of the workspace.
+     * The root node, "/", is the main access point to the content of the
+     * workspace.
+     *
+     * @return The root node of the workspace: a <code>Node</code> object.
+     *
+     * @throws RepositoryException if an error occurs.
+     */
+    public function getRootNode();
+
+    /**
+     * Returns the node specifed by the given UUID. Only applies to nodes that
+     * expose a UUID, in other words, those of mixin node type
+     * <code>mix:referenceable</code>
+     *
+     * @param uuid A universally unique identifier.
+     * @return A <code>Node</code>.
+     * @throws ItemNotFoundException if the specified UUID is not found.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getNodeByUUID( $uuid );
+
+    /**
+     * Returns the item at the specified absolute path in the workspace.
+     *
+     * @param absPath An absolute path.
+     * @return An <code>Item</code>.
+     * @throws PathNotFoundException if the specified path cannot be found.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getItem( $absPath );
+
+    /**
+     * Returns <code>true</code> if an item exists at <code>absPath</code>; otherwise returns <code>false</code>.
+     * Also returns <code>false</code> if the specified <code>absPath</code> is malformed.
+     *
+     * @param absPath an absolute path
+     * @return <code>true</code> if an item exists at <code>absPath</code>; otherwise returns <code>false</code>.
+     * @throws RepositoryException if an error occurs.
+     */
+    public function itemExists( $absPath );
+
+    /**
+     * Moves the node at <code>srcAbsPath</code> (and its entire subtree) to the new location
+     * at <code>destAbsPath</code>.
+     * <p>
+     * In order to persist the change, a <code>save</code>
+     * must be called on the parents of both the source and destination
+     * locations.
+     * <p/>
+     * A <code>ConstraintViolationException</code> is thrown if a node-type
+     * or other constraint violation is detected immediately. Otherwise,
+     * if the violation is only detected later, at <code>save</code>, then a
+     * <code>ConstraintViolationException</code> is thrown by that method.
+     * Implementations may differ as to which constraints are enforced immediately,
+     * and which on <code>save</code>.
+     * <p>
+     * As well, a <code>ConstraintViolationException</code> will be thrown on
+     * <code>save</code> if an attempt is made to seperately <code>save</code>
+     * either the source or destination node.
+     * <p>
+     * Note that this behaviour differs from that of
+     * {@link Workspace#move}, which operates directly in the persistent
+     * workspace and does not require a <code>save</code>.
+     * <p/>
+     * The <code>destAbsPath</code> provided must not
+     * have an index on its final element. If it does then a <code>RepositoryException</code>
+     * is thrown. Strictly speaking, the <code>destAbsPath</code> parameter is actually an <i>absolute path</i>
+     * to the parent node of the new location, appended with the new <i>name</i> desired for the
+     * moved node. It does not specify a position within the child node
+     * ordering (if such ordering is supported). 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.
+     * <p>
+     * This method cannot be used to move just an individual property by itself.
+     * It moves an entire node and its subtree (including, of course, any properties
+     * contained therein).
+     * <p>
+     * If no node exists at <code>srcAbsPath</code> or no node exists one level above <code>destAbsPath</code>
+     * (i.e. there is no node that will serve as the parent of the moved item) then a
+     * <code>PathNotFoundException</code> is thrown.
+     * <p>
+     * An <code>ItemExistException</code> is thrown if a property already exists at
+     * <code>destAbsPath</code> or a node already exist there, and same name
+     * siblings are not allowed.
+     * <p>
+     * A <code>VersionException</code> is thrown if the parent node of <code>destAbsPath</code> or the parent node of
+     * <code>srcAbsPath</code> is versionable and checked-in, or is non-verionable and its nearest versionable
+     * ancestor is checked-in.
+     * <p>
+     * A <code>LockException</code> is thrown if the <code>move</code> operation would violate a lock.
+     *
+     * @param srcAbsPath the root of the subtree to be moved.
+     * @param destAbsPath the location to which the subtree is to be moved.
+     * @throws ItemExistsException if a property already exists at
+     * <code>destAbsPath</code> or a node already exist there, and same name
+     * siblings are not allowed.
+     * @throws PathNotFoundException if either <code>srcAbsPath</code> or <code>destAbsPath</code> cannot be found.
+     * @throws VersionException if the parent node of <code>destAbsPath</code> or the parent node of <code>srcAbsPath</code>
+     * is versionable and checked-in, or or is non-verionable and its nearest versionable ancestor is checked-in.
+     * @throws ConstraintViolationException if a node-type or other constraint violation is detected immediately.
+     * @throws LockException if the move operation would violate a lock.
+     * @throws RepositoryException if the last element of <code>destAbsPath</code> has an index or if another error occurs.
+     */
+    public function move( $srcAbsPath, $destAbsPath );
+
+    /**
+     * Validates all pending changes currently recorded in this <code>Session</code>. If validation of all
+     * pending changes succeeds, then this change information is cleared from the <code>Session</code>.
+     * If the <code>save</code> occurs outside a transaction, the changes are persisted and thus
+     * made visible to other <code>Sessions</code>. If the <code>save</code> occurs within a transaction,
+     * the changes are not persisted until the transaction is committed.
+     * <p>
+     * If validation fails, then no pending changes are saved and they remain recorded on the <code>Session</code>.
+     * There is no best-effort or partial save.
+     * <p>
+     * When an item is saved the item in persistent storage to which pending changes are written is
+     * determined as follows:
+     * <ul>
+     *   <li>
+     *     If the transient item has a UUID, then the changes are written to the persistent item with the same UUID.
+     *   </li>
+     *   <li>
+     *     If the transient item does not have a UUID then its nearest ancestor with a UUID, or the root node
+     *     (whichever occurs first) is found, and the relative path from the node in persistent node with that UUID is
+     *     used to determine the item in persistent storage to which the changes are to be written.
+     *   </li>
+     * </ul>
+     * As a result of these rules, a <code>save</code> of an item that has a UUID will succeed even if that item has,
+     * in the meantime, been moved in persistent storage to a new location (that is, its path has changed). However, a
+     * <code>save</code> of a non-UUID item will fail (throwing an <code>InvalidItemStateException</code>) if it has,
+     * in the meantime, been moved in persistent storage to a new location. A <code>save</code> of a non-UUID item will
+     * also fail if it has, in addition to being moved, been replaced in its original position by a UUID-bearing item.
+     * <p>
+     * Note that <code>save</code> uses the same rules to match items between transient storage and persistent storage
+     * as {@link Node#update} does to match nodes between two workspaces.
+     * <p>
+     * An <code>AccessDeniedException</code> will be thrown if any of the changes
+     * to be persisted would violate the access privileges of this
+     * <code>Session</code> or if. Also thrown if  any of the
+     * changes to be persisted would cause the removal of a node that is currently
+     * referenced by a <code>REFERENCE</code> property that this Session
+     * <i>does not</i> have read access to.
+     * <p>
+     * A <code>ConstraintViolationException</code> will be thrown if any of the
+     * changes to be persisted would violate a node type restriction.
+     * Additionally, a repository may use this exception to enforce
+     * implementation- or configuration-dependant restrictions.
+     * <p>
+     * A <code>LockException</code> is thrown if any of the changes to be
+     * persisted would violate a lock.
+     * <p>
+     * An <code>InvalidItemStateException</code> is thrown if any of the
+     * changes to be persisted conflicts with a change already persisted
+     * through another session and the implementation is such that this
+     * conflict can only be detected at save-time and therefore was not
+     * detected earlier, at change-time.
+     * <p>
+     * A <code>ReferentialIntegrityException</code> is thrown if any of the
+     * changes to be persisted would cause the removal of a node that is currently
+     * referenced by a <code>REFERENCE</code> property that this <code>Session</code>
+     * has read access to.
+     * <p>
+     * A <code>VersionException</code> is thrown if the <code>save</code> would make a result in
+     * a change to persistent storage that would violate the read-only status of a
+     * checked-in node.
+     * <p>
+     * A <code>LockException</code> is thrown if the <code>save</code> would result in a
+     * change to persistent storage that would violate a lock.
+     * <p>
+     * A <code>RepositoryException</code> will be thrown if another error
+     * occurs.
+     *
+     * @throws AccessDeniedException if any of the changes to be persisted would violate
+     * the access privileges of the this <code>Session</code>. Also thrown if  any of the
+     * changes to be persisted would cause the removal of a node that is currently
+     * referenced by a <code>REFERENCE</code> property that this Session
+     * <i>does not</i> have read access to.
+     * @throws LockException if any of the changes to be persisted would violate a lock.
+     * @throws ConstraintViolationException if any of the changes to be persisted would
+     * violate a node type or restriction. Additionally, a repository may use this
+     * exception to enforce implementation- or configuration-dependent restrictions.
+     * @throws InvalidItemStateException if any of the
+     * changes to be persisted conflicts with a change already persisted
+     * through another session and the implementation is such that this
+     * conflict can only be detected at save-time and therefore was not
+     * detected earlier, at change-time.
+     * @throws ReferentialIntegrityException if any of the
+     * changes to be persisted would cause the removal of a node that is currently
+     * referenced by a <code>REFERENCE</code> property that this <code>Session</code>
+     * has read access to.
+     * @throws VersionException if the <code>save</code> would make a result in
+     * a change to persistent storage that would violate the read-only status of a
+     * checked-in node.
+     * @throws LockException if the <code>save</code> would result in a
+     * change to persistent storage that would violate a lock.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function save();
+
+    /**
+     * If <code>keepChanges</code> is <code>false</code>, this method discards all pending changes
+     * currently recorded in this <code>Session</code> and returns all items to reflect the current
+     * saved state. Outside a transaction this state is simply the current state of persistent storage.
+     * Within a transaction, this state will reflect persistent storage as modified by changes that have
+     * been saved but not yet committed.
+     * <p>
+     * If <code>keepChanges</code> is true then pending change are not discarded but items that do not
+     * have changes pending have their state refreshed to reflect the current saved state, thus revealing
+     * changes made by other sessions.
+     *
+     * @throws RepositoryException if an error occurs.
+     */
+    public function refresh( $keepChanges );
+
+    /**
+     * Returns <code>true</code> if this session holds pending (that is, unsaved) changes;
+     * otherwise returns <code>false</code>.
+     *
+     * @return a boolean
+     * @throws RepositoryException if an error occurs
+     */
+    public function hasPendingChanges();
+
+    /**
+     * Determines whether this <code>Session</code> has permission to perform the specified actions
+     * at the specified <code>absPath</code>. This method quietly returns if the access request is
+     * permitted, or throws Exception otherwise.
+     * <p/>
+     * The <code>actions</code> parameter is a comma separated list of action strings. The following
+     * action strings are defined:
+     * <ul>
+     * <li>
+     * <code>add_node</code>: If <code>checkPermission(path, "add_node")</code> returns quietly, then
+     * this <code>Session</code> has permission to add a node at <code>path</code>, otherwise permission
+     * is denied.
+     * </li>
+     * <li>
+     * <code>set_property</code>: If <code>checkPermission(path, "set_property")</code> returns quietly,
+     * then this <code>Session</code> has permission to set (add or change) a property at <code>path</code>,
+     * otherwise permission is denied.
+     * </li>
+     * <li>
+     * <code>remove</code>: If <code>checkPermission(path, "remove")</code> returns quietly, then this
+     * <code>Session</code> has permission to remove an item at <code>path</code>, otherwise permission is denied.
+     * </li>
+     * <li>
+     * <code>read</code>: If <code>checkPermission(path, "read")</code> returns quietly, then this
+     * <code>Session</code> has permission to retrieve (and read the value of, in the case of a property)
+     * an item at <code>path</code>, otherwise permission is denied.
+     * </li>
+     * </ul>
+     * When more than one action is specified in the <code>actions</code> parameter, this method will only
+     * return quietly if this <code>Session</code> has permission to perform <i>all</i> of the listed
+     * actions at the specified path.
+     * <p/>
+     * The information returned through this method will only reflect access control policies
+     * and not other restrictions that may exist. For example, even though <code>checkPermission</code>
+     * may indicate that a particular <code>Session</code> may add a property at <code>/A/B/C</code>,
+     * the node type of the node at <code>/A/B</code> may prevent the addition of a property called
+     * <code>C</code>.
+     *
+     * @throws Exception
+     */
+    public function checkPermission( $absPath, $actions );
+
+    /**
+     * Returns a <code>ContentHandler</code> 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.
+     * <p>
+     * The incoming XML is deserialized into a subtree of items immediately below the node at
+     * <code>parentAbsPath</code>.
+     * <p>
+     * The special properties <code>jcr:primaryType</code> and <code>jcr:mixinTypes</code> are
+     * taken into account during deserialization in order to determine the node types of the newly created nodes.
+     * <p>
+     * This method simply returns the <code>ContentHandler</code> without altering the state of the
+     * repository; the actual deserialization is done through the methods of the <code>ContentHandler</code>.
+     * <p>
+     * As SAX events are fed into the <code>ContentHandler</code>, the tree of new items is built
+     * in the transient storage of the <code>Session</code>. In order to persist the new content,
+     * <code>save</code> must be called. The advantage of this through-the-session method is that
+     * invalid data can be imported, fixed and then saved. The disadvantage is that a large
+     * import will result in a large cache of pending nodes in the <code>Session</code>. See
+     * {@link Workspace#getImportContentHandler} for a version of this method that <i>does not</i>
+     * go through the <code>Session</code>.
+     * <p>
+     * A <code>PathNotFoundException</code> is thrown if no node exists at <code>parentAbsPath</code>.
+     * <p>
+     * A <code>ConstraintViolationException</code> is thrown if the new subtree cannot be added to the node at
+     * <code>parentAbsPath</code> due to node-type or other implementation-specific constraints, and this can
+     * be determined before the first SAX event is sent. Unlike {@link Workspace#getImportContentHandler},
+     * this method does not enforce node type constraints by throwing <code>SAXException</code>s during
+     * deserialization. These constraints are checked on <code>save</code>.
+     * <p>
+     * A <code>VersionException</code> is thrown if the node at <code>parentAbsPath</code> is versionable
+     * and checked-in, or its nearest versionable ancestor is checked-in.
+     * <p>
+     * A <code>LockException</code> is thrown if a lock prevents the addition of the subtree.
+     * <p>
+     * A <code>RepositoryException</code> is thrown if another error occurs.
+     *
+     * @param parentAbsPath the absolute path of a node under which (as child) the imported subtree will be built.
+     * @param mode a four-value flag that governs how incoming UUIDs are handled.
+     *
+     * @return an org.xml.sax.ContentHandler whose methods may be called to feed SAX events into the deserializer.
+     *
+     * @throws PathNotFoundException if no node exists at <code>parentAbsPath</code>.
+     * @throws ConstraintViolationException if the new subtree cannot be added to the node at
+     * <code>parentAbsPath</code> due to node-type or other implementation-specific constraints, and this can
+     * be determined before the first SAX event is sent.
+     * @throws VersionException if the node at <code>parentAbsPath</code> is versionable
+     * and checked-in, or its nearest versionable ancestor is checked-in.
+     * @throws LockException if a lock prevents the addition of the subtree.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getImportContentHandler( $parentAbsPath, $mode );
+
+    /**
+     * Deserializes an XML document and adds the resulting item subtree as a child of the node at
+     * <code>parentAbsPath</code>. Requires a <code>save</code> to persist.
+     * <p>
+     * If the incoming XML stream does not appear to be a JCR system view XML document then it is interpreted as a
+     * <b>document view</b> XML document.
+     * <p>
+     * The special properties <code>jcr:primaryType</code> and <code>jcr:mixinTypes</code> are
+     * taken into account during deserialization in order to determine the node types of the newly
+     * created nodes.
+     * <p>
+     * The tree of new items is built in the transient storage of the <code>Session</code>.
+     * In order to persist the new content, <code>save</code> must be called. The advantage
+     * of this through-the-session method is that invalid data can be imported, fixed and
+     * then saved. The disadvantage is that a large import will result in a large cache
+     * of pending nodes in the <code>Session</code>. See {@link Workspace#importXML}
+     * for a version of this method that does not go through the <code>Session</code>.
+     * <p>
+     * An <code>IOException</code> is thrown if an I/O error occurs.
+     * <p>
+     * If no node exists at <code>parentAbsPath</code>, a <code>PathNotFoundException</code>
+     * is thrown.
+     * <p>
+     * If deserialization would overwrite an exisiting item, an <code>ItemExistsException</code>
+     * is thrown.
+     * <p>
+     * A <code>ConstraintViolationException</code> is thrown if the new subtree cannot be added to the node at
+     * <code>parentAbsPath</code> due to node-type or other implementation-specific constraints, and this can
+     * be determined before deserialization begins. Unlike {@link Workspace#getImportContentHandler},
+     * this method does not enforce node type constraints by during
+     * deserialization. These constraints are checked on <code>save</code>.
+     * <p>
+     * A <code>VersionException</code> is thrown if the node at <code>parentAbsPath</code> is versionable
+     * and checked-in, or its nearest versionable ancestor is checked-in.
+     * <p>
+     * A <code>LockException</code> is thrown if a lock prevents the addition of the subtree.
+     * <p>
+     * If the incoming XML is not valid, an <code>InvalidSerializedDataException</code> is thrown.
+     * <p>
+     * If another error occurs a <code>RepositoryException</code> is thrown.
+     *
+     * @param parentAbsPath the absolute path of the node below which the deserialized subtree is added.
+     * @param in The <code>Inputstream</code> from which the XML to be deserilaized is read.
+     * @param mode a four-value flag that governs how incoming UUIDs are handled.
+     *
+     * @throws IOException if an error during an I/O operation occurs.
+     * @throws PathNotFoundException if no node exists at <code>parentAbsPath</code>.
+     * @throws ItemExistsException if deserialization would overwrite an exisiting item.
+     * @throws ConstraintViolationException if the new subtree cannot be added to the node at
+     * <code>parentAbsPath</code> due to node-type or other implementation-specific constraints, and this can
+     * be determined before deserialization begins.
+     * @throws VersionException if the node at <code>parentAbsPath</code> is versionable
+     * and checked-in, or its nearest versionable ancestor is checked-in.
+     * @throws InvalidSerializedDataException if incoming stream is not a valid XML document.
+     * @throws LockException if a lock prevents the addition of the subtree.
+     * @throws RepositoryException is another error occurs.
+     */
+    public function importXML( $parentAbsPath, $in, $mode );
+
+    /**
+     * Serializes the node (and if <code>noRecurse</code> is <code>false</code>,
+     * the whole subtree) at <code>absPath</code> into a series of SAX events by
+     * calling the methods of the supplied <code>org.xml.sax.ContentHandler</code>.
+     * The resulting XML is in the system view form. Note that <code>absPath</code>
+     * must be the path of a node, not a property.
+     * <p>
+     * If <code>skipBinary</code> is <code>true</code> then any properties of
+     * <code>PropertyType.BINARY</code> will be ignored and will not appear in
+     * the serialized output. If <code>skipBinary</code> is false then the actual
+     * value of each <code>BINARY</code> property is recorded using Base64 encoding.
+     * <p>
+     * If <code>noRecurse</code> is true then only the node at
+     * <code>absPath</code> and its properties, but not its child nodes, are
+     * serialized. If <code>noRecurse</code> is <code>false</code> then the entire subtree
+     * rooted at <code>absPath</code> is serialized.
+     * <p>
+     * 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.
+     * <p>
+     * The serialized output will reflect the state of the current workspace as
+     * modified by the state of this <code>Session</code>. This means that
+     * pending changes (regardless of whether they are valid according to
+     * node type constraints) and the current session-mapping of namespaces
+     * are reflected in the output.
+     * <p>
+     * A <code>PathNotFoundException</code> is thrown if no node exists at <code>absPath</code>.
+     * <p>
+     * A <code>SAXException</code> is thrown if an error occurs while feeding events to the
+     * <code>ContentHandler</code>.
+     *
+     * @param absPath The path of the root of the subtree to be serialized.
+     * This must be the path to a node, not a property
+     * @param contentHandler The  <code>org.xml.sax.ContentHandler</code> to
+     * which the SAX events representing the XML serialization of the subtree
+     * will be output.
+     * @param skipBinary A <code>boolean</code> governing whether binary
+     * properties are to be serialized.
+     * @param noRecurse A <code>boolean</code> governing whether the subtree at
+     * absPath is to be recursed.
+     *
+     * @throws PathNotFoundException if no node exists at <code>absPath</code>.
+     * @throws org.xml.sax.SAXException if an error occurs while feeding events to the
+     * <code>org.xml.sax.ContentHandler</code>.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function exportSystemView( $absPath, $out, $skipBinary, $noRecurse );
+
+    /**
+     * Serializes the node (and if <code>noRecurse</code> is <code>false</code>,
+     * the whole subtree) at <code>absPath</code> into a series of SAX events by
+     * calling the methods of the supplied <code>org.xml.sax.ContentHandler</code>.
+     * The resulting XML is in the document view form. Note that <code>absPath</code>
+     * must be the path of a node, not a property.
+     * <p>
+     * If <code>skipBinary</code> is <code>true</code> then any properties of
+     * <code>PropertyType.BINARY</code> will be ignored and will not appear in
+     * the serialized output. If <code>skipBinary</code> is false then the actual
+     * value of each <code>BINARY</code> property is recorded using Base64 encoding.
+     * <p>
+     * If <code>noRecurse</code> is true then only the node at
+     * <code>absPath</code> and its properties, but not its child nodes, are
+     * serialized. If <code>noRecurse</code> is <code>false</code> then the entire subtree
+     * rooted at <code>absPath</code> is serialized.
+     * <p>
+     * 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.
+     * <p>
+     * The serialized output will reflect the state of the current workspace as
+     * modified by the state of this <code>Session</code>. This means that
+     * pending changes (regardless of whether they are valid according to
+     * node type constraints) and the current session-mapping of namespaces
+     * are reflected in the output.
+     * <p>
+     * A <code>PathNotFoundException</code> is thrown if no node exists at <code>absPath</code>.
+     * <p>
+     * A <code>SAXException</code> is thrown if an error occurs while feeding events to the
+     * <code>ContentHandler</code>.
+     *
+     * @param absPath The path of the root of the subtree to be serialized.
+     * This must be the path to a node, not a property
+     * @param out The <code>OutputStream</code> to which the XML
+     * serialization of the subtree will be output.
+     * @param skipBinary A <code>boolean</code> governing whether binary
+     * properties are to be serialized.
+     * @param noRecurse A <code>boolean</code> governing whether the subtree at
+     * absPath is to be recursed.
+     *
+     * @throws PathNotFoundException if no node exists at <code>absPath</code>.
+     * @throws org.xml.sax.SAXException if an error occurs while feeding events to the
+     * <code>org.xml.sax.ContentHandler</code>.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function exportDocumentView( $absPath, $out, $skipBinary, $noRecurse );
+
+    /**
+     * Within the scope of this session, rename a persistently registered
+     * namespace URI to the new prefix.  The renaming only affects operations
+     * done through this session. To clear all renamings the client must acquire
+     * a new session.
+     * <p>
+     * Note that a prefix that is currently mapped in the global namespace registry
+     * to some URI cannot be remapped to a new URI using this method, since this would
+     * make any content stored using the old URI unreadable. An attempt to do
+     * this will throw a <code>NamespaceException</code>.
+     * <p>
+     * A <code>NamespaceException</code> will be thrown if an attempt is made to remap a URI to a
+     * prefix beginning with "<code>xml</code>". These prefixes are reserved by the XML
+     * specification.
+     * <p>
+     * A <code>NamespaceException</code> will also be thrown if
+     * the specified uri is not among those registered in the NamespaceRegistry.
+     *
+     * @param prefix a string
+     * @param uri a string
+     * @throws NamespaceException if the specified uri is not registered or an attempt is made to remap to an illegal prefix.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function setNamespacePrefix( $prefix, $uri );
+
+    /**
+     * Returns all prefixes currently set for this session. This includes all
+     * those registered in the <code>NamespaceRegistry</code> but <i>not
+     * over-ridden</i> by a <code>Session.setNamespacePrefix</code>, plus those
+     * currently set locally by <code>Session.setNamespacePrefix</code>.
+     *
+     * @throws RepositoryException if an error occurs
+     * @return a string array
+     */
+    public function getNamespacePrefixes();
+
+    /**
+     * For a given prefix, returns the URI to which it is mapped as currently
+     * set in this <code>Session</code>. If the prefix is unknown, a <code>NamespaceException</code> is thrown.
+     *
+     * @param prefix a string
+     * @return a string
+     * @throws NamespaceException if the prefix is unknown.
+     * @throws RepositoryException if another error occurs
+     */
+    public function getNamespaceURI( $prefix );
+
+    /**
+     * Returns the prefix to which the given URI is mapped
+     *
+     * @param uri a string
+     * @return a string
+     * @throws NamespaceException if the URI is unknown.
+     * @throws RepositoryException if another error occurs
+     */
+    public function getNamespacePrefix( $uri );
+
+    /**
+     * Releases all resources associated with this <code>Session</code>. This method should be called when a
+     * <code>Session</code> is no longer needed.
+     */
+    public function logout();
+
+    /**
+     * Adds the specified lock token to this session. Holding a lock token allows the <code>Session</code> object of the
+     * lock owner to alter nodes that are locked by the lock specified by that particular lock token.
+     *
+     * @param lt a lock token (a string)
+     */
+    public function addLockToken( $lt );
+
+    /**
+     * Returns an array containing all lock tokens currently held by this session.
+     *
+     * @return an array of lock tokens (strings)
+     */
+    public function getLockTokens();
+
+    /**
+     * Removes the specified lock token from this session.
+     * @param lt a lock token (a string)
+     */
+    public function removeLockToken( $lt );
+}
+
+?>
\ No newline at end of file

Added: incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SimpleCredentials.php
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SimpleCredentials.php?rev=208906&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SimpleCredentials.php (added)
+++ incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/SimpleCredentials.php Sun Jul  3 04:58:33 2005
@@ -0,0 +1,152 @@
+<?php
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once 'PHPCR/Credentials.php';
+require_once 'PHPCR/IllegalArgumentException.php';
+
+
+/**
+ * <code>SimpleCredentials</code> implements the <code>Credentials</code>
+ * interface and represents simple user ID/password credentials.
+ *
+ * @author Markus Nix <mn...@mayflower.de>
+ * @package phpcr
+ */
+final class SimpleCredentials implements Credentials
+{
+    /**
+     * @var String
+     * @access private
+     */
+    private $userId;
+
+    /**
+     * @var string
+     * @access private
+     */
+    private $password;
+
+    /**
+     * @var array
+     * @access private
+     */
+    private $attributes;
+
+
+    /**
+     * Create a new <code>SimpleCredentials</code> object, given a user ID
+     * and password.
+     * <p/>
+     * Note that the given user password is cloned before it is stored
+     * in the new <code>SimpleCredentials</code> object. This should
+     * avoid the risk of having unnecessary references to password data
+     * lying around in memory.
+     * <p/>
+     *
+     * @param userId   the user ID
+     * @param password the user's password
+     */
+    public function __construct( $userId, $password ) {
+        $this->userId = $userId;
+        $this->password = $password;
+    }
+
+
+    /**
+     * Returns the user password.
+     * <p/>
+     * Note that this method returns a reference to the password.
+     * It is the caller's responsibility to zero out the password information
+     * after it is no longer needed.
+     *
+     * @return the password
+     */
+    public function getPassword() {
+        return $this->password;
+    }
+
+    /**
+     * Returns the user ID.
+     *
+     * @return String the user ID.
+     */
+    public function getUserId() {
+        return userId;
+    }
+
+    /**
+     * Stores an attribute in this credentials instance.
+     *
+     * @param name  a <code>String</code> specifying the name of the attribute
+     * @param value the <code>Object</code> to be stored
+     */
+    public function setAttribute( $name = null, $value = null ) {
+        // name cannot be null
+        if ( !isset( $name ) ) {
+            throw new IllegalArgumentException("name cannot be null");
+        }
+
+        // null value is the same as removeAttribute()
+        if ( !isset( $value ) ) {
+            $this->removeAttribute( $name );
+            return;
+        }
+
+        $this->attributes[$name] = $value;
+    }
+
+    /**
+     * Returns the value of the named attribute as an <code>Object</code>,
+     * or <code>null</code> if no attribute of the given name exists.
+     *
+     * @param name a <code>String</code> specifying the name of the attribute
+     * @return  an <code>Object</code> containing the value of the attribute,
+     * or <code>null</code> if the attribute does not exist
+     */
+    public function getAttribute( $name ) {
+        return $this->attributes[$name];
+    }
+
+    /**
+     * Removes an attribute from this credentials instance.
+     *
+     * @param name a <code>String</code> specifying the name of the attribute
+     *             to remove
+     */
+    public function removeAttribute( $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.
+     * <p/>
+     * <b>Level 1 and 2</b>
+     * <p/>
+     *
+     * @return a string array containing the names of the stored attributes
+     */
+    public function getAttributeNames() {
+        return array_keys( $this->attributes );
+    }
+}
+
+?>
\ No newline at end of file

Added: incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/UnsupportedRepositoryOperationException.php
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/UnsupportedRepositoryOperationException.php?rev=208906&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/UnsupportedRepositoryOperationException.php (added)
+++ incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/UnsupportedRepositoryOperationException.php Sun Jul  3 04:58:33 2005
@@ -0,0 +1,37 @@
+<?php
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once 'PHPCR/RepositoryException.php';
+
+
+/**
+ * In level 1 implementations, exception thrown by methods that are only
+ * relevant to level 2 implementations, in level 2 may be thrown by methods
+ * related to optional features (such as locking) which are missing from a
+ * particular level 2 implementation.
+ *
+ * @author Markus Nix <mn...@mayflower.de>
+ * @package phpcr
+ */
+class UnsupportedRepositoryOperationException extends RepositoryException
+{
+}
+
+?>
\ No newline at end of file

Added: incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Value.php
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Value.php?rev=208906&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Value.php (added)
+++ incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/Value.php Sun Jul  3 04:58:33 2005
@@ -0,0 +1,229 @@
+<?php
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once 'PHPCR/ValueFormatException.php';
+require_once 'PHPCR/IllegalStateException.php';
+require_once 'PHPCR/RepositoryException.php';
+
+
+/**
+ * A generic holder for the value of a property. A <code>Value</code> object can be used without knowing the actual
+ * property type (<code>STRING</code>, <code>DOUBLE</code>, <code>BINARY</code> etc.).
+ * <p>
+ * Any implementation of this interface must match the behavior of the JCR-supplied classes ({@link BaseValue} and its
+ * subclasses) in the following respects:
+ * <ul>
+ *   <li>
+ *     A <code>Value</code> object returned by <code>Property.getValue()</code> can be read using type-specific
+ *     <code>get</code> methods. These methods are divided into two groups:
+ *     <ul>
+ *       <li>
+ *         The non-stream <code>get</code> methods <code>getString()</code>, <code>getDate()</code>,
+ *         <code>getLong()</code>, <code>getDouble()</code> and <code>getBoolean()</code>.
+ *       </li>
+ *       <li>
+ *          <code>getStream()</code>.
+ *       </li>
+ *     </ul>
+ *    </li>
+ *   <li>
+ *     Once a <code>Value</code> object has been read once using <code>getStream()</code>, all subsequent calls to
+ *     <code>getStream()</code> will return the same <code>Stream</code> object. This may mean, for example, that the
+ *     stream returned is fully or partially consumed. In order to get a fresh stream the <code>Value</code> object
+ *     must be reacquired via {@link Property#getValue()} or {@link Property#getValues()}.
+ *   </li>
+ *   <li>
+ *     Once a <code>Value</code> object has been read once using <code>getStream()</code>, any subsequent call to any
+ *     of the non-stream <code>get</code> methods will throw an <code>IllegalStateException</code>. In order to
+ *     successfully invoke a non-stream <code>get</code> method, the <code>Value</code> must be reacquired.
+ *   </li>
+ *   <li>
+ *     Once a <code>Value</code> object has been read once using a non-stream get method, any subsequent call to
+ *     <code>getStream()</code> will throw an <code>IllegalStateException</code>. In order to successfully invoke
+ *     <code>getStream()</code>, the <code>Value</code> must be reacquired.
+ * </ul>
+ * An implementation that obeys these restrictions can be found in the class {@link BaseValue} and its subclasses
+ * {@link StringValue}, {@link LongValue}, {@link DoubleValue}, {@link BooleanValue}, {@link DateValue},
+ * {@link BinaryValue}, {@link NameValue}, {@link PathValue} and {@link ReferenceValue}.
+ * <p/>
+ * Two <code>Value</code> instances, <code>v1</code> and <code>v2</code>, are considered equal if and only if:
+ * <ul>
+ * <li><code>v1.getType() == v2.getType()</code>, and,</li>
+ * <li><code>v1.getString().equals(v2.getString())</code></li>
+ * </ul>
+ * Actually comparing two <code>Value</code> instances by converting them to
+ * string form may not be practical in some cases (for example, if the values are very large
+ * binaries). Consequently, the above is intended as a normative definition of <code>Value</code> equality
+ * but not as a procedural test of equality. It is assumed that implementations will have efficient means
+ * of determining equality that conform with the above definition.
+ *
+ * @author Markus Nix <mn...@mayflower.de>
+ * @package phpcr
+ */
+interface Value
+{
+    /**
+     * Returns a <code>String</code> representation of this value.
+     * <p>
+     * If this value cannot be converted to a string, a
+     * <code>ValueFormatException</code> is thrown.
+     * <p>
+     * If <code>getStream</code> has previously been called on this
+     * <code>Value</code> instance, an <code>IllegalStateException</code> is thrown.
+     * In this case a new <code>Value</code> instance must be acquired in order to
+     * successfully call <code>getString</code>.
+     * <p>
+     * A <code>RepositoryException</code> is thrown if another error occurs.
+     *
+     * @return A <code>String</code> representation of the value of this property.
+     * @throws ValueFormatException if conversion to a <code>String</code> is not possible.
+     * @throws IllegalStateException if <code>getStream</code> has previously
+     * been called on this <code>Value</code> instance.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getString();
+
+    /**
+     * Returns an <code>InputStream</code> representation of this value.
+     * USes the standard conversion to binary (see JCR specification)<p>
+     * If this value cannot be converted to a stream, a
+     * <code>ValueFormatException</code> is thrown.
+     * <p>
+     * If a non-stream <code>get</code> method has previously been called on this
+     * <code>Value</code> instance, an <code>IllegalStateException</code> is thrown.
+     * In this case a new <code>Value</code> instance must be acquired in order to successfully call
+     * <code>getStream</code>.
+     * <p>
+     * A <code>RepositoryException</code> is thrown if another error occurs.
+     *
+     * @return An <code>InputStream</code> representation of this value.
+     * @throws ValueFormatException if conversion to an <code>InputStream</code> is not possible.
+     * @throws IllegalStateException if a non-stream <code>get</code> method has previously
+     * been called on this <code>Value</code> instance.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getStream();
+
+    /**
+     * Returns a <code>long</code> representation of this value.
+     * <p>
+     * If this value cannot be converted to a <code>long</code>, a
+     * <code>ValueFormatException</code> is thrown.
+     * <p>
+     * If <code>getStream</code> has previously been called on this
+     * <code>Value</code> instance, an <code>IllegalStateException</code> is thrown.
+     * In this case a new <code>Value</code> instance must be acquired in order to
+     * successfully call <code>getLong</code>.
+     * <p>
+     * A <code>RepositoryException</code> is thrown if another error occurs.
+     *
+     * @return A <code>long</code> representation of this value.
+     * @throws ValueFormatException if conversion to a <code>long</code> is not possible.
+     * @throws IllegalStateException if <code>getStream</code> has previously
+     * been called on this <code>Value</code> instance.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getLong();
+
+    /**
+     * Returns a <code>double</code> representation of this value.
+     * <p>
+     * If this value cannot be converted to a <code>double</code>, a
+     * <code>ValueFormatException</code> is thrown.
+     * <p>
+     * If <code>getStream</code> has previously been called on this
+     * <code>Value</code> instance, an <code>IllegalStateException</code> is thrown.
+     * In this case a new <code>Value</code> instance must be acquired in order to
+     * successfully call <code>getDouble</code>.
+     * <p>
+     * A <code>RepositoryException</code> is thrown if another error occurs.
+     *
+     * @return A <code>double</code> representation of this value.
+     * @throws ValueFormatException if conversion to a <code>double</code> is not possible.
+     * @throws IllegalStateException if <code>getStream</code> has previously
+     * been called on this <code>Value</code> instance.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getDouble();
+
+    /**
+     * Returns date representation of this value.
+     * <p>
+     * If this value cannot be converted to a <code>Calendar</code>, a
+     * <code>ValueFormatException</code> is thrown.
+     * <p>
+     * If <code>getStream</code> has previously been called on this
+     * <code>Value</code> instance, an <code>IllegalStateException</code> is thrown.
+     * In this case a new <code>Value</code> instance must be acquired in order to
+     * successfully call <code>getDate</code>.
+     * <p>
+     * A <code>RepositoryException</code> is thrown if another error occurs.
+     *
+     * @return date
+     * @throws ValueFormatException if conversion to a <code>Calendar</code> is not possible.
+     * @throws IllegalStateException if <code>getStream</code> has previously
+     * been called on this <code>Value</code> instance.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getDate();
+
+    /**
+     * Returns a <code>Boolean</code> representation of this value.
+     * <p>
+     * If this value cannot be converted to a <code>Boolean</code>, a
+     * <code>ValueFormatException</code> is thrown.
+     * <p>
+     * If <code>getStream</code> has previously been called on this
+     * <code>Value</code> instance, an <code>IllegalStateException</code> is thrown.
+     * In this case a new <code>Value</code> instance must be acquired in order to
+     * successfully call <code>getBoolean</code>.
+     * <p>
+     * A <code>RepositoryException</code> is thrown if another error occurs.
+     *
+     * @return A <code>Boolean</code> representation of this value.
+     * @throws ValueFormatException if conversion to a <code>Boolean</code> is not possible.
+     * @throws IllegalStateException if <code>getStream</code> has previously
+     * been called on this <code>Value</code> instance.
+     * @throws RepositoryException if another error occurs.
+     */
+    public function getBoolean();
+
+    /**
+     * Returns the <code>type</code> of this <code>Value</code>.
+     * One of:
+     * <ul>
+     * <li><code>PropertyType::STRING</code></li>
+     * <li><code>PropertyType::DATE</code></li>
+     * <li><code>PropertyType::BINARY</code></li>
+     * <li><code>PropertyType::DOUBLE</code></li>
+     * <li><code>PropertyType::LONG</code></li>
+     * <li><code>PropertyType::BOOLEAN</code></li>
+     * <li><code>PropertyType::NAME</code></li>
+     * <li><code>PropertyType::PATH</code></li>
+     * <li><code>PropertyType::REFERENCE</code></li>
+     * </ul>
+     * See <code>{@link PropertyType}</code>.
+     * <p>
+     * The type returned is that which was set at property creation.
+     */
+    public function getType();
+}
+
+?>
\ No newline at end of file

Added: incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFactory.php
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFactory.php?rev=208906&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFactory.php (added)
+++ incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFactory.php Sun Jul  3 04:58:33 2005
@@ -0,0 +1,43 @@
+<?php
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require_once 'PHPCR/Value.php';
+require_once 'PHPCR/ValueFormatException.php';
+require_once 'PHPCR/RepositoryException.php';
+
+/**
+ * The ValueFactory object provides methods for the creation Value
+ * objects that can then be used to set properties.
+ */
+interface ValueFactory
+{
+    /**
+     * Returns a Value object of with the specified value and an inferred
+     * type.
+     *
+     * @param the specified value
+     * @return a Value object
+     * @throws ValueFormatException if the specified value format is invalid
+     * @throws RepositoryException if a repository error occurs
+     */
+    public function createValue($value);
+
+}
+
+?>

Added: incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFormatException.php
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFormatException.php?rev=208906&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFormatException.php (added)
+++ incubator/jackrabbit/trunk/contrib/phpcr/PHPCR/ValueFormatException.php Sun Jul  3 04:58:33 2005
@@ -0,0 +1,38 @@
+<?php
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once 'PHPCR/RepositoryException.php';
+
+
+/**
+ * Exception thrown when an attempt is made to assign a
+ * value to a property that has an invalid format, given the type of the
+ * property. Also thrown if an attempt is made to read the value of
+ * a property using a type-specific read method of a type into which it is not
+ * convertable.
+ *
+ * @author Markus Nix <mn...@mayflower.de>
+ * @package phpcr
+ */
+class ValueFormatException extends RepositoryException
+{
+}
+
+?>
\ No newline at end of file