Select themeIds from plugins in Designer Xsp Properties Editor
A couple of months back I did a blog post demonstrating how you could modify the source code of the extension library designer tooling, to allow your own plugins to make contributions to the Theme selection drop-down.
I also posted a feature request to the Extension Library Project on OpenNTF, I quickly got a response from Gary Marjoram that they were already thinking about this and to keep a lookout for future releases.
Well the IBM team have just released Release 9 (R09) of the 9.0.1 Extension library and I am happy to see Gary has included his fix for this in this release. Here is the text from the Readme.pdf file within the release download:
Enhancements to the theme combo boxes in the Xsp Properties editor
Currently, to contribute a theme to the XPages runtime, you must use the StyleKitFactory
interface via the com.ibm.commons.Extension extension point.
With this release of the Extension Library (ExtLib), you can also contribute themeIds to
the theme combo boxes in the Xsp Properties editor of Domino Designer. To do this, in
your implementation of StyleKitFactory, you must also implement StyleKitListFactory and
return an array of themeIds from the getThemeIds method.
Note: ThemeIds contributed via the StyleKitListFactory interface are also used in the
JUnit tests.
As a further enhancement to theme combo boxes, themes defined within the application
are postfixed with an “(Application)” label to distinguish them from other themes.
So I thought I better check this out! I downloaded and installed ExtLib 9.0.1 R09 to my Domino Designer.
Then I made the necessary changes to my bootswatch themes ‘fragment’ plugin as follows:
I made my existing StyleKitFactory also implement StyleKitListFactory
An then implemented the getThemeIds method. This is the method which the Xsp Properties editor will use to get the list of contributing themes
Then Installed this new plugin to Designer, restarted and it worked a charm
To verify I selected ‘anytheme_youlike’ and saved, then inspected the actual xsp.properties file
and it is as expected.
So I would like to say thanks a lot to the IBM ExtLib / Designer Team for this, I think that the Bootstrap4XPages project will definitely be happy about this too!