当前位置: 首页>>代码示例>>Java>>正文


Java Person.getEmailAddress方法代码示例

本文整理汇总了Java中org.kuali.rice.kim.api.identity.Person.getEmailAddress方法的典型用法代码示例。如果您正苦于以下问题:Java Person.getEmailAddress方法的具体用法?Java Person.getEmailAddress怎么用?Java Person.getEmailAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kim.api.identity.Person的用法示例。


在下文中一共展示了Person.getEmailAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFromAddress

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
protected String getFromAddress() {
       // First check if message template already defines the mailing list
       String email = this.getMessageTemplate().getFromAddress();

       if (StringUtils.isBlank(email)) {
           Person actualUser = GlobalVariables.getUserSession().getActualPerson();

           if (StringUtils.isBlank(actualUser.getEmailAddress())) {
               String em = "No email address available from the current user or messageTemplate does not have FromAddress already set.";
               LOG.error(em);
               throw new IllegalStateException(em);
           } else {
               return actualUser.getEmailAddress();
           }
       } else {
           return email;
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:KualiFeedbackServiceImpl.java

示例2: 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();
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:54,代码来源:EmailNode.java


注:本文中的org.kuali.rice.kim.api.identity.Person.getEmailAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。