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
"using a 3rd party API"
sgenzer
Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
Hi...I am foolishly trying to do something beyond my comp sci abilities - extending RM. Specifically I am trying to use this API within "Execute Script" in order to pull data into RM:
Help? I have NOT done the tutorial on how to build RM extensions as I am not a programmer and certainly do not know how to program in Groovy or Gradle. The API was pulled from here: https://github.com/benwaffle/PSlib
Thanks!
import com.benwaffle.pslib.PSlib;I put the PSlib.jar file into the /lib folder and I get an error that says..."unable to resolve class com.benwaffle.pslib.PSlib..."
PSlib api = new PSlib("https://ps01.bergen.org");
api.login("username","password");
Grade[] grades = api.getCourses()[0].getGrades();
for (Grade g : grades)
System.out.printf("%s - %d%%", g.name(), g.score());
Help? I have NOT done the tutorial on how to build RM extensions as I am not a programmer and certainly do not know how to program in Groovy or Gradle. The API was pulled from here: https://github.com/benwaffle/PSlib
Thanks!
Tagged:
0
Answers
you are on the right track - however the .jar you added to your /lib folder does not contain the class "com.benwaffle.pslib.PSlib". You can open a .jar with any tool used to extract .zip files. You can then have a look at the folders and .class files in there. Folders represent the package structure (e.g. "com.benwaffle.pslib"), and the .class files are the actual Java classes (e.g. "PSlib").
You will see that neither the folders nor the class exist in the .jar which is why you Studio complained it knew nothing about the imported class.
Regards,
Marco
I was hoping you would chime in to help.
Yes that part I understand but I believe the file is in the jar file. Here is a screenshot of the file structure when I unzip:
http://bit.ly/17b8snJ
so as far as I can see, the class "com.benwaffle.pslib.PSlib" seems to be in psapi.jar. Am I missing something?
Scott
I cannot access that link. I checked the jar available for download on github. Anyway, I quickly threw together an example. Simply place the test.jar in the lib folder and execute the process below. A popup dialog should appear and convince you that it works
Download: test.jar Regards,
Marco
Thanks so much - I got that to work easily and will go back and see why this other file does not work. The template is very useful.
Scott
Thanks!!
Scott