We are building a large set of pages for our Intranet with (nearly) identical web parts (these are actually search results and refiner WPs with fixed queries, but the details aren't really relevant) Only a few of the WP properties will vary across pages, the rest should be the same for consistency. Creating and maintaining these page WP configurations manually is going to be a lot of effort -- we could use custom web part definitions to provide some level of reuse, but that only helps with the initial setup; if (when!) we need to make changes to the WP config, we will still have to change each one individually.
So what I'd like to do is find a way to centralize the configuration for all of the related web parts,and make it dynamic, i.e. the web parts should get property definitions at load time, vs coming from the personalization store. That way if we need to update a web part property, we need change it only once, rather than for every individual web part.
I'm thinking about leveraging the existing web part gallery for the location of the shared configuration, as it seems like a reasonable place to capture definitions. What I'm not sure about is how/where to use it.
One thought is to create a custom, generic "wrapper" web part class whose only configuration is a path to a .webpart/.dwp file in the site WP gallery. When the wrapper WP is loaded, it in turn creates a child web part (transient, not persisted) on the fly using the web part definition. The complexity comes with the requirement to override the common, shared properties for any given WP instance. Not sure how to allow a page author to specify these overrides in a general way.
Another possibility is hooking into the web part persistence mechanism, hacking the Load operation to pull certain properties from the central config vs the stored WP instance definition.
Has anyone come across something like this? Any ideas or suggestions?
Thanks,
Peter