WebSphere Application Server Liberty 概要文件上部署文档构建器

可以在 WebSphere® Application Server Liberty 以及 IBM® DB2®、Oracle 或包含了文档构建器 Web 应用程序的 Derby 数据库上部署 Rational® Publishing Engine 文档构建器(仅用于评估)。

开始之前

在部署文档构建器之前,必须安装 WebSphere Application Server Liberty 以及具有 RPE 文档构建器功能部件的 Rational Publishing Engine

过程

  1. 文档构建器创建 Liberty 概要文件服务器。
  2. 通过将 com.ibm.rpe.web.app.ear 文件从 RPE_HOME\document-builder 目录复制到 Liberty apps 目录来部署该文件。 请参阅 WebSphere Application Server Liberty 产品文档中的将 Web 应用程序部署到 Liberty 概要文件
  3. 文档构建器创建具有 16K 页面和 UTF-8 代码集的数据库。
  4. 对于 DB2 或 Oracle,设置 VCAP_SERVICES 变量(Derby 不需要):
    • 对于 Windows:将下列文本添加至 <Liberty_install_dir>\bin\server.bat 文件:
      set VCAP_SERVICES={"sqldb": [{}]}
    • 对于 Linux:将下列文本添加至 <Liberty_install_dir>\bin\server.sh 文件:
      export VCAP_SERVICES={"sqldb":[{}]}
  5. (可选)如果您已经在不同的应用程序服务器或机器上部署 rpeng.war dgaas.war 文件,那么您必须设置 DGAAS_URL 变量。如果您已经部署 com.ibm.rpe.web.app.ear 文件,那么您可以跳过此步骤。
    • 对于 Windows:将下列文本添加至 <Liberty_install_dir>\bin\server.bat 文件:
      set DGAAS_URL="http://[server IP]:[port]/dgaas/"
    • 对于 Linux:将下列文本添加至 <Liberty_install_dir>\bin\server.sh 文件:
      export DGAAS_URL="http://[server IP]:[port]/dgaas/" 
  6. 编辑 server.xml 文件以配置 Liberty 概要文件的数据库连接。
    1. 添加下列功能部件:
      <featureManager>
                 <feature>jsp-2.2</feature> 
                 <feature>servlet-3.0</feature> 
                 <feature>appSecurity-2.0</feature> 
                 <feature>jndi-1.0</feature>   
                 <feature>jpa-2.0</feature>  
                 <feature>jdbc-4.0</feature>
          </featureManager>
    2. 定义指向 JDBC 驱动程序 JAR 或压缩文件的位置的共享库(Derby 不需要)。
      对于 DB2:
      <jdbcDriver id="db2-lib">
                 <library>
                     <fileset caseSensitive="false" dir="C:\Program Files\IBM\SQLLIB\java"/>  
                 </library> 
                </jdbcDriver>
      对于 Oracle:
      <jdbcDriver id="OracleLib">
                 <library>
                      <fileset caseSensitive="false" dir="/oracle_jdbc" includes="*.jar">  
                 </library> 
                </jdbcDriver>
    3. 使用数据库连接详细信息为 rpengdgaas 数据源定义使用 JDBC 驱动程序的数据源(Derby 不需要)。
      对于 DB2:
      <dataSource id="rpeng" jdbcDriverRef="db2-lib" jndiName="jdbc/RPENG_DB">
                 <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
                </dataSource> 
               <id="DGAAS_DB" jdbcDriverRef="db2-lib" jndiName="jdbc/DGAAS_DB">
                 <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
                </dataSource> 
      对于 Oracle:
       <dataSource id="rpeng_db" jdbcDriverRef="OracleLib" jndiName="jdbc/RPENG_DB">
             <properties.oracle password="password" URL="jdbc:oracle:thin:@//hostname/lib1" user="rpe_user"/>
          </dataSource> 
          <dataSource id="DGAAS_DB" jdbcDriverRef="db2-lib" jndiName="jdbc/DGAAS_DB">
             <properties.oracle password="password" URL="jdbc:oracle:thin:@//hostname/lib1" user="rpe_user"/>
          </dataSource>
    请参阅 WebSphere Application Server Liberty 产品文档中的在 Liberty 概要文件中配置数据库连接
  7. server.xml 文件中,添加以下条目以启用 http://server:port/dgaas/debug
    <classloading useJarUrls="true"/>
  8. server.xml 文件中,添加以下条目以便在会话管理器对未授权的请求作出响应时使会话失效,而不发出 UnauthorizedSessionRequestException 错误消息:
    <httpSession invalidateOnUnauthorizedSessionRequestException="true" cookieSecure="true"></httpSession>
  9. 将以下配置添加到 server.xml 文件。 idname 属性是可选属性。 不必完全限定 location 属性,因为缺省情况下,Liberty 将查看 apps 目录。
    对于 DB2:
    <application id="" name="rpeng" type="ear" location="[Liberty_install_dir]\usr\servers\rpeng\apps\com.ibm.rpe.web.app.ear" >
         <classloader apiTypeVisibility="spec,ibm-api,api"/>
    </application>
    对于 Oracle:
    <application type="ear" location="/opt/IBM/WebSphere/Liberty/usr/servers/rpe_oracle/apps/com.ibm.rpe.web.app.ear">
           <classloader apiTypeVisibility="spec, ibm-api, api" commonLibraryRef="rcl" />
          
    如果已部署 rpeng.wardgaas.war 文件而不是 .ear 文件,那么需要添加的应用程序条目是两个而不是一个:
    <application id="" name="rpeng" location="rpeng.war" type="war>
         <classloader commonLibraryRef="rcl" apiTypeVisibility="spec,ibm-api,api"/>
    </application>
    <application id="" name="dgaas" location="dgaas.war" type="war>
         <classloader commonLibraryRef="rcl" apiTypeVisibility="spec,ibm-api,api"/>
    </application>
  10. 针对本主题底部的示例部分提供的 server.xml 示例来验证配置设置。
  11. 设置许可证发放变量。请参阅验证 TELELOGIC_LICENSE_FILE 环境变量
  12. 启动 Liberty 概要文件。 执行文档生成时,所有资产和数据都将存储在数据库中。

