diff --git a/config/alfresco/bootstrap-context.xml b/config/alfresco/bootstrap-context.xml
index deca0b7235..86b376ac27 100644
--- a/config/alfresco/bootstrap-context.xml
+++ b/config/alfresco/bootstrap-context.xml
@@ -147,6 +147,7 @@
+
diff --git a/source/java/org/alfresco/repo/dictionary/DictionaryModelType.java b/source/java/org/alfresco/repo/dictionary/DictionaryModelType.java
index 029c546112..2e45384171 100644
--- a/source/java/org/alfresco/repo/dictionary/DictionaryModelType.java
+++ b/source/java/org/alfresco/repo/dictionary/DictionaryModelType.java
@@ -251,6 +251,10 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
*/
public void init()
{
+ if(logger.isDebugEnabled())
+ {
+ logger.debug("init : bind class behaviours for " + ContentModel.TYPE_DICTIONARY_MODEL);
+ }
// Register interest in the onContentUpdate policy for the dictionary model type
policyComponent.bindClassBehaviour(
ContentServicePolicies.OnContentUpdatePolicy.QNAME,
@@ -298,12 +302,16 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
*/
public void onContentUpdate(NodeRef nodeRef, boolean newContent)
{
- if (logger.isTraceEnabled())
+ if (logger.isTraceEnabled())
{
logger.trace("onContentUpdate: nodeRef="+nodeRef+ " ["+AlfrescoTransactionSupport.getTransactionId()+"]");
}
- queueModel(nodeRef);
+ Boolean value = (Boolean)nodeService.getProperty(nodeRef, ContentModel.PROP_MODEL_ACTIVE);
+ if ((value != null) && (value == true))
+ {
+ queueModel(nodeRef);
+ }
}
@SuppressWarnings("unchecked")
@@ -679,6 +687,7 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
props.put(ContentModel.PROP_MODEL_AUTHOR, modelDefinition.getAuthor());
props.put(ContentModel.PROP_MODEL_PUBLISHED_DATE, modelDefinition.getPublishedDate());
props.put(ContentModel.PROP_MODEL_VERSION, modelDefinition.getVersion());
+
nodeService.setProperties(nodeRef, props);
// Validate model against dictionary - could be new, unchanged or updated
diff --git a/source/java/org/alfresco/repo/dictionary/DictionaryRepositoryBootstrap.java b/source/java/org/alfresco/repo/dictionary/DictionaryRepositoryBootstrap.java
index 36607cc6cf..a53996fdd2 100644
--- a/source/java/org/alfresco/repo/dictionary/DictionaryRepositoryBootstrap.java
+++ b/source/java/org/alfresco/repo/dictionary/DictionaryRepositoryBootstrap.java
@@ -33,6 +33,8 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.EmptyContentReader;
import org.alfresco.repo.i18n.MessageDeployer;
import org.alfresco.repo.i18n.MessageService;
+import org.alfresco.repo.policy.ClassPolicyDelegate;
+import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.tenant.TenantAdminService;
import org.alfresco.repo.tenant.TenantDeployer;
import org.alfresco.repo.tenant.TenantService;
@@ -51,11 +53,13 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.Pair;
+import org.alfresco.util.PropertyCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.extensions.surf.util.AbstractLifecycleBean;
+import org.alfresco.repo.dictionary.DynamicModelPolicies.OnLoadDynamicModel;
/**
* Bootstrap the dictionary from specified locations within the repository
@@ -93,6 +97,10 @@ public class DictionaryRepositoryBootstrap extends AbstractLifecycleBean impleme
/** The transaction service */
private TransactionService transactionService;
+
+ /** The policy component */
+ private PolicyComponent policyComponent;
+
/**
* Sets the Dictionary DAO
@@ -186,12 +194,27 @@ public class DictionaryRepositoryBootstrap extends AbstractLifecycleBean impleme
this.repositoryMessagesLocations = repositoryLocations;
}
-
+ private ClassPolicyDelegate onLoadDynamicModelDelegate;
+
/**
* Initialise - after bootstrap of schema and tenant admin service
*/
public void init()
{
+ PropertyCheck.mandatory(this, "dictionaryDAO", dictionaryDAO);
+ PropertyCheck.mandatory(this, "contentService", contentService);
+ PropertyCheck.mandatory(this, "nodeService", nodeService);
+ PropertyCheck.mandatory(this, "tenantAdminService", tenantAdminService);
+ PropertyCheck.mandatory(this, "namespaceService", namespaceService);
+ PropertyCheck.mandatory(this, "messageService", messageService);
+ PropertyCheck.mandatory(this, "transactionService", transactionService);
+ PropertyCheck.mandatory(this, "policyComponent", policyComponent);
+
+ if(onLoadDynamicModelDelegate == null)
+ {
+ onLoadDynamicModelDelegate = policyComponent.registerClassPolicy(DynamicModelPolicies.OnLoadDynamicModel.class);
+ }
+
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback