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


Java Person.getName方法代码示例

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


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

示例1: delete

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
/**
    * @see org.kuali.rice.krad.service.PessimisticLockService#delete(java.lang.String)
    */
   @Override
public void delete(String id) {
       if (StringUtils.isBlank(id)) {
           throw new IllegalArgumentException("An invalid blank id was passed to delete a Pessimistic Lock.");
       }
       PessimisticLock lock = dataObjectService.find(PessimisticLock.class, Long.valueOf(id));
       if ( lock == null ) {
           throw new IllegalArgumentException("Pessimistic Lock with id " + id + " cannot be found in the database.");
       }
       Person user = GlobalVariables.getUserSession().getPerson();
       if ( (!lock.isOwnedByUser(user)) && (!isPessimisticLockAdminUser(user)) ) {
           throw new AuthorizationException(user.getName(),"delete", "Pessimistick Lock (id " + id + ")");
       }
       delete(lock);
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:PessimisticLockServiceImpl.java

示例2: getDisplayName

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public String getDisplayName() {
	if (isUserRequest()) {
        Person person = getPerson();
        if ( person != null ) {
	        return person.getName();
        }
	} else if (isGroupRequest()) {
        Group group = getGroup();
        if ( group != null ) {
		    return group.getName();
        } else {
            return getGroupId();
        }
	} else if (isRoleRequest()) {
		return getRoleName();
	}
	return "";
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:ActionRequestValue.java

示例3: getPersonNameByPrincipalId

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
protected String getPersonNameByPrincipalId(String principalId) {
    Person person = KimApiServiceLocator.getPersonService().getPerson(principalId);
    if (person == null) {
        // disable link and display principalId
        setDisableLink(true);
        return principalId;
    }

    return person.getName();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:UserLinkField.java

示例4: getPersonNameByPrincipalName

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
protected String getPersonNameByPrincipalName(String principalName) {
    Person person = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(principalName);
    if (person == null) {
        // disable link and display principalName
        setDisableLink(true);
        return principalName;
    }

    return person.getName();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:UserLinkField.java

示例5: setPerson

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public void setPerson(Person person) {
    this.person = person;

    if (person != null) {
        this.id = person.getPrincipalName();
        this.name = person.getName();
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:AdHocRoutePerson.java

示例6: setPerson

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
/**
 * Sets the person attribute value.
 * @param person The person to set.
 */
public void setPerson(Person person) {
    this.person = person;
    if ( person != null ) {
        principalMemberPrincipalName = person.getPrincipalName();
        principalMemberPrincipalId = person.getPrincipalId();
        principalMemberName = person.getName();
    } else {
        principalMemberPrincipalId = "";
        principalMemberPrincipalName = "";
        principalMemberName = "";
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:TestReviewRole.java

示例7: 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;

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:IncidentReportUtils.java

示例8: getInitiatorDisplayName

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public String getInitiatorDisplayName() {
    try {
        Person person = KEWServiceLocator.getIdentityHelperService().getPerson(getInitiatorWorkflowId());
        return person.getName();
    } catch (RiceIllegalArgumentException e) {
        return getInitiatorWorkflowId();
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:DocumentRouteHeaderValue.java

示例9: administerEventNotificationMessage

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
/**
 * This method handles approval/disapproval/acknowledgement of the notification request
 * @param request the HttpServletRequest
 * @param response the HttpServletResponse
 * @param command the command object bound for this MultiActionController
 * @throws ServletException
 */
private void administerEventNotificationMessage(HttpServletRequest request, HttpServletResponse response, AdministerNotificationRequestCommand command, String action) throws ServletException {
    LOG.debug("remoteUser: " + request.getRemoteUser());

    BindException bindException = new BindException(command, "command");
    ValidationUtils.rejectIfEmpty(bindException, "docId", "Document id must be specified");
    if (bindException.hasErrors()) {
        throw new ServletRequestBindingException("Document id must be specified", bindException);
    }

    // obtain a workflow user object first
    //WorkflowIdDTO user = new WorkflowIdDTO(request.getRemoteUser());
    String userId = request.getRemoteUser();

    try {
        // now construct the workflow document, which will interact with workflow
        WorkflowDocument document = NotificationWorkflowDocument.loadNotificationDocument(userId, command.getDocId());

        NotificationBo notification = retrieveNotificationForWorkflowDocument(document);

        String initiatorPrincipalId = document.getInitiatorPrincipalId();
        Person initiator = KimApiServiceLocator.getPersonService().getPerson(initiatorPrincipalId);
        String notificationBlurb =  notification.getContentType().getName() + " notification submitted by " + initiator.getName() + " for channel " + notification.getChannel().getName();
        if ("disapprove".equals(action)) {
            document.disapprove("User " + userId + " disapproving " + notificationBlurb);
        } else if ("approve".equals(action)) {
            document.approve("User " + userId + " approving " + notificationBlurb);
        } else if ("acknowledge".equals(action)) {
            document.acknowledge("User " + userId + " acknowledging " + notificationBlurb);
        }
    } catch (Exception e) {
        LOG.error("Exception occurred taking action on notification request", e);
        throw new ServletException("Exception occurred taking action on notification request", e);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:42,代码来源:AdministerNotificationRequestController.java

示例10: 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

示例11: getTransposedName

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public static String getTransposedName(UserSession userSession, PrincipalContract principal) {
	Person person = getPersonService().getPerson(principal.getPrincipalId());
	return person.getName(); //contructTransposedName(person);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:UserUtils.java


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