Search in sources :

Example 1 with CMISAbstractDictionaryService

use of org.alfresco.opencmis.dictionary.CMISAbstractDictionaryService in project alfresco-repository by Alfresco.

the class OpenCmisQueryTest method addTypeTestDataModel.

private void addTypeTestDataModel() {
    // load in the test model
    ClassLoader cl = BaseNodeServiceTest.class.getClassLoader();
    InputStream modelStream = cl.getResourceAsStream("org/alfresco/cmis/search/CMIS-query-test-model.xml");
    assertNotNull(modelStream);
    M2Model model = M2Model.createModel(modelStream);
    dictionaryDAO.putModel(model);
    ((CMISAbstractDictionaryService) cmisDictionaryService).afterDictionaryDestroy();
    ((CMISAbstractDictionaryService) cmisDictionaryService).afterDictionaryInit();
}
Also used : InputStream(java.io.InputStream) M2Model(org.alfresco.repo.dictionary.M2Model) CMISAbstractDictionaryService(org.alfresco.opencmis.dictionary.CMISAbstractDictionaryService)

Example 2 with CMISAbstractDictionaryService

use of org.alfresco.opencmis.dictionary.CMISAbstractDictionaryService in project SearchServices by Alfresco.

the class AlfrescoClientDataModelServicesFactory method constructDictionaries.

/**
 * Constructs a dictionary by default.
 *
 * @param qnameFilter QNameFilter
 * @param namespaceDAO NamespaceDAO
 * @param dictionaryService DictionaryComponent
 * @param dictionaryDAO DictionaryDAO
 * @return Map
 */
public static Map<DictionaryKey, CMISAbstractDictionaryService> constructDictionaries(QNameFilter qnameFilter, NamespaceDAO namespaceDAO, DictionaryComponent dictionaryService, DictionaryDAO dictionaryDAO) {
    DictionaryNamespaceComponent namespaceService = new DictionaryNamespaceComponent();
    namespaceService.setNamespaceDAO(namespaceDAO);
    CMISMapping cmisMapping = new CMISMapping();
    cmisMapping.setCmisVersion(CmisVersion.CMIS_1_0);
    cmisMapping.setFilter(qnameFilter);
    cmisMapping.setNamespaceService(namespaceService);
    cmisMapping.setDictionaryService(dictionaryService);
    cmisMapping.afterPropertiesSet();
    CMISMapping cmisMapping11 = new CMISMapping();
    cmisMapping11.setCmisVersion(CmisVersion.CMIS_1_1);
    cmisMapping11.setFilter(qnameFilter);
    cmisMapping11.setNamespaceService(namespaceService);
    cmisMapping11.setDictionaryService(dictionaryService);
    cmisMapping11.afterPropertiesSet();
    Map<DictionaryKey, CMISAbstractDictionaryService> dictionaries = new HashMap<DictionaryKey, CMISAbstractDictionaryService>();
    DictionaryKey key = new DictionaryKey(CmisVersion.CMIS_1_0, CMISStrictDictionaryService.DEFAULT);
    dictionaries.put(key, newInstance(cmisMapping, dictionaryService, dictionaryDAO));
    CMISMapping mappingWithExclusions = newInstanceOfExcludedCMISMapping(cmisMapping, qnameFilter);
    key = new DictionaryKey(CmisVersion.CMIS_1_0, DICTIONARY_FILTERED_WITH_EXCLUSIONS);
    dictionaries.put(key, newInstance(mappingWithExclusions, dictionaryService, dictionaryDAO));
    key = new DictionaryKey(CmisVersion.CMIS_1_1, CMISStrictDictionaryService.DEFAULT);
    dictionaries.put(key, newInstance(cmisMapping11, dictionaryService, dictionaryDAO));
    CMISMapping mappingWithExclusions11 = newInstanceOfExcludedCMISMapping(cmisMapping11, qnameFilter);
    key = new DictionaryKey(CmisVersion.CMIS_1_1, DICTIONARY_FILTERED_WITH_EXCLUSIONS);
    dictionaries.put(key, newInstance(mappingWithExclusions11, dictionaryService, dictionaryDAO));
    return dictionaries;
}
Also used : CMISMapping(org.alfresco.opencmis.mapping.CMISMapping) DictionaryNamespaceComponent(org.alfresco.repo.dictionary.DictionaryNamespaceComponent) HashMap(java.util.HashMap) CMISAbstractDictionaryService(org.alfresco.opencmis.dictionary.CMISAbstractDictionaryService)

Aggregations

CMISAbstractDictionaryService (org.alfresco.opencmis.dictionary.CMISAbstractDictionaryService)2 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 CMISMapping (org.alfresco.opencmis.mapping.CMISMapping)1 DictionaryNamespaceComponent (org.alfresco.repo.dictionary.DictionaryNamespaceComponent)1 M2Model (org.alfresco.repo.dictionary.M2Model)1