[BLOSSOM-15] Add "inheritance" to reuse parts of repo dialog configuration in Blossom configured dialogs. Created: 15/Sep/10  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Blossom
Component/s: None
Affects Version/s: 1.1
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Danilo Ghirardelli Assignee: Tobias Mattsson
Resolution: Won't Do Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Add the possibility to re-use dialogs configured in repo as prototypes for Blossom configured dialogs.
Sometimes there are just a couple of controls that you really need/like to configure through Blossom, and many that just fit well in the repo (so it's quicker to change live label/descriptions and such, or simply are already there). Sometimes also all the Blossom controls are in a single dialog tab, and all the other tabs of the dialog could have been loaded from the repo, or simply a repo-configured tab is shared among many dialogs.

@DialogFactory(value="my-dialog", prototype="some-other-dialog")
@Paragraph(value="my-paragraph", prototype="some-other-dialog")

When my-dialog (or the dialog for my-paragraph) is created it will include all the tabs and controls of some-other-dialog. That way you could configure some parts of your dialog in the repository, under a different dialog name.

A @TabFactory("Content") method would not create a new tab if one with the label "Content" already exists, instead it would add/remove/edit controls in it.
It would be nice to have also the same pattern on @TabFactory, like @TabFactory(value="Content", prototype="/config/modules/myModule/dialogs/dialog/tab/title") so a tab can inherit directly from some repo configured tab, overriding the DialogFactory prototype, if any.



 Comments   
Comment by Danilo Ghirardelli [ 15/Sep/10 ]

At the moment the @TabFactory annotation does not have @Inherited annotation, maybe it should have it but I don't know if this would cause side effects.

Comment by Danilo Ghirardelli [ 21/Sep/10 ]

I did a quick test and maybe this would be easy using an hidden (and undocumented) Magnolia feature, the "reference".
For instance, if in the TabBuilder constructor you create the new tab like this:

this.tab = new DialogTab();
try

{ this.tab.init(getRequest(), getResponse(), null, fakeConfigNode); }

catch (RepositoryException e)

{ // ignore }

this.tab.setLabel(label);
context.getDialog().add(tab);

you can pass a "fakeConfigNode" to the init method. If that node has only a property named "reference" with the path (in config repo) of the "parent" tab, everything works just like asked in the issue (DialogControlImpl.initializeConfig takes care of everything). The problem is just to create a temporary content with a single property with the value provided by the annotation.
The same idea is also appliable at dialog level.

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Sun Feb 11 23:29:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.