ODI中新增插件(Open Tools)介紹

1、添加ODI驅動
在ODI11G中需要將數據jdbc驅動拷貝到以下兩個位置:
$HOME(一般在windows的系統文件夾,如:C:\Users\Administrator\AppData\Roaming\odi\oracledi\)/.odi/oracledi/userlib-----用於statio的數據集成;
ODI_HOME/oracledi/agent/drivers/----用於代理的數據集成;
王珂
2、添加自定義插件
首先將待添加的open tools jar包放到上述ODI驅動的位置下。
打開ODIstadio之後,在odi菜單項,選擇添加或刪除open tools
添加完成後:

附相關代碼如下:
/**
 *
 */
package com.dataonv.OpenTools;
import javax.swing.JOptionPane; /* Needed for the message box used in this example*/
import oracle.odi.sdk.opentools.IOpenTool; /* All Open Tool classes need these three classes */
import oracle.odi.sdk.opentools.IOpenToolParameter;
import oracle.odi.sdk.opentools.OpenToolAbstract;
import oracle.odi.sdk.opentools.OpenToolExecutionException;
import oracle.odi.sdk.opentools.OpenToolParameter; /* The class used for parameters */
/**
 * @author Administrator
 *
 */
public class SimpleMessageBox extends OpenToolAbstract {
 private static final IOpenToolParameter[] mParameters = new IOpenToolParameter[] {
   new OpenToolParameter("-TEXT", "Message text",
     "Text to show in the messagebox(Mandatory).", true),
   new OpenToolParameter("-TITLE", "Messagebox title",
     "Title of the messagebox.", false) };
 public IOpenToolParameter[] getParameters() {
  return mParameters;
 }
 public String getDescription() {
  return "彈出對話框";
 }
 public String getVersion() {
  return "v1.0";
 }
 public String getProvider() {
  return "公司名稱.";
 }
 public String getSyntax() {
  return "SimpleMessageBox \"-TEXT=<text message>\" \"-TITLE=<window title>\"";
 }
 public String getIcon(int pIconType) {
  switch (pIconType) {
  case IOpenTool.SMALL_ICON:
   return "/com/dataonv/OpenTools/haishu16.gif";
  case IOpenTool.BIG_ICON:
   return "/com/dataonv/OpenTools/haishu32.gif";
  default:
   return "";
  }
 }
 public void execute() throws OpenToolExecutionException {
  try {
   if (getParameterValue("-TITLE") == null
     || getParameterValue("-TITLE").equals("")) /*
                 * title was not
                 * filled in by
                 * user
                 */
   {
    JOptionPane.showMessageDialog(null,
      (String) getParameterValue("-TEXT"),
      (String) "Message", JOptionPane.INFORMATION_MESSAGE);
   } else {
    JOptionPane.showMessageDialog(null,
      (String) getParameterValue("-TEXT"),
      (String) getParameterValue("-TITLE"),
      JOptionPane.INFORMATION_MESSAGE);
   }
  }
  /* Traps any exception and throw them as OpenToolExecutionException */
  catch (IllegalArgumentException e) {
   throw new OpenToolExecutionException(e);
  }
 }
}


代理啓動命令:
1、linux:./agent.sh -PORT=20300 -NAME=agent_001 -PROTOCOL=http
2、windows:agent.bat "-PORT=20300" "-NAME=agent_001" "-PROTOCOL=http"
發佈了48 篇原創文章 · 獲贊 2 · 訪問量 11萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章