Thanks for your response Kasper.
I think using the hack is quite dirty and does not solve the problem
completely too since I want to get handle to a custom dictionary based
on 2 things we would have: -
1. User selected KnowledgeType
2. Class of the custom dictionary
Using the dictionary name will require that we have some logic in the
filter to get the correct dictionary name somehow.
Solution (Not very clean still):
In ReferenceDataCatalog we introduce a new method to get handle to a
dictionary based on Dictionary class type and KnowledgeType
combination.
We obviously could argue that there can be a scenario where in
configuration we have 2 dictionaries with different names but same
class type and KnowledgeType combination, but I guess that is one of
the non-trivial cases and if such a case exist then we return the
first handle that we can find out.
In case you agree I can try implementing this.
Regards
Ankit
On Dec 23, 2:56 pm, Kasper Sørensen <
kas...@eobjects.dk> wrote:
> Hi Ankit,
>
> Hmm took me a while to see the problem but now I think I see it. Basically
> what you need is either a handle to a dictionary or to a datastore (which
> you then should also pass to the dictionary constructor). Unfortunately I
> think this is not possible using the current API so we might consider if we
> should allow for example to inject the configuration object so you can
> access the datastores and dictionaries from there. On the other hand it may
> allow a component to do things outside it's intended scope (eg. to open up a
> connection to another datastore - this kind of behaviour should be handled
> by the framework IMO).
>
> To make a long story short: Using @Configured Dictionary is the official way
> for now. There is a hack though, that you can use, but it's not that nice
> because it touches upon the UI-layer:
>
> AnalyzerBeansConfiguration conf =
> WindowManager.getInstance().getMainWindow().getConfiguration();
> Dictionary dictionary = conf.getReferenceDataCatalog().getDictionary("my
> dictionary");
>
> Let me know if you have suggestions for a nicer way of doing this.
>
> Regards,
> Kasper Sørensen
>
> >
datacleaner-d...@googlegroups.com<
datacleaner-dev%2Bunsu...@googlegroups.com>
> > .