Overview
This guide provides essential tips and steps to help developers set up their IDE to help them code Yellowfin supported plugins, widgets, advanced functions, and more.
Setting up your IDE
Here's a step-by-step tutorial to help you set up your development environment.
- Get Eclipse for EE developers. Note: This is Yellowfin's recommendation, however these steps can be applied in case of other IDEs as well.
- Install the Tomcat plugin if it isn't already bundled with the installation.
- Install the version of Yellowfin to be used for development. It's ideal to get the latest version, so that more functionality is supported, allowing you to create advanced plugins.
- Start up Yellowfin to extract the WAR file.
Create a Plugin Project
- Once Eclipse is started, create a new Java project.
- Enter the project name and ensure you select a JRE compatible with the version of Yellowfin.
- Click Next and change the default output folder to <project-name>/ROOT/WEB-INF/classes.
- Click Finish.
- Import files from the installed Yellowfin.
- Right click on the project and select Import.
- Select File System and click Next.
- Navigate to appserver/webapps/ROOT in the Yellowfin install directory. Select ROOT and click OK.
- Select everything under ROOT and in the Advanced section, select Create links in workspace.
- Click Finish. Files from the installed Yellowfin get linked to the plugin project.
- Right click on the project and select Import.
Configure the Project
- Right click on the project and select Build Path > Configure Build Path and select the Libraries tab
- Click Add JARs and type "i4" into the search bar. From the results, select i4-core.jar and i4-mi.jar from your plugin project. Click OK to save this and OK again in the build path config window.
- Create the following folder structure under src: META-INF/services.
Depending on which plugin is being developed, create a file with the full qualified name of the plugin interface, in the services directory.
Yellowin Plugin
Interface
Description
Transformation Step com.hof.mi.etl.step.ETLStep A Step which may be used in Data Transformation Analytic Function com.hof.mi.interfaces.AnalyticalFunction Analytic Functions used in Reports Data Type Converter com.hof.mi.interfaces.Converter Converts used at the View Level and Data Transformations Custom Formatter com.hof.mi.interfaces.CustomFormatter Formatting used in Reports Data Profiler com.hof.mi.interfaces.DataSuggestionPlugin Profile data for a field and and determine whether the implemented suggestion is applicable
Icon Set com.hof.mi.interfaces.IconSet Defines an icon set for use with Report Alerts Third Party Connector com.hof.mi.thirdparty.interfaces.AbstractDataSource Connectors to an external API Canvas Widget com.hof.mi.widgetcanvas.interfaces.CanvasObjectTemplate Custom Widgets for the Dashboard, Storyboard and Report Output Source Platform com.hof.sources.SourcePlatform Define Source Types such as JDBC, JNDI, OLAP etc - For example, name the file 'com.hof.mi.etl.step.ETLStep' if creating a Transformation Step.
- For example, name the file 'com.hof.mi.etl.step.ETLStep' if creating a Transformation Step.
- Create the plugin class by implementing one of the interfaces given above. The fully qualified classname should be added to the services file corresponding to the interface.
So if the plugin being developed is a Data Transformation Step, add its fully qualfied class name to META-INF/services/com.hof.etl.step.ETLStep
If necessary, another transformation step may be added below this line.
Configure Tomcat
- Select Window > Preferences and go to the section for Tomcat
- Set Tomcat Home to <Yellowfin Install directory>/appserver and Contexts directory to <Yellowfin Install directory>/appserver/conf/Catalina/localhost
- Expand the Tomcat section and click on Advanced. Add the plugin project to Tomcat's classpath.
- Adjust JVM Settings if necessary. You could use this to increase the memory available for Tomcat.
- Select Source Path and add the plugin project.
- Click OK to save.
- Start up tomcat from eclipse using the buttons in the toolbar
- The plugin will be now be available in Yellowfin
Changes to code get reflected instantly except when:
- a method's signature is changed
- new methods/members are are added to the class
- new classes are added to the plugin package
In these cases, Tomcat must be restarted to apply changes.
Packaging the Plugin
Once you've created your plugin, you will need to package it will all of its dependencies. The file extension in a specific file format that is supported in Yellowfin.
- Right click on the project and select Export > JAR file
- Select only the package(s) to be exported and nothing else
- If the project has dependent JARs, put all of them and the Plugin JAR into one directory, zip into one archive, and give it the extension "yfp".
Debugging
Debugging is easy as the Eclipse Tomcat plugin starts Tomcat in debug mode. Simply add breakpoints in code and ensure they are active.