public InviteSender(ServiceRegistry services, Repository repository, MessageService messageService) { this.actionService = services.getActionService(); this.nodeService = services.getNodeService(); this.personService = services.getPersonService(); this.searchService = services.getSearchService(); this.siteService = services.getSiteService(); this.fileFolderService = services.getFileFolderService(); this.repoAdminService = services.getRepoAdminService(); this.namespaceService = services.getNamespaceService(); this.repository = repository; this.messageService = messageService; }
/** * Construct * * @param action * Alfresco action */ public ScriptAction(ServiceRegistry services, Action action, ActionDefinition actionDef) { this.services = services; this.actionService = services.getActionService(); this.namespaceService = services.getNamespaceService(); this.transactionService = services.getTransactionService(); this.action = action; this.actionDef = actionDef; this.converter = new ActionValueConverter(); }
/** * Get the user's authentication ticket. * * @return String */ public String getTicket() { return services.getAuthenticationService().getCurrentTicket(); } }
/** * Injects the ServiceRegistry bean. * @param serviceRegistry ServiceRegistry */ public void setServiceRegistry(ServiceRegistry serviceRegistry) { this.contentService = serviceRegistry.getContentService(); this.nodeService = serviceRegistry.getNodeService(); }
public void setServiceRegistry(ServiceRegistry serviceRegistry) { this.serviceRegistry = serviceRegistry; this.authorityService = serviceRegistry.getAuthorityService(); this.personService = serviceRegistry.getPersonService(); }
this.nodeService = serviceRegistry.getNodeService(); this.ruleService = serviceRegistry.getRuleService(); this.cociService = serviceRegistry.getCheckOutCheckInService(); this.lockService = serviceRegistry.getLockService(); this.copyService = serviceRegistry.getCopyService(); this.contentService = serviceRegistry.getContentService(); this.dictionaryDAO = (DictionaryDAO)applicationContext.getBean("dictionaryDAO"); this.actionService = serviceRegistry.getActionService(); this.transactionService = serviceRegistry.getTransactionService(); this.transformerRegistry = (ContentTransformerRegistry)applicationContext.getBean("contentTransformerRegistry"); this.authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent"); this.fileFolderService = serviceRegistry.getFileFolderService();
this.workflowService = serviceRegistry.getWorkflowService(); this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent"); this.nodeService = serviceRegistry.getNodeService(); this.historyService = (HistoryService) applicationContext.getBean("activitiHistoryService"); Repository repositoryHelper = (Repository) applicationContext.getBean("repositoryHelper"); try this.transactionService = (TransactionServiceImpl) serviceRegistry.getTransactionService(); MutableAuthenticationService authenticationService = serviceRegistry.getAuthenticationService(); AuthorityService authorityService = serviceRegistry.getAuthorityService(); PersonService personService = serviceRegistry.getPersonService();
@BeforeClass public static void setupTest() throws Exception { SERVICE_REGISTRY = (ServiceRegistry)APP_CONTEXT_INIT.getApplicationContext().getBean(ServiceRegistry.SERVICE_REGISTRY); NODE_SERVICE = SERVICE_REGISTRY.getNodeService(); TRANSACTION_HELPER = SERVICE_REGISTRY.getTransactionService().getRetryingTransactionHelper(); ACTION_SERVICE = SERVICE_REGISTRY.getActionService(); RULE_SERVICE = SERVICE_REGISTRY.getRuleService(); CONTENT_SERVICE = SERVICE_REGISTRY.getContentService(); MAIL_ACTION_EXECUTER = APP_CONTEXT_INIT.getApplicationContext().getBean("OutboundSMTP", ApplicationContextFactory.class).getApplicationContext().getBean("mail", MailActionExecuter.class); WAS_IN_TEST_MODE = MAIL_ACTION_EXECUTER.isTestMode(); MAIL_ACTION_EXECUTER.setTestMode(true); 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()); }
@SuppressWarnings("deprecation") @Override public void setUp() throws Exception { auditModelRegistry = (AuditModelRegistryImpl) ctx.getBean("auditModel.modelRegistry"); serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); auditComponent = (AuditComponent) ctx.getBean("auditComponent"); auditService = serviceRegistry.getAuditService(); transactionService = serviceRegistry.getTransactionService(); transactionServiceImpl = (TransactionServiceImpl) ctx.getBean("transactionService"); nodeService = serviceRegistry.getNodeService(); searchService = serviceRegistry.getSearchService(); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName()); nodeRef = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE); // Register the models URL modelUrlMnt11072 = ResourceUtils.getURL("classpath:alfresco/testaudit/alfresco-audit-test-mnt-11072.xml"); URL modelUrlMnt16748 = ResourceUtils.getURL("classpath:alfresco/testaudit/alfresco-audit-test-mnt-16748.xml"); auditModelRegistry.registerModel(modelUrlMnt11072); auditModelRegistry.registerModel(modelUrlMnt16748); auditModelRegistry.loadAuditModels(); }
public void setUp() throws Exception { if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE) { throw new AlfrescoRuntimeException( "A previous tests did not clean up transaction: " + AlfrescoTransactionSupport.getTransactionId()); } serviceRegistry = (ServiceRegistry)ctx.getBean("ServiceRegistry"); SimpleCache<String, RepositoryAuthenticationDao.CacheEntry> authenticationCache = (SimpleCache<String, RepositoryAuthenticationDao.CacheEntry>) ctx.getBean("authenticationCache"); SimpleCache<String, NodeRef> immutableSingletonCache = (SimpleCache<String, NodeRef>) ctx.getBean("immutableSingletonCache"); TenantService tenantService = (TenantService) ctx.getBean("tenantService"); compositePasswordEncoder = (CompositePasswordEncoder) ctx.getBean("compositePasswordEncoder"); PolicyComponent policyComponent = (PolicyComponent) ctx.getBean("policyComponent"); repositoryAuthenticationDao = new RepositoryAuthenticationDao(); repositoryAuthenticationDao.setTransactionService(serviceRegistry.getTransactionService()); repositoryAuthenticationDao.setAuthorityService(serviceRegistry.getAuthorityService()); repositoryAuthenticationDao.setTenantService(tenantService); repositoryAuthenticationDao.setNodeService(serviceRegistry.getNodeService()); repositoryAuthenticationDao.setNamespaceService(serviceRegistry.getNamespaceService()); repositoryAuthenticationDao.setCompositePasswordEncoder(compositePasswordEncoder); repositoryAuthenticationDao.setPolicyComponent(policyComponent); repositoryAuthenticationDao.setAuthenticationCache(authenticationCache); repositoryAuthenticationDao.setSingletonCache(immutableSingletonCache); upgradePasswordHashWorker = (UpgradePasswordHashWorker)ctx.getBean("upgradePasswordHashWorker"); nodeService = serviceRegistry.getNodeService(); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName()); }
@Before public void setUp() throws Exception { serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY); transactionHelper = serviceRegistry.getTransactionService().getRetryingTransactionHelper(); authenticationService = serviceRegistry.getAuthenticationService(); personService = serviceRegistry.getPersonService(); oauth2CredentialsStoreService = (OAuth2CredentialsStoreService) applicationContext.getBean("oauth2CredentialsStoreService"); AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER); createUser(TEST_USER_ONE); createUser(TEST_USER_TWO); }
/** * Constructs a scriptable object representing a user. * * @param userName The username * @param personNodeRef The NodeRef * @param serviceRegistry A ServiceRegistry instance * @param scope Script scope * @since 4.0 */ public ScriptUser(String userName, NodeRef personNodeRef, ServiceRegistry serviceRegistry, Scriptable scope) { this.serviceRegistry = serviceRegistry; this.authorityService = serviceRegistry.getAuthorityService(); this.personService = serviceRegistry.getPersonService(); this.scope = scope; this.personNodeRef = personNodeRef == null ? personService.getPerson(userName) : personNodeRef; this.userName = userName; this.shortName = authorityService.getShortName(userName); NodeService nodeService = serviceRegistry.getNodeService(); String firstName = (String)nodeService.getProperty(this.personNodeRef, ContentModel.PROP_FIRSTNAME); String lastName = (String)nodeService.getProperty(this.personNodeRef, ContentModel.PROP_LASTNAME); this.displayName = this.fullName = (firstName != null ? firstName : "") + (lastName != null ? (' ' + lastName) : ""); }
Nester(String name, Thread waiter, ApplicationContext ctx, int batchSize, int batchCount) { super(name); this.setDaemon(true); this.waiter = waiter; this.ctx = ctx; serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); personService = serviceRegistry.getPersonService(); transactionService = serviceRegistry.getTransactionService(); this.batchSize = batchSize; this.batchCount = batchCount; }
/** * @return <code>true</code> if this node is a working copy */ public boolean getIsWorkingCopy() { return this.services.getNodeService().hasAspect(this.nodeRef, ContentModel.ASPECT_WORKING_COPY); }
ContentService contentService = this.services.getContentService(); ContentReader reader = contentService.getReader(this.nodeRef, ContentModel.PROP_CONTENT); String copyName = TransformActionExecuter.transformName(this.services.getMimetypeService(), getName(), mimetype, true); NodeRef copyNodeRef = this.services.getCopyService().copy(this.nodeRef, destination, ContentModel.ASSOC_CONTAINS, QName.createQName(ContentModel.PROP_CONTENT.getNamespaceURI(), QName.createValidLocalName(copyName)),
@Override public void setUp() throws Exception { ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); transactionService = serviceRegistry.getTransactionService(); txnHelper = transactionService.getRetryingTransactionHelper(); tenantAdminDAO = (TenantAdminDAO)ctx.getBean("tenantAdminDAO"); }
/** * @return Display path to this node - the path built of 'cm:name' attribute values. */ public String getDisplayPath() { if (displayPath == null) { displayPath = this.services.getNodeService().getPath(getNodeRef()).toDisplayPath( services.getNodeService(), services.getPermissionService()); } return displayPath; }
/** * @return all the aspects that define a classification. */ public List<QName> getAllClassificationAspects() { Collection<QName> aspects = services.getCategoryService().getClassificationAspects(); ArrayList<QName> answer = new ArrayList<QName>(aspects.size()); answer.addAll(aspects); return answer; }
/** * @return QName path to this node. This can be used for Lucene PATH: style queries */ public String getQnamePath() { return this.services.getNodeService().getPath(getNodeRef()).toPrefixString(this.services.getNamespaceService()); }
/** * Cancel the check-out of a working copy document. The working copy will be deleted and any changes made to it * are lost. Note that this method can only be called on a working copy Node. The reference to this working copy * Node should be discarded. * * @return the original Node that was checked out. */ public ScriptNode cancelCheckout() { NodeRef original = this.services.getCheckOutCheckInService().cancelCheckout(this.nodeRef); return newInstance(original, this.services, this.scope); }