业务流程编排器资源管理器 JSF 组件提供的实用程序

JavaServer Faces(JSF)组件提供了实用程序来处理特定于用户的时区信息以及错误。

特定于用户的时区信息

BPCListHandler 类使用 com.ibm.bpc.clientcore.util.User 接口来获取每个用户的时区信息和语言环境信息。“列表”组件期望将此接口的实现中的 user 配置成 JavaServer Faces(JSF)配置文件中的受管 Bean 名称。如果配置文件未包含此条目,则将返回 WebSphere Process Server 使用的时区。

com.ibm.bpc.clientcore.util.User 接口的定义如下所示:
public interface User {

    /**
     * The locale used by the client of the user.
     * @return Locale.
     */
    public Locale getLocale();
   /**
    * The time zone used by the client of the user.    
    * @return TimeZone.
    */
    public TimeZone getTimeZone();

   /**
    * The name of the user.
    * @return name of the user.
    */
    public String getName();
}

用于处理错误的 ErrorBean 接口

有时,JSF 组件使用预定义的受管 Bean BPCError 来处理错误。这个 Bean 实现了 com.ibm.bpc.clientcore.util.ErrorBean 接口。在触发了错误页面的错误情况下,将对错误 Bean 设置此异常。在下列情况下将显示错误页面:
  • 在执行对列表处理程序定义的查询期间发生了错误,并且该错误是由命令的 execute 方法作为 ClientException 错误抛出的
  • 如果命令的 execute 方法抛出了 ClientException 错误,并且此错误既不是 ErrorsInCommandException 错误也未实现 CommandBarMessage 接口
  • 如果在该组件中显示了错误消息,并且您转到了该消息的超链接

com.ibm.bpc.clientcore.util.ErrorBeanImpl 接口提供了缺省实现。

此接口的定义如下所示:
public interface ErrorBean {

    public void setException(Exception ex);
    
    /*
     * This setter method call allows a locale and 
     * the exception to be passed. This allows the 
     * getExceptionMessage methods to return localized Strings
     *
     */
    public void setException(Exception ex, Locale locale);
    
    public Exception getException();
    public String getStack();
    public String getNestedExceptionMessage();
    public String getNestedExceptionStack();
    public String getRootExceptionMessage();
    public String getRootExceptionStack();
    
    /*
     * This method returns the exception message 
     * concatenated recursively with the messages of all 
     * the nested exceptions.
     */
    public String getAllExceptionMessages();
    
    /*
     * This method is returns the exception stack 
     * concatenated recursively with the stacks of all 
     * the nested exceptions.
     */
    public String getAllExceptionStacks();
}

使用条款 |


(c) Copyright IBM Corporation 2005, 2006.
本信息中心基于 Eclipse 技术(http://www.eclipse.org)。