Hi Devs,
Currently DocumentNames generated by DocumentNameFactory contains the fully
qualified document name at all times. And when they are serialized using
DocumentNameSerializer, they result in the fully qualified document name
string like "wiki:space.name".
The problem with this is that new xwiki components using
DocumentAccessBridge cannot use relative document names. For an example,
"parent" field of a document cannot be set w.r.t the current wiki because
the "wiki:" part is always appended by default (by the serializer). So we
need a mechanism to specify "what kind of document name" we mean (relative
or absolute).
We can achive this in many ways:
1. Allow pasing a Serializer into methods which takes in a DocumentName.
2. Allow associating a Serilizer with a DocumentName.
3. Use Execution as a means of passing the preferred Serializer
4. Use a flag inside DocumentName (ABSOLUTE, WIKI_RELATIVE, SPACE_RELATIVE)
which will be intepretted by the Serializer appropriately whenever a
DocumentName is serialized.
None of the above approaches are perfectly clean. But the fourth approach
seems to make more sense.
I'm +1 for 4.
Thanks.
- Asiri