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

Java UserDirectoryService类代码示例

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

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



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

示例1: setUp

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
@Before
public void setUp() throws UserNotDefinedException {
    MockitoAnnotations.initMocks(this);
    provider = new MembershipEntityProvider();
    provider.setSiteService(siteService);
    provider.setDeveloperHelperService(developerHelperService);
    provider.setUserEntityProvider(userEntityProvider);
	provider.setSecurityService(securityService);
    userDirectoryService = Mockito.mock(UserDirectoryService.class);
    userAuditRegistrationService = Mockito.mock(UserAuditRegistration.class);
    provider.setUserDirectoryService(userDirectoryService);
    provider.setUserAuditRegistration(userAuditRegistrationService);
    provider.setPrivacyManager(privacyManager);

    User user = mock(User.class);
    when(userDirectoryService.getUser("user-foo")).thenReturn(user);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:18,代码来源:MembershipEntityProviderTest.java


示例2: SiteEmailNotificationRWiki

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
/**
 * Construct.
 */
public SiteEmailNotificationRWiki(RWikiObjectService rwikiObjectService,
		RenderService renderService, PreferenceService preferenceService,
		SiteService siteService, SecurityService securityService,
		EntityManager entityManager, ThreadLocalManager threadLocalManager,
		TimeService timeService, DigestService digestService, UserDirectoryService userDirectoryService) {
	this.renderService = renderService;
	this.rwikiObjectService = rwikiObjectService;
	this.preferenceService = preferenceService;
	this.siteService = siteService;
	this.securityService = securityService;
	this.entityManager = entityManager;
	this.threadLocalManager = threadLocalManager;
	this.timeService = timeService;
	this.digestService = digestService;
	this.userDirectoryService = userDirectoryService;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:20,代码来源:SiteEmailNotificationRWiki.java


示例3: setUp

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	userDirectoryService = getService(UserDirectoryService.class);
	siteService = getService(SiteService.class);
	authzGroupService = getService(AuthzGroupService.class);
	
	actAsUserEid("admin");
	
	// Add test users.
	addUserWithEid(NOT_IN_SITE_USER_EID);
	addUserWithEid(UNADVISED_USER_EID);
	addUserWithEid(DISPLAY_ADVISED_USER_EID);
	
	// Add test sites.
	Site site = siteService.addSite(STANDARD_SITE_NAME, "project");
	siteService.save(site);
	standardSiteUid = site.getReference();
	
	site = siteService.addSite(CONTEXTUAL_SITE_NAME, "project");
	siteService.save(site);
	contextualSiteUid = site.getReference();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:23,代码来源:ContextualDisplayServiceTest.java


示例4: DeveloperHelperServiceImpl

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
/**
 * Full constructor
 * @param entityBroker
 * @param entityBrokerManager
 * @param authzGroupService
 * @param functionManager
 * @param securityService
 * @param serverConfigurationService
 * @param sessionManager
 * @param siteService
 * @param toolManager
 * @param userDirectoryService
 */
public DeveloperHelperServiceImpl(EntityBroker entityBroker,
        EntityBrokerManager entityBrokerManager, 
        AuthzGroupService authzGroupService,
        FunctionManager functionManager, SecurityService securityService,
        ServerConfigurationService serverConfigurationService, SessionManager sessionManager,
        SiteService siteService, ToolManager toolManager,
        UserDirectoryService userDirectoryService) {
    super(entityBroker, entityBrokerManager);
    this.authzGroupService = authzGroupService;
    this.functionManager = functionManager;
    this.securityService = securityService;
    this.serverConfigurationService = serverConfigurationService;
    this.sessionManager = sessionManager;
    this.siteService = siteService;
    this.toolManager = toolManager;
    this.userDirectoryService = userDirectoryService;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:31,代码来源:DeveloperHelperServiceImpl.java


示例5: setUp

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
@Before
public void setUp() throws UserNotDefinedException {
    provider = new UserEntityProvider();
    uds = Mockito.mock(UserDirectoryService.class);
    dhs = Mockito.mock(DeveloperHelperService.class);
    user = Mockito.mock(User.class);

    // Set the default for these methods, need to use Yoda syntax when mocking other invocations of these methods.
    Mockito.when(uds.getUserId(Mockito.anyString())).thenThrow(UserNotDefinedException.class);
    Mockito.when(uds.getUserByEid(Mockito.anyString())).thenThrow(UserNotDefinedException.class);
    Mockito.when(uds.getUserByAid(Mockito.anyString())).thenThrow(UserNotDefinedException.class);
    Mockito.when(uds.getUserEid(Mockito.anyString())).thenThrow(UserNotDefinedException.class);

    provider.setUserDirectoryService(uds);
    provider.setDeveloperHelperService(dhs);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:17,代码来源:UserEntityProviderFindAndCheckUserId.java


示例6: setupServices

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
/**
 * Sets up the services needed by the BaseSite to operate
 * @param siteService the BSS
 * @param sessionManager the SM
 * @param userDirectoryService the UDS
 * @throws java.lang.IllegalStateException if the services would be null
 */
void setupServices(BaseSiteService siteService, SessionManager sessionManager, UserDirectoryService userDirectoryService) {
	this.siteService = siteService;
	if (this.siteService == null) {
		this.siteService = (BaseSiteService) ComponentManager.get(SiteService.class);
		if (this.siteService == null) {
			throw new IllegalStateException("Cannot get the SiteService when constructing BaseSite");
		}
	}
	this.authzGroupService = this.siteService.authzGroupService();
	this.sessionManager = sessionManager;
	if (this.sessionManager == null) {
		this.sessionManager = (SessionManager) ComponentManager.get(SessionManager.class);
		if (this.sessionManager == null) {
			throw new IllegalStateException("Cannot get the SessionManager when constructing BaseSite");
		}
	}
	this.userDirectoryService = userDirectoryService;
	if (this.userDirectoryService == null) {
		this.userDirectoryService = (UserDirectoryService) ComponentManager.get(UserDirectoryService.class);
		if (this.userDirectoryService == null) {
			throw new IllegalStateException("Cannot get the UserDirectoryService when constructing BaseSite");
		}
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:32,代码来源:BaseSite.java


示例7: execute

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
public void execute(JobExecutionContext context) throws JobExecutionException {
	//TODO lock while executing?
	String id;
	try
	{
		Session s = sessionManager.getCurrentSession();
		if (s != null)
			s.setUserId(UserDirectoryService.ADMIN_ID);
		
		//job details 
		JobDetail jobDetail = context.getJobDetail();
		jobName = jobDetail.getKey().getName();
		JobDataMap dataMap = jobDetail.getJobDataMap();
		
		//job execution parameters
		id = (String)dataMap.get("ID");
		currentUserId = (String)dataMap.getString("CURRENT_USER");
		if(id == null || currentUserId == null) {
			//TODO add to audit trail
			throw new JobExecutionException("ContentResource id and/or current User id null");
		}
		
		//parse and persist the XML data
		results = evalImport.process(id, currentUserId);
		
		//TODO email results to current user
	}
	catch(Exception e) {
		//TODO add to audit trail
		LOG.error("job execution " + e);
	}
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:33,代码来源:EvalImportJobImpl.java


示例8: setUp

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
@Before
public void setUp() {
    provider = new UserEntityProvider();
    uds = Mockito.mock(UserDirectoryService.class);
    dhs = Mockito.mock(DeveloperHelperService.class);
    user = Mockito.mock(User.class);

    provider.setUserDirectoryService(uds);
    provider.setDeveloperHelperService(dhs);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:11,代码来源:UserEntityProviderGetUserByIdEidTest.java


示例9: UserIdComparator

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
public UserIdComparator(UserDirectoryService userDirectoryService) {
    this.userDirectoryService = userDirectoryService;
    // TODO this should be in a service and should repect the current user's locale
    try {
        collator = new RuleBasedCollator(((RuleBasedCollator) Collator.getInstance()).getRules().replaceAll("<'\u005f'", "<' '<'\u005f'"));
    } catch (ParseException e) {
        // error with init RuleBasedCollator with rules
        // use the default Collator
        collator = Collator.getInstance();
        log.warn("{} UserIdComparator cannot init RuleBasedCollator. Will use the default Collator instead. {}", this, e);
    }
    // This is to ignore case of the values
    collator.setStrength(Collator.SECONDARY);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:15,代码来源:UserIdComparator.java


示例10: setUp

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	log.debug("Setting up UserDirectoryServiceIntegrationTest");		
	userDirectoryService = (UserDirectoryService)getService(UserDirectoryService.class.getName());
	threadLocalManager = (ThreadLocalManager)getService(ThreadLocalManager.class.getName());
	eventTrackingService = (EventTrackingService)getService(EventTrackingService.class);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:8,代码来源:RequireLocalAccountLegacyAuthenticationTest.java


示例11: addUserWithEid

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
private static User addUserWithEid(UserDirectoryService userDirectoryService, String eid) throws Exception {
	BaseResourceProperties props = new BaseResourceProperties();
	props.addProperty(USER_SOURCE_PROPERTY, "local");
	User user = userDirectoryService.addUser(null, eid, "J. " + eid, "de " + eid, eid + "@somewhere.edu", eid + "pwd", "Guest", props);
	eidToId.put(eid, user.getId());
	log.debug("addUser eid=" + eid + ", id=" + user.getId());
	return user;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:9,代码来源:UserDirectoryServiceGetTest.java


示例12: update

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
public void update(Observable o, Object arg) {
	// arg is Event
	if (!(arg instanceof Event))
		return;
	Event event = (Event) arg;
	
	
	// check the event function against the functions we have notifications watching for
	String function = event.getEvent();
	
	if (UserDirectoryService.SECURE_REMOVE_USER.equals(function)) {
		//then delete this users profiles
		
		
		Reference ref = entityManager.newReference(event.getResource());
		
		// look for group reference. Need to replace it with parent site reference
		String refId = ref.getId();
		
		///TODO we need a security advisor
		
		SakaiPerson sp = sakaiPersonManager.getSakaiPerson(refId, sakaiPersonManager.getUserMutableType());
		if (sp != null) {
			sakaiPersonManager.delete(sp);
		}
		
		sp = sakaiPersonManager.getSakaiPerson(refId, sakaiPersonManager.getSystemMutableType());
		if (sp != null) {
			sakaiPersonManager.delete(sp);
		}
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:33,代码来源:SakaiPersonObserver.java


示例13: DropboxNotification

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
/**
 * The preferred form for construction is to supply the needed items rather than having to do a lookup. This constructor was
 * left in place for compatibility with any custom tool that might currently be using it, but should be considered deprecated.
 * 
 * @deprecated
 */
public DropboxNotification() {
	this.securityService = (SecurityService) ComponentManager.get("org.sakaiproject.authz.api.SecurityService");
	this.contentHostingService = (ContentHostingService) ComponentManager.get("org.sakaiproject.content.api.ContentHostingService");
	this.entityManager = (EntityManager) ComponentManager.get("org.sakaiproject.entity.api.EntityManager");
	this.siteService = (SiteService) ComponentManager.get("org.sakaiproject.site.api.SiteService");
	this.userDirectoryService = (UserDirectoryService) ComponentManager.get("org.sakaiproject.user.api.UserDirectoryService");
	this.serverConfigurationService = (ServerConfigurationService) ComponentManager
			.get("org.sakaiproject.component.api.ServerConfigurationService");
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:16,代码来源:DropboxNotification.java


示例14: ArchiveAction

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
public ArchiveAction() {
	super();
	courseManagementService = ComponentManager.get(CourseManagementService.class);
	siteService = ComponentManager.get(SiteService.class);
	sessionManager = ComponentManager.get(SessionManager.class);
	userDirectoryService = ComponentManager.get(UserDirectoryService.class);
	authzGroupService = ComponentManager.get(AuthzGroupService.class);
	serverConfigurationService = ComponentManager.get(ServerConfigurationService.class);
	archiveService = ComponentManager.get(ArchiveService.class);
	securityService = ComponentManager.get(SecurityService.class);
	idManager = ComponentManager.get(IdManager.class);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:ArchiveAction.java


示例15: RealmsAction

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
public RealmsAction()
{
	authzGroupService = ComponentManager.get(AuthzGroupService.class);
	functionManager = ComponentManager.get(FunctionManager.class);
	groupProvider = ComponentManager.get(GroupProvider.class);
	securityService = ComponentManager.get(SecurityService.class);
	sessionManager = ComponentManager.get(SessionManager.class);
	toolManager = ComponentManager.get(ToolManager.class);
	userDirectoryService = ComponentManager.get(UserDirectoryService.class);
	userAuditRegistration = ComponentManager.get(UserAuditRegistration.class);
	userAuditService = ComponentManager.get(UserAuditService.class);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:RealmsAction.java


示例16: SearchBeanImpl

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
/**
 * @see #SearchBeanImpl(HttpServletRequest, SearchService, SiteService, ToolManager)
 */
public SearchBeanImpl(HttpServletRequest request, String sortName,
		String filterName, SearchService searchService,
		SiteService siteService, ToolManager toolManager,
		UserDirectoryService userDirectoryService, SecurityService securityService, ServerConfigurationService serverConfigurationService) throws IdUnusedException
{
	this(request, searchService, siteService, toolManager, userDirectoryService, securityService, serverConfigurationService);
	this.sortName = sortName;
	this.filterName = filterName;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:SearchBeanImpl.java


示例17: init

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
public void init()
{
	ComponentManager cm = org.sakaiproject.component.cover.ComponentManager
			.getInstance();
	sessionManager = (SessionManager) load(cm, SessionManager.class
			.getName());
	searchService = (SearchService) load(cm, SearchService.class.getName());
	siteService = (SiteService) load(cm, SiteService.class.getName());
	toolManager = (ToolManager) load(cm, ToolManager.class.getName());
	userDirectoryService = (UserDirectoryService) load(cm, UserDirectoryService.class.getName());
	securityService = (SecurityService)load(cm, SecurityService.class.getName());
	serverConfigurationService = (ServerConfigurationService) load(cm, ServerConfigurationService.class.getName());
	
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:15,代码来源:SearchBeanFactoryImpl.java


示例18: setUp

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
/**
 * Setup test fixture (runs once for each test method called)
 */
public void setUp() throws Exception {
	// Fetch the services we need to run the tests
	sectionAwareness = (SectionAwareness)getService(SectionAwareness.class.getName());
	siteService = (SiteService)getService(SiteService.class.getName());
	userDirService = (UserDirectoryService)getService(UserDirectoryService.class.getName());
	sessionManager = (SessionManager)getService(SessionManager.class.getName());

	Session session = sessionManager.getCurrentSession();
	session.setUserId("admin");
	session.setUserEid("admin");

	// Create some users
	userDirService.addUser("test.user.a", "test.user.a", "Jane", "Doe", "[email protected]", "123", null, null);
	userDirService.addUser("test.user.b", "test.user.b", "Joe", "Schmoe", "[email protected]", "123", null, null);

	// Create a site
	site = siteService.addSite(generateSiteId(), "course");
	
	// Create a group for SectionAwareness to, er, become aware of
	group1 = site.addGroup();
	group1.setTitle(GROUP1_TITLE);
			
	// Save the group
	siteService.save(site);
	
	site.addMember("test.user.a", "Student", true, false);

	// Save the site and its new member
	siteService.save(site);

	// Add a user to a group
	group1.addMember("test.user.a", "Student", true, false);
	
	// Save the group with its new member
	siteService.saveGroupMembership(site);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:40,代码来源:SectionAwarenessImplTest.java


示例19: init

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);
    ComponentManager componentManager = org.sakaiproject.component.cover.ComponentManager.getInstance();
    oAuthService = (OAuthService) componentManager.get(OAuthService.class);
    oAuthHttpService = (OAuthHttpService) componentManager.get(OAuthHttpService.class);
    sessionManager = (SessionManager) componentManager.get(SessionManager.class);
    activeToolManager = (ActiveToolManager) componentManager.get(ActiveToolManager.class);
    userDirectoryService = (UserDirectoryService) componentManager.get(UserDirectoryService.class);
    serverConfigurationService =
            (ServerConfigurationService) componentManager.get(ServerConfigurationService.class);
    // TODO: get this path from the configuration (injection?)
    authorisePath = "/authorise.jsp";
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:15,代码来源:AuthorisationServlet.java


示例20: init

import org.sakaiproject.user.api.UserDirectoryService; //导入依赖的package包/类
@Override
public void init(FilterConfig filterConfig) throws ServletException {
    ComponentManager componentManager = org.sakaiproject.component.cover.ComponentManager.getInstance();
    oAuthHttpService = (OAuthHttpService) componentManager.get(OAuthHttpService.class);
    sessionManager = (SessionManager) componentManager.get(SessionManager.class);
    userDirectoryService = (UserDirectoryService) componentManager.get(UserDirectoryService.class);
    usageSessionService = (UsageSessionService) componentManager.get(UsageSessionService.class);
    // authenticationManager = (AuthenticationManager) componentManager.get(AuthenticationManager.class);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:10,代码来源:OAuthPostFilter.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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