WebApplicationContext wc1 = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
ServiceRegistry serviceRegistry = getServiceRegistry(getServletContext());
transactionService = (TransactionService) wc1.getBean("transactionComponent");
authenticationComponent = (AuthenticationComponent) wc1.getBean("authenticationComponent");
AuthenticationService ass = serviceRegistry.getAuthenticationService();
ass.authenticate("admin", "admin".toCharArray());
authenticationDAO = (MutableAuthenticationDao) wc1.getBean("authenticationDao");
testTX = transactionService.getUserTransaction();
testTX.begin();
System.out.println("###################################");
this.authenticationComponent.setSystemUserAsCurrentUser();
NodeService ns = serviceRegistry.getNodeService();
SearchService serses = serviceRegistry.getSearchService();
System.out.println("ON CSTORERQ: 2 destination eswar ");
NodeRef rootNode = Repository.getCompanyRoot(ns, serses, serviceRegistry.getNamespaceService(), Repository.getStoreRef(), "app:company_home");
if (authenticationDAO.userExists("admin")) {
ass.deleteAuthentication("admin");
}
ass.createAuthentication("admin", "admin".toCharArray());
cmisService = (CMISService) wc1.getBean("CMISService");
System.out.println("***** cmisService.getDefaultRootNodeRef() **** " + cmisService.getDefaultRootNodeRef());
NodeRef rootNode123 = cmisService.getDefaultRootNodeRef();
cmisPropertyService = (CMISPropertyService) wc1.getBean("CMISPropertyService");
cmisQueryService = (CMISQueryService) wc1.getBean("CMISQueryService");
String qr = getQuery();
}
CMISResultSet rs = cmisQueryService.query(getQuery());
System.out.println("ON CSTORERQ:5 rs.getLength :" + rs.getLength());
CMISResultSetMetaData md = rs.getMetaData();