On Mar 7, 2013, at 9:35 AM, Marius Dumitru Florea <mariusdumitru.florea(a)xwiki.com>
wrote:
On Wed, Mar 6, 2013 at 12:36 PM, Vincent Massol
<vincent(a)massol.net> wrote:
Resending since I've made mistakes (it's
only about ObjectReference, not Properties), sorry about that. Here's the new
version:
------------
Hi devs,
ATM in the model module there's no ability to reference an xobject other than by
using a free form name. The problem is that this is not really usable. This is why we
introduced the BaseObjectReference in oldcore.
However this is major PITA since we can't have clean code that create an object
reference and that doesn't depend on oldcore.
I'd like to propose the following:
* Modify ObjectReference to add 2 named parameters: Class reference and position
* Make the name optional in EntityReference
This means that when we use an EntityReferenceResolver to resolve
"wiki:space.page^wiki2:space2.page2" we get an ObjetReference with:
* name = null
* param1: name = "classReference", value = EntityReference
* param2: name = "objectPosition", value = 0
Rationale:
* This is exactly what we already do for Locale (and what we'll do for Version too
probably) so it's logical to do it for Object References too
Consequences:
* We need to modify the Seralizers/Resolvers accordingly
* We need to modify EntityReference to support a
null name
This doesn't sound right to me. Why not store the object position in
the entity name?
The entity name is a string. It's a black box and you shouldn't have to use a
resolver to make anything out of it.
Supposing we add support for free-text in object
names, I'm sure there will be users (including me) that will name
their object using a number, and that number will be the object index.
That's not the proposal Marius.
The proposal is that in the syntax: "wiki:space.page^wiki1.space1.page1[N]", the
"wiki1.space1.page1[N]" part is NOT the object name but a class ref +
index/number.
To specify a name you'd use another syntax (that doesn't exist yet). For example:
"wiki:space.page^^freeformname".
Thanks
-Vincent
Thanks,
Marius
> * We deprecate BaseObjectReference
> * Probably some other stuff to modify like modifying event listeners listening on
objects since it's now going to be much easier, etc
>
> WDYT?
>
> Thanks
> -Vincent
>
>
> On Mar 5, 2013, at 9:35 PM, Vincent Massol <vincent(a)massol.net> wrote:
>
>> Hi devs,
>>
>> ATM in the model module there's no ability to reference an xobject other than
by using a free form name. The problem is that this is not really usable. This is why we
introduced the BaseObjectProperty in oldcore.
>>
>> However this is major PITA since we can't have clean code that create an
object reference and that doesn't depend on oldcore.
>>
>> I'd like to propose the following:
>> * Modify ObjectProperty to add 2 named parameters: Class reference and position
>> * Make the name optional in EntityReference
>>
>> This means that when we use an EntityReferenceResolver to resolve
"wiki:space.page^wiki2:space2.page2" we get an ObjetReference with:
>> * name = null
>> * param1: name = "classReference", value = EntityReference
>> * param2: name = "objectPosition", value = 0
>>
>> Rationale:
>> * This is exactly what we already do for Locale (and what we'll do for
Version too probably) so it's logical to do it for Object References too
>>
>> Consequences:
>> * We need to modify the Seralizers/Resolvers accordingly
>> * We need to modify EntityReference to support a null name
>> * We deprecate BaseObjectProperty
>> * Probably some other stuff to modify like modifying event listeners listening on
objects since it's now going to be much easier, etc
>>
>> WDYT?
>>
>> Thanks
>> -Vincent