The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
How to access a "Configurable" Parameter
janvanrijn
Member Posts: 15 Contributor II
in Help
The document "How to Extend RapidMiner 5" describes how to create Configurables, for example to store Connections to certain servers (Chapter 8 ). I try to do so for a RapidMiner Studio, and as it turns out, many of the code is applicable for this version. However, I ran into some difficulties.
I have for my Operator overridden the getParameterTypes function:
Now, if I want to access the integer parameter, I can easily access it in the doWork function:
I have for my Operator overridden the getParameterTypes function:
public List<ParameterType> getParameterTypes() {Hence, I can see both the integer and configurable parameter fields.
List<ParameterType> types = super.getParameterTypes();
types.add(new ParameterTypeConfigurable(PARAMETER_CONFIG, "Choose a Connection", "Config"));
types.add(new ParameterTypeInt(PARAMETER_TASKID, "The Task that needs to be executed", 1, Integer.MAX_VALUE, false));
return types;
}
Now, if I want to access the integer parameter, I can easily access it in the doWork function:
getParameterAsInt(PARAMETER_TASKID);I would assume there is a similar way to obtain the Configurable? Yet, I can't find it, and it is not documented in the manual. Many thanks for helping out.
0
Answers
I have some example code from our own Amazon S3 configurable for you which should be helpful.
The parameter type defintion:
The doWork() method of the operator: Regards,
Marco
You just made my day! Thanks.
One more question regarding the GUI description, as described on page 73. I copied these values, of course changing ofcourse "crmconfig" into my own I18NBaseKey. However, these didn't change anything. Did something change between version 5 and RM Studio? Or am I changing the wrong config file? I work in src/main/resources/com/rapidminer/resources/i18n/GUITemplate.properties, since I found a reference to this file in some META-INF from a shadow Jar. Coudn't find any other references...
Seems to be out of date. Amazon S3 example again: Regards,
Marco
Just not the icon. I tried some different ones, but the button is still empty.
Are you sure it's this one? In the manual it hints at but replacing crmconfig with {baseKey} doesn't work
1. Where is your icon located? Should be "resources/icons/16/my_icon.png"
2. What version of RapidMiner Studio are we talking about? I looked at the 6.4 sources.
Ultimately, it should work if you can successfully get the icon in your code via Regards,
Marco
I tried using resources from the RapidMiner resources, like I do for the operators. Apparently that is not possible. In which subfolder of my plugin should I locate resources/icons/16/? I tried some different options, but apparently not the right one.
sorry, the code should have been: Regards,
Marco
When I open my operator, I can see in the parameter list "OpenML Connection" and when I hoover over the info button it also says "An entry decribing an OpenML Connector". However, the button still shows no icon which makes it both small and hard to understand for end users.
Is there somewhere documentation on this GUI properties file, apart from the Extension manual?
the i18n files themselves are not documented, usually (at least for newer classes) the i18n key format is part of the JavaDoc for the classes.
Your code looks good, it should work - I don't know why it does not. Does it work if you change the icon in the i18n file to "import.png", i.e. an icon from Studio itself?
Regards,
Marco
Just to be sure we're talking about the same thing, I have attached a screenshot about where I would expect an icon.
(any icon would be fine by me.)
[img=http://s1.postimg.org/wqydhjyxn/screen.jpg]
when you add a configurable instance to the operator (so it is selected) and the click the button again, is the correct configurable preselected in the dialog? Is the icon in the dialog correct?
Regards,
Marco
this icon:
Regards,
Marco