Pre Setup Settings

Topics: General
Aug 25, 2011 at 3:28 AM

Does Orchard support the ability to configure some settings before a module is setup? For instance, I want to provide an XYZ module but I want the site owner to have the ability to store data in MSSql, MySql, Oracle, Cloud, etc.
by selecting the data provider type setting BEFORE actually enabling the module. I invision a workflow like this
1) User downloads the module.
2) User initiates setup.
3) Module prompts the user for the data provider (or whatever) they want to use. A strategy pattern here used in the Migrations step would work.
4) Initialization continues.

I know Orchard will store some stuff in MSSql for the actual module registration, but everything else could be agnostic to storage. Is this currently possible with Orchard?


Aug 25, 2011 at 7:46 PM

Well, no, you can't directly do this today, but there may be a hacky way to do it.

You could have two features in your module: the actual feature XYZ and a SetupXYZ module. SetupXYZ could surface a message with a link to a screen that asks the user to choose a data provider, until a provider has been chosen. The XYZ module would look at this setting from its migration and would revert if it doesn't find the setting from SetupXYZ, with a message to the user explaining that they need to install and setup SetupXYZ before they attempt to use XYZ. If it does find the setting from SetupXYZ, it would disable the SetupXYZ feature.