Hi everyone,
so as part of my work on refactoring I started working on a relative resolvers to ResourceReference and in the ends it appeared that I needed a supplementary information in EntityReference when it’s relative, to know how to properly resolve it.
@tmortagne managed after a long discussion to explain to me that the info we need is for the resolver to be able to properly perform the resolution by selecting the proper parts in the base reference. And he proposed that instead of providing an artificial boolean value API in EntityReference we’d provide instead a new method EntityType getParentType()
which would avoid letting the resolvers to compute that info, and which could be set when creating the reference.
We also agreed that best for storing that information would be the parameters of the EntityReference, since we always have all mechanism to serialize/parse those, and we already do that for the Locale in some references.
Regarding the name of the key for the parameter I propose to use parentType
as we use locale
for the locale key parameter.
So the 3 questions are:
- Do you agree with adding a new method
getParentType()
in EntityReference? - Do you agree with storing that in the map of parameters using
parentType
as key? - Do you agree about backporting those changes in future LTS (16.10.x)?
Question 3 is because all this work is originally done for fixing Loading...
Note that you can check the status of the changes I propose here in that PR: XWIKI-22702: Provide parentType information in EntityReference by surli · Pull Request #3698 · xwiki/xwiki-platform · GitHub
3 posts - 3 participants