kettle源碼下載
⑴ 如何使用kettle源碼更改spoon的東西
1.2. 編譯源碼
將項目載入到eclipse
將kettle項目拷貝到eclipse的workspace目錄下,在eclipse中新建java project,項目名稱和你拷貝過來的kettle文件夾名稱一致
項目導入到eclipse中會出現一個錯誤,如下圖,將這個文件的源碼全部注釋掉
編譯
打開build.xml, 在右邊的。Outline 點擊kettle->run as ->ant build
第一次編譯的時候需要從網上下載幾個文件,放在C:\Documents and Settings\Administrator\.subfloor,網路不好的話下載會比較慢,也可以直接文件放在C:\Documents and Settings\Administrator\下。編譯完成後將bin目錄下的.bat文件拷貝到Kettle目錄下點擊Spoon.bat運行,運行成功代表編譯已近通過
用源碼運行Spoon
Kettle源碼工程本身可能是在linux64位機器上調試的,swt配置是linux64的庫,所有在運行源碼前需要修改成win32的swt,步驟如下:工程à屬性àJava Build Pathàlibrariesàadd jars
然後將linux64的SWT庫刪除
最後打開src-uiàorg.pentaho.di.ui.spoonàSpoon.java, Run As àjava application
二.源碼分析
2.1. 修改kettle界面
修改初始化界面
打開package org.pentaho.di.ui.spoon的Spoon.Java,找到main函數,該main函數為Spoon工具的入口,找到如下語句
Splash splash = new Splash(display);
該語句為spoon初始化顯示的界面,跳到定義Splash.java,下面函數
canvas.addPaintListener(new PaintListener() {
publicvoid paintControl(PaintEvent e) {
String versionText = BaseMessages.getString(PKG, "SplashDialog.Version") + " " + Const.VERSION; //$NON-NLS-1$ //$NON-NLS-2$
StringBuilder sb = new StringBuilder();
String line = null;
try {
BufferedReader reader = new BufferedReader(newInputStreamReader(Splash.class.getClassLoader().getResourceAsStream("org/pentaho/di/ui/core/dialog/license/license.txt")));//$NON-NLS-1$
while((line = reader.readLine()) != null) {
sb.append(line + System.getProperty("line.separator")); //$NON-NLS-1$
}
} catch (Exception ex) {
sb.append(""); //$NON-NLS-1$
Log.warn(BaseMessages.getString(PKG, "SplashDialog.LicenseTextNotFound")); //$NON-NLS-1$
}
String licenseText = sb.toString();
e.gc.drawImage(kettle_image, 0, 0);
// If this is a Milestone or RC release, warn the user
if (Const.RELEASE.equals(Const.ReleaseType.MILESTONE)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.DeveloperRelease") + " - " + versionText; //$NON-NLS-1$ //$NON-NLS-2$
drawVersionWarning(e);
} elseif (Const.RELEASE.equals(Const.ReleaseType.RELEASE_CANDIDATE)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.ReleaseCandidate") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
elseif (Const.RELEASE.equals(Const.ReleaseType.PREVIEW)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.PreviewRelease") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
elseif (Const.RELEASE.equals(Const.ReleaseType.GA)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.GA") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
Font verFont = new Font(e.display, "Helvetica", 11, SWT.BOLD); //$NON-NLS-1$
e.gc.setFont(verFont);
e.gc.drawText(versionText, 290, 205, true);
// try using the desired font size for the license text
int fontSize = 8;
Font licFont = new Font(e.display, "Helvetica", fontSize, SWT.NORMAL); //$NON-NLS-1$
e.gc.setFont(licFont);
// if the text will not fit the allowed space
while (!willLicenseTextFit(licenseText, e.gc)) {
fontSize--;
licFont = new Font(e.display, "Helvetica", fontSize, SWT.NORMAL); //$NON-NLS-1$
e.gc.setFont(licFont);
}
e.gc.drawText(licenseText, 290, 290, true);
}
});
1. 修改背景圖片
找到ui/image/下面的kettle_splash.png,替換該圖片
2. 修改版本信息
找到e.gc.drawText(versionText, 290, 205, true); 改為e.gc.drawText("海康威視數據交換平台V1.0", 290, 205, true);
3. 修改下面的描述性文字
找到e.gc.drawText(licenseText, 290, 290, true);改為e.gc.drawText("作者:海康", 290, 290, true);
4. 預覽效果
⑵ kettle源碼搭建運行時出現錯誤
將安裝包pdi-ce-5.4.0.1-130\data-integration\ui目錄下的所有文件拷貝到源碼包pentaho-kettle-5.4.0.1-R\ui目錄下,即可解決~~
⑶ 我看到你關於kettle不釋放內存的回答,想要一下你改完後org.pentaho.di.core.logging.LoggingRegistr源碼
你留個郵箱或者qq吧 網路hi怎麼發文件我還不怎麼清楚
⑷ 如何使用kettle源碼更改spoon的東西
1.2. 編譯源碼
將項目載入到eclipse
將kettle項目拷貝到eclipse的workspace目錄下,在eclipse中新建java project,項目名稱和你拷貝過來的kettle文件夾名稱一致
項目導入到eclipse中會出現一個錯誤,如下圖,將這個文件的源碼全部注釋掉
編譯
打開build.xml, 在右邊的。Outline 點擊kettle->run as ->ant build
第一次編譯的時候需要從網上下載幾個文件,放在C:\Documents and Settings\Administrator\.subfloor,網路不好的話下載會比較慢,也可以直接文件放在C:\Documents and Settings\Administrator\下。編譯完成後將bin目錄下的.bat文件拷貝到Kettle目錄下點擊Spoon.bat運行,運行成功代表編譯已近通過
用源碼運行Spoon
Kettle源碼工程本身可能是在linux64位機器上調試的,swt配置是linux64的庫,所有在運行源碼前需要修改成win32的swt,步驟如下:工程à屬性àJava Build Pathàlibrariesàadd jars
然後將linux64的SWT庫刪除
最後打開src-uiàorg.pentaho.di.ui.spoonàSpoon.java, Run As àjava application
二.源碼分析
2.1. 修改kettle界面
修改初始化界面
打開package org.pentaho.di.ui.spoon的Spoon.Java,找到main函數,該main函數為Spoon工具的入口,找到如下語句
Splash splash = new Splash(display);
該語句為spoon初始化顯示的界面,跳到定義Splash.java,下面函數
canvas.addPaintListener(new PaintListener() {
publicvoid paintControl(PaintEvent e) {
String versionText = BaseMessages.getString(PKG, "SplashDialog.Version") + " " + Const.VERSION; //$NON-NLS-1$ //$NON-NLS-2$
StringBuilder sb = new StringBuilder();
String line = null;
try {
BufferedReader reader = new BufferedReader(newInputStreamReader(Splash.class.getClassLoader().getResourceAsStream("org/pentaho/di/ui/core/dialog/license/license.txt")));//$NON-NLS-1$
while((line = reader.readLine()) != null) {
sb.append(line + System.getProperty("line.separator")); //$NON-NLS-1$
}
} catch (Exception ex) {
sb.append(""); //$NON-NLS-1$
Log.warn(BaseMessages.getString(PKG, "SplashDialog.LicenseTextNotFound")); //$NON-NLS-1$
}
String licenseText = sb.toString();
e.gc.drawImage(kettle_image, 0, 0);
// If this is a Milestone or RC release, warn the user
if (Const.RELEASE.equals(Const.ReleaseType.MILESTONE)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.DeveloperRelease") + " - " + versionText; //$NON-NLS-1$ //$NON-NLS-2$
drawVersionWarning(e);
} elseif (Const.RELEASE.equals(Const.ReleaseType.RELEASE_CANDIDATE)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.ReleaseCandidate") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
elseif (Const.RELEASE.equals(Const.ReleaseType.PREVIEW)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.PreviewRelease") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
elseif (Const.RELEASE.equals(Const.ReleaseType.GA)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.GA") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
Font verFont = new Font(e.display, "Helvetica", 11, SWT.BOLD); //$NON-NLS-1$
e.gc.setFont(verFont);
e.gc.drawText(versionText, 290, 205, true);
// try using the desired font size for the license text
int fontSize = 8;
Font licFont = new Font(e.display, "Helvetica", fontSize, SWT.NORMAL); //$NON-NLS-1$
e.gc.setFont(licFont);
// if the text will not fit the allowed space
while (!willLicenseTextFit(licenseText, e.gc)) {
fontSize--;
licFont = new Font(e.display, "Helvetica", fontSize, SWT.NORMAL); //$NON-NLS-1$
e.gc.setFont(licFont);
}
e.gc.drawText(licenseText, 290, 290, true);
}
});
1. 修改背景圖片
找到ui/image/下面的kettle_splash.png,替換該圖片
2. 修改版本信息
找到e.gc.drawText(versionText, 290, 205, true); 改為e.gc.drawText("海康威視數據交換平台V1.0", 290, 205, true);
3. 修改下面的描述性文字
找到e.gc.drawText(licenseText, 290, 290, true);改為e.gc.drawText("作者:海康", 290, 290, true);
4. 預覽效果
⑸ 求Kettle 源代碼 下載地址及 Kettle java api教程...
http://kettle.pentaho.com/下載地址!想要什麼自己選
http://wiki.pentaho.com/display/EAI/Getting+Started基礎教程
http://wiki.pentaho.com/display/EAI/Pentaho+Data+Integration+Steps詳細教程