At one point i was considering adding support for dialog "inheritance" that
would've worked like this:
@DialogFactory(value="my-dialog", prototype="some-other-dialog")
public class MyDialog {
}
When my-dialog 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 controls to it.
In the end i decided not to include it because i didnt see a need for it and
its pretty complex.
Does this idea solve your problem?
Perhaps you might also require a @TabFactory(value="Content",
prototype="/config/modules/myModule/dialogs/dialog/tab/title") ?
Another way of solving this is just doing what you're already doing but
abstracting the logic to a helper class.
// Tobias
On Sep 10, 2010, at 6:41 PM, Danilo Ghirardelli wrote:
>
> Hi all,
> I started using Blossom, and I have a question about dialog configuration: is
> there any easy way to mix the configuration by annotation with the one of the
> standard dialog in the config repo?
> Usually I have just a couple of controls that I really need/like to configure
> through Blossom (and it's really a wonderful lovely feature!), and many that
> just fit well in the repo (so it's quicker to change live label/descriptions
> and such). 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.
> As a side problem, some controls do most of their self configuration in the
> init method (yep! :-), so setting config values after getting the control
> from the factory is just pointless. I'm talking about SelectMedia of media
> module or even simply having a DialogSelect taking options from a path/repo
> (using Blossom, obviously), because setting those config values after init
> would do nothing, and the tabBuilder method will fill with code that loads
> options from the repo and set them just like what DialogSelect does
> internally.
>
> My solution for both problem until now is to do this:
>
> Content configNode =
> MgnlContext.getHierarchyManager(ContentRepository.CONFIG).getContent(
> "/modules/myModule/dialogs/myParagraph/tabMy/myDialog", false,
> ItemType.CONTENTNODE);
> DialogSelect select =
> DialogFactory.getDialogSelectInstance(dialogContext.getRequest(),
> dialogContext.getResponse(), dialogContext.getWebsiteNode(), configNode);
>
> I load a config node and pass it to the factory instead of the Blossom
> provided config node. I don't know why but this solution doesn't feel "right"
> to me, so I'm asking for advice.
> Is there a better way to have the same result (a control configured with a
> repo config in a Blossom context)? Would it be possible to do the same with
> some annotations?
> And the last problem: how to do the same with an entire tab? The tab is
> passed already initialized to the @TabFactory paragraph methods, and
> DialogBuilder has no other way to add a tab than using the label.
> I'd like to hear your thoughts about this topic. Thank you.
>
> Regards, Danilo.
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------