可以通过在服务器上安装信息中心和文档插件来允许用户通过因特网或内部网访问帮助系统。客户机 通过导航至 URL 来查看帮助,而帮助系统会显示在它们的 Web 浏览器中。信息中心帮助系统可用于客户机应用程序和 Web 应用程序,对于每种应用程序,都可以远程方式访问其帮助。除弹出信息和活动帮助之外的帮助系统的所有功能部件都受支持。
信息中心帮助系统允许传递可用来定制信息中心的各个方面的许多选项。下列选项是受支持的:
-vmargs -Xmx256M
增加信息中心可用的内存,从而允许处理较大的书籍集合。这些步骤用于帮助系统集成器,但并不表示能解决所有可能的情况。假定如下:所有文档都是作为 Eclipse 插件交付的并且通常您熟悉 eclipse 帮助系统。
org.eclipse.help.standalone.Infocenter 类有一个 main 方法,您可以使用该方法来从命令行启动信息中心。命令行自变量语法为:
-command start | shutdown | [-eclipsehome eclipseInstallPath] [-host helpServerHost] [-port helpServerPort] [-servertimeout timeout] [-noexec] [platform options] [-vmargs JavaVMarguments]
要在端口 8081 上启动信息中心,通过运行以下命令发出启动命令
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
要关闭信息中心,通过运行以下命令发出关闭命令
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
启动 Web 服务器。使 Web 浏览器指向在启动信息中心时指定的端口上 Web 应用程序运行的路径“help”。在安装了信息中心的机器上,这将是 http://localhost:8081/help/。
当将信息中心包括为另一应用程序的一部分时,使用 Java API 而不是使用系统命令来启动或停止信息中心可能会更方便。如果是这种情况,则遵循下列步骤:
String[] options = new String[] { "-eclipsehome", "d:\\myApp\\eclipse" , "-port", "8081" };
Infocenter infocenter = new Help(options);
helpSystem.start();
要关闭信息中心:
helpSystem.shutdown();
Eclipse 包含完整的信息中心并且不需要其它服务器软件就可运行。但是,在不安全环境(如因特网)中,建议不要通过客户机直接访问信息中心,而是通过 HTTP Server 或应用程序服务器来访问信息中心。大多数服务器附带有用于代理对其它 Web 资源的某个请求的模块或 servlet。例如,用户可配置 Apache HTTP Server 的代理模块来将对 http://mycompany.com/myproduct/infocenter 的请求重定向至运行信息中心的 http://internalserver:8081/help。将以下行
LoadModule proxy_module modules/ApacheModuleProxy.dll ProxyPass /myproduct http://internalserver:8081/help ProxyPassReverse /myproduct http://internalserver:8081/help添加至运行 mycompany Web 站点的 Apache 服务器的 conf/httpd.conf 文件就行了。
信息中心不需要整个“Eclipse 平台”包。可使用下列插件(它们位于 eclipse\plugins 目录中)运行信息中心:
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