cancel
Showing results for 
Search instead for 
Did you mean: 

how will you query using CMIS CQL(SQL) from java client?

sangireddi
Champ in-the-making
Champ in-the-making
I want to query alfresco repository using CMIS SQL(CQL).can we query from normal java client with CURD operations?how?can you give me sample?i tried to JavaCmisTest client but it is giving exception—>Could not find definition for service {http://www.cmis.org/ns/1.0}NavigationService.

Thanks in advance
6 REPLIES 6

sangireddi
Champ in-the-making
Champ in-the-making
Hi All now I am able to run javaCMISTest and getting folders and documents in Company Home but not querying to repo

sangireddi
Champ in-the-making
Champ in-the-making
hi all …finally i got a solution..
thank you

josekdiz
Champ in-the-making
Champ in-the-making
Hi,

I have the same problem of you. I do not know how to query using CMIS SQL from Java client. How did you do it finally? Can you help me?
Thanks in advance.

vinila
Champ in-the-making
Champ in-the-making
Hi,

I am trying to set up a sample CM IS java application to perform the CRUD operations. Could you please let me know where i can find the JavaCmisTest client? Or can somebody provide a sample application for my reference.

Please help me.. It is urgent.

Thanks in advance

sangireddi
Champ in-the-making
Champ in-the-making
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();

sangireddi
Champ in-the-making
Champ in-the-making
In the above logic getquery method will take any sql like query from user and then by using CMISquery service will provide u the service for your query..
if you have more requirements on CMIS SQL please let me know if possible

thanks in advance