Giter VIP home page Giter VIP logo

jackalope's Introduction

Jackalope Test application Static analysis

A powerful implementation of the PHPCR API.

You can use Jackalope with different storage backends. For now, we support:

  • relational databases with the DoctrineDBAL backend. Works with any database supported by doctrine (mysql, postgres, ...) and has no dependency on java or jackrabbit. For the moment, it is less feature complete. See jackalope-doctrine-dbal
  • Jackrabbit server backend supports many features and requires you to simply install a .jar file for the data store component. See jackalope-jackrabbit

Discuss on [email protected] or visit #jackalope on irc.freenode.net

License

This code is dual licensed under the MIT license and the Apache License Version 2.0. Please see the file LICENSE in this folder.

Install instructions

Go to the repository of the storage backend you want and follow the instructions there.

Implementation notes

See doc/architecture.md for an introduction how Jackalope is built. Have a look at the source files and generate the phpdoc.

Contributors

jackalope's People

Contributors

adou600 avatar alexander-schranz avatar beberlei avatar brki avatar chirimoya avatar chregu avatar cryptocompress avatar cystbear avatar damz avatar danrot avatar dantleech avatar dbu avatar ebi avatar exsio avatar justinrainbow avatar lapistano avatar lsmith77 avatar middlebrain avatar nicam avatar ornicar avatar pavelvondrasek avatar petesiss avatar rndstr avatar sarcher avatar seldaek avatar toflar avatar uwej711 avatar vdrnn avatar wachterjohannes avatar wouterj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jackalope's Issues

issues with move and add

this test fails (even with the jsop jackrabbit transport) phpcr/phpcr-api-tests@a512c88

i wonder if we should, instead of calculating a changeset, just record all operations with the transport. but that would be a rather drastic change and could lead to quite some overhead when the phpcr user is not doing things straightforward.

btw #99 is an internal state issue, i think it is not related to this problem here

Possible recursion bug

I was trying to run a script that imports data into jackrabbit. After running for a very long time, at some point it died due to memory exhaustion.

The stack trace looked a bit suspicious, since there's 1200 calls to the same functions over and over. It looks like a potential recursion bug.

The tail of the stack trace:

967.7610  990701032 1165. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
967.7610  990701032 1166. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
967.7611  990701032 1167. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
967.8066  996698872 1168. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
967.8067  996698872 1169. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
967.8067  996698872 1170. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
967.8067  996698872 1171. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
967.8555 1002716904 1172. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
967.8556 1002716904 1173. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
967.8556 1002716904 1174. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
967.8556 1002716904 1175. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
967.9026 1008754872 1176. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
967.9026 1008754872 1177. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
967.9026 1008754872 1178. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
967.9027 1008754872 1179. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
967.9517 1014813064 1180. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
967.9518 1014813064 1181. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
967.9518 1014813064 1182. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
967.9518 1014813064 1183. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
967.9997 1020891704 1184. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
967.9998 1020891704 1185. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
967.9998 1020891704 1186. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
967.9998 1020891704 1187. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
968.0897 1026990200 1188. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
968.0898 1026990200 1189. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
968.0903 1027514048 1190. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
968.0903 1027514048 1191. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
968.1374 1033632624 1192. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
968.1375 1033632624 1193. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
968.1375 1033632624 1194. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
968.1375 1033632624 1195. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
968.1869 1039771320 1196. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
968.1870 1039771320 1197. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
968.1870 1039771320 1198. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
968.1870 1039771320 1199. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
968.2343 1045930232 1200. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
968.2343 1045930232 1201. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
968.2343 1045930232 1202. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
968.2344 1045930232 1203. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
968.3044 1052109176 1204. Jackalope\ObjectManager->purgeDisappearedNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:986
968.3045 1052109176 1205. Jackalope\Node->getIdentifier() /Users/me/project/vendor/jackalope/src/Jackalope/ObjectManager.php:1518
968.3045 1052109176 1206. Jackalope\Item->checkState() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:580
968.3045 1052109176 1207. Jackalope\Node->refresh() /Users/me/project/vendor/jackalope/src/Jackalope/Item.php:522
968.3046 1052109512 1208. Jackalope\Transport\Jackrabbit\Client->getNode() /Users/me/project/vendor/jackalope/src/Jackalope/Node.php:982

Contact me for more details.

Offset doesn't work without limit

setOffset is doing weird things with there is no limit set.

With the current implementation, setting an offset and no limit has no effect (returns the same nodes as if there was no offset specified).

I found this:

https://github.com/jackalope/jackalope/blob/master/src/Jackalope/Transport/Jackrabbit/Client.php#L686

