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


Java PersonService类代码示例

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


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

示例1: setUp

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@Override
public void setUp() throws Exception
{  
    AuthenticationUtil.setRunAsUserSystem();
    nodeService = (NodeService)ctx.getBean("NodeService");
    assertNotNull("nodeService", nodeService);
    authorityService = (AuthorityService)ctx.getBean("AuthorityService");
    assertNotNull("authorityService", authorityService);
    ChildApplicationContextFactory emailSubsystem = (ChildApplicationContextFactory) ctx.getBean("InboundSMTP");
    assertNotNull("emailSubsystem", emailSubsystem);
    ApplicationContext emailCtx = emailSubsystem.getApplicationContext();
    emailService = (EmailService)emailCtx.getBean("emailService");       
    assertNotNull("emailService", emailService);
    personService = (PersonService)emailCtx.getBean("PersonService");       
    assertNotNull("personService", personService);     
    namespaceService = (NamespaceService)emailCtx.getBean("NamespaceService");       
    assertNotNull("namespaceService", namespaceService);
    searchService = (SearchService)emailCtx.getBean("SearchService");  
    assertNotNull("searchService", searchService);
    folderEmailMessageHandler = (FolderEmailMessageHandler) emailCtx.getBean("folderEmailMessageHandler");  
    assertNotNull("folderEmailMessageHandler", folderEmailMessageHandler);
    transactionHelper = (RetryingTransactionHelper) emailCtx.getBean("retryingTransactionHelper");
    assertNotNull("transactionHelper", transactionHelper);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:EmailServiceImplTest.java

示例2: setUp

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
    super.setUp();
    this.authenticationComponent = (AuthenticationComponent) getServer()
            .getApplicationContext().getBean("authenticationComponent");
    this.authenticationService = (MutableAuthenticationService) getServer()
            .getApplicationContext().getBean("AuthenticationService");
    this.personService = (PersonService) getServer().getApplicationContext().getBean(
            "PersonService");

    // sets the testMode property to true via spring injection. This will
    // prevent emails
    // from being sent from within this test case.
    this.authenticationComponent.setSystemUserAsCurrentUser();
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:17,代码来源:AbstractSiteServiceTest.java

示例3: getPersonNode

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
protected ActivitiScriptNode getPersonNode(String runAsUser)
{
    String userName = null;
    if (runAsUser != null) 
    {
        userName = runAsUser;
    }
    else 
    {
        userName = AuthenticationUtil.getFullyAuthenticatedUser();
    }
    
    // The "System" user is a special case, which has no person object associated with it.
    if(userName != null && !AuthenticationUtil.SYSTEM_USER_NAME.equals(userName))
    {
        ServiceRegistry services = getServiceRegistry();
        PersonService personService = services.getPersonService();
        if (personService.personExists(userName))
        {
            NodeRef person = personService.getPerson(userName);
            return new ActivitiScriptNode(person, services);
        }
    }
    return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:ActivitiScriptBase.java

示例4: mapMinimalInfo

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
protected void mapMinimalInfo(Map<QName, Serializable> nodeProps,  Map<String, UserInfo> mapUserInfo, ServiceRegistry sr)
{
    PersonService personService = sr.getPersonService();

    this.name = (String)nodeProps.get(ContentModel.PROP_NAME);

    if (mapUserInfo == null) {
        // minor: save one lookup if creator & modifier are the same
        mapUserInfo = new HashMap<>(2);
    }

    this.createdAt = (Date)nodeProps.get(ContentModel.PROP_CREATED);
    this.createdByUser = lookupUserInfo((String)nodeProps.get(ContentModel.PROP_CREATOR), mapUserInfo, personService);

    this.modifiedAt = (Date)nodeProps.get(ContentModel.PROP_MODIFIED);
    this.modifiedByUser = lookupUserInfo((String)nodeProps.get(ContentModel.PROP_MODIFIER), mapUserInfo, personService);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:18,代码来源:Node.java

示例5: mockServices

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
/**
 * @return ServiceRegistry
 */
private ServiceRegistry mockServices()
{
    ActionService mockActionService = mockActionService();
    NodeService mockNodeService = mockNodeService();
    PersonService mockPersonService = mockPersonService();
    SearchService mockSearchService = mockSearchService();
    SiteService mockSiteService = mockSiteService();
    FileFolderService mockFileFolderService = mockFileFolderService();

    ServiceRegistry services = mock(ServiceRegistry.class);
    when(services.getActionService()).thenReturn(mockActionService);
    when(services.getNodeService()).thenReturn(mockNodeService);
    when(services.getPersonService()).thenReturn(mockPersonService);
    when(services.getSearchService()).thenReturn(mockSearchService);
    when(services.getSiteService()).thenReturn(mockSiteService);
    when(services.getFileFolderService()).thenReturn(mockFileFolderService);
    return services;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:InviteModeratedSenderTest.java

示例6: setUp

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@Override
public void setUp() throws Exception
{
    if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
    {
        throw new AlfrescoRuntimeException(
                "A previous tests did not clean up transaction: " +
                AlfrescoTransactionSupport.getTransactionId());
    }
    
    transactionService = (TransactionService) ctx.getBean(ServiceRegistry.TRANSACTION_SERVICE.getLocalName());
    authorityService = (AuthorityService) ctx.getBean(ServiceRegistry.AUTHORITY_SERVICE.getLocalName());
    tenantAdminService = ctx.getBean("tenantAdminService", TenantAdminService.class);
    personService = (PersonService) ctx.getBean(ServiceRegistry.PERSON_SERVICE.getLocalName());
    tenantService = (TenantService) ctx.getBean("tenantService");
    authorityBridgeTableCache = (AuthorityBridgeTableAsynchronouslyRefreshedCache) ctx.getBean("authorityBridgeTableCache");
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:AuthorityBridgeTableAsynchronouslyRefreshedCacheTest.java

示例7: initBasicServices

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@BeforeClass public static void initBasicServices() throws Exception
{
    behaviourFilter = (BehaviourFilter)APP_CONTEXT_INIT.getApplicationContext().getBean("policyBehaviourFilter");
    contentService = (ContentService)APP_CONTEXT_INIT.getApplicationContext().getBean("ContentService");
    nodeService = (NodeService)APP_CONTEXT_INIT.getApplicationContext().getBean("NodeService");
    repositoryHelper = (Repository)APP_CONTEXT_INIT.getApplicationContext().getBean("repositoryHelper");
    siteService = (SiteService)APP_CONTEXT_INIT.getApplicationContext().getBean("SiteService");
    transactionHelper = (RetryingTransactionHelper)APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper");

    authenticationComponent = (AuthenticationComponent)APP_CONTEXT_INIT.getApplicationContext().getBean("authenticationComponent");
    commentService = (CommentService)APP_CONTEXT_INIT.getApplicationContext().getBean("commentService");
    authenticationService = (MutableAuthenticationService)APP_CONTEXT_INIT.getApplicationContext().getBean("AuthenticationService");
    personService = (PersonService)APP_CONTEXT_INIT.getApplicationContext().getBean("PersonService");
    postDAO = (ActivityPostDAO)APP_CONTEXT_INIT.getApplicationContext().getBean("postDAO");
    permissionServiceImpl = (PermissionServiceImpl)APP_CONTEXT_INIT.getApplicationContext().getBean("permissionServiceImpl");
    permissionModelDAO = (ModelDAO)APP_CONTEXT_INIT.getApplicationContext().getBean("permissionsModelDAO");
    lockService = (LockService)APP_CONTEXT_INIT.getApplicationContext().getBean("lockService");

    COMPANY_HOME = repositoryHelper.getCompanyHome();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:CommentsTest.java

示例8: initTestsContext

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@BeforeClass public static void initTestsContext() throws Exception
{
    AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
    BEHAVIOUR_FILTER       = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
    BLOG_SERVICE           = (BlogService)testContext.getBean("blogService");
    DICTIONARY_SERVICE     = (DictionaryService)testContext.getBean("dictionaryService");
    NODE_SERVICE           = (NodeService)testContext.getBean("nodeService");
    PERSON_SERVICE         = (PersonService)testContext.getBean("personService");
    TRANSACTION_HELPER     = (RetryingTransactionHelper)testContext.getBean("retryingTransactionHelper");
    SITE_SERVICE           = (SiteService)testContext.getBean("siteService");
    TAGGING_SERVICE        = (TaggingService)testContext.getBean("TaggingService");
    
    AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER);
    createUser(TEST_USER);
    
    // We need to create the test site as the test user so that they can contribute content to it in tests below.
    AuthenticationUtil.setFullyAuthenticatedUser(TEST_USER);
    createTestSiteWithBlogContainer();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:BlogServiceImplTest.java

示例9: setUp

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
    super.setUp();
    
    this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService");
    this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent");
    this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
    this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
    this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
    this.activityService = (ActivityService)getServer().getApplicationContext().getBean("activityService");
    ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory)getServer().getApplicationContext().getBean("ActivitiesFeed");
    ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext();
    this.feedGenerator = (FeedGenerator)activitiesFeedCtx.getBean("feedGenerator");
    this.postLookup = (PostLookup)activitiesFeedCtx.getBean("postLookup");

    // Authenticate as user
    this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
    
    // Create test site
    // - only create the site if it doesn't already exist
    SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_BLOG);
    if (siteInfo == null)
    {
        this.siteService.createSite("BlogSitePreset", SITE_SHORT_NAME_BLOG, "BlogSiteTitle", "BlogSiteDescription", SiteVisibility.PUBLIC);
    }
    
    // Create users
    createUser(USER_ONE, SiteModel.SITE_COLLABORATOR, SITE_SHORT_NAME_BLOG);
    createUser(USER_TWO, SiteModel.SITE_COLLABORATOR, SITE_SHORT_NAME_BLOG);

    // Blank our lists used to track things the test creates
    posts = new ArrayList<String>(5);
    drafts = new ArrayList<String>(5);
    
    // Do tests as inviter user
    this.authenticationComponent.setCurrentUser(USER_ONE);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:39,代码来源:BlogServiceTest.java

示例10: setUp

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@Override
public void setUp() throws Exception
{
    ctx = ApplicationContextHelper.getApplicationContext(CONTEXTS);
    // Get the required services
    transactionService = (TransactionService) ctx.getBean("TransactionService");
    subscriptionService = (SubscriptionService) ctx.getBean("SubscriptionService");
    personService = (PersonService) ctx.getBean("PersonService");
    nodeService = (NodeService) ctx.getBean("NodeService");
    searchService = (SearchService) ctx.getBean("SearchService");
    repositoryHelper = (Repository) ctx.getBean("repositoryHelper");

    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());

    txn = transactionService.getNonPropagatingUserTransaction(false);
    txn.begin();

    createPerson(USER_BOB);
    createPerson(USER_TOM);
    createPerson(USER_LISA);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:SubscriptionServiceImplTest.java

示例11: initTestsContext

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@BeforeClass public static void initTestsContext() throws Exception
{
    AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
    BEHAVIOUR_FILTER       = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
    LINKS_SERVICE          = (LinksService)testContext.getBean("LinksService");
    NODE_SERVICE           = (NodeService)testContext.getBean("nodeService");
    PUBLIC_NODE_SERVICE    = (NodeService)testContext.getBean("NodeService");
    PERSON_SERVICE         = (PersonService)testContext.getBean("personService");
    TRANSACTION_HELPER     = (RetryingTransactionHelper)testContext.getBean("retryingTransactionHelper");
    PERMISSION_SERVICE     = (PermissionService)testContext.getBean("permissionService");
    SITE_SERVICE           = (SiteService)testContext.getBean("siteService");
    CONTENT_SERVICE        = (ContentService)testContext.getBean("ContentService");

    // Do the setup as admin
    AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER);
    createUser(TEST_USER);
    
    // We need to create the test site as the test user so that they can contribute content to it in tests below.
    AuthenticationUtil.setFullyAuthenticatedUser(TEST_USER);
    createTestSites();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:LinksServiceImplTest.java

示例12: mockServices

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
/**
 * @return ServiceRegistry
 */
private ServiceRegistry mockServices()
{
    ActionService mockActionService = mockActionService();
    NodeService mockNodeService = mockNodeService();
    PersonService mockPersonService = mockPersonService();
    SearchService mockSearchService = mockSearchService();
    SiteService mockSiteService = mockSiteService();
    FileFolderService mockFileFolderService = mockFileFolderService();
    RepoAdminService mockRepoAdminService = mockRepoAdminService();
    SysAdminParams sysAdminParams = new SysAdminParamsImpl();

    ServiceRegistry services = mock(ServiceRegistry.class);
    when(services.getActionService()).thenReturn(mockActionService);
    when(services.getNodeService()).thenReturn(mockNodeService);
    when(services.getPersonService()).thenReturn(mockPersonService);
    when(services.getSearchService()).thenReturn(mockSearchService);
    when(services.getSiteService()).thenReturn(mockSiteService);
    when(services.getFileFolderService()).thenReturn(mockFileFolderService);
    when(services.getSysAdminParams()).thenReturn(sysAdminParams);
    when(services.getRepoAdminService()).thenReturn(mockRepoAdminService);
    return services;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:InviteSenderTest.java

示例13: setup

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
@Before
public void setup() throws Exception
{
    this.dummyTemplateNodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate());
    // Mock the required services
    this.serviceRegistryMock = mock(ServiceRegistry.class);
    this.nodeServiceMock = mock(NodeService.class);
    this.searchServiceMock = mock(SearchService.class);
    this.namespaceServiceMock = mock(NamespaceService.class);
    this.fileFolderServiceMock = mock(FileFolderService.class);
    this.personServiceMock = mock(PersonService.class);
    this.preferenceServiceMock = mock(PreferenceService.class);
    this.repositoryHelperMock = mock(Repository.class);
    this.templateLoaderMock = mock(TemplateLoader.class);

    when(serviceRegistryMock.getNodeService()).thenReturn(nodeServiceMock);
    when(serviceRegistryMock.getSearchService()).thenReturn(searchServiceMock);
    when(serviceRegistryMock.getNamespaceService()).thenReturn(namespaceServiceMock);
    when(serviceRegistryMock.getFileFolderService()).thenReturn(fileFolderServiceMock);
    when(serviceRegistryMock.getPersonService()).thenReturn(personServiceMock);
    when(serviceRegistryMock.getContentService()).thenReturn(mock(ContentService.class));
    when(repositoryHelperMock.getRootHome()).thenReturn(new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate()));
    when(fileFolderServiceMock.getLocalizedSibling(dummyTemplateNodeRef)).thenReturn(dummyTemplateNodeRef);

    this.emailHelper = new EmailHelper();
    emailHelper.setServiceRegistry(serviceRegistryMock);
    emailHelper.setPreferenceService(preferenceServiceMock);
    emailHelper.setRepositoryHelper(repositoryHelperMock);
    emailHelper.setCompanyHomeChildName("app:company_home");
    //test init
    emailHelper.init();
    // Note: set the template loader after the init method
    emailHelper.setTemplateLoader(templateLoaderMock);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:35,代码来源:EmailHelperTest.java

示例14: HomeFolderProviderSynchronizer

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
public HomeFolderProviderSynchronizer(
        TransactionService transactionService,
        AuthorityService authorityService, PersonService personService,
        FileFolderService fileFolderService, NodeService nodeService,
        PortableHomeFolderManager homeFolderManager,
        TenantAdminService tenantAdminService)
{
    this.transactionService = transactionService;
    this.authorityService = authorityService;
    this.personService = personService;
    this.fileFolderService = fileFolderService;
    this.nodeService = nodeService;
    this.homeFolderManager = homeFolderManager;
    this.tenantAdminService = tenantAdminService;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:16,代码来源:HomeFolderProviderSynchronizer.java

示例15: ScriptInvitationFactory

import org.alfresco.service.cmr.security.PersonService; //导入依赖的package包/类
/**
 * Constructor 
 * 
 * @param siteInfo      site information
 */
/*package*/ Site(SiteInfo siteInfo, ServiceRegistry serviceRegistry, SiteService siteService, Scriptable scope)
{
	this.serviceRegistry = serviceRegistry;
    this.siteService = siteService;
    this.siteInfo = siteInfo;
    this.scope = scope;
    this.invitationService = serviceRegistry.getInvitationService();
    NodeService nodeService = serviceRegistry.getNodeService();
    PersonService personService = serviceRegistry.getPersonService();
    this.scriptInvitationFactory = new ScriptInvitationFactory(invitationService, nodeService, personService);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:Site.java


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