CMIS Dictionary Refactor

- follows pattern of Alfresco Dictionary
- simplified and much reduced DictionaryService interface
- model now compiled and cached (no more lots of small continuous object creations)
- walk model via simple getters
- validated (no dangling references)
- fix up property inheritance
- fix up sub-types for all types
- implements strict mode only for now (i.e. doesn't go outside of CMIS doc, folder, rel and policy)
- abstract helper for building other CMIS dictionaries (e.g. mapping all types in Alfresco)

Alfresco Dictionary:
- add event for initialized or re-initialized

Fix up usage in CMIS REST, Web Services and query. Tests pass.

REST support for custom sub-types and properties now reliable as constrained by validated CMIS model.

TODO:
- hook property value accessors into CMIS Dictionary

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13768 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2009-03-27 23:13:29 +00:00
parent df3e143e1c
commit 8fcebdc7cf
51 changed files with 2937 additions and 2095 deletions

View File

@@ -90,8 +90,8 @@ public class DictionaryDAOImpl implements DictionaryDAO
// Map of model name to compiled model
private SimpleCache<String, Map<QName,CompiledModel>> compiledModelsCache;
// Static list of registered dictionary deployers
private List<DictionaryDeployer> dictionaryDeployers = new ArrayList<DictionaryDeployer>();
// Static list of registered dictionary listeners
private List<DictionaryListener> dictionaryListeners = new ArrayList<DictionaryListener>();
// Logger
private static Log logger = LogFactory.getLog(DictionaryDAO.class);
@@ -129,11 +129,11 @@ public class DictionaryDAOImpl implements DictionaryDAO
/**
* Register with the Dictionary
*/
public void register(DictionaryDeployer dictionaryDeployer)
public void register(DictionaryListener dictionaryDeployer)
{
if (! dictionaryDeployers.contains(dictionaryDeployer))
if (! dictionaryListeners.contains(dictionaryDeployer))
{
dictionaryDeployers.add(dictionaryDeployer);
dictionaryListeners.add(dictionaryDeployer);
}
}
@@ -151,9 +151,15 @@ public class DictionaryDAOImpl implements DictionaryDAO
namespaceDAO.init();
// populate the dictionary
for (DictionaryDeployer dictionaryDeployer : dictionaryDeployers)
for (DictionaryListener dictionaryListener : dictionaryListeners)
{
dictionaryDeployer.initDictionary();
dictionaryListener.onDictionaryInit();
}
// populate the dictionary
for (DictionaryListener dictionaryListener : dictionaryListeners)
{
dictionaryListener.afterDictionaryInit();
}
logger.info("Dictionary initialised");