Search in sources :

Example 1 with MultiTServiceImpl

use of org.alfresco.repo.tenant.MultiTServiceImpl in project alfresco-repository by Alfresco.

the class DictionaryDAOTest method setUp.

@Before
public void setUp() throws Exception {
    // register resource bundles for messages
    I18NUtil.registerResourceBundle(TEST_RESOURCE_MESSAGES);
    // Instantiate Dictionary Service
    TenantService tenantService = new MultiTServiceImpl();
    this.dictionaryDAO = new DictionaryDAOImpl();
    dictionaryDAO.setTenantService(tenantService);
    initDictionaryCaches(dictionaryDAO, tenantService);
    new AuthenticationUtil().afterPropertiesSet();
    // Populate with appropriate models
    DictionaryBootstrap bootstrap = new DictionaryBootstrap();
    List<String> bootstrapModels = new ArrayList<String>();
    bootstrapModels.add("alfresco/model/dictionaryModel.xml");
    bootstrapModels.add("alfresco/model/systemModel.xml");
    bootstrapModels.add("alfresco/model/contentModel.xml");
    List<String> labels = new ArrayList<String>();
    bootstrap.setModels(bootstrapModels);
    bootstrap.setLabels(labels);
    bootstrap.setDictionaryDAO(dictionaryDAO);
    bootstrap.setTenantService(tenantService);
    bootstrap.bootstrap();
    DictionaryComponent component = new DictionaryComponent();
    component.setDictionaryDAO(dictionaryDAO);
    component.setMessageLookup(new StaticMessageLookup());
    service = component;
}
Also used : TenantService(org.alfresco.repo.tenant.TenantService) MultiTServiceImpl(org.alfresco.repo.tenant.MultiTServiceImpl) AuthenticationUtil(org.alfresco.repo.security.authentication.AuthenticationUtil) StaticMessageLookup(org.alfresco.repo.i18n.StaticMessageLookup) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Example 2 with MultiTServiceImpl

use of org.alfresco.repo.tenant.MultiTServiceImpl in project alfresco-repository by Alfresco.

the class DictionaryLoadDAOTest method setUp.

@Before
public void setUp() throws Exception {
    // register resource bundles for messages
    I18NUtil.registerResourceBundle(TEST_RESOURCE_MESSAGES);
    // Instantiate Dictionary Service
    TenantService tenantService = new MultiTServiceImpl();
    this.dictionaryDAO = new DictionaryDAOImpl();
    dictionaryDAO.setTenantService(tenantService);
    // TenantUtil.runAsUserTenant(new TenantRunAsWork<Void>()
    // {
    // @Override
    // public Void doWork() throws Exception
    // {
    // dictionaryDAO.init();
    // return null;
    // }
    // }, "user1", "tenant1");
    initDictionaryCaches(dictionaryDAO, tenantService);
    new AuthenticationUtil().afterPropertiesSet();
    // Populate with appropriate models
    DictionaryBootstrap bootstrap = new DictionaryBootstrap();
    List<String> bootstrapModels = new ArrayList<String>();
    bootstrapModels.add("alfresco/model/dictionaryModel.xml");
    bootstrapModels.add("alfresco/model/systemModel.xml");
    bootstrapModels.add("alfresco/model/contentModel.xml");
    bootstrapModels.add("org/alfresco/repo/security/authentication/userModel.xml");
    bootstrapModels.add("alfresco/model/bpmModel.xml");
    bootstrapModels.add("alfresco/model/wcmModel.xml");
    bootstrapModels.add("alfresco/model/forumModel.xml");
    bootstrapModels.add("alfresco/model/imapModel.xml");
    bootstrapModels.add("alfresco/model/transferModel.xml");
    bootstrapModels.add("alfresco/model/applicationModel.xml");
    bootstrapModels.add("alfresco/model/wcmAppModel.xml");
    bootstrapModels.add("org/alfresco/repo/action/actionModel.xml");
    bootstrapModels.add("org/alfresco/repo/rule/ruleModel.xml");
    bootstrapModels.add("org/alfresco/repo/version/version_model.xml");
    bootstrapModels.add("org/alfresco/repo/version/version2_model.xml");
    bootstrapModels.add("alfresco/model/emailServerModel.xml");
    bootstrapModels.add("alfresco/model/calendarModel.xml");
    bootstrapModels.add("alfresco/model/deprecated/blogIntegrationModel.xml");
    bootstrapModels.add("alfresco/model/linksModel.xml");
    bootstrapModels.add("alfresco/model/remoteCredentialsModel.xml");
    bootstrapModels.add("alfresco/model/datalistModel.xml");
    bootstrapModels.add("alfresco/model/quickShareModel.xml");
    bootstrapModels.add("alfresco/model/surfModel.xml");
    bootstrapModels.add("alfresco/model/siteModel.xml");
    List<String> labels = new ArrayList<String>();
    bootstrap.setModels(bootstrapModels);
    bootstrap.setLabels(labels);
    bootstrap.setDictionaryDAO(dictionaryDAO);
    bootstrap.setTenantService(tenantService);
    bootstrap.bootstrap();
}
Also used : TenantService(org.alfresco.repo.tenant.TenantService) MultiTServiceImpl(org.alfresco.repo.tenant.MultiTServiceImpl) AuthenticationUtil(org.alfresco.repo.security.authentication.AuthenticationUtil) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Aggregations

ArrayList (java.util.ArrayList)2 AuthenticationUtil (org.alfresco.repo.security.authentication.AuthenticationUtil)2 MultiTServiceImpl (org.alfresco.repo.tenant.MultiTServiceImpl)2 TenantService (org.alfresco.repo.tenant.TenantService)2 Before (org.junit.Before)2 StaticMessageLookup (org.alfresco.repo.i18n.StaticMessageLookup)1