Hi,
What’s the alternative for getting a TaxonomyManager in a cms project?
In a site project I can do something similar to this but it won’t work in a cms project.
TaxonomyManager taxonomyManager = HstServices.getComponentManager().getComponent(TaxonomyManager.class);
I have a valuelistprovider in the cms project whereby the values are fetched for a given taxonomy key.
Thanks in advance.
Kind Regards
Mehul Parmar
You can use ClassificationDao on CMS side, see:
private final Mode mode;
private final ClassificationDao dao;
private final FieldPluginHelper helper;
public TaxonomyPickerPlugin(final IPluginContext context, final IPluginConfig config) {
super(context, config);
setOutputMarkupId(true);
mode = Mode.fromString(config.getString("mode", "view"));
dao = getService(ClassificationDao.SERVICE_ID, ClassificationDao.class);
if (dao == null) {
log.warn("No DAO found to retrieve classification for service id {}",
config.getString(ClassificationDao.SERVICE_ID));
}
ValidationModel validationModel = null;
if (config.containsKey(IValidationService.VALIDATE_ID)) {
validationModel = new ValidationModel(context, config);
}
Hello @Mehul_Parmar1 ,
We are happy you are part of Bloomreach Developer’s Community.
Thank you for reaching out to us.
We hope we have answered your queries and therefore marking this thread for Closure.
Looking forward to your continuous contribution towards our vibrant Bloomreach Community.
Thank you