创建后处理插件

管理员可创建后处理插件,以便为组织中所有用户在部署级别添加后处理功能,而不是编码到每个单独的文档规范中。例如,可添加诸如复制、归档或重命名输出文件、通过电子邮件发送结果或将生成的文档上载到服务器之类的后处理功能。

关于此任务

过程

要为后处理创建新插件并将其部署到客户机,请执行以下操作:

  1. 创建一个新的插件项目。
  2. 添加扩展点应为 RRDGPostProcessor 的新扩展。
  3. 提供新扩展的标识和名称。 例如,如果新扩展的名称为 PostProcessor1,那么应该在 plugin.xml 文件中显示与此扩展相似的条目:
    <extension id="PostProcessor1" name="PostProcessor1" point="com.ibm.rational.rrdg.RRDGPostProcessor">
         <RRDGPostProcessor class="com.ibm.rational.rpe.postprocessor.PostProcessor1">
         </RRDGPostProcessor>
    </extension>
  4. 使用以下代码创建 PostProcessor1 类:
    public class PostProcessor1 implements IPostProcessor
    {
        @Override
        public void processResults(List <RPEResult> results) 
        {  
           //All the code for processing results should go here. 
        }
     }
  5. 应将以下处理结果的代码添加到 PostProcessor1.processResults 方法。
  6. 将插件和包编译为 .jar 文件。
  7. 针对本地文档生成,将打包的 .jar 文件放置到 <RPE_installdir>/launcher/plugins 文件夹中,且应该在 Launcher 启动时装入此文件。针对 Document Studio,将 .jar 文件添加到 <RPE_installdir>/studio/plugins 文件夹。
  8. 针对远程服务,将打包的 .jar 文件添加到 <RPE_installdir>/webapps/WEB-INF/lib/plugins 文件夹中。 如果 plugins 文件夹不存在,那么手动创建此文件夹。

反馈