/** * Populate the version history */ private function populateVersionHistory() { // Use the web service API to get the version history for this node $client = WebServiceFactory::getAuthoringService($this->_node->session->repository->connectionUrl, $this->_node->session->ticket); $result = $client->getVersionHistory(array("node" => $this->_node->__toArray())); //var_dump($result); // TODO populate the version history from the result of the web service call }
public function createVersion($description = null, $major = false) { // We can only create a version if there are no outstanding changes for this node if ($this->isDirty() == true) { throw new Exception("You must save any outstanding modifications before a new version can be created."); } // TODO implement major flag ... $client = WebServiceFactory::getAuthoringService($this->_session->repository->connectionUrl, $this->_session->ticket); $result = $client->createVersion(array("items" => array("nodes" => $this->__toArray()), "comments" => array("name" => "description", "value" => $description), "versionChildren" => false)); // Clear the properties and aspects $this->_properties = null; $this->_aspects = null; // Get the version details // TODO get some of the other details too ... $versionId = $result->createVersionReturn->versions->id->uuid; $versionStoreScheme = $result->createVersionReturn->versions->id->store->scheme; $versionStoreAddress = $result->createVersionReturn->versions->id->store->address; // Create the version object to return return new Version($this->_session, new Store($this->_session, $versionStoreAddress, $versionStoreScheme), $versionId); }