您可以將 InfoCenter 和文件外掛程式安裝在伺服器上,讓使用者透過網際網路或企業內部網路來存取說明系統。 用戶端可以導覽至 URL 來檢視說明,說明系統會顯示在它們的 Web 瀏覽器中。 用戶端和 Web 應用程式都可以使用 InfoCenter 說明系統,兩者都可以讓它們的說明成為從遠端存取。 除了環境定義說明、作用中的說明、指令支援和說明視圖,說明系統的所有特性都受到支援。
InfoCenter 說明系統容許傳遞若干可用來自訂 InfoCenter 各種層面的選項。下列是支援的選項:
osgi.instance.area
或 osgi.instance.area.default
內容,便必須提供這個選項。
-nl en -locales de en es fr it ja ko pt_BR zh_CN zh_TW
選項 InfoCenter 在 10 種語言環境中運作。
所有其他語言環境都會收到 en
語言環境的內容。
-vmargs -Xmx256M
選項會增加 InfoCenter 所能使用的記憶體,且可以提供更大的書籍集合。
這些步驟為說明系統整合器的步驟而不是要解釋所有可能的情況。 假設所有的文件傳遞為 Eclipse 外掛程式,一般來說,您熟悉 Eclipse 說明系統。
d:\myApp
。
這會建立一個 eclipse 子目錄 (d:\myApp\eclipse
),其中含有 Eclipse 平台(包括說明系統)所需要的程式碼。
org.eclipse.help.standalone.Infocenter
類別有一個 main()
方法,可供您用來從指令行啟動 Eclipse。
指令行引數語法如下:
-command start | shutdown | [-eclipsehome eclipseInstallPath] [-data instanceArea] [-host helpServerHost] [-locales localeList] [-port helpServerPort] [-dir rtl] [-noexec] [platform options] [-vmargs JavaVMarguments]
如果要在 8081 埠上啟動 InfoCenter,請執行下列指令行來發出 start
指令:
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,請執行下列指令行來發出 shutdown
指令:
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 瀏覽器指向執行於啟動 InfoCenter 時所指定之埠(如 8081)的 "/help" Web 應用程式。
例如,從安裝了 InfoCenter 的機器中,這是 http://localhost:8081/help/
。
當在另外一個應用程式中併入 InfoCenter 時,不用系統指令,而用 Java API 呼叫來啟動和停止它,可能會更方便。 若是如此,請遵循下列步驟:
d:\myApp\eclipse\plugins\org.eclipse.help.base_3.1.0.jar
在您的應用程式類別路徑中。
您用來啟動和關閉 InfoCenter 的類別是 org.eclipse.help.standalone.Infocenter
。
String
物件陣列,其中含有您要傳給 InfoCenter 的選項。
通常會需要 eclipsehome
和 port
選項。
String[] options = new String[] { "-eclipsehome", "d:\\myApp\\eclipse" , "-port", "8081" };
Help
類別的實例。
Infocenter infocenter = new Help(options);
helpSystem.start();
helpSystem.shutdown();
Eclipse 包含一個完整的 InfoCenter,不需要執行任何其他伺服器軟體。
不過,在網際網路之類不安全的環境中,最好是透過 HTTP 伺服器或應用程式伺服器來提供,不要讓用戶端直接存取。
大部分伺服器都檢附了將特定要求委派給其他 Web 資源的模組或 Servlets。
例如,使用者可能會配置 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 的多個實例可以從單一安裝架構執行於某部機器。
每個已啟動的實例都必須使用它自己的埠,且必須隨著工作台而提供,因此,必須指定 -port
和 -data
選項。
這些實例可以利用 -configuration
選項來提供有效的平台配置,以便從不同組的外掛程式提供文件。
如果未使用 -configuration
,且多個 InfoCenter 實例(重疊各組語言環境)共用配置目錄,您必須確定在啟動下一個 InfoCenter 實例之前,上一個 InfoCenter 實例已建立好所有搜尋索引。
索引儲存在配置目錄中,各個 InfoCenter 實例的寫入權不會同步。
當執行 InfoCenter 模式時,會關閉過濾支援,結果所有內容都會成為可見,過濾的內容也包括在內。 如果您要文件同時在工作台和 InfoCenter 這兩種模式中,您在使用過濾器時,所用的方式應該是即使將過濾關閉,也有意義。
InfoCenter 不需要整個 Eclipse Platform 套件。
您有可能利用下列外掛程式(在 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
有些文件外掛程式可能會相依於其他外掛程式,通常是在它們的軟體組 Manifest 中指定所需要的外掛程式。 InfoCenter 中也需要安裝相依的外掛程式。
您不需要重新啟動 InfoCenter,只要利用從指令行更新執行中的 InfoCenter 主題所說明的指令,便可以更新 InfoCenter 外掛程式。
如果要使用這項功能,最小組的外掛程式也必須包括 org.eclipse.update.core
外掛程式。
請參閱產品自訂作業主題,以取得自訂說明系統的詳細資訊。