modelDef = dictionaryDAO.getModel(modelQName);
public void onDictionaryInit() { // Register the test model dictionaryDAO.putModel(model); }
protected void loadTestModel() { ClassLoader cl = BaseNodeServiceTest.class.getClassLoader(); InputStream modelStream = cl.getResourceAsStream("org/alfresco/repo/search/impl/MetadataQueryTest_model.xml"); assertNotNull(modelStream); model = M2Model.createModel(modelStream); dictionaryDAO.registerListener(this); dictionaryDAO.reset(); assertNotNull(dictionaryDAO.getClass(TEST_SUPER_CONTENT_TYPE)); }
@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)); }
namespaceDefs = dictionaryDAO.getNamespaces(modelName); typeDefs = dictionaryDAO.getTypes(modelName); aspectDefs = dictionaryDAO.getAspects(modelName);
/** * Register listeners */ public void register() { // register with Dictionary Service to allow (re-)init dictionaryDAO.registerListener(this); // register with Message Service to allow (re-)init messageService.register(this); if (tenantAdminService.isEnabled()) { // register dictionary repository bootstrap tenantAdminService.register(this); // register repository message (I18N) service tenantAdminService.register(messageService); } }
private void validateDeleteProperty(QName modelName, QName propertyQName, boolean sharedModel) { String tenantDomain = TenantService.DEFAULT_DOMAIN; if (sharedModel) { tenantDomain = " for tenant [" + tenantService.getCurrentUserDomain() + "]"; } PropertyDefinition prop = dictionaryDAO.getProperty(propertyQName); if(prop != null && prop.getName().equals(propertyQName) && prop.getModel().getName().equals(modelName)) { validateDeleteProperty(tenantDomain, prop); } else { throw new AlfrescoRuntimeException("Cannot delete model " + modelName + " in tenant " + tenantDomain + " - property definition '" + propertyQName + "' not defined in model '" + modelName + "'"); } }
dictionaryDAO.putModel(testModel); dictionaryDAO.removeModel(QName.createQName(testModel.getName(), namespaceService));
Collection<QName> allModels = dictionaryDAO.getModels(); for (QName model : allModels) propDefs = dictionaryDAO.getProperties(model);
List<M2ModelDiff> modelDiffs = dictionaryDAO.diffModel(model);
@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)); }
namespaceDefs = dictionaryDAO.getNamespaces(modelName); typeDefs = dictionaryDAO.getTypes(modelName); aspectDefs = dictionaryDAO.getAspects(modelName);
/** * Register listeners */ public void register() { // register with Dictionary Service to allow (re-)init dictionaryDAO.registerListener(this); // register with Message Service to allow (re-)init messageService.register(this); if (tenantAdminService.isEnabled()) { // register dictionary repository bootstrap tenantAdminService.register(this); // register repository message (I18N) service tenantAdminService.register(messageService); } }
private void validateDeleteProperty(QName modelName, QName propertyQName, boolean sharedModel) { String tenantDomain = TenantService.DEFAULT_DOMAIN; if (sharedModel) { tenantDomain = " for tenant [" + tenantService.getCurrentUserDomain() + "]"; } PropertyDefinition prop = dictionaryDAO.getProperty(propertyQName); if(prop != null && prop.getName().equals(propertyQName) && prop.getModel().getName().equals(modelName)) { validateDeleteProperty(tenantDomain, prop); } else { throw new AlfrescoRuntimeException("Cannot delete model " + modelName + " in tenant " + tenantDomain + " - property definition '" + propertyQName + "' not defined in model '" + modelName + "'"); } }
Collection<QName> allModels = dictionaryDAO.getModels(); for (QName model : allModels) propDefs = dictionaryDAO.getProperties(model);
List<M2ModelDiff> modelDiffs = dictionaryDAO.diffModel(model);