Kettle series: KettleEasyExpand, an open source Kettle universal plugin by Ma Jinju

To extend the Kettle function, you often use user defined java class components, or develop your own Java plug-ins. Both methods have their own pain points:

1. Write java code in the user defined java class component. There is no automatic code prompt or syntax check in this environment. Basically, it takes continuous trial and error to complete the development, which is very inefficient.
2. The development of Kettle plug-ins is difficult and requires a lot of time. Understand the basic Kettle meta class, and UI development is also difficult.
The following plug-in gives a good solution.

Introduction to the KettleEasyExpand Plug-
in A general plug-in that simplifies the development of kettle plug-ins, using JSON as parameter configuration, eliminating the need for ui debugging design steps, A plugin can be developed with just one class. Plug-ins developed based on this plug-in will be easily integrated into the kettle management platform.

====================
Universal Kettle Plugin, KettleEasyExpand
===================
Project Documentation: https:/ /github.com/majinju/KettleEasyExpand/blob/master/doc/KettleEasyExpand.md
Project address: https://github.com/majinju/KettleEasyExpand
https://github.com/majinju/KettleUtil/blob/master/src/ main/java/cn/benma666/kettleutil/utilrun/KurDemo.java


====================Original
design intent
====================
The function of the kettle plugin is similar to the existing definition of kettle java class plug-in, custom java class plug-in mainly supports writing java code directly in kettle to realize custom special functions, and this control mainly transfers the custom code to jar package, that is to say, the realization of custom functions is changed to eclipse Wait for ide development.

The reason for designing this plug-in is that it is not easy to write user defined java class code directly in kettle. The development experience is far from eclipse, and the java syntax is also limited, which makes debugging troublesome. It’s okay to implement some simple logic, but it’s more troublesome if it’s a little more complicated. You need to be familiar with java and kettle related interfaces. While simple functions can be implemented by javascript scripts, it is difficult for ordinary people to directly write java implementations in custom java class controls for complex functions.

Some people say that you can directly develop a new plug-in every time. Although the plug-in mechanism of java is still very good, it is not so easy to develop a plug-in. You need to design metadata, plug-in function realization, plug-in operation interface design, etc. Among them, the operation interface The adjustment is the last thing I want to spend time on. I can also call up the configuration interface of common controls by slowly adjusting it, but I don’t think it is necessary, so there are still many things that need to be done to realize a perfect plug-in.

This plug-in integrates the above two mechanisms. It not only has the simplicity of customizing java classes, but also directly writes core business codes. The operation interface uniformly uses a JSON object as a parameter setting method. Therefore, based on this development function, only one base class needs to be inherited. It is enough to write a function implementation class; it also has the convenience of directly developing plug-ins, just import the relevant jar package as a user class library into the project, create a class, inherit the base class, and then you can write as much as you like in eclipse business code.

===================
Environmental Construction
===================
1. Create a user class library ku in eclipse , go to the blog post introduced by the Kettle management platform project (https://github.com/majinju/kettle-manager) to download the version 0.2.0 deployment package, and then add all the jars in the lib directory of the deployment package.
2. Create a user class library kettleLib in eclipse, and add all the libs in your kettle directory.
3. Create a java project in eclipse and add the two user class libraries created earlier to the build path.
4. Then you can create a new java class and follow the next steps for plug-in development.


Step plugin example
https://github.com/majinju/KettleEasyExpand/blob/master/src/main/java/cn/benma666/kettle/easyexpand/EasyExpandDemo.java
Job Entry plugin example
https://github.com/majinju/ KettleEasyExpand/blob/master/src/main/java/cn/benma666/kettle/easyexpand/JobEntryEasyExpandDemo.java


=====================
Ketlt-1.kettle source code acquisition and Running
===================
http://www.cnblogs.com/majinju/p/4455107.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324697377&siteId=291194637