Note that the JCR Repository Compliance specification defines a larger set of functions, but we want Jackalope to even work with very minimalistic backends. See the README.md in this folder for general information about the transport layer. This interface is now synchronized with what we had for davex as per 2011-12-28 TODO: keep this in sync with Transport/Jackrabbit/Client.php
Esempio n. 1
0
 /**
  * {@inheritDoc}
  *
  * @api
  */
 public function unregisterNamespace($prefix)
 {
     if (!$this->transport instanceof WritingInterface) {
         throw new UnsupportedRepositoryOperationException('Transport does not support writing');
     }
     $this->lazyLoadNamespaces();
     $this->checkPrefix($prefix);
     if (!array_key_exists($prefix, $this->userNamespaces)) {
         // we already checked whether this is a prefix out of the defaultNamespaces in checkPrefix
         throw new NamespaceException("Prefix {$prefix} is not currently registered");
     }
     $this->transport->unregisterNamespace($prefix);
     //remove the prefix from the local userNamespaces array
     unset($this->userNamespaces[$prefix]);
 }
Esempio n. 2
0
 /**
  * Load the descriptors into $this->descriptors
  *
  * Most of them come from the transport to allow for non-feature complete
  * transports.
  *
  * @return array Hashmap of descriptor names to descriptor values
  */
 protected function loadDescriptors()
 {
     $this->descriptors = array_merge($this->jackalopeNotImplemented, $this->transport->getRepositoryDescriptors());
 }
Esempio n. 3
0
 /** Creates a session
  *
  * Builds the corresponding workspace instance
  *
  * @param FactoryInterface  $factory       the object factory
  * @param Repository        $repository
  * @param string            $workspaceName the workspace name that is used
  * @param SimpleCredentials $credentials   the credentials that where
  *      used to log in, in order to implement Session::getUserID()
  *      if they are null, getUserID returns null
  * @param TransportInterface $transport the transport implementation
  */
 public function __construct(FactoryInterface $factory, Repository $repository, $workspaceName, SimpleCredentials $credentials = null, TransportInterface $transport)
 {
     $this->factory = $factory;
     $this->repository = $repository;
     $this->objectManager = $this->factory->get('ObjectManager', array($transport, $this));
     $this->workspace = $this->factory->get('Workspace', array($this, $this->objectManager, $workspaceName));
     $this->credentials = $credentials;
     $this->namespaceRegistry = $this->workspace->getNamespaceRegistry();
     self::registerSession($this);
     $transport->setNodeTypeManager($this->workspace->getNodeTypeManager());
 }
Esempio n. 4
0
 /**
  * Roll back the transaction associated with the current session.
  *
  * TODO: Make sure AccessDeniedException is thrown by the transport
  * if corresponding problems occur
  * TODO: restore the in-memory state as it would be if save() was never
  * called during the transaction. The save() method will need to track some
  * undo information for this to be possible.
  *
  * @throws AccessDeniedException if the session is not allowed to
  *      roll back the transaction.
  * @throws RepositoryException if the transaction implementation
  *      encounters an unexpected error condition.
  */
 public function rollbackTransaction()
 {
     $this->transport->rollbackTransaction();
     $this->notifyItems('rollbackTransaction');
 }
 /**
  * {@inheritDoc}
  */
 public function getAutoLastModified()
 {
     return $this->transport->getAutoLastModified();
 }
Esempio n. 6
0
 /**
  * Load the descriptors from the transport and cache them
  */
 protected function loadDescriptors()
 {
     $this->descriptors = $this->transport->getRepositoryDescriptors();
 }