Commit d94a49445b80f43f9f8c8e392e2a93c6642931ea

Authored by Stefan Kopf
Exists in master

Merge remote-tracking branch 'origin/master' into feature/opencmis-upgrade

Resolved Conflicts:
	pom.xml
... ... @@ -10,7 +10,7 @@
10 10 <artifactId>alfresco-data-model</artifactId>
11 11 <name>Alfresco Data Model</name>
12 12 <description>Alfresco Data Model classes</description>
13   - <version>6.2-SNAPSHOT</version>
  13 + <version>6.6-SNAPSHOT</version>
14 14  
15 15 <scm>
16 16 <connection>scm:git:https://gitlab.alfresco.com/platform/alfresco-data-model.git</connection>
... ... @@ -145,7 +145,7 @@
145 145 <dependency>
146 146 <groupId>org.alfresco</groupId>
147 147 <artifactId>alfresco-core</artifactId>
148   - <version>6.5</version>
  148 + <version>6.8</version>
149 149 </dependency>
150 150 <!--
151 151 | provided dependencies (are not transitive and not included in webapps)
... ...
src/main/java/org/alfresco/opencmis/dictionary/CMISAbstractDictionaryService.java
... ... @@ -73,20 +73,21 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
73 73 private final ReentrantReadWriteLock registryLock = new ReentrantReadWriteLock();
74 74 private final WriteLock registryWriteLock = registryLock.writeLock();
75 75 private final ReadLock registryReadLock = registryLock.readLock();
76   -
  76 +
77 77 // note: cache is tenant-aware (if using TransctionalCache impl)
78   - private SimpleCache<String, CMISDictionaryRegistry> singletonCache; // eg. for openCmisDictionaryRegistry
  78 + private SimpleCache<String, CMISDictionaryRegistry> cmisRegistryCache;
79 79 private final String KEY_OPENCMIS_DICTIONARY_REGISTRY = "key.openCmisDictionaryRegistry";
80 80  
81 81 public void setTenantService(TenantService tenantService)
82 82 {
83   - this.tenantService = tenantService;
84   - }
  83 + this.tenantService = tenantService;
  84 + }
