Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
Change parameters list upon read
chicofranchico
Member Posts: 3 Contributor I
Hi,
we currently have an operator that reads from a database the tables. We stipulated that there is a ParameterTypeCategory defined in the getParameterTypes method with a list of categories (take for reference the DatabaseHandler).
Is there a way to change this list of categories after I make a read from the database and populate it with my database table names?
I've tackled this problem but I've reached the point where I get to replace the parameters but that throws some Observer issues.
Can someone point me out a simple way to do what I'm trying?
Thanks
we currently have an operator that reads from a database the tables. We stipulated that there is a ParameterTypeCategory defined in the getParameterTypes method with a list of categories (take for reference the DatabaseHandler).
Is there a way to change this list of categories after I make a read from the database and populate it with my database table names?
I've tackled this problem but I've reached the point where I get to replace the parameters but that throws some Observer issues.
Can someone point me out a simple way to do what I'm trying?
Thanks
Tagged:
0
Answers
for the ParameterTypeCategory, there is no such way. In fact I wouldn't expect this to be the right way to go. The right thing would probably be to make a ParameterTypeTableName (I think we have something like this for the Read Database operator.) You would also have to register an editor for this type by calling
PropertyPanel.registerPropertyValueCellEditor(Class<? extends ParameterType> typeClass, Class<? extends PropertyValueCellEditor> editor)
unless using the one provided by the ParameterTypeCategory works out for you.
Best,
Simon
Thanks a lot for the reply.
Where should I make the registration of my PropertyValueCellEditor implementation? If I do it on the initPlugin I get the following error:
The method registerPropertyValueCellEditor(Class<? extends ParameterType>, Class<? extends PropertyValueCellEditor>) in the type PropertyPanel is not applicable for the arguments (Class<DatabaseDataReader>, Class<MyDatabaseTableValueCellEditor>) where MyDatabaseTableValueCellEditor is my implementation.
Thanks again!
you should use initGui(MainFrame), but I don't think this will solve your problem. Isn't that a compile time error anyway?
Cheers,
Simon
Yeah, I don't know why the compile time error. If I put the declaration in the PropertyPanel static block (like the others) it works fine. Is there something I'm missing?
Thanks again!