public void onDisableTenant() { destroy(); // will be called in context of tenant }
public void onEnableTenant() { init(); // will be called in context of tenant }
public Object execute() throws Exception { onDictionaryInit(); initMessages(); return (Object)null; } }, transactionService.isReadOnly(), false);
/** * Bootstraps the model from custom store */ private void setUpBootstrap() { bootstrap = new DictionaryRepositoryBootstrap(); bootstrap.setContentService(CONTENT_SERVICE); bootstrap.setDictionaryDAO(DICTIONARY_DAO); bootstrap.setTransactionService(TRANSACTION_SERVICE); bootstrap.setTenantAdminService(TENANT_ADMIN_SERVICE); bootstrap.setNodeService(NODE_SERVICE); bootstrap.setNamespaceService(NAMESPACE_SERVICE); bootstrap.setMessageService(MESSAGE_SERVICE); bootstrap.setPolicyComponent(POLICY_COMPONENT); RepositoryLocation location = new RepositoryLocation(); location.setStoreProtocol(storeRef.getProtocol()); location.setStoreId(storeRef.getIdentifier()); location.setQueryLanguage(RepositoryLocation.LANGUAGE_PATH); // NOTE: we are not setting the path for now .. in doing so we are searching the root node only List<RepositoryLocation> locations = new ArrayList<RepositoryLocation>(); locations.add(location); bootstrap.setRepositoryModelsLocations(locations); // register with dictionary service bootstrap.register(); }
/** * Bootstraps the model from default store */ private void revertBootstrap() { bootstrap.destroy(); RepositoryLocation location = new RepositoryLocation(); location.setStoreProtocol(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE.getProtocol()); location.setStoreId(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE.getIdentifier()); location.setQueryLanguage(RepositoryLocation.LANGUAGE_PATH); // NOTE: we are not setting the path for now .. in doing so we are searching the root node only List<RepositoryLocation> locations = new ArrayList<RepositoryLocation>(); locations.add(location); bootstrap.setRepositoryModelsLocations(locations); // register with dictionary service bootstrap.register(); }
nodeRefs = getNodes(storeRef, repositoryLocation, ContentModel.TYPE_DICTIONARY_MODEL); M2Model model = createM2Model(dictionaryModel); if (model != null) loadModel(modelMap, loadedModels, importedModel, importedLocation); notifyDynamicModelLoaded(entry.getValue());
@Override protected void onBootstrap(ApplicationEvent event) { // Reset the dictionary (destroy and reload) in order to ensure that we have a basic version of // the dictionary (static models) loaded at least dictionaryDAO.reset(); // Register listeners, which will be called when the dictionary is next reloaded register(); // Trigger a reload. The callbacks will occur immediately on the current thread, however, // the model created in reset() will still be available for the basic necessities dictionaryDAO.init(); // The listeners can now know about this // However, the listeners will be needing to access the dictionary themselves, hence the earlier 'reset' // to ensure that there is no deadlock waiting for a new dictionary ((ApplicationContext) event.getSource()).publishEvent(new DictionaryRepositoryBootstrappedEvent(this)); }
List<NodeRef> nodeRefs = getNodes(storeRef, repositoryLocation, ContentModel.TYPE_CONTENT);
loadModel(modelMap, loadedModels, importedModel, importedLocation);
txn.begin(); this.bootstrap = new DictionaryRepositoryBootstrap(); this.bootstrap.setContentService(this.contentService); this.bootstrap.setDictionaryDAO(this.dictionaryDAO); this.bootstrap.setTransactionService(this.transactionService); this.bootstrap.setTenantAdminService(this.tenantAdminService); this.bootstrap.setNodeService(this.nodeService); this.bootstrap.setNamespaceService(this.namespaceService); this.bootstrap.setMessageService(this.messageService); this.bootstrap.setPolicyComponent(this.policyComponent); locations.add(location); this.bootstrap.setRepositoryModelsLocations(locations); this.bootstrap.register(); txn.commit();
nodeRefs = getNodes(storeRef, repositoryLocation, ContentModel.TYPE_DICTIONARY_MODEL); M2Model model = createM2Model(dictionaryModel); if (model != null) loadModel(modelMap, loadedModels, importedModel, importedLocation); notifyDynamicModelLoaded(entry.getValue());
@Override protected void onBootstrap(ApplicationEvent event) { // Reset the dictionary (destroy and reload) in order to ensure that we have a basic version of // the dictionary (static models) loaded at least dictionaryDAO.reset(); // Register listeners, which will be called when the dictionary is next reloaded register(); // Trigger a reload. The callbacks will occur immediately on the current thread, however, // the model created in reset() will still be available for the basic necessities dictionaryDAO.init(); // The listeners can now know about this // However, the listeners will be needing to access the dictionary themselves, hence the earlier 'reset' // to ensure that there is no deadlock waiting for a new dictionary ((ApplicationContext) event.getSource()).publishEvent(new DictionaryRepositoryBootstrappedEvent(this)); }
List<NodeRef> nodeRefs = getNodes(storeRef, repositoryLocation, ContentModel.TYPE_DICTIONARY_MODEL);
loadModel(modelMap, loadedModels, importedModel, importedLocation);
TestTransaction.flagForCommit(); DictionaryRepositoryBootstrap bootstrap = new DictionaryRepositoryBootstrap(); bootstrap.setContentService(this.contentService); bootstrap.setDictionaryDAO(this.dictionaryDAO); bootstrap.setTransactionService(this.transactionService); bootstrap.setTenantAdminService(tenantAdminService); bootstrap.setNodeService(this.nodeService); bootstrap.setNamespaceService(this.namespaceService); bootstrap.setMessageService(messageService); bootstrap.setPolicyComponent(policyComponent); locations.add(location); bootstrap.setRepositoryModelsLocations(locations); bootstrap.register();
public void onEnableTenant() { init(); // will be called in context of tenant }
public Object execute() throws Exception { onDictionaryInit(); initMessages(); return (Object)null; } }, transactionService.isReadOnly(), false);
public void onDisableTenant() { destroy(); // will be called in context of tenant }
List<NodeRef> nodeRefs = getNodes(storeRef, repositoryLocation, ContentModel.TYPE_CONTENT);
this.bootstrap.init();