Hi,
We are customizing Broadleaf to meet our specific needs. In doing do we have extended ProductSkuImpl to add extra attributes, including a couple of ManyToOne relationships. We have created a custom Presenter / View and registered them. This is working fine.
We are now trying to customize the Admin to provide the Search support for these attributes, which requires adding AdditionalForeignKey entries to the "productDS". The problem we are running in to is in our implementation of setup(). We don't want to lose all the additional capabilities of OneToOneProductSkuPresenter, so we are extending and overriding. However, if we call super.setup() then OneToOneProductSkuPresenter will already have declared the "productDS" and called setupDisplayItems. Even more so, a bunch of the other PresenterSetupItems will have gotten a reference to "productDS" and added Search Form Items. After super.setup() returns seems to be too late to try and augment "productDS" with extra ForeignKey entries - I can't get the new attribute to appear in the "right-side" Dynamic Form.
Do we, today, have no other option but to copy the entire OneToOneProductSkuPresenter.setup() code into our presenter, and not call super.setup()?
If this is the case you might want to consider refactoring the way you setup the "top" datasource to call a "template method". This way a subclass could drop in a replacement and it would allow easier extension.
Thanks,
- John
This forum is in readonly mode and serves as an archive of old information. All posting, registration and commenting abilities have been turned off. To get help, the Broadleaf team reguarly monitors the broadleaf-commerce tag on Stack Overflow so please ask your questions there.