85 85  
86   - /**
  86 + /**
87 87 * Set the mapping service
88 88 *
89   - * @param cmisMapping CMISMapping
  89 + * @param cmisMapping
  90 + * CMISMapping
90 91 */
91 92 public void setCmisMapping(CMISMapping cmisMapping)
92 93 {
... ... @@ -96,7 +97,8 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
96 97 /**
97 98 * Set the property accessor mapping service
98 99 *
99   - * @param accessorMapping mapping
  100 + * @param accessorMapping
  101 + * mapping
100 102 */
101 103 public void setPropertyAccessorMapping(PropertyAccessorMapping accessorMapping)
102 104 {
... ... @@ -106,7 +108,8 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
106 108 /**
107 109 * Set the property lucene mapping service
108 110 *
109   - * @param luceneBuilderMapping mapping
  111 + * @param luceneBuilderMapping
  112 + * mapping
110 113 */
111 114 public void setPropertyLuceneBuilderMapping(PropertyLuceneBuilderMapping luceneBuilderMapping)
112 115 {
... ... @@ -116,7 +119,8 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
116 119 /**
117 120 * Set the dictionary Service
118 121 *
119   - * @param dictionaryService DictionaryService
  122 + * @param dictionaryService
  123 + * DictionaryService
120 124 */
121 125 public void setDictionaryService(DictionaryService dictionaryService)
122 126 {
... ... @@ -126,7 +130,8 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
126 130 /**
127 131 * Set the dictionary DAO
128 132 *
129   - * @param dictionaryDAO DictionaryDAO
  133 + * @param dictionaryDAO
  134 + * DictionaryDAO
130 135 */
131 136 public void setDictionaryDAO(DictionaryDAO dictionaryDAO)
132 137 {
... ... @@ -135,63 +140,57 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
135 140  
136 141 public void setSingletonCache(SimpleCache<String, CMISDictionaryRegistry> singletonCache)
137 142 {
138   - this.singletonCache = singletonCache;
  143 + this.cmisRegistryCache = singletonCache;
139 144 }
140 145  
141 146 protected interface DictionaryInitializer
142 147 {
143   - Collection<AbstractTypeDefinitionWrapper> createDefinitions(CMISDictionaryRegistry cmisRegistry);
144   - Collection<AbstractTypeDefinitionWrapper> createDefinitions(CMISDictionaryRegistry cmisRegistry, CompiledModel model);
  148 + Collection<AbstractTypeDefinitionWrapper> createDefinitions(CMISDictionaryRegistry cmisRegistry);
  149 +
  150 + Collection<AbstractTypeDefinitionWrapper> createDefinitions(CMISDictionaryRegistry cmisRegistry,
  151 + CompiledModel model);
145 152 }
146 153  
147 154 protected abstract DictionaryInitializer getCoreDictionaryInitializer();
  155 +
148 156 protected abstract DictionaryInitializer getTenantDictionaryInitializer();
149 157  
150 158 protected CMISDictionaryRegistry getRegistry()
151 159 {
152   - String tenant = TenantUtil.getCurrentDomain();
153   - return getRegistry(tenant);
  160 + String tenant = TenantUtil.getCurrentDomain();
  161 + return getRegistry(tenant);
154 162 }
155 163  
156 164 CMISDictionaryRegistry getRegistry(String tenant)
157 165 {
158   - CMISDictionaryRegistry cmisRegistry = null;
159   - boolean readLockReleased = false;
160   - //Make sure that DictionaryRegistry exist
161   - dictionaryDAO.getDictionaryRegistry(tenant);
162   -
163   - registryReadLock.lock();
164   - try
165   - {
166   - String cacheKey = getCacheKey(tenant);
167   - cmisRegistry = singletonCache.get(cacheKey);
168   - if(cmisRegistry == null)
169   - {
170   - registryReadLock.unlock();
171   - readLockReleased = true;
172   -
173   - registryWriteLock.lock();
174   - try
175   - {
176   - cmisRegistry = singletonCache.get(cacheKey);
177   - if(cmisRegistry == null)
178   - {
179   - cmisRegistry = createDictionaryRegistry(tenant);
180   - }
181   - }
182   - finally
183   - {
184   - registryWriteLock.unlock();
185   - }
186   - }
187   - }
188   - finally
189   - {
190   - if(!readLockReleased)
191   - {
192   - registryReadLock.unlock();
193   - }
194   - }
  166 + CMISDictionaryRegistry cmisRegistry = null;
  167 +
  168 + String cacheKey = getCacheKey(tenant);
  169 +
  170 + registryReadLock.lock();
  171 + try
  172 + {
  173 + cmisRegistry = cmisRegistryCache.get(cacheKey);
  174 + }
  175 + finally
  176 + {
  177 + registryReadLock.unlock();
  178 + }
  179 +
  180 + if (cmisRegistry == null)
  181 + {
  182 + cmisRegistry = createDictionaryRegistry(tenant);
  183 +
  184 + registryWriteLock.lock();
  185 + try
  186 + {
  187 + cmisRegistryCache.put(cacheKey, cmisRegistry);
  188 + }
  189 + finally
  190 + {
  191 + registryWriteLock.unlock();
  192 + }
  193 + }
195 194  
196 195 return cmisRegistry;
197 196 }
... ... @@ -199,9 +198,8 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
199 198 /*
200 199 * (non-Javadoc)
201 200 *
202   - * @see
203   - * org.springframework.extensions.surf.util.AbstractLifecycleBean#onBootstrap
204   - * (org.springframework.context.ApplicationEvent)
  201 + * @see org.springframework.extensions.surf.util.AbstractLifecycleBean#
  202 + * onBootstrap (org.springframework.context.ApplicationEvent)
205 203 */
206 204 @Override
207 205 protected void onBootstrap(ApplicationEvent event)
... ... @@ -233,42 +231,45 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
233 231  
234 232 private String getCacheKey()
235 233 {
236   - String tenant = tenantService.getCurrentUserDomain();
237   - return getCacheKey(tenant);
  234 + String tenant = tenantService.getCurrentUserDomain();
  235 + return getCacheKey(tenant);
238 236 }
239 237  
240 238 private String getCacheKey(String tenant)
241 239 {
242   - String cacheKey = KEY_OPENCMIS_DICTIONARY_REGISTRY + "." + tenant + "." + cmisMapping.getCmisVersion().toString();
243   - return cacheKey;
  240 + String cacheKey = KEY_OPENCMIS_DICTIONARY_REGISTRY + "." + tenant + "."
  241 + + cmisMapping.getCmisVersion().toString();
  242 + return cacheKey;
244 243 }
245 244  
246 245 protected CMISDictionaryRegistry createCoreDictionaryRegistry()
247 246 {
248   - CMISDictionaryRegistryImpl cmisRegistry = new CMISDictionaryRegistryImpl(this, cmisMapping, dictionaryService,
249   - getCoreDictionaryInitializer());
  247 + CMISDictionaryRegistryImpl cmisRegistry = new CMISDictionaryRegistryImpl(this, cmisMapping, dictionaryService,
  248 + getCoreDictionaryInitializer());
250 249 cmisRegistry.init();
251 250 return cmisRegistry;
252 251 }
253 252  
254 253 protected CMISDictionaryRegistry createTenantDictionaryRegistry(String tenant)
255 254 {
256   - CMISDictionaryRegistryImpl cmisRegistry = new CMISDictionaryRegistryImpl(this, tenant, "",
257   - cmisMapping, dictionaryService, getTenantDictionaryInitializer());
  255 + CMISDictionaryRegistryImpl cmisRegistry = new CMISDictionaryRegistryImpl(this, tenant, "", cmisMapping,
  256 + dictionaryService, getTenantDictionaryInitializer());
258 257 cmisRegistry.init();
259 258 return cmisRegistry;
260 259 }
261   -
  260 +
262 261 protected CMISDictionaryRegistry createDictionaryRegistryWithWriteLock()
263 262 {
264   - CMISDictionaryRegistry cmisRegistry = null;
265   -
266   - String tenant = TenantUtil.getCurrentDomain();
  263 + String tenant = TenantUtil.getCurrentDomain();
  264 + CMISDictionaryRegistry cmisRegistry = createDictionaryRegistry(tenant);
  265 + String cacheKey = getCacheKey(tenant);
267 266  
268 267 registryWriteLock.lock();
269 268 try
270 269 {
271   - cmisRegistry = createDictionaryRegistry(tenant);
  270 + // publish new registry
  271 + cmisRegistryCache.put(cacheKey, cmisRegistry);
  272 +
272 273 }
273 274 finally
274 275 {
... ... @@ -280,20 +281,16 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
280 281  
281 282 protected CMISDictionaryRegistry createDictionaryRegistry(String tenant)
282 283 {
283   - CMISDictionaryRegistry cmisRegistry = null;
284   - String cacheKey = getCacheKey(tenant);
  284 + CMISDictionaryRegistry cmisRegistry = null;
285 285  
286   - if(tenant.equals(TenantService.DEFAULT_DOMAIN))
287   - {
288   - cmisRegistry = createCoreDictionaryRegistry();
289   - }
290   - else
291   - {
292   - cmisRegistry = createTenantDictionaryRegistry(tenant);
293   - }
294   -
295   - // publish new registry
296   - singletonCache.put(cacheKey, cmisRegistry);
  286 + if (tenant.equals(TenantService.DEFAULT_DOMAIN))
  287 + {
  288 + cmisRegistry = createCoreDictionaryRegistry();
  289 + }
  290 + else
  291 + {
  292 + cmisRegistry = createTenantDictionaryRegistry(tenant);
  293 + }
297 294  
298 295 return cmisRegistry;
299 296 }
... ... @@ -373,7 +370,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
373 370 {
374 371 return getRegistry().getAssocDefByQName(cmisMapping.getCmisType(clazz));
375 372 }
376   -
  373 +
377 374 @Override
378 375 public TypeDefinitionWrapper findTypeByQueryName(String queryName)
379 376 {
... ... @@ -418,15 +415,16 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
418 415 @Override
419 416 public List<TypeDefinitionWrapper> getAllTypes()
420 417 {
421   - // TODO is there a way of not having to reconstruct this every time?
422   - return Collections.unmodifiableList(new ArrayList<TypeDefinitionWrapper>(getRegistry().getTypeDefs()));
  418 + // TODO is there a way of not having to reconstruct this every time?
  419 + return Collections.unmodifiableList(new ArrayList<TypeDefinitionWrapper>(getRegistry().getTypeDefs()));
423 420 }
424 421  
425 422 @Override
426 423 public List<TypeDefinitionWrapper> getAllTypes(boolean includeParent)
427 424 {
428   - // TODO is there a way of not having to reconstruct this every time?
429   - return Collections.unmodifiableList(new ArrayList<TypeDefinitionWrapper>(getRegistry().getTypeDefs(includeParent)));
  425 + // TODO is there a way of not having to reconstruct this every time?
  426 + return Collections
  427 + .unmodifiableList(new ArrayList<TypeDefinitionWrapper>(getRegistry().getTypeDefs(includeParent)));
430 428 }
431 429  
432 430 @Override
... ... @@ -454,7 +452,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
454 452 @Override
455 453 public void modelAdded(CompiledModel model, String tenantDomain)
456 454 {
457   - getRegistry(tenantDomain).addModel(model);
  455 + getRegistry(tenantDomain).addModel(model);
458 456 }
459 457  
460 458 /*
... ... @@ -465,7 +463,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
465 463 @Override
466 464 public void afterDictionaryInit()
467 465 {
468   - createDictionaryRegistryWithWriteLock();
  466 + createDictionaryRegistryWithWriteLock();
469 467 }
470 468  
471 469 /*
... ... @@ -480,8 +478,8 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
480 478 registryWriteLock.lock();
481 479 try
482 480 {
483   - String cacheKey = getCacheKey();
484   - singletonCache.remove(cacheKey);
  481 + String cacheKey = getCacheKey();
  482 + cmisRegistryCache.remove(cacheKey);
485 483 }
486 484 finally
487 485 {
... ... @@ -493,7 +491,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
493 491 public List<TypeDefinitionWrapper> getChildren(String typeId)
494 492 {
495 493 List<TypeDefinitionWrapper> children = getRegistry().getChildren(typeId);
496   -
  494 +
497 495 for (TypeDefinitionWrapper child : children)
498 496 {
499 497 if (child != null && child.getTypeDefinition(false).getDisplayName() == null)
... ... @@ -501,7 +499,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
501 499 child.updateDefinition(dictionaryService);
502 500 }
503 501 }
504   -
505   - return children;
  502 +
  503 + return children;
506 504 }
507 505 }
... ...
src/main/java/org/alfresco/opencmis/dictionary/CMISDictionaryRegistryImpl.java
... ... @@ -33,7 +33,6 @@ import java.util.LinkedList;
33 33 import java.util.List;
34 34 import java.util.Map;
35 35  
36   -import org.alfresco.error.AlfrescoRuntimeException;
37 36 import org.alfresco.opencmis.dictionary.CMISAbstractDictionaryService.DictionaryInitializer;
38 37 import org.alfresco.opencmis.mapping.CMISMapping;
39 38 import org.alfresco.repo.dictionary.CompiledModel;
... ...
src/main/java/org/alfresco/opencmis/dictionary/CMISDictionaryReload.java
... ... @@ -1,77 +0,0 @@
1   -/*
2   - * #%L
3   - * Alfresco Data model classes
4   - * %%
5   - * Copyright (C) 2005 - 2016 Alfresco Software Limited
6   - * %%
7   - * This file is part of the Alfresco software.
8   - * If the software was purchased under a paid Alfresco license, the terms of
9   - * the paid license agreement will prevail. Otherwise, the software is
10   - * provided under the following open source license terms:
11   - *
12   - * Alfresco is free software: you can redistribute it and/or modify
13   - * it under the terms of the GNU Lesser General Public License as published by
14   - * the Free Software Foundation, either version 3 of the License, or
15   - * (at your option) any later version.
16   - *
17   - * Alfresco is distributed in the hope that it will be useful,
18   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
19   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20   - * GNU Lesser General Public License for more details.
21   - *
22   - * You should have received a copy of the GNU Lesser General Public License
23   - * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
24   - * #L%
25   - */
26   -package org.alfresco.opencmis.dictionary;
27   -
28   -import org.apache.commons.logging.Log;
29   -import org.apache.commons.logging.LogFactory;
30   -import org.springframework.context.ApplicationEvent;
31   -import org.springframework.extensions.surf.util.AbstractLifecycleBean;
32   -
33   -/**
34   - * Temporary workaround for:
35   - * <ul>
36   - * <li>ACE-5041: CLONE - google docs content cannot be accessed via cmis</li>
37   - * </ul>
38   - *
39   - * TODO: Remove this bean when rework for MNT-14819 is complete.
40   - *
41   - * @author Matt Ward
42   - */
43   -public final class CMISDictionaryReload extends AbstractLifecycleBean
44   -{
45   - private static final Log log = LogFactory.getLog(CMISDictionaryReload.class);
46   - private final CMISAbstractDictionaryService cmisDictService;
47   - private final boolean enabled;
48   -
49   - public CMISDictionaryReload(CMISAbstractDictionaryService cmisDictService, boolean enabled)
50   - {
51   - this.cmisDictService = cmisDictService;
52   - this.enabled = enabled;
53   - }
54   -
55   - public void reload()
56   - {
57   - if (enabled)
58   - {
59   - // Avoid deadlock by making sure we already have a registry present.
60   - cmisDictService.getRegistry();
61   - log.debug("Reloading CMIS dictionary.");
62   - cmisDictService.afterDictionaryInit();
63   - }
64   - }
65   -
66   - @Override
67   - protected void onBootstrap(ApplicationEvent event)
68   - {
69   - reload();
70   - }
71   -
72   - @Override
73   - protected void onShutdown(ApplicationEvent event)
74   - {
75   - // Do nothing.
76   - }
77   -}
src/main/java/org/alfresco/opencmis/search/CmisFunctionEvaluationContext.java
... ... @@ -110,6 +110,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
110 110 EXPOSED_FIELDS.add(QueryConstants.FIELD_TAG);
111 111 EXPOSED_FIELDS.add(QueryConstants.FIELD_PNAME);
112 112 EXPOSED_FIELDS.add(QueryConstants.FIELD_NPATH);
  113 + EXPOSED_FIELDS.add(QueryConstants.FIELD_ANAME);
  114 + EXPOSED_FIELDS.add(QueryConstants.FIELD_APATH);
113 115 EXPOSED_FIELDS.add(QueryConstants.FIELD_DOC_TYPE);
114 116  
115 117  
... ...
src/main/java/org/alfresco/repo/content/ContentStore.java
... ... @@ -42,7 +42,11 @@ import org.alfresco.service.cmr.repository.ContentWriter;
42 42 * <code>content URL</code>.
43 43 * <p>
44 44 * Content URLs must consist of a prefix or protocol followed by an
45   - * implementation-specific identifier. For example, the content URL format
  45 + * implementation-specific identifier. See
  46 + * {@link org.alfresco.repo.content.filestore.TimeBasedFileContentUrlProvider TimeBasedFileContentUrlProvider} and
  47 + * {@link org.alfresco.repo.content.filestore.VolumeAwareContentUrlProvider VolumeAwareContentUrlProvider} implementations of
  48 + * {@link org.alfresco.repo.content.filestore.FileContentUrlProvider FileContentUrlProvider}
  49 + * For example, default content URL format
46 50 * for file stores is <b>store://year/month/day/hour/minute/GUID.bin</b> <br>
47 51 * <ul>
48 52 * <li> <b>store://</b>: prefix identifying an Alfresco content stores
... ...
src/main/java/org/alfresco/repo/dictionary/CompiledModelsCache.java
... ... @@ -29,6 +29,9 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
29 29 import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
30 30 import org.alfresco.repo.tenant.TenantService;
31 31 import org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache;
  32 +import org.alfresco.util.cache.RefreshableCacheEvent;
  33 +import org.alfresco.util.cache.RefreshableCacheListener;
  34 +import org.alfresco.util.cache.RefreshableCacheRefreshedEvent;
32 35 import org.apache.commons.logging.Log;
33 36 import org.apache.commons.logging.LogFactory;
34 37  
... ... @@ -103,4 +106,49 @@ public class CompiledModelsCache extends AbstractAsynchronouslyRefreshedCache&lt;Di
103 106 {
104 107 this.tenantService = tenantService;
105 108 }
  109 +
  110 + @Override
  111 + public void afterPropertiesSet() throws Exception
  112 + {
  113 + super.afterPropertiesSet();
  114 + // RefreshableCacheListener as anonymous class since CompileModelsCache already
  115 + // implements this interface, but expects to be invoked in different circumstances.
  116 + register(new RefreshableCacheListener()
  117 + {
  118 + @Override
  119 + public void onRefreshableCacheEvent(RefreshableCacheEvent event)
  120 + {
  121 + if (logger.isDebugEnabled())
  122 + {
  123 + logger.debug("Handling "+event.getClass().getSimpleName()+
  124 + ", cache="+event.getCacheId()+
  125 + ", key="+event.getKey());
  126 + }
  127 +
  128 + if (event instanceof RefreshableCacheRefreshedEvent &&
  129 + event.getCacheId().equals(getCacheId()))
  130 + {
  131 + // notify registered listeners that dictionary has been initialised (population is complete).
  132 + // Note we do that here to ensure that the dictionary registry has been added to the cache,
  133 + // so that any dependencies (like the CMIS dictionary) will use the new dictionary.
  134 + for (DictionaryListener dictionaryListener : dictionaryDAO.getDictionaryListeners())
  135 + {
  136 + logger.debug("Calling afterDIctionaryInit ["+event.getClass().getSimpleName()+
  137 + ", cache="+event.getCacheId()+
  138 + ", key="+event.getKey()+
  139 + "] on "+
  140 + dictionaryListener.getClass().getSimpleName());
  141 +
  142 + dictionaryListener.afterDictionaryInit();
  143 + }
  144 + }
  145 + }
  146 +
  147 + @Override
  148 + public String getCacheId()
  149 + {
  150 + return CompiledModelsCache.this.getCacheId();
  151 + }
  152 + });
  153 + }
106 154 }
... ...
src/main/java/org/alfresco/repo/dictionary/CoreDictionaryRegistryImpl.java
... ... @@ -59,12 +59,6 @@ public class CoreDictionaryRegistryImpl extends AbstractDictionaryRegistry
59 59 dictionaryDeployer.onDictionaryInit();
60 60 }
61 61  
62   - // notify registered listeners that dictionary has been initialised (population is complete)
63   - for (DictionaryListener dictionaryListener : dictionaryDAO.getDictionaryListeners())
64   - {
65   - dictionaryListener.afterDictionaryInit();
66   - }
67   -
68 62 // Done
69 63 if (logger.isInfoEnabled())
70 64 {
... ... @@ -87,33 +81,7 @@ public class CoreDictionaryRegistryImpl extends AbstractDictionaryRegistry
87 81 protected QName putModelImpl(CompiledModel model)
88 82 {
89 83 // TODO disallow model overrides for the core dictionary
90   -
91   -// if(compiledModels.get(model.getModelDefinition().getName()) != null)
92   -// {
93   -// throw new AlfrescoRuntimeException("Cannot override existing model " + model.getModelDefinition().getName());
94   -// }
95   -//
96   -// for(M2Namespace namespace : model.getM2Model().getNamespaces())
97   -// {
98   -// if(uriToModels.get(namespace.getUri()) != null)
99   -// {
100   -// throw new AlfrescoRuntimeException("Cannot override existing namespace " + namespace.getUri());
101   -// }
102   -// }
103   -
104 84 QName qname = super.putModelImpl(model);
105   -
106   -// if(dictionaryDAO.isContextRefreshed())
107   -// {
108   -// for(DictionaryListener listener : dictionaryDAO.getDictionaryListeners())
109   -// {
110   -// if(listener instanceof ExtendedDictionaryListener)
111   -// {
112   -// ((ExtendedDictionaryListener)listener).coreModelAdded(model);
113   -// }
114   -// }
115   -// }
116   -
117 85 return qname;
118 86 }
119 87  
... ...
src/main/java/org/alfresco/repo/dictionary/DictionaryDAOImpl.java
... ... @@ -186,9 +186,6 @@ public class DictionaryDAOImpl implements DictionaryDAO, NamespaceDAO,
186 186 {
187 187 DictionaryRegistry dictionaryRegistry = new CoreDictionaryRegistryImpl(
188 188 this);
189   - getThreadLocal().put("", dictionaryRegistry);
190   - dictionaryRegistry.init();
191   - getThreadLocal().remove("");
192 189 return dictionaryRegistry;
193 190 }
194 191  
... ... @@ -202,9 +199,6 @@ public class DictionaryDAOImpl implements DictionaryDAO, NamespaceDAO,
202 199 {
203 200 DictionaryRegistry dictionaryRegistry = new TenantDictionaryRegistryImpl(
204 201 DictionaryDAOImpl.this, tenant);
205   - getThreadLocal().put(tenant, dictionaryRegistry);
206   - dictionaryRegistry.init();
207   - getThreadLocal().remove(tenant);
208 202 return dictionaryRegistry;
209 203 }
210 204 }, tenantService.getDomainUser(
... ... @@ -233,7 +227,6 @@ public class DictionaryDAOImpl implements DictionaryDAO, NamespaceDAO,
233 227  
234 228 // TODO Should be reworked when ACE-2001 will be implemented
235 229 dictionaryRegistryCache.remove(tenant);
236   - dictionaryRegistryCache.refresh(tenant);
237 230  
238 231 if (logger.isDebugEnabled())
239 232 {
... ...
src/main/java/org/alfresco/repo/dictionary/TenantDictionaryRegistryImpl.java
... ... @@ -221,12 +221,6 @@ public class TenantDictionaryRegistryImpl extends AbstractDictionaryRegistry
221 221 dictionaryDeployer.onDictionaryInit();
222 222 }
223 223  
224   - // notify registered listeners that dictionary has been initialised (population is complete)
225   - for (DictionaryListener dictionaryListener : dictionaryDAO.getDictionaryListeners())
226   - {
227   - dictionaryListener.afterDictionaryInit();
228   - }
229   -
230 224 // Done
231 225 if (logger.isInfoEnabled())
232 226 {
... ...
src/main/java/org/alfresco/repo/index/shard/ShardMethodEnum.java
... ... @@ -35,10 +35,9 @@ public enum ShardMethodEnum
35 35 MOD_ACL_ID,
36 36 ACL_ID,
37 37 DB_ID,
38   - DATE,//Time stamp
39   - DATE_YEAR,
40   - DATE_MONTH,
41   - UNKOWN;
  38 + DATE,
  39 + UNKOWN,
  40 + PROPERTY;
42 41  
43 42 public static ShardMethodEnum getShardMethod(String shardMethod)
44 43 {
... ... @@ -63,11 +62,8 @@ public enum ShardMethodEnum
63 62 case "DATE":
64 63 shardMethodEnum = DATE;
65 64 break;
66   - case "DATE_YEAR":
67   - shardMethodEnum = DATE_YEAR;
68   - break;
69   - case "DATE_MONTH":
70   - shardMethodEnum = DATE_MONTH;
  65 + case "PROPERTY":
  66 + shardMethodEnum = PROPERTY;
71 67 break;
72 68 default:
73 69 shardMethodEnum = UNKOWN;
... ...
src/main/java/org/alfresco/repo/search/adaptor/lucene/QueryConstants.java
... ... @@ -189,6 +189,10 @@ public interface QueryConstants
189 189  
190 190 public static final String FIELD_PNAME = "PNAME";
191 191  
  192 + public static final String FIELD_APATH = "APATH";
  193 +
  194 + public static final String FIELD_ANAME = "ANAME";
  195 +
192 196 public static final String FIELD_PROPERTIES = "PROPERTIES";
193 197  
194 198 public static final String FIELD_NULLPROPERTIES = "NULLPROPERTIES";
... ...
src/main/java/org/alfresco/repo/search/impl/parsers/AlfrescoFunctionEvaluationContext.java
... ... @@ -116,6 +116,8 @@ public class AlfrescoFunctionEvaluationContext implements FunctionEvaluationCont
116 116 EXPOSED_FIELDS.add(QueryConstants.FIELD_TAG);
117 117 EXPOSED_FIELDS.add(QueryConstants.FIELD_PNAME);
118 118 EXPOSED_FIELDS.add(QueryConstants.FIELD_NPATH);
  119 + EXPOSED_FIELDS.add(QueryConstants.FIELD_ANAME);
  120 + EXPOSED_FIELDS.add(QueryConstants.FIELD_APATH);
119 121 EXPOSED_FIELDS.add(QueryConstants.FIELD_DOC_TYPE);
120 122 EXPOSED_FIELDS.add(QueryConstants.FIELD_PROPERTIES);
121 123 EXPOSED_FIELDS.add(QueryConstants.FIELD_NULLPROPERTIES);
... ...
src/main/java/org/alfresco/service/cmr/dictionary/DictionaryService.java
... ... @@ -33,9 +33,6 @@ import org.alfresco.service.NotAuditable;
33 33 import org.alfresco.service.cmr.i18n.MessageLookup;
34 34 import org.alfresco.service.namespace.QName;
35 35  
36   -import com.sun.tools.xjc.outline.Aspect;
37   -
38   -
39 36  
40 37 /**
41 38 * This interface represents the Repository Data Dictionary. The
... ...
src/test/java/org/alfresco/repo/index/ShardMethodEnumTest.java
... ... @@ -59,14 +59,9 @@ public class ShardMethodEnumTest
59 59 Assert.assertEquals(ShardMethodEnum.DATE, ShardMethodEnum.getShardMethod("DATE"));
60 60 }
61 61 @Test
62   - public void testTypeDateYear()
  62 + public void testTypeProperty()
63 63 {
64   - Assert.assertEquals(ShardMethodEnum.DATE_YEAR, ShardMethodEnum.getShardMethod("DATE_YEAR"));
65   - }
66   - @Test
67   - public void testTypeDateMonth()
68   - {
69   - Assert.assertEquals(ShardMethodEnum.DATE_MONTH, ShardMethodEnum.getShardMethod("DATE_MONTH"));
  64 + Assert.assertEquals(ShardMethodEnum.PROPERTY, ShardMethodEnum.getShardMethod("PROPERTY"));
70 65 }
71 66 @Test
72 67 public void testUnknown()
... ...