/** * Delegates to the <code>NodeService</code> used as the version store implementation */ public StoreRef createStore(String protocol, String identifier) { return dbNodeService.createStore(protocol, identifier); }
/** * Delegates to the <code>NodeService</code> used as the version store implementation */ public StoreRef createStore(String protocol, String identifier) { return dbNodeService.createStore(protocol, identifier); }
public StoreRef execute() { StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.nanoTime()); return storeRef; } });
public NodeRef execute() { StoreRef storeRef = nodeService.createStore( StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.nanoTime()); return nodeService.getRootNode(storeRef); } };
/** * @return Returns a reference to the created store */ private StoreRef createStore() throws Exception { StoreRef storeRef = nodeService.createStore( StoreRef.PROTOCOL_WORKSPACE, getClass().getName() + "_" + System.nanoTime()); assertNotNull("No reference returned", storeRef); // done return storeRef; }
public Object execute() throws Exception { StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); rootNodeRef = nodeService.getRootNode(storeRef); return null; } };
public NodeRef execute() { StoreRef storeRef = nodeService.createStore( StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.nanoTime()); return nodeService.getRootNode(storeRef); } };
public NodeRef execute() { StoreRef storeRef = nodeService.createStore( StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.nanoTime()); return nodeService.getRootNode(storeRef); } };
@Before public void before() throws Exception { this.nodeService = (NodeService)this.applicationContext.getBean("nodeService"); this.contentService = (ContentService)this.applicationContext.getBean("contentService"); this.testStoreRef = this.nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef); }
@Before public void before() throws Exception { nodeService = (NodeService)applicationContext.getBean(ServiceRegistry.NODE_SERVICE.getLocalName()); exporterService = (ExporterService)applicationContext.getBean("exporterComponent"); importerService = (ImporterService)applicationContext.getBean("importerComponent"); fileFolderService = (FileFolderService) applicationContext.getBean("fileFolderService"); categoryService = (CategoryService) applicationContext.getBean("categoryService"); transactionService = (TransactionService) applicationContext.getBean("transactionService"); permissionService = (PermissionServiceSPI) applicationContext.getBean("permissionService"); this.authenticationService = (MutableAuthenticationService) applicationContext.getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent"); this.authenticationComponent.setSystemUserAsCurrentUser(); this.storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); contentLocaleToRestore = I18NUtil.getContentLocale(); localeToRestore = I18NUtil.getLocale(); }
@Before public void before() throws Exception { this.nodeService = (NodeService)this.applicationContext.getBean("nodeService"); this.serviceRegistry = (ServiceRegistry)this.applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY); this.configurableService = (ConfigurableService)this.applicationContext.getBean("configurableService"); this.testStoreRef = this.nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef); // Create the node used for tests this.nodeRef = this.nodeService.createNode( this.rootNodeRef, ContentModel.ASSOC_CHILDREN, ContentModel.ASSOC_CHILDREN, ContentModel.TYPE_CONTAINER).getChildRef(); }
@Before public void before() throws Exception { nodeService = (NodeService)applicationContext.getBean(ServiceRegistry.NODE_SERVICE.getLocalName()); importerService = (ImporterService)applicationContext.getBean(ServiceRegistry.IMPORTER_SERVICE.getLocalName()); importerBootstrap = (ImporterBootstrap)applicationContext.getBean("spacesBootstrap"); this.authenticationComponent = (AuthenticationComponent)this.applicationContext.getBean("authenticationComponent"); this.authenticationComponent.setSystemUserAsCurrentUser(); this.versionService = (VersionService)this.applicationContext.getBean("VersionService"); // Create the store this.storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); TimeZone tz = TimeZone.getTimeZone("GMT"); TimeZone.setDefault(tz); // Joda time has already grabbed the JVM zone so re-set it here DateTimeZone.setDefault(DateTimeZone.forTimeZone(tz)); }
@Before public void before() throws Exception { mlAwareNodeService = (NodeService) applicationContext.getBean("mlAwareNodeService"); nodeService = (NodeService) applicationContext.getBean("nodeService"); dictionaryDAO = (DictionaryDAO) applicationContext.getBean("dictionaryDAO"); authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent"); authenticationComponent.setSystemUserAsCurrentUser(); ClassLoader cl = BaseNodeServiceTest.class.getClassLoader(); InputStream modelStream = cl.getResourceAsStream("org/alfresco/repo/node/NodeRefTestModel.xml"); assertNotNull(modelStream); M2Model model = M2Model.createModel(modelStream); dictionaryDAO.putModel(model); StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); rootNodeRef = nodeService.getRootNode(storeRef); }
@Override public void setUp() throws Exception { ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); // Set the services this.transactionService = serviceRegistry.getTransactionService(); this.nodeService = serviceRegistry.getNodeService(); this.contentService = serviceRegistry.getContentService(); this.behaviourFilter = (BehaviourFilter) ctx.getBean("policyBehaviourFilter"); AuthenticationUtil.setRunAsUserSystem(); // Create the store and get the root node reference this.storeRef = this.nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); this.rootNodeRef = this.nodeService.getRootNode(storeRef); }
@Before public void before() throws Exception { this.nodeService = (NodeService)this.applicationContext.getBean("nodeService"); // Create the store and get the root node this.testStoreRef = this.nodeService.createStore( StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef); // Create the node used for tests this.nodeRef = this.nodeService.createNode( this.rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName("{test}testnode"), ContentModel.TYPE_CONTENT).getChildRef(); this.evaluator = (HasAspectEvaluator)this.applicationContext.getBean(HasAspectEvaluator.NAME); }
@Before public void before() throws Exception { ServiceRegistry serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY); this.nodeService = serviceRegistry.getNodeService(); this.contentService = serviceRegistry.getContentService(); AuthenticationUtil.setRunAsUser(AuthenticationUtil.getSystemUserName()); this.testStoreRef = this.nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef); }
@Before public void createTestContent() { excludedOnUpdateProps = VERSIONABLE_ASPECT.getExcludedOnUpdateProps(); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName()); // Create the store and get the root node storeRef = NODE_SERVICE.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); rootNodeRef = NODE_SERVICE.getRootNode(storeRef); }
public NodeRef execute() throws Throwable { // authenticate authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName()); // create a test store StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, getName() + System.currentTimeMillis()); rootNodeRef = nodeService.getRootNode(storeRef); // create a folder to import into NodeRef nodeRef = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName(NamespaceService.ALFRESCO_URI, "working root"), ContentModel.TYPE_FOLDER).getChildRef(); // Done return nodeRef; } };
private void setupTestData() { // create a store and get the root node StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, this.getClass().getName()); if (!nodeService.exists(storeRef)) { storeRef = nodeService.createStore(storeRef.getProtocol(), storeRef.getIdentifier()); } this.rootNodeRef = nodeService.getRootNode(storeRef); // create a content node ContentData contentData = new ContentData(null, "text/plain", 0L, "UTF-16", Locale.CHINESE); PropertyMap properties = new PropertyMap(); properties.put(ContentModel.PROP_CONTENT, contentData); ChildAssociationRef assocRef = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName(TEST_NAMESPACE, GUID.generate()), ContentModel.TYPE_CONTENT, properties); this.contentNodeRef = assocRef.getChildRef(); validateSetUp(); }
@Ignore @Commit @Test public void testRepositoryExport() { // Create a temp store to hold exports StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); NodeRef rootNode = nodeService.getRootNode(storeRef); FileInfo container = fileFolderService.create(rootNode, "export", ContentModel.TYPE_FOLDER); // Export stores RepositoryExportHandle[] handles = repositoryService.export(container.getNodeRef(), "test"); assertNotNull(handles); assertEquals(6, handles.length); for (RepositoryExportHandle handle : handles) { assertTrue(nodeService.exists(handle.exportFile)); } }