安裝獨立式說明系統為 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] [-data instanceArea] [-host helpServerHost] [-locales localeList] [-port helpServerPort] [-dir rtl] [-noexec] [platform options] [-vmargs JavaVMarguments]

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

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

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

java -classpath d:\myApp\eclipse\plugins\org.eclipse.help.base_3.1.0.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.base_3.1.0.jar 。您用來啟動及關閉 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/infocenter http://internalserver:8081/help
ProxyPassReverse /myproduct/infocenter http://internalserver:8081/help

到執行 mycompany 網站之 Apache Server 的 conf/httpd.conf 檔,就可以達成這個目的。

有的 Apache HTTP Server 版本,可能含有在配置檔中啟用的 AddDefaultCharset 指引。 請移除這個指引,或者把它換成

AddDefaultCharset Off

,讓瀏覽器使用正確的字集來顯示文件。

執行多個 InfoCenter 實例

您可以從一個安裝架構,執行多個 Infocenter 實例。 每一個啟動的實例,都必須使用它自己的埠,並且被提供一個工作區, 這樣才能指定 -port and -data 選項。 這些實例可以利用 -configuration 選項,提供有效的平台配置,從不同的外掛程式集來供文件使用。

如果沒有使用 -configuration,而且有好幾個重疊使用語言環境的 InfoCenter 實例,一起共用配置目錄, 則所有的搜尋索引都必須先由一個 InfoCenter 實例建立之後,才能啟動另一個實例。 索引儲存在配置目錄中,而 InfoCenter 程序之間的寫入權並未同步化。

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

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

org.apache.lucene
org.eclipse.core.runtime
org.eclipse.help
org.eclipse.help.appserver
org.eclipse.help.base
org.eclipse.help.webapp
org.eclipse.osgi
org.eclipse.tomcat
org.eclipse.update.configurator

部分說明文件外掛程式可能與其他外掛程式有相依關係,通常會在其 plugin.xml 中指定需要的外掛程式。 InfoCenter 中也需要安裝相依的外掛程式。 此外,為 Eclipse 3.0 版之前版本所設計的外掛程式,需要 org.eclipse.core.runtime.compatibility 才能使用外掛程式。

使用從指令行更新執行中的 InfoCenter 主題中所說明的命令,不需重新啟動 InfoCenter,即可更新 InfoCenter 外掛程式。 若要使用此功能,外掛程式的最小設定必須包含 org.eclipse.update.core 外掛程式。

如果需要自訂說明系統的詳細資訊,請參閱說明系統喜好設定