结果

可以通过在浏览器中打开介绍性页面 (http://server:port/rpeng/
切记: 如果您在 Web 浏览器中遇到 UnauthorizedSessionRequestException 错误消息,请确认您已完成前一步骤,即,将以下条目添加至 server.xml 文件:
<httpSession invalidateOnUnauthorizedSessionRequestException="true"></httpSession>

示例

对于 DB2:配置为部署 文档构建器server.xml 文件的示例:
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
    <!-- Enable features -->
    <featureManager>
       <feature>jsp-2.2</feature> 
       <feature>jndi-1.0</feature>   
       <feature>jpa-2.0</feature>  
       <feature>jdbc-4.0</feature>
       <feature>servlet-3.0</feature> 
       <feature>appSecurity-2.0</feature>
    </featureManager>
    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443" host="localhost"/>
    <classloading useJarUrls="true"/>
    <!-- User creation-->
    <basicRegistry id="form" realm="WebRealm">
       <user name="rpe_user" password="xyz" />
       <user name="rpe_report_designer" password="xyz" />
       <user name="rpe_admin" password="xyz" />
    </basicRegistry>
    <application type="ear" location="C:\IBM\WebSphere\Liberty\usr\servers\rpeng\apps\com.ibm.rpe.web.app.ear">
       <classloader apiTypeVisibility="spec, ibm-api, api" commonLibraryRef="rcl" />
       <application-bnd>
          <security-role name="rpe_user">
             <user name="rpe_user" />
          </security-role>
          <security-role name="rpe_report_designer">
             <user name="rpe_report_designer" />
          </security-role>
          <security-role name="rpe_admin">
             <user name="rpe_admin" />
          </security-role>
       </application-bnd>
    </application>
    <httpSession invalidateOnUnauthorizedSessionRequestException="true"></httpSession>
    <!--Database Configuration -->
    <jdbcDriver id="db2-lib">
       <library>
          <fileset caseSensitive="false" dir="C:\Program Files\IBM\SQLLIB\java"/>  
       </library> 
    </jdbcDriver>
    <dataSource id="rpeng" jdbcDriverRef="db2-lib" jndiName="jdbc/RPENG_DB">
       <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
    </dataSource> 
    <dataSource id="DGAAS_DB" jdbcDriverRef="db2-lib" jndiName="jdbc/DGAAS_DB">
       <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
    </dataSource> 
</server>
对于 Oracle:已配置 server.xml 文件的示例以部署文档构建器
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
    <!-- Enable features -->
    <featureManager>
       <feature>jsp-2.2</feature> 
       <feature>jndi-1.0</feature>   
       <feature>jpa-2.0</feature>  
       <feature>jdbc-4.0</feature>
       <feature>servlet-3.0</feature> 
       <feature>appSecurity-2.0</feature>
       <feature>ssl-1.0</feature>
    </featureManager>
    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint id="defaultHttpEndpoint" httpPort="9445" httpsPort="9082" host="localhost"/>
    <keystore id="defaultKeyStore" password="password"/>
    <classloading useJarUrls="true"/>
   <httpSession cookieSecure="true invalidateOnUnauthorizedSessionRequestException="true"></httpSession>
    <!-- User creation-->
    <basicRegistry id="form" realm="WebRealm">
       <user name="rpe_user" password="xyz" />
       <user name="rpe_designer" password="xyz" />
       <user name="rpe_admin" password="xyz" />
    </basicRegistry>
   <!-- Define licensing Library consumption for RPE  -->
    <application type="ear" location="/opt/IBM/WebSphere/Liberty/usr/servers/rpe_oracle/apps/com.ibm.rpe.web.app.ear">
       <classloader apiTypeVisibility="spec, ibm-api, api" commonLibraryRef="rcl" />
       <application-bnd>
          <security-role name="rpe_user">
             <user name="rpe_user" />
          </security-role>
          <security-role name="rpe_report_designer">
             <user name="rpe_designer" />
          </security-role>
          <security-role name="rpe_admin">
             <user name="rpe_admin" />
          </security-role>
       </application-bnd>
    </application>
   
    <!--Database Configuration -->
    <jdbcDriver id="OracleLib">
       <library>
          <fileset caseSensitive="false" dir="/oracle_jdbc" includes="*.jar">
       </library> 
    </jdbcDriver>
    <dataSource id="rpeng_db" jdbcDriverRef="OracleLib" jndiName="jdbc/RPENG_DB">
       <properties.oracle password="password" URL="jdbc:oracle:thin:@//hostname/lib1" user="rpe_user"/>
    </dataSource> 
    <dataSource id="DGAAS_DB" jdbcDriverRef="db2-lib" jndiName="jdbc/DGAAS_DB">
       <properties.oracle password="password" URL="jdbc:oracle:thin:@//hostname/lib1" user="rpe_user"/>
    </dataSource> 
</server>

下一步做什么

(可选)可以部署和运行使用文档生成服务技术来生成文档的 Newskeeper 样本应用程序,并为文档生成服务资产和文档提供存储接口。有关更多详细信息,请参阅运行 Newskeeper 样本

配置 http://server:port/rpeng/ 页面上所列示的 Rational Publishing Engine 文档构建器。请参阅文档构建器 URL,以获取每个 URL 的用法说明以及用于配置每项功能部件的任务。