Tópico anterior: taskContextInformationPróximo tópico: Fluxo de saída padrão do Java


Métodos adicionais

Os métodos _taskContextInformation e _eventContextInformation são fornecidos por meio dos objetos do CA Identity Manager ExposedTaskContextInformation e ExposedEventContextInformation, respectivamente.

Esses objetos herdam métodos na API principal do CA Identity Manager. Consequentemente, os métodos herdados também estão disponíveis para _taskContextInformation and _eventContextInformation.

Os seguintes métodos herdados do objeto TaskInfo são particularmente úteis para um modelo de email:

Esses objetos recuperados permitem inserir informações específicas de administrador e específicas de tarefa em um email. Por exemplo:

<!-- 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>

Possível corpo do email:

Possível corpo do email

Para obter mais informações sobre os métodos herdados disponíveis para a API de modelo de email, consulte os objetos ExposedTaskContextInformation e ExposedEventContextInformation no Javadoc do CA Identity Manager.