-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add version restore functionality to transport layer #283
Open
danrot
wants to merge
12
commits into
jackalope:2.x
Choose a base branch
from
danrot:version-restore
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+126
−25
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
49e2a36
implemented VersioningInterface
danrot 5b759ab
fixed tests for versioning
danrot c40c703
adjusted tests to skip not yet supported ones
danrot 0c74057
updated phpcr-utils
danrot 4b7b9e2
updated dependencies
danrot c1055e6
enabled version history tests
danrot 14b2a99
added required versioning properties to test fixtures
danrot 0504963
removed the test for write protection
danrot 4682466
cleaned code
danrot 9a359b3
added restore functionality to transport layer
danrot bf93ebd
fixed generation of invalid xml in fixtures
danrot d5b4a6a
create jcr:system and jcr:versionStorage nodes for testing
danrot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
namespace Jackalope\Transport\DoctrineDBAL; | ||
|
||
use Jackalope\NamespaceRegistry; | ||
use Jackalope\Version\GenericVersioningInterface; | ||
use Jackalope\Version\VersionHandler; | ||
use PHPCR\LoginException; | ||
|
@@ -30,6 +31,8 @@ | |
use PHPCR\Util\ValueConverter; | ||
use PHPCR\Util\UUIDHelper; | ||
use PHPCR\Util\PathHelper; | ||
use PHPCR\Version\LabelExistsVersionException; | ||
use PHPCR\Version\VersionException; | ||
use Doctrine\DBAL\Connection; | ||
use Doctrine\DBAL\DBALException; | ||
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; | ||
|
@@ -51,7 +54,6 @@ | |
use Jackalope\FactoryInterface; | ||
use Jackalope\NotImplementedException; | ||
use Jackalope\NodeType\NodeProcessor; | ||
use PHPCR\Version\VersionException; | ||
|
||
/** | ||
* Class to handle the communication between Jackalope and RDBMS via Doctrine DBAL. | ||
|
@@ -148,6 +150,7 @@ class Client extends BaseTransport implements QueryTransport, WritingInterface, | |
*/ | ||
private $coreNamespaces = array( | ||
NamespaceRegistryInterface::PREFIX_EMPTY => NamespaceRegistryInterface::NAMESPACE_EMPTY, | ||
NamespaceRegistry::PREFIX_REP => NamespaceRegistry::NAMESPACE_REP, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dbu Is this solution ok? Have now moved the constant to jackalope/jackalope instead of phpcr/phpcr. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, i think that is the correct thing to do |
||
NamespaceRegistryInterface::PREFIX_JCR => NamespaceRegistryInterface::NAMESPACE_JCR, | ||
NamespaceRegistryInterface::PREFIX_NT => NamespaceRegistryInterface::NAMESPACE_NT, | ||
NamespaceRegistryInterface::PREFIX_MIX => NamespaceRegistryInterface::NAMESPACE_MIX, | ||
|
@@ -1915,6 +1918,16 @@ private function getNodeProcessor() | |
return $this->nodeProcessor; | ||
} | ||
|
||
/** | ||
* Returns a handler for the versioning mechanism | ||
* | ||
* @return VersionHandler | ||
*/ | ||
private function getVersionHandler() | ||
{ | ||
return $this->versionHandler; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
|
@@ -2653,7 +2666,7 @@ public function checkoutItem($path) | |
*/ | ||
public function restoreItem($removeExisting, $versionPath, $path) | ||
{ | ||
throw new NotImplementedException(); | ||
return $this->versionHandler->restoreItem($removeExisting, $versionPath, $path); | ||
} | ||
|
||
/** | ||
|
@@ -2676,4 +2689,32 @@ public function setVersionHandler(VersionHandler $versionHandler) | |
|
||
$this->versionHandler = $versionHandler; | ||
} | ||
|
||
/** | ||
* Adds the label <code>label</code> to the specified version. | ||
* | ||
* @param string $versionName the absolute path to the version | ||
* @param string $label | ||
* @param boolean $moveLabel | ||
* | ||
* @throws LabelExistsVersionException if, the label is set to another version and | ||
* the parameter moveLabel is set to false. | ||
* | ||
* @throws RepositoryException in case of an other error. | ||
*/ | ||
public function addVersionLabel($versionName, $label, $moveLabel) | ||
{ | ||
// TODO: Implement addVersionLabel() method. | ||
} | ||
|
||
/** | ||
* Removes a label from the specified version. | ||
* | ||
* @param string $versionPath the absolute path to the version. | ||
* @param string $label the label, that has to be removed. | ||
*/ | ||
public function removeVersionLabel($versionPath, $label) | ||
{ | ||
// TODO: Implement removeVersionLabel() method. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert when merged