安裝獨立式說明系統為 InfoCenter

您可以利用在伺服器上安裝 InfoCenter 和文件外掛程式, 讓使用者透過網際網路 或 Intranet 來存取說明系統。 用戶端會藉由導覽至 URL 來檢視說明,而且說明系統會顯示在它們的 Web 瀏覽器中。InfoCenter 說明系統可供用戶端應用程式和 Web 應用程式使用,任一方式 均可自遠端存取說明。 除了蹦現資訊和作用中的說明之外,支援說明系統的所有特性。

InfoCenter 說明系統容許傳遞若干可用來自訂 InfoCenter 各種層面的選項。下列是支援的選項:

安裝/包裝

這些步驟為說明系統整合器的步驟而不是要解釋所有可能的情況。 假設所有的文件傳遞為 Eclipse 外掛程式,一般來說,您熟悉 Eclipse 說明系統。

  1. www.eclipse.org 下載「Eclipse 平台執行時期二進位」驅動程式。
  2. d:\myApp 目錄中安裝(解壓縮)驅動程式。這將建立 Eclipse 子目錄,d:\myApp\eclipse,其中包含 Eclipse 平台所需的程式碼(包括說明系統)。

如何從指令行啟動或停止 InfoCenter

org.eclipse.help.standalone.Infocenter 類別具有一個 main 方法, 您可以使用它,從指令行啟動 InfoCenter。指令行引數語法如下:

-command start | shutdown | [-eclipsehome eclipseInstallPath] [-host helpServerHost] [-port helpServerPort] [-servertimeout timeout] [-noexec] [platform options] [-vmargs JavaVMarguments]

若要在 8081 埠上啟動 InfoCenter,請執行下列來發出啟動指令

java -classpath d:\myApp\eclipse\plugins\org.eclipse.help_2.1.0\help.jar org.eclipse.help.standalone.Infocenter -command start -eclipsehome d:\myApp\eclipse -port 8081

若要關閉 InfoCenter,請執行下列來發出關閉指令

java -classpath d:\myApp\eclipse\plugins\org.eclipse.help_2.1.0\help.jar org.eclipse.help.standalone.Infocenter -command shutdown -eclipsehome d:\myApp\eclipse

使用 InfoCenter

啟動 Web 伺服器。將 Web 瀏覽器指向在啟動 InfoCenter 時所指定的埠上執行 "help" Web 應用程式的路徑 。   在安裝 InfoCenter 的機器上,這將是 http://localhost:8081/help/。

如何從 Java 啟動或停止 InfoCenter

當包括 InfoCenter 作為另一個應用程式的一部份時, 使用 Java API 代替使用系統指令來啟動及停止它,可能更加便利。若是如此, 請遵循下列步驟:

  1. 確定 d:\myApp\eclipse\plugins\org.eclipse.help_2.1.0\help.jar 位在您的 app 類別路徑上。您用來啟動及關閉 InfoCenter isorg.eclipse.help.standalone.Infocenter 的類別。
  2. 建立一個「字串」陣列,來含有要傳遞至 InfoCenter 的選項。 通常需要 eclipsehome 和 port 選項。
    String[] options = new String[] { "-eclipsehome", "d:\\myApp\\eclipse" , "-port", "8081" }; 
  3. 在您的應用程式中,利用傳遞選項來建立「說明」類別的實例。
    Infocenter infocenter = new Help(options); 
  4. 若要啟動說明系統:
    helpSystem.start();
  5. 若要關閉 InfoCenter:

    helpSystem.shutdown(); 

使 InfoCenter 可在 Web 上使用

Eclipse 含有完整的 InfoCenter,因此不需要其他伺服器軟體,就能執行。然而,在不具安全保護的環境(如網際網路)中,我們建議不要直接透過用戶端存取 InfoCenter, 而是透過 HTTP 伺服器或應用程式伺服器使用它。大部分伺服器都附有若干模組或 Servlet, 用來委派某個要求給其他 Web 資源。例如,其中一個可能配置 Apache HTTP Server 的 Proxy 模組,將對 http://mycompany.com/myproduct/infocenter 所做的要求重新導向至執行 InfoCenter 的 http://internalserver:8081/help。新增這幾行

LoadModule proxy_module modules/ApacheModuleProxy.dll
ProxyPass /myproduct http://internalserver:8081/help
ProxyPassReverse /myproduct http://internalserver:8081/help
到執行 mycompany 網站之 Apache Server 的 conf/httpd.conf 檔,就可以達成這個目的。

[選用] 安裝最小的一組外掛程式

InfoCenter 不需要整個「Eclipse 平台」套件。 只要具有下列外掛程式(位於 eclipse\plugins 目錄),就可以執行 InfoCenter:

org.apache.lucene
org.apache.xerces
org.eclipse.core.boot
org.eclipse.core.resources
org.eclipse.core.runtime
org.eclipse.help
org.eclipse.help.appserver
org.eclipse.help.webapp
org.eclipse.tomcat
org.eclipse.update.core

除了這些外掛程式之外,您還可能需要安裝上述外掛程式(當它們存在時)的對應片段, 此取決於作業系統或機器架構而定。舉例來說,在 Windows 上, 您需要新增下列片段(也位在 eclipse\plugins 目錄):

org.eclipse.core.resources.win32
org.eclipse.update.core.win32

Copyright IBM Corporation and others 2000, 2003.