上一主题: _taskContextInformation下一主题: Java 标准输出流


其他方法

_taskContextInformation 和 _eventContextInformation 中的方法是通过 Identity Manager 对象 ExposedTaskContextInformation 和 ExposedEventContextInformation 分别提供的。

这些对象继承核心 Identity Manager API 中的方法。 因此,继承的方法也可以用于 _taskContextInformation 和 _eventContextInformation。

从 TaskInfo 对象继承的下列方法对电子邮件模板特别有用:

这些检索的对象允许您将针对管理员和针对任务的信息插入电子邮件。 例如:

<!-- Define the E-mail Properties --->

<%
   _cc = "" ;
   _bcc = "" ;
   _subject = _eventContextInformation.getEventName() +
                                              " Approval Request";
%>
<!--- Start of Body --->
<html>
<body text="Navy">

The following item has been added to your work list for approval:<br>
<br>
User <b><%= _eventContextInformation.getAdministrator().
               getAttribute(Packages.com.netegrity.llsdk6.imsapi.
                managedobject.User.PROPERTY_FRIENDLY_NAME)%> </b>
               from department <b><%= _eventContextInformation.
               getAdministrator().getOrg(null).getFriendlyName()
               %></b> initiated task <b><%= _eventContextInformation.
               getAdminTask().getFriendlyName() %></b>at <b><%=                _eventContextInformation.getSessionCreateTime() %></b>
<br><br>
<font color="green">Details: </font><b><%=_eventContextInformation.
                                          getEventName()%></b><br>
<font color="green"><%=_eventContextInformation.
                              getPrimaryObjectTypeName()%>:</font>
<b><%=_eventContextInformation.getPrimaryObjectName()%></b> 
                                                      was modified
<br>
<font color="green">Updated Attributes:</font>
<table border="1">
<tr>
  <td><b>Name</b></td>
  <td><b>Value</b></td>
</tr>
<%
   var event = _eventContextInformation.getEvent();
   if(event instanceof Packages.com.netegrity.imapi.UserEvent) {
      var user = event.getUser();
      var attributes = user.getAttributes().keys();
      while(attributes.hasMoreElements()) {
         var attr = attributes.nextElement();
         var value = user.getAttribute(attr);
         if(user.hasAttributeChanged(attr)) {
            template.add("<tr><td>" + attr +"</td>");
            template.add("<td>" + value +"</td></tr>");
         }
      }
   }
%>
</table>
<br>
</body>
</html>

可能的电子邮件正文:

有关电子邮件模板 API 可用的继承的方法的详细信息,请参阅“Identity Manager Javadoc”中的 ExposedTaskContextInformation 和 ExposedEventContextInformation 对象。