本文整理汇总了Java中org.kuali.rice.kim.api.identity.Person.getEmailAddressUnmasked方法的典型用法代码示例。如果您正苦于以下问题:Java Person.getEmailAddressUnmasked方法的具体用法?Java Person.getEmailAddressUnmasked怎么用?Java Person.getEmailAddressUnmasked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.api.identity.Person
的用法示例。
在下文中一共展示了Person.getEmailAddressUnmasked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateRequestForIncidentReport
import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public static Map<String, String> populateRequestForIncidentReport(Exception exception,
String documentId, String componentName, HttpServletRequest request) {
// Create properties of form and user for additional information
// to be displayed or passing through JSP
Map<String, String> properties = new HashMap<String, String>();
properties.put(KualiExceptionIncident.DOCUMENT_ID, documentId);
String userEmail = "";
String userName = "";
String uuid = "";
// No specific forward for the caught exception, use default logic
// Get user information
UserSession userSession = (UserSession) request.getSession()
.getAttribute(KRADConstants.USER_SESSION_KEY);
Person sessionUser = null;
if (userSession != null) {
sessionUser = userSession.getPerson();
}
if (sessionUser != null) {
userEmail = sessionUser.getEmailAddressUnmasked();
userName = sessionUser.getName();
uuid = sessionUser.getPrincipalName();
}
properties.put(KualiExceptionIncident.USER_EMAIL, userEmail);
properties.put(KualiExceptionIncident.USER_NAME, userName);
properties.put(KualiExceptionIncident.UUID, uuid);
properties.put(KualiExceptionIncident.COMPONENT_NAME, componentName);
// Reset the exception so the forward action can read it
request.setAttribute(Globals.EXCEPTION_KEY, exception);
// Set exception current information
request.setAttribute(EXCEPTION_PROPERTIES, properties);
return properties;
}
示例2: getEmailTo
import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
protected EmailTo getEmailTo(Person user) {
String address = user.getEmailAddressUnmasked();
if (!isProduction()) {
LOG.info("If this were production, email would be sent to "+ user.getEmailAddressUnmasked());
address = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(
KewApiConstants.KEW_NAMESPACE,
KRADConstants.DetailTypes.ACTION_LIST_DETAIL_TYPE,
KewApiConstants.ACTIONLIST_EMAIL_TEST_ADDRESS);
}
return new EmailTo(address);
}
示例3: loadConfiguration
import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
protected void loadConfiguration(RouteContext context) throws Exception {
String contentFragment = context.getNodeInstance().getRouteNode().getContentFragment();
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = db.parse(new InputSource(new StringReader(contentFragment)));
if (!isProduction()) {
NodeList testAddresses = document.getElementsByTagName("testAddress");
if (testAddresses.getLength() >= 1) {
this.to = testAddresses.item(0).getTextContent();
}
} else {
NodeList toAddresses = document.getElementsByTagName("to");
if (toAddresses.getLength() != 1) {
throw new WorkflowRuntimeException("Must have exactly one 'to' address");
}
to = toAddresses.item(0).getTextContent();
if ("initiator".equalsIgnoreCase(to))
{
Person person = KimApiServiceLocator.getPersonService().getPerson(context.getDocument().getInitiatorWorkflowId());
to = (person == null ? "" : person.getEmailAddressUnmasked());
}
if (StringUtils.isBlank(to)) {
throw new WorkflowRuntimeException("Email Address is missing from user's profile.");
}
}
NodeList fromAddresses = document.getElementsByTagName("from");
if (fromAddresses.getLength() != 1) {
throw new WorkflowRuntimeException("Must have exactly one 'from' address");
}
this.from = fromAddresses.item(0).getTextContent();
if ("initiator".equalsIgnoreCase(this.from)) {
Person initiator = KEWServiceLocator.getIdentityHelperService().getPerson(context.getDocument().getInitiatorWorkflowId());
// contructs the email from so that it includes name as well as address
// for example: "Doe, John D" <[email protected]>
this.from = "\"" + initiator.getName() + "\" <";
this.from += initiator.getEmailAddress() + ">";
}
if (StringUtils.isBlank(this.from)) {
throw new WorkflowRuntimeException("No email address could be found found for principal with id " + context.getDocument().getInitiatorWorkflowId());
}
if (LOG.isInfoEnabled()) {
LOG.info("Email From is set to:" + this.from);
LOG.info("Email To is set to:" + this.to);
}
NodeList styleNames = document.getElementsByTagName("style");
if (styleNames.getLength() != 1) {
throw new WorkflowRuntimeException("Must have exactly one 'style'");
}
this.styleName = styleNames.item(0).getTextContent();
}