|[p2] Querying Babel p2 repository for language packs [message #1717216]
||Thu, 10 December 2015 19:31
| Wayne Beaton
Registered: December 2017
I'm writing a little plug-in that needs to query the Babel p2 repository for language packs.|
I've taken the approach of walking through the installed features and building a potential bundle id by suffixing the feature id to match the expected corresponding Babel feature. (e.g. featureId + ".nl_de" for German). I use the value to build an IQuery using the QueryUtil.createUIQuery and then mash the collection of them together as a compound query. This seems to find the features that I'm looking for.
List<IQuery<IInstallableUnit>> featureQueries = new ArrayList<IQuery<IInstallableUnit>>();
IQuery<IInstallableUnit> query = QueryUtil.createCompoundQuery(featureQueries, false);
First question... Is this the right way to do this?
Second question... how do I do a more complex query when there are regional translations available (e.g. ".nl_fr_FR" vs. ".nl_fr_CA"). i.e. how do you form a p2 query that prefers "fr_CA" over the "fr"?
Powered by FUDForum
. Page generated in 0.05529 seconds