[PHPCR-84] make the query API work with i18n Created: 23/Oct/12  Updated: 14/May/13

Status: Open
Project: Doctrine PHPCR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Lukas Kahwe Assignee: Lukas Kahwe
Resolution: Unresolved Votes: 0
Labels: None


 Description   

when searching there must be some way to ensure that for translateable documents the right fields are filters. f.e. when using the child strategy then for the given columns the node name needs to be checked (nodename = phpcr_locale:fr). for attributes strategy the property name needs to be rewritten ("title" vs "phpcr_locale:fr-title").

it might not be possible to easily automate this.



 Comments   
Comment by David Buchmann [ 23/Oct/12 ]

sounds like asking for a PHPCR-ODM DQL , then we could handle this perfectly transparent. as an intermediate, a method to build the criterion for a field of a mapped entity would be the right way i think. you could even do that for non-multilang in case you mapped the documents field to some differently named PHPCR property.

Comment by Lukas Kahwe [ 24/Oct/12 ]

here is an example where i manually handle this:
https://github.com/symfony-cmf/SearchBundle/blob/master/Controller/PhpcrSearchController.php

if we were to do it automatically we might not need our own DQL, we could do a QOMWalker. however i doubt that we can fully automate this, since everything can be mixed. ie. one path can have any number of different strategies.

Comment by Lukas Kahwe [ 24/Oct/12 ]

btw .. it might make sense to always namespace the property names, even when using the child translation strategy. this could make it easier to deal with searching across mixed translation strategies.

Comment by Lukas Kahwe [ 11/Jan/13 ]

if we do this change we should provide a migration script

Comment by David Buchmann [ 25/Mar/13 ]

it gets even worse when translated and non-translated documents get mixed up. see for example the cmf sandbox menu admin (not multilang menu). it mixes translated and non-translated documents. since https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/pull/100 you can sort on columns, so sorting will half work half not.

Comment by David Buchmann [ 13/May/13 ]

there seem to be other solutions like descendant, but if we had join in jackalope-doctrine-dbal that could be a good option https://github.com/jackalope/jackalope-doctrine-dbal/issues/15

Comment by Willem-Jan [ 14/May/13 ]

I started working on the Join issue and will start working on this issue when the Join feature is more or less stable.

Generated at Tue May 21 20:59:38 UTC 2013 using JIRA 5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5.