• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java KimApiServiceLocator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kuali.rice.kim.api.services.KimApiServiceLocator的典型用法代码示例。如果您正苦于以下问题:Java KimApiServiceLocator类的具体用法?Java KimApiServiceLocator怎么用?Java KimApiServiceLocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KimApiServiceLocator类属于org.kuali.rice.kim.api.services包,在下文中一共展示了KimApiServiceLocator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkAuthorization

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Override
protected void checkAuthorization(ActionForm form, String methodToCall) throws AuthorizationException {
    if (!(form instanceof LookupForm)) {
        super.checkAuthorization(form, methodToCall);
    } else {
        try {
            Class businessObjectClass = Class.forName(((LookupForm) form).getBusinessObjectClassName());
            if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(
                    GlobalVariables.getUserSession().getPrincipalId(), KRADConstants.KNS_NAMESPACE,
                    KimConstants.PermissionTemplateNames.LOOK_UP_RECORDS,
                    KRADUtils.getNamespaceAndComponentSimpleName(businessObjectClass),
                    Collections.<String, String>emptyMap())) {
                throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(),
                        KimConstants.PermissionTemplateNames.LOOK_UP_RECORDS,
                        businessObjectClass.getSimpleName());
            }
        }
        catch (ClassNotFoundException e) {
            LOG.warn("Unable to load BusinessObject class: " + ((LookupForm) form).getBusinessObjectClassName(), e);
            super.checkAuthorization(form, methodToCall);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:KualiLookupAction.java


示例2: testLoadToPersonDocument

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Test
public void testLoadToPersonDocument() {

	Entity entity = KimApiServiceLocator.getIdentityService().getEntity("entity123eId");
	assertNotNull(entity);
	IdentityManagementPersonDocument personDoc = new IdentityManagementPersonDocument();
	uiDocumentService.loadEntityToPersonDoc(personDoc, "entity123pId");
       EntityTypeContactInfo entityType = entity.getEntityTypeContactInfos().get(0);
       personDoc.getExternalIdentifiers();
	assertAddressTrue(personDoc.getAddrs().get(0), entityType.getAddresses().get(0));
	assertPhoneTrue(personDoc.getPhones().get(0), entityType.getPhoneNumbers().get(0));
	assertEmailTrue(personDoc.getEmails().get(0), entityType.getEmailAddresses().get(0));
	assertNameTrue(personDoc.getNames().get(0), entity.getNames().get(0));
	//assertPrincipalTrue(personDoc, identity.getPrincipals().get(0));
	assertAffiliationTrue(personDoc.getAffiliations().get(0), entity.getAffiliations().get(0));
	assertEmpInfoTrue(personDoc.getAffiliations().get(0).getEmpInfos().get(0), entity.getEmploymentInformation().get(0));

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


示例3: testGetWebFriendlyRecipientsWithGroup

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
/**
 * KULRICE-7615
 * bmcgough is a secondary delegate *for* the NonSIT group; getWebFriendlyRecipients should handle this
 */
@Test
public void testGetWebFriendlyRecipientsWithGroup() {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("jhopf"), "ActionListDocumentType_PrimaryDelegate");
    document.route("");
    Person bmcgough = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("bmcgough");
    Collection<Recipient> delegators = getActionListService().findUserSecondaryDelegators(bmcgough.getPrincipalId());
    String nonSITGroupId = getGroupIdForName("KR-WKFLW", "NonSIT");
    assertFalse(delegators.isEmpty());
    boolean nonSITGroupFound = false;
    for (Recipient d: delegators) {
        if (d instanceof KimGroupRecipient) {
            if (nonSITGroupId.equals(((KimGroupRecipient) d).getGroupId())) {
                nonSITGroupFound = true;
            }
        }
    }
    assertTrue("NonSIT group was not found as a delegator to bmcgough (has test config changed?)", nonSITGroupFound);
    // now test that it can actually deal with the KimGroupRecipient
    ActionListUtil.getWebFriendlyRecipients(delegators);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:ActionListTest.java


示例4: getErrorMessage

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Override
public String getErrorMessage(Element originalConfigElement, RequestParser requestParser, MatchingParam param) {
       if (!getEdlContext().getUserAction().isValidatableAction()) {
           return null;
       } else if (StringUtils.isBlank(param.getParamValue()) && required ) {
           // empty or whitespaces and required so send error
           return ("Network ID is a required field");
       } else if (StringUtils.isBlank(param.getParamValue()) && !required ) {
           // empty or whitespaces and not required so ignore
           return null;
	} else {
		//not blank validate as normal whether required or not
		Principal principal = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName(param.getParamValue());
		if (principal == null) {
			return ("The value " + param.getParamValue() + " is an invalid principal name");
		}
	}
	return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:NetworkIdWorkflowEDLConfigComponent.java


示例5: testIngesterPermissionExampleLikeRice

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Test
/**
 * tests {@link NamespaceWildcardAllowedAndOrStringExactMatchPermissionTypeServiceImpl#getMatchingPermissions(java.util.Map, java.util.List)}
 */
public void testIngesterPermissionExampleLikeRice() {
    Map<String, String> requestedDetails = getUseIngesterRequestedDetails();
    
    List<PermissionBo> permissionsList = new ArrayList<PermissionBo>();

    Template template = KimApiServiceLocator.getPermissionService().findPermTemplateByNamespaceCodeAndName("KR-NS",
            "Use Screen");
    permissionsList.add(createPermission(template, "Use All Screens", "KR-SYS", "namespaceCode=KR*"));
    PermissionBo exactMatch = createPermission(template, "Use Ingester Screen", "KR-WKFLW", "actionClass=" + INGESTER_ACTION, "namespaceCode=KR-WKFLW");
    permissionsList.add(exactMatch);

    List<Permission> immutablePermissionList = new ArrayList<Permission>();
    for (PermissionBo bo : permissionsList) {
        immutablePermissionList.add(PermissionBo.to(bo));
    }
   
    List<Permission> returnedPermissions = permissionService.getMatchingPermissions(requestedDetails, immutablePermissionList);
    assertTrue(returnedPermissions.size() == 1);
    assertTrue(returnedPermissions.get(0).equals(PermissionBo.to(exactMatch)));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:NamespaceWildcardAllowedAndOrStringExactMatchPermissionTypeServiceImplTest.java


示例6: sendPeriodicReminder

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
protected void sendPeriodicReminder(String principalId, Collection<ActionItem> actionItems, String emailSetting) {
    String emailBody = null;
    actionItems = filterActionItemsToNotify(principalId, actionItems, emailSetting);
    // if there are no action items after being filtered, there's no
    // reason to send the email
    if (actionItems.isEmpty()) {
        return;
    }
    if (KewApiConstants.EMAIL_RMNDR_DAY_VAL.equals(emailSetting)) {
        emailBody = buildDailyReminderBody(actionItems);
    } else if (KewApiConstants.EMAIL_RMNDR_WEEK_VAL.equals(emailSetting)) {
        emailBody = buildWeeklyReminderBody(actionItems);
    }
    Person person = KimApiServiceLocator.getPersonService().getPerson(principalId);
    sendEmail(person, getEmailSubject(), new EmailBody(emailBody));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:ActionListEmailServiceImpl.java


示例7: testUserDelegator

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
/**
 * This method tests that delegation doesn't break the email
 * 
 * @throws Exception
 */
@Test
public void testUserDelegator() throws Exception {
	
	RuleTestUtils.createDelegationToUser("EmailTestUserDocType", "WorkflowDocumentTemplate", "user1");
	
	String user1PrincipalId = getPrincipalIdForName("user1");
	
	// this document type has a group responsibility
	WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "EmailTestUserDocType");
	doc.route("");
	
	ActionListFilter actionListFilter = new ActionListFilter();
	actionListFilter.setDocumentType(doc.getDocumentTypeName());
	Collection<ActionItem> actionItems = KEWServiceLocator.getActionListService().getActionList(user1PrincipalId, actionListFilter);

	EmailContentService emailContentService = KEWServiceLocator.getEmailContentService();
	
	Person person = KimApiServiceLocator.getPersonService().getPerson(user1PrincipalId);
	EmailContent emailContent = emailContentService.generateDailyReminder(person, ActionItem.to(new ArrayList<ActionItem>(actionItems)));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:EmailContentServiceTest.java


示例8: getGroupNameByNamespaceAndName

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
protected String getGroupNameByNamespaceAndName(String namespaceCode, String groupName) {
    Group group = KimApiServiceLocator.getGroupService().getGroupByNamespaceCodeAndName(namespaceCode, groupName);
    if (group == null) {
        // disable link
        setDisableLink(true);

        if (isNamespaceInLinkText()){
            return this.groupNamespaceCode + " " + this.groupName;
        } else {
            return this.groupName;
        }
    }

    if (isNamespaceInLinkText()){
        return group.getNamespaceCode() + " " + group.getName();
    }

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


示例9: testDocSearch

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Test public void testDocSearch() throws Exception {
    Person user = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("bmcgough");
    DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
    DocumentSearchResults results = null;
    criteria.setTitle("*IN");
    criteria.setSaveName("bytitle");
    results = docSearchService.lookupDocuments(user.getPrincipalId(), criteria.build());
    criteria = DocumentSearchCriteria.Builder.create();
    criteria.setTitle("*IN-CFSG");
    criteria.setSaveName("for in accounts");
    results = docSearchService.lookupDocuments(user.getPrincipalId(), criteria.build());
    criteria = DocumentSearchCriteria.Builder.create();
    criteria.setDateApprovedFrom(new DateTime(2004, 9, 16, 0, 0));
    results = docSearchService.lookupDocuments(user.getPrincipalId(), criteria.build());
    criteria = DocumentSearchCriteria.Builder.create();
    user = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("bmcgough");
    DocumentSearchCriteria savedCriteria = docSearchService.getNamedSearchCriteria(user.getPrincipalId(), "bytitle");
    assertNotNull(savedCriteria);
    assertEquals("bytitle", savedCriteria.getSaveName());
    savedCriteria = docSearchService.getNamedSearchCriteria(user.getPrincipalId(), "for in accounts");
    assertNotNull(savedCriteria);
    assertEquals("for in accounts", savedCriteria.getSaveName());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:DocumentSearchTest.java


示例10: copy

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
/**
     * Executes a deep copy of the BaseWorkgroup
     */
 /*   private BaseWorkgroup copy(BaseWorkgroup workgroup) throws Exception {
    	BaseWorkgroup workgroupCopy = (BaseWorkgroup)KEWServiceLocator.getWorkgroupService().copy(workgroup);
    	// copy above does a shallow copy so we need to deep copy members
    	List<BaseWorkgroupMember> members = workgroupCopy.getWorkgroupMembers();
    	List<BaseWorkgroupMember> membersCopy = new ArrayList<BaseWorkgroupMember>();
    	for (BaseWorkgroupMember member : members) {
    		membersCopy.add(copy(member));
    	}
    	workgroupCopy.setWorkgroupMembers(membersCopy);
    	workgroupCopy.setMembers(new ArrayList<Recipient>());
    	workgroupCopy.materializeMembers();
    	return workgroupCopy;
    }

    private BaseWorkgroupMember copy(BaseWorkgroupMember member) throws Exception {
    	return (BaseWorkgroupMember)BeanUtils.cloneBean(member);
    }
*/

    protected Group getGroup(String groupId) {
		return KimApiServiceLocator.getGroupService().getGroup(groupId);
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:ActionItemServiceTest.java


示例11: testGenerateRemindersCustomStyleSheet

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
/**
 * tests custom stylesheet
 * @throws Exception
 */
@Test
public void testGenerateRemindersCustomStyleSheet() throws Exception {
    loadXmlFile("customEmailStyleData.xml");
    assertNotNull(CoreServiceApiServiceLocator.getStyleService().getStyle("kew.email.style"));

    Person user = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("arh14");
    int count = generateDocs(new String[] { "PingDocument", "PingDocumentWithEmailAttrib" }, user);

    Collection<ActionItem> actionItems = org.kuali.rice.kew.actionitem.ActionItem.to(new ArrayList<org.kuali.rice.kew.actionitem.ActionItem>(KEWServiceLocator.getActionListService().getActionList(user.getPrincipalId(), null)));
    assertEquals("user should have " + count + " items in his action list.", count, actionItems.size());

    EmailContent content = styleableContentService.generateImmediateReminder(user, actionItems.iterator().next(), KEWServiceLocator.getDocumentTypeService().findByName(actionItems.iterator().next().getDocName()));
    assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
    assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));

    content = styleableContentService.generateDailyReminder(user, actionItems);
    assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
    assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));

    content = styleableContentService.generateWeeklyReminder(user, actionItems);
    assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
    assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:EmailMessageTest.java


示例12: loadWebValues

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
private void loadWebValues() throws Exception {
	if (!org.apache.commons.lang.StringUtils.isEmpty(getRuleResponsibilityName())) {
		if (KewApiConstants.RULE_RESPONSIBILITY_WORKFLOW_ID.equals(getRuleResponsibilityType())) {
			// setReviewer(getUserService().getWorkflowUser(new
			// WorkflowUserId(getRuleResponsibilityName())).getPrincipalName().getAuthenticationId());
			Principal principal = KEWServiceLocator.getIdentityHelperService().getPrincipal(getRuleResponsibilityName());
			setReviewer(principal.getPrincipalName());
			setReviewerId(principal.getPrincipalId());
		} else if (KewApiConstants.RULE_RESPONSIBILITY_GROUP_ID.equals(getRuleResponsibilityType())) {
			// setReviewer(getWorkgroupService().getWorkgroup(new
			// WorkflowGroupId(new
			// Long(getRuleResponsibilityName()))).getGroupNameId().getNameId());
			Group group = KimApiServiceLocator.getGroupService().
                  getGroup(getRuleResponsibilityName());
			setReviewer(group.getName());
			setReviewerId(group.getId());
		} else if (KewApiConstants.RULE_RESPONSIBILITY_ROLE_ID.equals(getRuleResponsibilityType())) {
			setRoleReviewer(getRuleResponsibilityName());
			setReviewer(getResolvedRoleName());
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:WebRuleResponsibility.java


示例13: findUserSecondaryDelegators

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Override
public Collection<Recipient> findUserSecondaryDelegators(String principalId) {

    QueryByCriteria query = QueryByCriteria.Builder.fromPredicates(
            equal("principalId", principalId),
            equal("delegationType", DelegationType.SECONDARY.getCode()),
            or(isNotNull("delegatorPrincipalId"), isNotNull("delegatorGroupId")));

    QueryResults<ActionItem> results = dataObjectService.findMatching(ActionItem.class, query);

    Map<Object, Recipient> delegators = new HashMap<Object, Recipient>(results.getResults().size());

    for ( ActionItem actionItem : results.getResults() ) {
        String delegatorPrincipalId = actionItem.getDelegatorPrincipalId();
        String delegatorGroupId = actionItem.getDelegatorGroupId();

        if (delegatorPrincipalId != null && !delegators.containsKey(delegatorPrincipalId)) {
            delegators.put(delegatorPrincipalId,new WebFriendlyRecipient(KimApiServiceLocator.getPersonService().getPerson(delegatorPrincipalId)));
        } else if (delegatorGroupId != null && !delegators.containsKey(delegatorGroupId)) {
            delegators.put(delegatorGroupId, new KimGroupRecipient(KimApiServiceLocator.getGroupService().getGroup(delegatorGroupId)));
        }
    }

    return delegators.values();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:ActionListServiceImpl.java


示例14: viewResults

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
public ActionForward viewResults(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    LookupForm lookupForm = (LookupForm) form;
    if (lookupForm.isSearchUsingOnlyPrimaryKeyValues()) {
        lookupForm.setPrimaryKeyFieldLabels(lookupForm.getLookupable().getPrimaryKeyFieldLabels());
    }
    // KULRICE-12281- Turn off the ability to export results from  certain lookups
	 if(StringUtils.isNotBlank(request.getParameter(KRADConstants.Lookup.VIEW_RESULTS_EXPORT_OPTION))) {
        String componentName = Class.forName(lookupForm.getBusinessObjectClassName()).getSimpleName();
        String principalId = GlobalVariables.getUserSession().getPrincipalId();
        String principalUserName = GlobalVariables.getUserSession().getPrincipalName();
        Map<String, String> permissionDetails = new HashMap<String,String>();
        permissionDetails.put(KRADConstants.COMPONENT_NAME, componentName);
        boolean isAuthorized = KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(
                principalId,KRADConstants.KNS_NAMESPACE,KimConstants.PermissionTemplateNames.VIEW_RESULTS_EXPORT_ACTION,
                permissionDetails,new HashMap<String,String>());
        if(!isAuthorized){
            throw new AuthorizationException(principalUserName, "Exporting the Lookup Results", componentName);
        }
     }
    request.setAttribute(KRADConstants.SEARCH_LIST_REQUEST_KEY, request.getParameter(KRADConstants.SEARCH_LIST_REQUEST_KEY));
    request.setAttribute("reqSearchResults", GlobalVariables.getUserSession().retrieveObject(request.getParameter(
            KRADConstants.SEARCH_LIST_REQUEST_KEY)));
    request.setAttribute("reqSearchResultsActualSize", request.getParameter("reqSearchResultsActualSize"));
    return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:KualiLookupAction.java


示例15: getAuthorData

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
/**
 * Method added for notes editing function. Called by retrieveNoteList method
 * @param note
 * @throws Exception
 */

private void getAuthorData(Note note) throws Exception {
    Person workflowUser = null;
    String id = "";
    if (note != null && note.getNoteAuthorWorkflowId() != null
            && !"".equalsIgnoreCase(note.getNoteAuthorWorkflowId())) {
        workflowUser = KimApiServiceLocator.getPersonService().getPerson(note.getNoteAuthorWorkflowId());
        id = note.getNoteAuthorWorkflowId();
    }
    if (workflowUser != null) {
        note.setNoteAuthorFullName(workflowUser.getName());
        note.setNoteAuthorEmailAddress(workflowUser.getEmailAddress());
        note.setNoteAuthorNetworkId(workflowUser.getPrincipalName());
    } else {
        note.setNoteAuthorFullName(id + " (Name not Available)");
        note.setNoteAuthorEmailAddress("Not Available");
        note.setNoteAuthorNetworkId("Not Available");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:NoteConfigComponent.java


示例16: doesPrincipalHaveRequest

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Override
public boolean doesPrincipalHaveRequest(String principalId, String documentId) {
    QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create().setPredicates(
            equal(PRINCIPAL_ID, principalId),
            equal(DOCUMENT_ID, documentId),
            equal(RECIPIENT_TYPE_CD, RecipientType.PRINCIPAL.getCode()),
            equal(CURRENT_INDICATOR, Boolean.TRUE)
    );

    criteria.setCountFlag(CountFlag.ONLY);
    Integer count = getDataObjectService().findMatching(ActionRequestValue.class, criteria.build()).getTotalRowCount();
    if (count != null && count > 0) {
        return true;
    }
    // TODO since we only store the workgroup id for workgroup requests, if the user is in a workgroup that has a request
    // than we need get all the requests with workgroup ids and see if our user is in that group
    List<String> groupIds = getActionRequestDAO().getRequestGroupIds(documentId);
    for (String groupId : groupIds) {
        if (KimApiServiceLocator.getGroupService().isMemberOfGroup(principalId, groupId)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:ActionRequestServiceImpl.java


示例17: validDuplicateRoleName

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected boolean validDuplicateRoleName(IdentityManagementRoleDocument roleDoc){
       Role role = KimApiServiceLocator.getRoleService().getRoleByNamespaceCodeAndName(roleDoc.getRoleNamespace(),
               roleDoc.getRoleName());
   	boolean rulePassed = true;
   	if(role!=null){
   		if(role.getId().equals(roleDoc.getRoleId())) {
               rulePassed = true;
           }
   		else{
    		GlobalVariables.getMessageMap().putError("document.roleName",
    				RiceKeyConstants.ERROR_DUPLICATE_ENTRY, new String[] {"Role Name"});
    		rulePassed = false;
   		}
   	}
   	return rulePassed;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:IdentityManagementRoleDocumentRule.java


示例18: testGetPersonByExternalIdentifier

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
/**
 * Test method for {@link org.kuali.rice.kim.impl.identity.PersonServiceImpl#getPersonByExternalIdentifier(java.lang.String, java.lang.String)}.
 */
@Test
public void testGetPersonByExternalIdentifier() {
	//insert external identifier
	Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal("p1");

       EntityExternalIdentifierBo externalIdentifier = new EntityExternalIdentifierBo();
	externalIdentifier.setId("externalIdentifierId");
	externalIdentifier.setEntityId(principal.getEntityId());
	externalIdentifier.setExternalId("000-00-0000");
	externalIdentifier.setExternalIdentifierTypeCode("SSN");
       KradDataServiceLocator.getDataObjectService().save(externalIdentifier);
	
	List<Person> people = personService.getPersonByExternalIdentifier( "SSN", "000-00-0000" );
	assertNotNull( "result object must not be null", people );
	assertEquals( "exactly one record should be returned", 1, people.size() );
	assertEquals( "the returned principal is not correct", "p1", people.get(0).getPrincipalId() );
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:PersonServiceImplTest.java


示例19: getMemberNamespaceCode

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
@Override
public String getMemberNamespaceCode() {
    if (getType() == null || StringUtils.isEmpty(getMemberId())) {
        return "";
    }
    this.memberNamespaceCode = "";
    if (MemberType.PRINCIPAL.equals(getType())) {
        this.memberNamespaceCode = "";
    } else if (MemberType.GROUP.equals(getType())) {
        Group groupInfo = KimApiServiceLocator.getGroupService().getGroup(getMemberId());
        if (groupInfo != null) {
            this.memberNamespaceCode = groupInfo.getNamespaceCode();
        }
    } else if (MemberType.ROLE.equals(getType())) {
        Role role = KimApiServiceLocator.getRoleService().getRole(getMemberId());
        if (role != null) {
            this.memberNamespaceCode = role.getNamespaceCode();
        }
    }
    return this.memberNamespaceCode;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:RoleMemberBo.java


示例20: marshal

import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入依赖的package包/类
/**
 * @see javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
 */
@Override
public NameAndNamespacePair marshal(String v) throws Exception {
    if (v != null) {
        KimTypeContract kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(StringUtils.trim(v));
        if (kimType == null) {
            throw new MarshalException("Cannot find KIM Type with ID \"" + v + "\"");
        }
        return new NameAndNamespacePair(kimType.getNamespaceCode(), kimType.getName());
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:NameAndNamespacePairToKimTypeIdAdapter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VideoItem类代码示例发布时间:2022-05-22
下一篇:
Java RSAPublicBCPGKey类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap