[xwiki-devs] [Proposal][Model] ModelContext getCurrentEntity()

2009-12-21 Thread Vincent Massol
Hi devs, I'm still working on the Model Reference domain. We've brainstormed with Thomas and we'd like to propose replacing the current ModelContext.getCurrentDocumentName() by ModelContext.getCurrentEntityReference() (which returns an EntityReference). The idea is that a URL could

Re: [xwiki-devs] [Proposal][Model] ModelContext getCurrentEntity()

2009-12-21 Thread Thomas Mortagne
On Mon, Dec 21, 2009 at 10:29, Vincent Massol vinc...@massol.net wrote: Hi devs, I'm still working on the Model Reference domain. We've brainstormed with Thomas and we'd like to propose replacing the current ModelContext.getCurrentDocumentName() by ModelContext.getCurrentEntityReference()

Re: [xwiki-devs] [Proposal][Model] ModelContext getCurrentEntity()

2009-12-21 Thread Asiri Rathnayake
On Mon, Dec 21, 2009 at 2:59 PM, Vincent Massol vinc...@massol.net wrote: Hi devs, I'm still working on the Model Reference domain. We've brainstormed with Thomas and we'd like to propose replacing the current ModelContext.getCurrentDocumentName() by ModelContext.getCurrentEntityReference()

Re: [xwiki-devs] [Proposal][Model] ModelContext getCurrentEntity()

2009-12-21 Thread Thomas Mortagne
On Mon, Dec 21, 2009 at 18:10, Asiri Rathnayake asiri.rathnay...@gmail.com wrote: On Mon, Dec 21, 2009 at 2:59 PM, Vincent Massol vinc...@massol.net wrote: Hi devs, I'm still working on the Model Reference domain. We've brainstormed with Thomas and we'd like to propose replacing the current

Re: [xwiki-devs] [Proposal][Model] ModelContext getCurrentEntity()

2009-12-21 Thread Asiri Rathnayake
Hi Thomas, May be we can avoid the enum type by using generics? T extends EntityReference T getCurrentEntityReference(); Not sure if this is a good practice though. Generic does not exist in the bytecode so impossible to know that you want the EntityType.WIKI if you don't explicitly

Re: [xwiki-devs] [Proposal][Model] ModelContext getCurrentEntity()

2009-12-21 Thread Sergiu Dumitriu
On 12/21/2009 07:31 PM, Asiri Rathnayake wrote: Hi Thomas, May be we can avoid the enum type by using generics? T extends EntityReference T getCurrentEntityReference(); Not sure if this is a good practice though. Generic does not exist in the bytecode so impossible to know that you