MOB-659 (part 2 of 2) - improve dictionary cache reset (should work even with null / cache)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14059 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-04-23 10:29:32 +00:00
parent 9c91679af7
commit f28579cc8e
24 changed files with 777 additions and 532 deletions

View File

@@ -251,8 +251,8 @@ public class DictionaryRepositoryBootstrap extends AbstractLifecycleBean impleme
for (NodeRef dictionaryModel : nodeRefs)
{
// Ignore if the node is a working copy or if its inactive
if (nodeService.hasAspect(dictionaryModel, ContentModel.ASPECT_WORKING_COPY) == false)
// Ignore if the node is a working copy or archived, or if its inactive
if (! (nodeService.hasAspect(dictionaryModel, ContentModel.ASPECT_WORKING_COPY) || nodeService.hasAspect(dictionaryModel, ContentModel.ASPECT_ARCHIVED)))
{
Boolean isActive = (Boolean)nodeService.getProperty(dictionaryModel, ContentModel.PROP_MODEL_ACTIVE);
@@ -261,6 +261,11 @@ public class DictionaryRepositoryBootstrap extends AbstractLifecycleBean impleme
M2Model model = createM2Model(dictionaryModel);
if (model != null)
{
if (logger.isTraceEnabled())
{
logger.trace("onDictionaryInit: "+model.getName()+" ("+dictionaryModel+")");
}
for (M2Namespace namespace : model.getNamespaces())
{
modelMap.put(namespace.getUri(), model);
@@ -407,22 +412,7 @@ public class DictionaryRepositoryBootstrap extends AbstractLifecycleBean impleme
@Override
protected void onBootstrap(ApplicationEvent event)
{
// run as System on bootstrap
AuthenticationUtil.runAs(new RunAsWork<Object>()
{
public Object doWork()
{
init();
return null;
}
}, AuthenticationUtil.getSystemUserName());
if (tenantAdminService.isEnabled())
{
tenantAdminService.deployTenants(this, logger);
}
register();
register();
}
@Override