use of org.springframework.extensions.jcr.JcrTemplate in project pentaho-platform by pentaho.
the class UserRoleDaoIT method setApplicationContext.
public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean("backingRepositoryLifecycleManager");
SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean("jcrSessionFactory");
testJcrTemplate = new JcrTemplate(jcrSessionFactory);
testJcrTemplate.setAllowCreate(true);
testJcrTemplate.setExposeNativeSession(true);
repositoryAdminUsername = (String) applicationContext.getBean("repositoryAdminUsername");
authenticatedRoleName = (String) applicationContext.getBean("singleTenantAuthenticatedAuthorityName");
adminRoleName = (String) applicationContext.getBean("singleTenantAdminAuthorityName");
roleBindingDaoTarget = (IRoleAuthorizationPolicyRoleBindingDao) applicationContext.getBean("roleAuthorizationPolicyRoleBindingDaoTarget");
sysAdminRoleName = (String) applicationContext.getBean("superAdminAuthorityName");
sysAdminUserName = (String) applicationContext.getBean("superAdminUserName");
authorizationPolicy = (IAuthorizationPolicy) applicationContext.getBean("authorizationPolicy");
tenantManager = (ITenantManager) applicationContext.getBean("tenantMgrProxy");
repositoryFileDao = (IRepositoryFileDao) applicationContext.getBean("repositoryFileDao");
userRoleDaoProxy = (IUserRoleDao) applicationContext.getBean("userRoleDaoTxn");
userRoleDaoTestProxy = (IUserRoleDao) applicationContext.getBean("userRoleDaoTxn");
tenantedUserNameUtils = (ITenantedPrincipleNameResolver) applicationContext.getBean("tenantedUserNameUtils");
tenantedRoleNameUtils = (ITenantedPrincipleNameResolver) applicationContext.getBean("tenantedRoleNameUtils");
TestPrincipalProvider.userRoleDao = (IUserRoleDao) applicationContext.getBean("userRoleDaoTxn");
TestPrincipalProvider.adminCredentialsStrategy = (CredentialsStrategy) applicationContext.getBean("jcrAdminCredentialsStrategy");
TestPrincipalProvider.repository = (Repository) applicationContext.getBean("jcrRepository");
jcrTemplate = (JcrTemplate) applicationContext.getBean("jcrTemplate");
}
use of org.springframework.extensions.jcr.JcrTemplate in project data-access by pentaho.
the class AgileMartDatasourceLifecycleManager method getInstance.
public static AgileMartDatasourceLifecycleManager getInstance() {
if (instance == null) {
TransactionTemplate txnTemplate = PentahoSystem.get(TransactionTemplate.class, "jcrTransactionTemplate", PentahoSessionHolder.getSession());
JcrTemplate adminJcrTemplate = PentahoSystem.get(JcrTemplate.class, "adminJcrTemplate", PentahoSessionHolder.getSession());
IPathConversionHelper pathConversionHelper = PentahoSystem.get(IPathConversionHelper.class, "pathConversionHelper", PentahoSessionHolder.getSession());
IPluginResourceLoader resLoader = PentahoSystem.get(IPluginResourceLoader.class, PentahoSessionHolder.getSession());
IDatasourceMgmtService datasourceMgmtService = PentahoSystem.get(IDatasourceMgmtService.class, PentahoSessionHolder.getSession());
instance = new AgileMartDatasourceLifecycleManager(txnTemplate, adminJcrTemplate, pathConversionHelper, datasourceMgmtService, resLoader);
}
return instance;
}
Aggregations