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;
}
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();
}
Aggregations