Search in sources :

Example 21 with Repository

use of org.alfresco.repo.model.Repository in project alfresco-repository by Alfresco.

the class QuickShareServiceIntegrationTest method findServices.

private static void findServices() {
    ApplicationContext ctx = testContext.getApplicationContext();
    copyService = ctx.getBean("CopyService", CopyService.class);
    nodeService = ctx.getBean("NodeService", NodeService.class);
    directQuickShareService = ctx.getBean("quickShareService", QuickShareService.class);
    quickShareService = ctx.getBean("QuickShareService", QuickShareService.class);
    repository = ctx.getBean("repositoryHelper", Repository.class);
    attributeService = ctx.getBean("AttributeService", AttributeService.class);
    permissionService = ctx.getBean("PermissionService", PermissionService.class);
    nodeArchiveService = ctx.getBean("nodeArchiveService", NodeArchiveService.class);
    scheduledPersistedActionService = ctx.getBean("scheduledPersistedActionService", ScheduledPersistedActionService.class);
    quickShareLinkExpiryActionPersister = ctx.getBean("quickShareLinkExpiryActionPersister", QuickShareLinkExpiryActionPersister.class);
    transactionHelper = ctx.getBean("retryingTransactionHelper", RetryingTransactionHelper.class);
    globalProperties = ctx.getBean("global-properties", Properties.class);
    siteService = (SiteService) ctx.getBean("SiteService");
}
Also used : PermissionService(org.alfresco.service.cmr.security.PermissionService) QuickShareLinkExpiryActionPersister(org.alfresco.service.cmr.quickshare.QuickShareLinkExpiryActionPersister) QuickShareService(org.alfresco.service.cmr.quickshare.QuickShareService) ScheduledPersistedActionService(org.alfresco.service.cmr.action.scheduled.ScheduledPersistedActionService) ApplicationContext(org.springframework.context.ApplicationContext) Repository(org.alfresco.repo.model.Repository) AttributeService(org.alfresco.service.cmr.attributes.AttributeService) RetryingTransactionHelper(org.alfresco.repo.transaction.RetryingTransactionHelper) NodeService(org.alfresco.service.cmr.repository.NodeService) Properties(java.util.Properties) CopyService(org.alfresco.service.cmr.repository.CopyService) NodeArchiveService(org.alfresco.repo.node.archive.NodeArchiveService)

Example 22 with Repository

use of org.alfresco.repo.model.Repository in project alfresco-repository by Alfresco.

the class PreferenceServiceImplTest method initStaticData.

@BeforeClass
public static void initStaticData() throws Exception {
    CONTENT_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("ContentService", ContentService.class);
    PERSON_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("PersonService", PersonService.class);
    PREFERENCE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("PreferenceService", PreferenceService.class);
    SCRIPT_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("ScriptService", ScriptService.class);
    TRANSACTION_HELPER = APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper", RetryingTransactionHelper.class);
    Repository repositoryHelper = (Repository) APP_CONTEXT_INIT.getApplicationContext().getBean("repositoryHelper");
    COMPANY_HOME = repositoryHelper.getCompanyHome();
}
Also used : ScriptService(org.alfresco.service.cmr.repository.ScriptService) Repository(org.alfresco.repo.model.Repository) PreferenceService(org.alfresco.service.cmr.preference.PreferenceService) RetryingTransactionHelper(org.alfresco.repo.transaction.RetryingTransactionHelper) PersonService(org.alfresco.service.cmr.security.PersonService) ContentService(org.alfresco.service.cmr.repository.ContentService) BeforeClass(org.junit.BeforeClass)

Example 23 with Repository

use of org.alfresco.repo.model.Repository in project alfresco-repository by Alfresco.

the class RatingServiceIntegrationTest method initStaticData.

@BeforeClass
public static void initStaticData() throws Exception {
    COPY_SERVICE = (CopyService) APP_CONTEXT_INIT.getApplicationContext().getBean("copyService");
    NODE_SERVICE = (NodeService) APP_CONTEXT_INIT.getApplicationContext().getBean("nodeService");
    RATING_NAMING_CONVENTIONS = (RatingNamingConventionsUtil) APP_CONTEXT_INIT.getApplicationContext().getBean("rollupNamingConventions");
    RATING_SERVICE = (RatingService) APP_CONTEXT_INIT.getApplicationContext().getBean("ratingService");
    SCRIPT_SERVICE = (ScriptService) APP_CONTEXT_INIT.getApplicationContext().getBean("scriptService");
    TRANSACTION_HELPER = (RetryingTransactionHelper) APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper");
    Repository repositoryHelper = (Repository) APP_CONTEXT_INIT.getApplicationContext().getBean("repositoryHelper");
    COMPANY_HOME = repositoryHelper.getCompanyHome();
    // Create some static test content
    TEST_FOLDER = STATIC_TEST_NODES.createNode(COMPANY_HOME, "testFolder", ContentModel.TYPE_FOLDER, AuthenticationUtil.getAdminUserName());
    COPY_DEST_FOLDER = STATIC_TEST_NODES.createNode(COMPANY_HOME, "testCopyDestinationFolder", ContentModel.TYPE_FOLDER, AuthenticationUtil.getAdminUserName());
}
Also used : Repository(org.alfresco.repo.model.Repository) BeforeClass(org.junit.BeforeClass)

Example 24 with Repository

use of org.alfresco.repo.model.Repository in project alfresco-repository by Alfresco.

the class NodeCrawlerTest method before.

/**
 * Called during the transaction setup
 */
@SuppressWarnings("deprecation")
@Before
public void before() throws Exception {
    super.before();
    // Get the required services
    this.nodeService = (NodeService) applicationContext.getBean("NodeService");
    this.serviceRegistry = (ServiceRegistry) applicationContext.getBean("ServiceRegistry");
    this.nodeCrawlerFactory = (NodeCrawlerFactory) applicationContext.getBean("NodeCrawlerFactory");
    Repository repositoryHelper = (Repository) applicationContext.getBean("repositoryHelper");
    this.companyHome = repositoryHelper.getCompanyHome();
}
Also used : Repository(org.alfresco.repo.model.Repository) Before(org.junit.Before)

Aggregations

Repository (org.alfresco.repo.model.Repository)24 NodeRef (org.alfresco.service.cmr.repository.NodeRef)10 Before (org.junit.Before)6 Test (org.junit.Test)6 ActivitiScriptNode (org.alfresco.repo.workflow.activiti.ActivitiScriptNode)5 NodeService (org.alfresco.service.cmr.repository.NodeService)4 BeforeClass (org.junit.BeforeClass)4 RetryingTransactionHelper (org.alfresco.repo.transaction.RetryingTransactionHelper)3 ServiceRegistry (org.alfresco.service.ServiceRegistry)3 ContentService (org.alfresco.service.cmr.repository.ContentService)3 PersonService (org.alfresco.service.cmr.security.PersonService)3 QName (org.alfresco.service.namespace.QName)3 ScriptContentData (org.alfresco.repo.jscript.ScriptNode.ScriptContentData)2 AuthenticationComponent (org.alfresco.repo.security.authentication.AuthenticationComponent)2 AccessDeniedException (org.alfresco.repo.security.permissions.AccessDeniedException)2 ScriptException (org.alfresco.scripts.ScriptException)2 FileFolderService (org.alfresco.service.cmr.model.FileFolderService)2 ContentData (org.alfresco.service.cmr.repository.ContentData)2 MutableAuthenticationService (org.alfresco.service.cmr.security.MutableAuthenticationService)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1