if (null !== $limit || null !== $limit) {

I changed the second null !== $limit for null !== $offset, and whit that change, the behaviour is:

  • It returns correctly (total number of results) - offset nodes.
  • The first node is the same as if you don't apply offset at all.

I am experiencied this while implementing findBy of the ODM using QOM, I arrived here, but no clue on how to continue. I can provide code to test this (broken tests for that findBy method and the method itself).

Cleanup reading in NodeType

implement the Read part of the NodeType

there are unit tests, but we miss api tests and probably some finishing work

  • complete the api tests
  • implement the primary node feature that allows to define some sort of "default" child for a node.
  • implement templates
  • type exists exception
  • InvalidNodeTypeDefinitionException

Versioning: implement labels

getting and setting version labels could be used to build simple workflows.

the methods are

VersionHistory::addVersionLabel
VersionHistory::getVersionByLabel
VersionHistory::getVersionLabels
VersionHistory::hasVersionLabel
VersionHistory::removeVersionLabel

when fixed, also update Repository::jackalopeNotImplemented

2 failing tests related to descriptor reading

There were 2 errors:

  1. PHPCR\Tests\Connecting\RepositoryDescriptorsTest::testDescriptorKeys
    PHPCR\RepositoryException: Unexpected error:
    CURL Error:
    Response (HTTP 401): REPORT array (
    'http://localhost:8080/server/' => 'http://localhost:8080/server/',
    )

/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:468
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:392
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:287
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:481
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Client.php:283
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Repository.php:164
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Repository.php:119
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/tests/phpcr-api/tests/04_Connecting/RepositoryDescriptorsTest.php:33

  1. PHPCR\Tests\Connecting\RepositoryDescriptorsTest::testDescription
    PHPCR\RepositoryException: Unexpected error:
    CURL Error:
    Response (HTTP 401): REPORT array (
    'http://localhost:8080/server/' => 'http://localhost:8080/server/',
    )

/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:468
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:392
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:287
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:481
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Client.php:283
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Repository.php:153
/Users/lsmith/htdocs/symfony-standard/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/tests/phpcr-api/tests/04_Connecting/RepositoryDescriptorsTest.php:46

Implement Session based namespace remapping

we only have support to handle namespaces and add namespaces, but not to remap them locally in a session (mostly useful in case of namespace prefix collisions).
the session remapping is probably tricky as we need to rewrite all the paths for the storage layer.

basically we need to str_replace the local namespace with the backend namespace and back whenever we talk to the backend. or use the backend namespace internally and replace on all requests and results, but that is probably even more difficult.

when fixed, also update Repository::jackalopeNotImplemented

Use Jackrabbits diff/patch methods to save content for the jackalope transport

as a long (or middle) term goal we should thinking about switching to
the diff/patch format, which could boost write performance and make it
easier. Jackalope just replays on .save() what was done before, so one
would just have to record that logfile and replay it.

eg.

Node f = root.addNode("foo");
f.addNode("a");
f.addNode("b");
Node c = f.addNode("c");
c.setProperty("foo","bar");
f.orderBefore("a","c");
f.orderBefore("b","a");
c.remove();
f.addNode("c");
s.save();*

ends up in

+/foo : {"jcr:primaryType":"nt:unstructured"}
+/foo[4]/a : {"jcr:primaryType":"nt:unstructured"}
+/foo[4]/b : {"jcr:primaryType":"nt:unstructured"}
+/foo[4]/c : {"jcr:primaryType":"nt:unstructured"}
^/foo[4]/c/foo : "bar"
> /foo[4]/a : c#before
> /foo[4]/b : a#before
-/foo[4]/c :
+/foo[4]/c : {"jcr:primaryType":"nt:unstructured"}

This needs quite some changes/additions in jackalope (we have to call
the transport on every write operations, so that it can record the
history, if needed and not only on save like we do now. Or build up our
own log, which the transport can read on save), but should simplify
things, afaics now

tests/README.md outdated?

Following instructions in tests/README.md results in phpunit help/syntax message dumped to stdout after running command sequence "cd tests; phpunit;" at the command line. The correct setup or command-line parameters for running the tests should be reflected on this README to make running tests accessible to new users.

only create SQL(1) and XPATH queries if transport can handle them

follow-up of #110

need to build getSupportedQueryLanguages into Transport\QueryInterface. at the moment QueryManager::getSupportedQueryLanguages is not telling the thruth anyways, it has to return all languages we support. i guess we should redirect getSupportedQueryLanguages to transport and call it in createQuery to check if we should create that type of query.

the Transport\QueryInterface has a TODO about getSupportedQueryLanguages already btw

path invalid characters (on Jackrabbit)

Since Jackrabbit allows me to add files with "&" character in it I guess Jackalope would also have to allow me to read those paths.

Exception Message: Path is not well-formed or contains invalid characters: /edu/jhu/pha/www/einstein/stuff/einstein&music.pdf

improve code coverage

we should check the code coverage and improve it with either more phpcr-api tests or unit or functional tests in jackalope.

for example, the jackrabbit transport has two methods that read a stream and until #44 one closed the stream as it should but the other left it open.

Doctrine fixture conversion needs to include namespaces

There are a couple of export tests failing on Doctrine DBAL because the custom namespaces are not properly exported:

PHPCR\Tests\Export\ExportRepositoryContentTest::testExportDocumentView
DOMDocument::loadXML(): Namespace prefix test on namespacedNode is not defined in Entity, line: 2

/projects/PHPCR/jackalope/tests/phpcr-api/tests/07_Export/ExportRepositoryContentTest.php:106

I traced that to the namespace prefix registrations not being in the database in the first place. Because the test fixtures are not going through a real import process, but are converted into PHPUnit DB fixtures by the generate_doctrine_dbal_fixture.php script, shall we just add support for namespaces in this script?

Damien

Backend error on adding new mixin type to node already having a mixin type

Adding a new mixin type to a node that already has another mixin type fails. This is either a special case of mixin or maybe even a general issue with multivalue properties.

see 10_Writing/NodeTypeAssignmentTest::testAddMixinTwice

on the update, jackalope transport sends this:

PROPPATCH /server/tests/jcr:root/tests_write_nodetype/testAddMixinTwice HTTP/1.1
Authorization: Basic YWRtaW46YWRtaW4=
Host: localhost:8080
Accept: */*
Depth: 0
Content-Type: text/xml; charset=utf-8
User-Agent: jackalope-php/1.0
TransactionId: <opaquelocktoken:9e96b564-5b32-47b2-ac96-8bbdc894d8c7>
Content-Length: 370

<?xml version="1.0" encoding="UTF-8"?><D:propertyupdate xmlns:D="DAV:"><D:set><D:prop><dcr:mixinnodetypes xmlns:dcr="http://www.day.com/jcr/webdav/1.0"><dcr:nodetype><dcr:nodetypename>mix:referenceable</dcr:nodetypename></dcr:nodetype><dcr:nodetype><dcr:nodetypename>mix:mimeType</dcr:nodetypename></dcr:nodetype></dcr:mixinnodetypes></D:prop></D:set></D:propertyupdate>

while jackrabbit uses the diff format:

POST /server/tests/jcr%3aroot/ HTTP/1.1
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: Jakarta Commons-HttpClient/3.0
Host: localhost:8080
Content-Length: 717
Content-Type: multipart/form-data; boundary=m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm

--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm
Content-Disposition: form-data; name="/tests_write_nodetype/testAddMixinTwice/jcr:mixinTypes"
Content-Type: jcr-value/name; charset=UTF-8
Content-Transfer-Encoding: 8bit

mix:referenceable
--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm
Content-Disposition: form-data; name="/tests_write_nodetype/testAddMixinTwice/jcr:mixinTypes"
Content-Type: jcr-value/name; charset=UTF-8
Content-Transfer-Encoding: 8bit

mix:mimeType
--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm
Content-Disposition: form-data; name=":diff"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

^/tests_write_nodetype/testAddMixinTwice/jcr:mixinTypes : []
--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm--

we have to figure out whether there is some way to specify the change in the xml format correctly, or we have to implement the diff stuff.

  1. test if this is mixin specific or relevant for all multivalue properties
  2. see if the xml format can update multivalue or if we need to do the diff
  3. implement solution

Do not use dirname to get parent path

We should abstract getting the parent path into one method (maybe even in phpcr-utils) and remove any calls to dirname from jackalope, as this can fail on windows (see 2b6fdbd and grep for dirname in the code)

add to travis CI

the travis-ci guys said that either a JVM is already available or if not they can add it.
would also be nice to get the DBAL one running on there.

jackrabbit: better error message on invalid credentials

the exception we get when the credentials are invalid is very confusing. it should be improved to throw a LoginException and say something like "the backend did not accept our credentials"

PHPCR\RepositoryException: Unexpected error:
CURL Error:
Response (HTTP 401): PROPFIND array (
'http://127.0.0.1:8080/server/tests' => 'http://127.0.0.1:8080/server/tests',
)

/home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:473
/home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:397
/home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:289
/home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Request.php:486
/home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Transport/Jackrabbit/Client.php:253
/home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/vendor/jackalope/src/Jackalope/Repository.php:99

performance optimizations

  • do a performance analysis
  • identify main bottlenecks
  • improve the bottlenecks
  • some suspected problems are tagged with //OPTIMIZE
  • look for places where we could use getNodes or getNodesByIdentifier, instead of looping

ideas:

  • have a flexible cache object injected into ObjectManager. write one that uses memcache instead of the array to persist the cache over requests (will require some cache outdate logic, plus changes to make sure permissions are respected and local modifications don't leak into other sessions)
  • play with the depth parameter to retrieve more than one node in one request - but if we do that stupidly, we might slow everything down as we could retrieve way too many nodes. provide a way for hints, or learning, or whatever.
  • have a clever iterator for Node::getNodes that fetches a couple of nodes at a time to scale with large number of children (see FIXME in #95)

better error messages when a property namespace isn't registered

jackalope itself should check for valid namespace prefixes.

jackalope-doctrine-dbal fails during save with

Notice: Undefined index: phpcr_locale in .../jackalope-doctrine-dbal/src/Jackalope/Transport/DoctrineDBAL/Client.php line 440

jackalope-jackrabbit fails on save too, while talking to the backend

Sending this message without having "phpcr" registered as a namespace:
string(625) "<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" sv:name="user"><sv:property sv:name="jcr:primaryType" sv:type="Name">sv:valuent:unstructured/sv:value/sv:property<sv:property sv:name="username" sv:type="String">sv:value/sv:value/sv:property<sv:property sv:name="numbers" sv:type="Long">sv:value3/sv:valuesv:value1/sv:valuesv:value2/sv:value/sv:property<sv:property sv:name="phpcr:class" sv:type="String">sv:value/sv:value/sv:property/sv:node"

Leads to this is the response:
string(317) "<D:error xmlns:D="DAV:"><dcr:exception xmlns:dcr="http://www.day.com/jcr/webdav/1.0">dcr:classjavax.jcr.InvalidSerializedDataException/dcr:classdcr:messageillegal property name: {http://www.jcp.org/jcr/sv/1.0}property/dcr:message/dcr:exception/D:error"

And finally this exception:
PHPCR\InvalidSerializedDataException: HTTP 400: illegal property name: {http://www.jcp.org/jcr/sv/1.0}property

issue with remove on a parent that has children

i don't have time to isolate this as i managed to fix this via a work around. the issue can also be inside the ODM.

essentially in a single session i have created a parent node with new children via the ODM and then try to remove the parent node i end up with an issue inside Jackalope where it fails because it decides it cannot remove a node because its already marked as deleted.

Essentially it seems like remove() is being called multiple times for the same node. Again the issue could be in the ODM, but I suspect its in Jackalope.

The current work around I did was to use Jackalope's session directly and first remove the children and then the parent. However I just tried only removing the parent via Jackalope and that seemed to work .. so maybe its an ODM issue after all. Maybe caused by cascading the delete .. which is probably not necessary?

Implement Chapter 12: Observation

JCR defines an observation interface. In php we would have to register all observers on every request, which is not realistic and potentially a huge performance issue. To work around that, we could implement an javax.jcr.observation.EventListener (in Java) that can be configured for events and calls an URL or php cli to let php developers react to the event.

http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/index.html > javax.jcr.observation

For the pure php backend, the same configuration could be used to launch events based on repository operations.

Fully implementing the javax.jcr.observation classes in PHPCR is probably not going to work, as we do not have a long running server instance. So the listener would have to be instantiated first and be able to bootstrap itselves and whatnot. Nonetheless ObservationManager.getEventJournal could be useful.
We could also re-use the EventListener interface to allow defined communication between the storage backend and the event listener.

the spi uses a poll model. that is, the server stores all registered events and the client can do a poll for events. we should build on this model.

move transport layers to their own repo

This would have several benefits:

  1. easier to deal with different groups of maintainers
  2. separate release cycles
  3. easier to handle CI setup
  4. clearer dependencies
  5. better visibility for the different transports

The draw back would be one more dependency for users to configure.

In terms of work we would best do a subtree split of the current 2 transports (we could do the same with @chirimoya's fork).
The phpcr-api-tests would then have to be setup to run on the transport repositories. The jackalope unit tests would then likely need to be split, some remaining with Jackalope and any transport specific ones moved to the given transport.

explore adding a converter for SQL2 to QOM

SQL2 and QOM are required by the JCR spec, with such a converter implementations would only need to implement QOM and could rely on Jackalope to convert SQL2 to QOM queries.

adding node after refresh fails

pseudocode

$node = addNode
$session->save
$session->refresh
$node->addNode
$session->save

=> second node is not added. the internal state seems to get messed up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.